@intentius/chant 0.124.44 → 0.124.46
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/capabilities/aws.paths +148 -0
- package/dist/capabilities/base-mappings.json +122 -0
- package/dist/capabilities/catalog.d.ts +89 -0
- package/dist/capabilities/catalog.d.ts.map +1 -0
- package/dist/capabilities/catalog.js +204 -0
- package/dist/capabilities/language.d.ts +103 -0
- package/dist/capabilities/language.d.ts.map +1 -0
- package/dist/capabilities/language.js +335 -0
- package/dist/capabilities/matcher.d.ts +65 -0
- package/dist/capabilities/matcher.d.ts.map +1 -0
- package/dist/capabilities/matcher.js +299 -0
- package/dist/capabilities/view.d.ts +207 -0
- package/dist/capabilities/view.d.ts.map +1 -0
- package/dist/capabilities/view.js +484 -0
- package/dist/ci-identity.d.ts +183 -12
- package/dist/ci-identity.d.ts.map +1 -1
- package/dist/ci-identity.js +362 -53
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/lint.js +1 -0
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +17 -1
- package/dist/cli/handlers/declared-graph.d.ts +44 -0
- package/dist/cli/handlers/declared-graph.d.ts.map +1 -0
- package/dist/cli/handlers/declared-graph.js +87 -0
- package/dist/cli/handlers/graph.d.ts +25 -0
- package/dist/cli/handlers/graph.d.ts.map +1 -1
- package/dist/cli/handlers/graph.js +93 -87
- package/dist/cli/handlers/pr-env.d.ts +8 -2
- package/dist/cli/handlers/pr-env.d.ts.map +1 -1
- package/dist/cli/handlers/pr-env.js +127 -225
- package/dist/cli/handlers/pr.d.ts +3 -0
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +1 -0
- package/dist/cli/handlers/search-count.d.ts +89 -0
- package/dist/cli/handlers/search-count.d.ts.map +1 -0
- package/dist/cli/handlers/search-count.js +132 -0
- package/dist/cli/handlers/search.d.ts +358 -6
- package/dist/cli/handlers/search.d.ts.map +1 -1
- package/dist/cli/handlers/search.js +1065 -155
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +23 -3
- package/dist/cli/mcp/server.d.ts.map +1 -1
- package/dist/cli/mcp/server.js +3 -0
- package/dist/cli/mcp/tools/capabilities.d.ts +7 -0
- package/dist/cli/mcp/tools/capabilities.d.ts.map +1 -0
- package/dist/cli/mcp/tools/capabilities.js +27 -0
- package/dist/cli/mcp/workspace-tools.d.ts +3 -1
- package/dist/cli/mcp/workspace-tools.d.ts.map +1 -1
- package/dist/cli/mcp/workspace-tools.js +47 -2
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +64 -17
- package/dist/cli/registry.d.ts +22 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/cli-support.d.ts +2 -0
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/cli-support.js +4 -2
- package/dist/components/fan-out-support.d.ts +3 -0
- package/dist/components/fan-out-support.d.ts.map +1 -1
- package/dist/components/fan-out-support.js +1 -1
- package/dist/components/pr-env-ports.d.ts +29 -0
- package/dist/components/pr-env-ports.d.ts.map +1 -0
- package/dist/components/pr-env-ports.js +77 -0
- package/dist/components/pr-env-run.d.ts +254 -0
- package/dist/components/pr-env-run.d.ts.map +1 -0
- package/dist/components/pr-env-run.js +376 -0
- package/dist/components/pr-environment.d.ts +91 -15
- package/dist/components/pr-environment.d.ts.map +1 -1
- package/dist/components/pr-environment.js +95 -9
- package/dist/components/pr-pipeline.d.ts +10 -1
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/config-environments.d.ts +92 -0
- package/dist/config-environments.d.ts.map +1 -0
- package/dist/config-environments.js +102 -0
- package/dist/config.d.ts +24 -84
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +9 -96
- package/dist/graph-detail.d.ts.map +1 -1
- package/dist/graph-detail.js +15 -3
- package/dist/graph-effective.d.ts +33 -2
- package/dist/graph-effective.d.ts.map +1 -1
- package/dist/graph-effective.js +215 -68
- package/dist/graph-ir.d.ts +23 -0
- package/dist/graph-ir.d.ts.map +1 -1
- package/dist/graph-ir.js +130 -0
- package/dist/graph-sub-template.d.ts +11 -0
- package/dist/graph-sub-template.d.ts.map +1 -0
- package/dist/graph-sub-template.js +19 -0
- package/dist/lexicon.d.ts +9 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/observe.d.ts +28 -0
- package/dist/lifecycle/observe.d.ts.map +1 -1
- package/dist/lifecycle/observe.js +23 -1
- package/dist/lint/rule.d.ts +6 -0
- package/dist/lint/rule.d.ts.map +1 -1
- package/dist/live-endpoint.d.ts +1 -1
- package/dist/live-endpoint.d.ts.map +1 -1
- package/dist/live-endpoint.js +1 -1
- package/dist/observation.d.ts +48 -1
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +21 -5
- package/dist/op/activities/activity-contracts.d.ts +4 -4
- package/dist/op/op-waves.d.ts +17 -0
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +23 -1
- package/dist/pr-forge.d.ts +15 -1
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +28 -16
- package/dist/pr-requires.d.ts +5 -1
- package/dist/pr-requires.d.ts.map +1 -1
- package/dist/wave-runtime.mjs +251 -250
- package/dist/workspace/capabilities-contract.d.ts +66 -0
- package/dist/workspace/capabilities-contract.d.ts.map +1 -0
- package/dist/workspace/capabilities-contract.js +107 -0
- package/dist/workspace/capabilities.schema.json +229 -0
- package/dist/workspace/ci-cloud-identity.d.ts +3 -1
- package/dist/workspace/ci-cloud-identity.d.ts.map +1 -1
- package/dist/workspace/ci-cloud-identity.js +16 -1
- package/dist/workspace/ci-run.d.ts +35 -8
- package/dist/workspace/ci-run.d.ts.map +1 -1
- package/dist/workspace/ci-run.js +95 -21
- package/dist/workspace/ci-secrets.d.ts.map +1 -1
- package/dist/workspace/ci-secrets.js +4 -3
- package/dist/workspace/compose-graph.d.ts +9 -0
- package/dist/workspace/compose-graph.d.ts.map +1 -1
- package/dist/workspace/compose-graph.js +3 -1
- package/dist/workspace/conformance/index.d.ts +1 -1
- package/dist/workspace/conformance/index.d.ts.map +1 -1
- package/dist/workspace/conformance/index.js +39 -2
- package/dist/workspace/declaration.d.ts +10 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +17 -1
- package/dist/workspace/declaration.schema.json +36 -1
- package/dist/workspace/graph-cache.d.ts +8 -0
- package/dist/workspace/graph-cache.d.ts.map +1 -1
- package/dist/workspace/graph-cache.js +27 -3
- package/dist/workspace/graph-cli.d.ts +39 -2
- package/dist/workspace/graph-cli.d.ts.map +1 -1
- package/dist/workspace/graph-cli.js +66 -24
- package/dist/workspace/graph.schema.json +148 -0
- package/dist/workspace/kind-readers.d.ts +3 -0
- package/dist/workspace/kind-readers.d.ts.map +1 -1
- package/dist/workspace/kind-readers.js +7 -1
- package/dist/workspace/member-commands.d.ts +10 -1
- package/dist/workspace/member-commands.d.ts.map +1 -1
- package/dist/workspace/member-commands.js +17 -1
- package/dist/workspace/nested-graph.d.ts +2 -0
- package/dist/workspace/nested-graph.d.ts.map +1 -1
- package/dist/workspace/nested-graph.js +32 -1
- package/dist/workspace/reason-codes.d.ts +10 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +12 -0
- package/dist/workspace/search-cli.d.ts +204 -0
- package/dist/workspace/search-cli.d.ts.map +1 -0
- package/dist/workspace/search-cli.js +466 -0
- package/dist/workspace/search-contract.d.ts +56 -0
- package/dist/workspace/search-contract.d.ts.map +1 -0
- package/dist/workspace/search-contract.js +70 -0
- package/dist/workspace/search.schema.json +822 -0
- package/package.json +1 -1
- package/src/__snapshots__/okf.test.ts.snap +10 -0
- package/src/capabilities/aws.paths +148 -0
- package/src/capabilities/base-mappings.json +122 -0
- package/src/capabilities/catalog.ts +230 -0
- package/src/capabilities/language.test.ts +191 -0
- package/src/capabilities/language.ts +373 -0
- package/src/capabilities/matcher.ts +315 -0
- package/src/capabilities/view-compose.test.ts +76 -0
- package/src/capabilities/view.ts +631 -0
- package/src/ci-identity-targets.test.ts +275 -0
- package/src/ci-identity.ts +394 -61
- package/src/cli/commands/lint.ts +1 -0
- package/src/cli/handlers/build.ts +15 -1
- package/src/cli/handlers/declared-graph.ts +99 -0
- package/src/cli/handlers/graph.test.ts +94 -3
- package/src/cli/handlers/graph.ts +123 -96
- package/src/cli/handlers/pr-env.ts +135 -227
- package/src/cli/handlers/pr.ts +4 -0
- package/src/cli/handlers/search-build-roots.test.ts +144 -0
- package/src/cli/handlers/search-count.test.ts +191 -0
- package/src/cli/handlers/search-count.ts +165 -0
- package/src/cli/handlers/search-json.test.ts +333 -0
- package/src/cli/handlers/search-live.test.ts +387 -0
- package/src/cli/handlers/search-paths.test.ts +235 -0
- package/src/cli/handlers/search.ts +1312 -166
- package/src/cli/main.test.ts +28 -3
- package/src/cli/main.ts +23 -3
- package/src/cli/mcp/server.test.ts +3 -3
- package/src/cli/mcp/server.ts +3 -0
- package/src/cli/mcp/tools/capabilities.ts +32 -0
- package/src/cli/mcp/workspace-tools.e2e.test.ts +21 -1
- package/src/cli/mcp/workspace-tools.ts +47 -2
- package/src/cli/parse-args.ts +52 -13
- package/src/cli/registry.ts +22 -0
- package/src/components/cli-support.ts +6 -1
- package/src/components/fan-out-support.ts +4 -1
- package/src/components/pr-env-ports.ts +89 -0
- package/src/components/pr-env-run-bundle.test.ts +54 -0
- package/src/components/pr-env-run.test.ts +290 -0
- package/src/components/pr-env-run.ts +563 -0
- package/src/components/pr-environment.ts +161 -13
- package/src/components/pr-pipeline.ts +10 -1
- package/src/config-environments.ts +133 -0
- package/src/config.ts +37 -124
- package/src/graph-detail.ts +15 -3
- package/src/graph-effective.ts +226 -75
- package/src/graph-ir.test.ts +163 -0
- package/src/graph-ir.ts +147 -0
- package/src/graph-sub-template.ts +22 -0
- package/src/lexicon.ts +10 -0
- package/src/lifecycle/observe.test.ts +27 -1
- package/src/lifecycle/observe.ts +43 -1
- package/src/lint/rule.ts +6 -0
- package/src/live-endpoint.ts +1 -1
- package/src/observation.test.ts +25 -0
- package/src/observation.ts +69 -5
- package/src/op/op-waves.ts +38 -1
- package/src/pr-forge-bundle.test.ts +1 -1
- package/src/pr-forge.ts +44 -17
- package/src/pr-requires.test.ts +43 -6
- package/src/pr-requires.ts +5 -1
- package/src/workspace/capabilities-contract.test.ts +88 -0
- package/src/workspace/capabilities-contract.ts +132 -0
- package/src/workspace/capabilities.schema.json +229 -0
- package/src/workspace/ci-cloud-identity.test.ts +20 -0
- package/src/workspace/ci-cloud-identity.ts +14 -1
- package/src/workspace/ci-run.test.ts +74 -1
- package/src/workspace/ci-run.ts +122 -29
- package/src/workspace/ci-secrets.test.ts +1 -1
- package/src/workspace/ci-secrets.ts +4 -3
- package/src/workspace/compose-graph.ts +10 -1
- package/src/workspace/conformance/conformance.e2e.test.ts +14 -1
- package/src/workspace/conformance/index.ts +31 -2
- package/src/workspace/declaration.schema.json +36 -1
- package/src/workspace/declaration.test.ts +7 -0
- package/src/workspace/declaration.ts +24 -2
- package/src/workspace/graph-cache.ts +27 -3
- package/src/workspace/graph-cli.ts +96 -24
- package/src/workspace/graph.schema.json +148 -0
- package/src/workspace/kind-readers.e2e.test.ts +28 -0
- package/src/workspace/kind-readers.test.ts +1 -1
- package/src/workspace/kind-readers.ts +7 -1
- package/src/workspace/member-commands.ts +22 -1
- package/src/workspace/nested-graph.ts +32 -1
- package/src/workspace/reason-codes.test.ts +7 -0
- package/src/workspace/reason-codes.ts +12 -0
- package/src/workspace/search-cli.e2e.test.ts +305 -0
- package/src/workspace/search-cli.ts +591 -0
- package/src/workspace/search-contract.ts +95 -0
- package/src/workspace/search.schema.json +822 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `capabilities` document of the read contract (#4375, ws-017): the
|
|
3
|
+
* capability catalog `chant search` answers `cap:` terms with, described by
|
|
4
|
+
* `capabilities.schema.json` beside this file.
|
|
5
|
+
*
|
|
6
|
+
* `chant search --capabilities --json` prints it for one project, with a
|
|
7
|
+
* support statement for each lexicon the project loads. `chant workspace
|
|
8
|
+
* search --capabilities --json` prints it from the workspace root's chant,
|
|
9
|
+
* for every lexicon a member loads (a terraform member's reader lexicon
|
|
10
|
+
* included, #4380): capability rules run once, under
|
|
11
|
+
* the workspace's chant, so the catalog is that chant's. chant's MCP
|
|
12
|
+
* `capabilities` tool returns whichever of the two applies where the server
|
|
13
|
+
* runs, unchanged.
|
|
14
|
+
*/
|
|
15
|
+
import type { CapabilityEntry } from "../capabilities/catalog.js";
|
|
16
|
+
/** The version of the `capabilities` document this chant writes. */
|
|
17
|
+
export declare const CAPABILITIES_CONTRACT_VERSION = 1;
|
|
18
|
+
/** `$id` of the JSON Schema for the document, shipped beside this file. */
|
|
19
|
+
export declare const CAPABILITIES_OUTPUT_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/capabilities/v1/capabilities.schema.json";
|
|
20
|
+
/** Why no catalog was printed. */
|
|
21
|
+
export declare const CAPABILITIES_ERROR_CODES: readonly ["usage-invalid"];
|
|
22
|
+
export type CapabilitiesErrorCode = (typeof CAPABILITIES_ERROR_CODES)[number];
|
|
23
|
+
/** Why a lexicon can't supply a capability. */
|
|
24
|
+
export declare const CAPABILITY_SUPPORT_CODES: readonly ["lexicon-has-no-mapping", "capability-not-derivable", "lexicon-not-loaded"];
|
|
25
|
+
interface CapabilitiesHead {
|
|
26
|
+
$schema: typeof CAPABILITIES_OUTPUT_SCHEMA_ID;
|
|
27
|
+
contract: typeof CAPABILITIES_CONTRACT_VERSION;
|
|
28
|
+
/** The chant that wrote the document. */
|
|
29
|
+
chant: string;
|
|
30
|
+
}
|
|
31
|
+
export interface CapabilitiesResult extends CapabilitiesHead {
|
|
32
|
+
capabilities: CapabilityEntry[];
|
|
33
|
+
helpers: {
|
|
34
|
+
name: string;
|
|
35
|
+
rule: string;
|
|
36
|
+
}[];
|
|
37
|
+
}
|
|
38
|
+
export interface CapabilitiesFailure extends CapabilitiesHead {
|
|
39
|
+
error: {
|
|
40
|
+
code: CapabilitiesErrorCode;
|
|
41
|
+
message: string;
|
|
42
|
+
hint?: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export type CapabilitiesDocument = CapabilitiesResult | CapabilitiesFailure;
|
|
46
|
+
/**
|
|
47
|
+
* The catalog, with a support statement for each lexicon named. Each is
|
|
48
|
+
* loaded on its own, so one that isn't installed is said to be, and the rest
|
|
49
|
+
* still read.
|
|
50
|
+
*/
|
|
51
|
+
export declare function capabilitiesDocument(lexicons: string[], load?: (name: string) => Promise<{
|
|
52
|
+
capabilityPack?: {
|
|
53
|
+
mapping: unknown;
|
|
54
|
+
};
|
|
55
|
+
}>): Promise<CapabilitiesResult>;
|
|
56
|
+
export declare function capabilitiesFailure(error: CapabilitiesFailure["error"]): Promise<CapabilitiesFailure>;
|
|
57
|
+
/**
|
|
58
|
+
* The lexicons the members of the workspace at `cwd` load, for its catalog:
|
|
59
|
+
* each chant member's own, and for a member of a package's kind, such as
|
|
60
|
+
* `terraform`, the lexicon its reader project declares (#4380).
|
|
61
|
+
*/
|
|
62
|
+
export declare function workspaceLexicons(cwd: string): Promise<string[]>;
|
|
63
|
+
/** The catalog as text: one capability per line, its search term and meaning, then its parameters. */
|
|
64
|
+
export declare function formatCapabilities(doc: CapabilitiesResult): string[];
|
|
65
|
+
export {};
|
|
66
|
+
//# sourceMappingURL=capabilities-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities-contract.d.ts","sourceRoot":"","sources":["../../src/workspace/capabilities-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,oEAAoE;AACpE,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAE/C,2EAA2E;AAC3E,eAAO,MAAM,6BAA6B,0FAA0F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CAsBtE;AAED,sGAAsG;AACtG,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAYpE"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `capabilities` document of the read contract (#4375, ws-017): the
|
|
3
|
+
* capability catalog `chant search` answers `cap:` terms with, described by
|
|
4
|
+
* `capabilities.schema.json` beside this file.
|
|
5
|
+
*
|
|
6
|
+
* `chant search --capabilities --json` prints it for one project, with a
|
|
7
|
+
* support statement for each lexicon the project loads. `chant workspace
|
|
8
|
+
* search --capabilities --json` prints it from the workspace root's chant,
|
|
9
|
+
* for every lexicon a member loads (a terraform member's reader lexicon
|
|
10
|
+
* included, #4380): capability rules run once, under
|
|
11
|
+
* the workspace's chant, so the catalog is that chant's. chant's MCP
|
|
12
|
+
* `capabilities` tool returns whichever of the two applies where the server
|
|
13
|
+
* runs, unchanged.
|
|
14
|
+
*/
|
|
15
|
+
import { resolve } from "node:path";
|
|
16
|
+
/** The version of the `capabilities` document this chant writes. */
|
|
17
|
+
export const CAPABILITIES_CONTRACT_VERSION = 1;
|
|
18
|
+
/** `$id` of the JSON Schema for the document, shipped beside this file. */
|
|
19
|
+
export const CAPABILITIES_OUTPUT_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/capabilities/v1/capabilities.schema.json";
|
|
20
|
+
/** Why no catalog was printed. */
|
|
21
|
+
export const CAPABILITIES_ERROR_CODES = ["usage-invalid"];
|
|
22
|
+
/** Why a lexicon can't supply a capability. */
|
|
23
|
+
export const CAPABILITY_SUPPORT_CODES = ["lexicon-has-no-mapping", "capability-not-derivable", "lexicon-not-loaded"];
|
|
24
|
+
async function head() {
|
|
25
|
+
const { readChantPackageVersion } = await import("../package-version.js");
|
|
26
|
+
return { $schema: CAPABILITIES_OUTPUT_SCHEMA_ID, contract: CAPABILITIES_CONTRACT_VERSION, chant: readChantPackageVersion() };
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The catalog, with a support statement for each lexicon named. Each is
|
|
30
|
+
* loaded on its own, so one that isn't installed is said to be, and the rest
|
|
31
|
+
* still read.
|
|
32
|
+
*/
|
|
33
|
+
export async function capabilitiesDocument(lexicons, load) {
|
|
34
|
+
const loadPlugin = load ?? (await import("../cli/plugins.js")).loadPlugin;
|
|
35
|
+
const { capabilityCatalog } = await import("../capabilities/catalog.js");
|
|
36
|
+
const mappings = {};
|
|
37
|
+
const notLoaded = [];
|
|
38
|
+
for (const name of [...new Set(lexicons)].sort()) {
|
|
39
|
+
try {
|
|
40
|
+
mappings[name] = (await loadPlugin(name)).capabilityPack?.mapping;
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
notLoaded.push(name);
|
|
44
|
+
mappings[name] = undefined;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const catalog = capabilityCatalog(mappings);
|
|
48
|
+
for (const c of catalog.capabilities) {
|
|
49
|
+
for (const name of notLoaded) {
|
|
50
|
+
c.lexicons[name] = { code: "lexicon-not-loaded", message: `the ${name} lexicon isn't installed where this chant runs, so its mapping wasn't read` };
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return { ...(await head()), ...catalog };
|
|
54
|
+
}
|
|
55
|
+
export async function capabilitiesFailure(error) {
|
|
56
|
+
return { ...(await head()), error };
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The lexicons the members of the workspace at `cwd` load, for its catalog:
|
|
60
|
+
* each chant member's own, and for a member of a package's kind, such as
|
|
61
|
+
* `terraform`, the lexicon its reader project declares (#4380).
|
|
62
|
+
*/
|
|
63
|
+
export async function workspaceLexicons(cwd) {
|
|
64
|
+
const { listWorkspace } = await import("./ls.js");
|
|
65
|
+
const { findWorkspaceRoot } = await import("../project-root.js");
|
|
66
|
+
const { resolveProjectLexicons } = await import("../cli/plugins.js");
|
|
67
|
+
const { loadKindRegistry } = await import("./kinds.js");
|
|
68
|
+
const located = findWorkspaceRoot(cwd);
|
|
69
|
+
const doc = listWorkspace({ cwd });
|
|
70
|
+
if (!located || "error" in doc)
|
|
71
|
+
return [];
|
|
72
|
+
const out = new Set();
|
|
73
|
+
const kinds = doc.members.some((m) => m.kind !== "chant" && m.readable) ? loadKindRegistry(doc.workspace.pins, located.dir).registry : undefined;
|
|
74
|
+
for (const m of doc.members) {
|
|
75
|
+
if (!m.readable)
|
|
76
|
+
continue;
|
|
77
|
+
const reader = m.kind === "chant" ? undefined : kinds?.get(m.kind)?.graph?.lexicon;
|
|
78
|
+
if (reader)
|
|
79
|
+
out.add(reader);
|
|
80
|
+
if (m.kind !== "chant")
|
|
81
|
+
continue;
|
|
82
|
+
try {
|
|
83
|
+
for (const l of await resolveProjectLexicons(resolve(located.dir, m.dir)))
|
|
84
|
+
out.add(l);
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
// A member whose lexicons can't be resolved adds none; its own search says why.
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return [...out];
|
|
91
|
+
}
|
|
92
|
+
/** The catalog as text: one capability per line, its search term and meaning, then its parameters. */
|
|
93
|
+
export function formatCapabilities(doc) {
|
|
94
|
+
const width = Math.max(...doc.capabilities.map((c) => c.search.length));
|
|
95
|
+
const lines = [];
|
|
96
|
+
for (const c of doc.capabilities) {
|
|
97
|
+
lines.push(`${c.search.padEnd(width)} ${c.shape.padEnd(4)} ${c.meaning}`);
|
|
98
|
+
for (const p of c.params)
|
|
99
|
+
lines.push(`${"".padEnd(width)} ${p.name}${p.optional ? "?" : ""}: ${p.meaning}`);
|
|
100
|
+
const unsupported = Object.entries(c.lexicons).filter(([, s]) => s !== "supported");
|
|
101
|
+
for (const [lex, s] of unsupported)
|
|
102
|
+
lines.push(`${"".padEnd(width)} not in ${lex}: ${s.message}`);
|
|
103
|
+
}
|
|
104
|
+
const lexicons = Object.keys(doc.capabilities[0]?.lexicons ?? {});
|
|
105
|
+
lines.push(`— ${doc.capabilities.length} capabilities${lexicons.length ? ` · lexicons ${lexicons.join(", ")}` : ""} · --json prints each rule`);
|
|
106
|
+
return lines;
|
|
107
|
+
}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/chant/schemas/workspace/capabilities/v1/capabilities.schema.json",
|
|
4
|
+
"title": "chant capabilities catalog",
|
|
5
|
+
"description": "What `chant search --capabilities --json` prints (#4375): the capability catalog `chant search` answers `cap:` terms and `->[cap=...]` edges with, each capability's rule, and whether each lexicon the project loads can supply it. chant's MCP `capabilities` tool returns the same document. Version 1 of the read contract. Readers ignore fields they do not know; a field is only ever added within a version. The codes are a closed list, each in the one closed list of `reason-codes.ts`. Contract version 1 of this document is written by chant 0.124.46 and newer; the read contract as a whole by chant 0.81.0 and newer.",
|
|
6
|
+
"oneOf": [
|
|
7
|
+
{
|
|
8
|
+
"$ref": "#/$defs/result"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"$ref": "#/$defs/failure"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"$defs": {
|
|
15
|
+
"result": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"description": "Exit code 0.",
|
|
18
|
+
"required": [
|
|
19
|
+
"$schema",
|
|
20
|
+
"contract",
|
|
21
|
+
"chant",
|
|
22
|
+
"capabilities",
|
|
23
|
+
"helpers"
|
|
24
|
+
],
|
|
25
|
+
"properties": {
|
|
26
|
+
"$schema": {
|
|
27
|
+
"const": "https://intentius.io/chant/schemas/workspace/capabilities/v1/capabilities.schema.json"
|
|
28
|
+
},
|
|
29
|
+
"contract": {
|
|
30
|
+
"const": 1
|
|
31
|
+
},
|
|
32
|
+
"chant": {
|
|
33
|
+
"type": "string"
|
|
34
|
+
},
|
|
35
|
+
"error": false,
|
|
36
|
+
"capabilities": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"description": "Every capability the catalog lists, in the order the rule file defines them.",
|
|
39
|
+
"items": {
|
|
40
|
+
"$ref": "#/$defs/capability"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"helpers": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"description": "Rules the capabilities use that the catalog does not list as capabilities of their own.",
|
|
46
|
+
"items": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"required": [
|
|
49
|
+
"name",
|
|
50
|
+
"rule"
|
|
51
|
+
],
|
|
52
|
+
"properties": {
|
|
53
|
+
"name": {
|
|
54
|
+
"type": "string"
|
|
55
|
+
},
|
|
56
|
+
"rule": {
|
|
57
|
+
"type": "string"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"capability": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"required": [
|
|
67
|
+
"name",
|
|
68
|
+
"meaning",
|
|
69
|
+
"shape",
|
|
70
|
+
"params",
|
|
71
|
+
"search",
|
|
72
|
+
"answers",
|
|
73
|
+
"depth",
|
|
74
|
+
"lexicons",
|
|
75
|
+
"notEvaluated",
|
|
76
|
+
"uses",
|
|
77
|
+
"rule"
|
|
78
|
+
],
|
|
79
|
+
"properties": {
|
|
80
|
+
"name": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
83
|
+
},
|
|
84
|
+
"meaning": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"description": "What the capability says, in one line."
|
|
87
|
+
},
|
|
88
|
+
"shape": {
|
|
89
|
+
"enum": [
|
|
90
|
+
"set",
|
|
91
|
+
"edge"
|
|
92
|
+
],
|
|
93
|
+
"description": "set: a set of nodes, tested with cap:<name>. edge: pairs of nodes, walked with ->[cap=<name>] or <-[cap=<name>]."
|
|
94
|
+
},
|
|
95
|
+
"params": {
|
|
96
|
+
"type": "array",
|
|
97
|
+
"description": "Arguments, in order: cap:<name>(<a>, <b>). An optional one left out drops the test that reads it.",
|
|
98
|
+
"items": {
|
|
99
|
+
"type": "object",
|
|
100
|
+
"required": [
|
|
101
|
+
"name",
|
|
102
|
+
"optional",
|
|
103
|
+
"meaning"
|
|
104
|
+
],
|
|
105
|
+
"properties": {
|
|
106
|
+
"name": {
|
|
107
|
+
"type": "string"
|
|
108
|
+
},
|
|
109
|
+
"optional": {
|
|
110
|
+
"type": "boolean"
|
|
111
|
+
},
|
|
112
|
+
"meaning": {
|
|
113
|
+
"type": "string"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"search": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"description": "The search term that asks for it: cap:<name> for a set, ->[cap=<name>] for an edge."
|
|
121
|
+
},
|
|
122
|
+
"answers": {
|
|
123
|
+
"type": "array",
|
|
124
|
+
"description": "Questions it serves, in people's words.",
|
|
125
|
+
"items": {
|
|
126
|
+
"type": "string"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"depth": {
|
|
130
|
+
"enum": [
|
|
131
|
+
"declared",
|
|
132
|
+
"live",
|
|
133
|
+
"either"
|
|
134
|
+
],
|
|
135
|
+
"description": "Which observation can supply its facts: declared source, a live read or snapshot, or either."
|
|
136
|
+
},
|
|
137
|
+
"lexicons": {
|
|
138
|
+
"type": "object",
|
|
139
|
+
"description": "Each lexicon the project loads: supported, or why it can't supply the capability.",
|
|
140
|
+
"additionalProperties": {
|
|
141
|
+
"oneOf": [
|
|
142
|
+
{
|
|
143
|
+
"const": "supported"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"type": "object",
|
|
147
|
+
"required": [
|
|
148
|
+
"code",
|
|
149
|
+
"message"
|
|
150
|
+
],
|
|
151
|
+
"properties": {
|
|
152
|
+
"code": {
|
|
153
|
+
"enum": [
|
|
154
|
+
"lexicon-has-no-mapping",
|
|
155
|
+
"capability-not-derivable",
|
|
156
|
+
"lexicon-not-loaded"
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
"message": {
|
|
160
|
+
"type": "string"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"notEvaluated": {
|
|
168
|
+
"type": "array",
|
|
169
|
+
"description": "What the rule leaves out. chant search prints this under every answer that uses the capability.",
|
|
170
|
+
"items": {
|
|
171
|
+
"type": "string"
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"uses": {
|
|
175
|
+
"type": "array",
|
|
176
|
+
"description": "The capabilities and helpers its rule refers to.",
|
|
177
|
+
"items": {
|
|
178
|
+
"type": "string"
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"rule": {
|
|
182
|
+
"type": "string",
|
|
183
|
+
"description": "The rule as written, one alternative per line."
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
"failure": {
|
|
188
|
+
"type": "object",
|
|
189
|
+
"description": "Exit code 1.",
|
|
190
|
+
"required": [
|
|
191
|
+
"$schema",
|
|
192
|
+
"contract",
|
|
193
|
+
"chant",
|
|
194
|
+
"error"
|
|
195
|
+
],
|
|
196
|
+
"properties": {
|
|
197
|
+
"$schema": {
|
|
198
|
+
"const": "https://intentius.io/chant/schemas/workspace/capabilities/v1/capabilities.schema.json"
|
|
199
|
+
},
|
|
200
|
+
"contract": {
|
|
201
|
+
"const": 1
|
|
202
|
+
},
|
|
203
|
+
"chant": {
|
|
204
|
+
"type": "string"
|
|
205
|
+
},
|
|
206
|
+
"error": {
|
|
207
|
+
"type": "object",
|
|
208
|
+
"required": [
|
|
209
|
+
"code",
|
|
210
|
+
"message"
|
|
211
|
+
],
|
|
212
|
+
"properties": {
|
|
213
|
+
"code": {
|
|
214
|
+
"enum": [
|
|
215
|
+
"usage-invalid"
|
|
216
|
+
]
|
|
217
|
+
},
|
|
218
|
+
"message": {
|
|
219
|
+
"type": "string"
|
|
220
|
+
},
|
|
221
|
+
"hint": {
|
|
222
|
+
"type": "string"
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
* the workspace that holds `cwd`, as `ci.reportUrl` is (./ci-report-url.ts).
|
|
6
6
|
* A directory outside a workspace reads nothing.
|
|
7
7
|
*/
|
|
8
|
-
import { type PipelineCloudIdentity } from "../ci-identity.js";
|
|
8
|
+
import { type CloudTradeSpec, type PipelineCloudIdentity } from "../ci-identity.js";
|
|
9
9
|
/** The plan and apply identities of the pipeline for `env` and `member`, or undefined. */
|
|
10
10
|
export declare function declaredCloudIdentity(cwd: string, env: string, member?: string): Promise<PipelineCloudIdentity | undefined>;
|
|
11
|
+
/** The trade a pull request environment's jobs take for `member` (#4330, `resolvePrEnvCloudIdentity`), or undefined. */
|
|
12
|
+
export declare function declaredPrEnvCloudIdentity(cwd: string, member?: string): Promise<CloudTradeSpec | undefined>;
|
|
11
13
|
//# sourceMappingURL=ci-cloud-identity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-cloud-identity.d.ts","sourceRoot":"","sources":["../../src/workspace/ci-cloud-identity.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"ci-cloud-identity.d.ts","sourceRoot":"","sources":["../../src/workspace/ci-cloud-identity.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAmD,KAAK,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAElI,0FAA0F;AAC1F,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAUjI;AAED,wHAAwH;AACxH,wBAAsB,0BAA0B,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAUlH"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* A directory outside a workspace reads nothing.
|
|
7
7
|
*/
|
|
8
8
|
import { findWorkspaceRoot } from "../project-root.js";
|
|
9
|
-
import { resolveCloudIdentity } from "../ci-identity.js";
|
|
9
|
+
import { resolveCloudIdentity, resolvePrEnvCloudIdentity } from "../ci-identity.js";
|
|
10
10
|
/** The plan and apply identities of the pipeline for `env` and `member`, or undefined. */
|
|
11
11
|
export async function declaredCloudIdentity(cwd, env, member) {
|
|
12
12
|
const found = findWorkspaceRoot(cwd);
|
|
@@ -22,3 +22,18 @@ export async function declaredCloudIdentity(cwd, env, member) {
|
|
|
22
22
|
throw Object.assign(new Error(`${err.describe()} [${err.code}]`), { code: err.code });
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
+
/** The trade a pull request environment's jobs take for `member` (#4330, `resolvePrEnvCloudIdentity`), or undefined. */
|
|
26
|
+
export async function declaredPrEnvCloudIdentity(cwd, member) {
|
|
27
|
+
const found = findWorkspaceRoot(cwd);
|
|
28
|
+
if (!found)
|
|
29
|
+
return undefined;
|
|
30
|
+
const [{ readDeclaration, WorkspaceReadError }, { workingTree }] = await Promise.all([import("./declaration.js"), import("./tree.js")]);
|
|
31
|
+
try {
|
|
32
|
+
return resolvePrEnvCloudIdentity(readDeclaration(workingTree(found.dir)).ci?.identity?.cloud, member);
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
if (!(err instanceof WorkspaceReadError))
|
|
36
|
+
throw err;
|
|
37
|
+
throw Object.assign(new Error(`${err.describe()} [${err.code}]`), { code: err.code });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
* command always does, since a local apply changes the same infrastructure
|
|
80
80
|
* a CI one does.
|
|
81
81
|
*/
|
|
82
|
-
import { type PrLoopJob, type PrLoopPipelineOptions } from "../components/pr-pipeline.js";
|
|
82
|
+
import { type PrEnvJob, type PrLoopJob, type PrLoopPipelineOptions } from "../components/pr-pipeline.js";
|
|
83
83
|
import { type CommitStatus, type ForgeKind, type PrForge } from "../pr-forge.js";
|
|
84
84
|
import type { CommandContext } from "../cli/registry.js";
|
|
85
85
|
import { type RunOrigin } from "../lifecycle/release-ledger.js";
|
|
@@ -88,11 +88,25 @@ import type { OpRunFailureReason, OpRunRecord } from "../op/runtime.js";
|
|
|
88
88
|
import type { OpConfig } from "../op/types.js";
|
|
89
89
|
import { type Redact } from "../op/redact.js";
|
|
90
90
|
import { type CiSecrets } from "./ci-secrets.js";
|
|
91
|
-
/**
|
|
92
|
-
|
|
91
|
+
/**
|
|
92
|
+
* The jobs a pull-request pipeline has: plan, and on merge record (#4168) or,
|
|
93
|
+
* opted in, apply; and with `--pr-env` (#4298, #4330) the jobs of a pull
|
|
94
|
+
* request's environment.
|
|
95
|
+
*/
|
|
96
|
+
export type CiJobName = PrLoopJob["jobName"] | PrEnvJob["jobName"];
|
|
93
97
|
export declare const CI_JOB_NAMES: readonly CiJobName[];
|
|
94
|
-
/** The
|
|
98
|
+
/** The jobs of a pull request's environment (#4330). */
|
|
99
|
+
export declare const CI_ENV_JOB_NAMES: readonly PrEnvJob["jobName"][];
|
|
100
|
+
/** Whether `job` is one of a pull request environment's jobs. */
|
|
101
|
+
export declare const isCiEnvJob: (job: CiJobName) => job is PrEnvJob["jobName"];
|
|
102
|
+
/** The Op each job is recorded as, which `ci.green` phases match. An environment job's is its report's stem too. */
|
|
95
103
|
export declare const CI_JOB_OPS: Record<CiJobName, string>;
|
|
104
|
+
/** One job as `ci run` runs it: a pull-request job, or an environment job (#4330). */
|
|
105
|
+
export type CiJob = Pick<PrLoopJob, "command" | "env" | "setup" | "build" | "wave"> & {
|
|
106
|
+
jobName: CiJobName;
|
|
107
|
+
};
|
|
108
|
+
/** Where a job writes its report, inside its checkout. */
|
|
109
|
+
export declare function ciJobReportDir(job: CiJobName): string;
|
|
96
110
|
/** Where a job the chant runner ran says it ran (#4094). */
|
|
97
111
|
export declare const CHANT_RUNNER_ORIGIN: RunOrigin;
|
|
98
112
|
/** Where a job `chant ci run --local` ran says it ran (#4161): this machine, outside CI. */
|
|
@@ -113,6 +127,10 @@ export interface CiRunValues {
|
|
|
113
127
|
pr?: number;
|
|
114
128
|
/** The full commit the job runs at. */
|
|
115
129
|
commit: string;
|
|
130
|
+
/** `--head`: the pull request's head, `HEAD_SHA`, which `env-post` reads (#4330). */
|
|
131
|
+
head?: string;
|
|
132
|
+
/** `--result`: the env-up job's result, `UP_RESULT`, which `env-post` reads on GitHub and Forgejo (#4330). */
|
|
133
|
+
upResult?: string;
|
|
116
134
|
}
|
|
117
135
|
export declare class CiRunError extends Error {
|
|
118
136
|
constructor(message: string);
|
|
@@ -128,7 +146,7 @@ export declare class CiRunError extends Error {
|
|
|
128
146
|
* runner's variable of the same name, and none replaces a variable the
|
|
129
147
|
* runner sets for the job. `CHANT_RUNNER_KEY` is never in it.
|
|
130
148
|
*/
|
|
131
|
-
export declare function ciJobEnv(job:
|
|
149
|
+
export declare function ciJobEnv(job: CiJob, input: {
|
|
132
150
|
forge: ForgeKind;
|
|
133
151
|
env: string;
|
|
134
152
|
values: CiRunValues;
|
|
@@ -139,7 +157,7 @@ export declare function ciJobEnv(job: PrLoopJob, input: {
|
|
|
139
157
|
}): Record<string, string>;
|
|
140
158
|
/** What {@link ciJobOp} builds the Op from. */
|
|
141
159
|
export interface CiJobOpInput {
|
|
142
|
-
job:
|
|
160
|
+
job: CiJob;
|
|
143
161
|
env: string;
|
|
144
162
|
/** The directory the steps run in, inside the fresh checkout. */
|
|
145
163
|
cwd: string;
|
|
@@ -155,7 +173,7 @@ export interface CiJobOpInput {
|
|
|
155
173
|
/** `line` with a `chant` at its start replaced by the command the caller names, when it names one. */
|
|
156
174
|
export declare function withChant(line: string, chant?: string): string;
|
|
157
175
|
/** The job's own setup lines and its command, as one shell script, with `chant` at its start replaced by the command the caller names. */
|
|
158
|
-
export declare function ciJobCommand(job:
|
|
176
|
+
export declare function ciJobCommand(job: CiJob, chant?: string): string;
|
|
159
177
|
/**
|
|
160
178
|
* The job as an Op: `setup`, `build` and the job's own phase, each line one
|
|
161
179
|
* shell step in `cwd` with the job's environment and nothing else. A phase
|
|
@@ -251,10 +269,14 @@ export interface CiRunRequest {
|
|
|
251
269
|
* `forge` then only shapes the job's variables.
|
|
252
270
|
*/
|
|
253
271
|
noForge?: boolean;
|
|
254
|
-
/** `--base`, `--pr` and `--commit` (default `HEAD`). */
|
|
272
|
+
/** `--base`, `--pr` and `--commit` (default `HEAD`; for `env-post`, `--base`). */
|
|
255
273
|
base?: string;
|
|
256
274
|
pr?: number;
|
|
257
275
|
commit?: string;
|
|
276
|
+
/** `--head`: for `env-post` (#4330), the pull request's head its environment was applied from. */
|
|
277
|
+
head?: string;
|
|
278
|
+
/** `--result`: for `env-post` (#4330), the env-up job's result. */
|
|
279
|
+
upResult?: string;
|
|
258
280
|
/**
|
|
259
281
|
* The generator's options: `--gate`, `--branch`, `--events-json`,
|
|
260
282
|
* `--report-url`, `--pr-build` and `--pr-build-command`, and `--wave-gate`
|
|
@@ -365,6 +387,11 @@ export interface CiRunResult {
|
|
|
365
387
|
checkout: string;
|
|
366
388
|
/** The job ran with `local` (#4161): its record stays on this machine. */
|
|
367
389
|
local?: true;
|
|
390
|
+
/**
|
|
391
|
+
* For `env-up` (#4330): the `env-post` job the runner ran after it at
|
|
392
|
+
* `--base`, with its own token, which kept the record and posted the note.
|
|
393
|
+
*/
|
|
394
|
+
post?: CiRunResult;
|
|
368
395
|
}
|
|
369
396
|
/** The member a job runs for, and its directory from the repository root, as the generator decides it. */
|
|
370
397
|
export declare function ciJobPlace(cwd: string, top: string): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-run.d.ts","sourceRoot":"","sources":["../../src/workspace/ci-run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;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