@intentius/chant 0.18.12 → 0.18.14
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/cli/handlers/emulator.d.ts +22 -0
- package/dist/cli/handlers/emulator.d.ts.map +1 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/lexicon.d.ts +6 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/op/emulator-lifecycle.d.ts +11 -0
- package/dist/op/emulator-lifecycle.d.ts.map +1 -1
- package/dist/op/index.d.ts +1 -1
- package/dist/op/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/cli/handlers/emulator.test.ts +156 -0
- package/src/cli/handlers/emulator.ts +92 -0
- package/src/cli/main.ts +17 -1
- package/src/lexicon.ts +7 -0
- package/src/op/emulator-lifecycle.ts +16 -2
- package/src/op/index.ts +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CommandContext } from "../registry.js";
|
|
2
|
+
/** One emulator's state — the machine-readable `--json` unit (#920). */
|
|
3
|
+
export interface EmulatorReport {
|
|
4
|
+
lexicon: string;
|
|
5
|
+
/** Container name (e.g. `chant-floci`). */
|
|
6
|
+
name: string;
|
|
7
|
+
/** `http://localhost:<port>` when up; empty when down. */
|
|
8
|
+
endpoint: string;
|
|
9
|
+
/** Env that points the SDK / `chant graph --live` / a triggered Op at it. */
|
|
10
|
+
env: Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* chant emulator up|down|status [--lexicon <name>] [--json] (#920)
|
|
14
|
+
*
|
|
15
|
+
* Boot / stop / inspect the local emulators of the project's configured lexicons
|
|
16
|
+
* (Floci for aws, floci-az/gcp, mudflaps/spritzer for fly). `up` leaves them
|
|
17
|
+
* running (persistent, unlike the in-Op boot/teardown) so a consumer can deploy to
|
|
18
|
+
* and observe them; `--json` reports each one's endpoint + the env that redirects
|
|
19
|
+
* tooling at it. Consumed by behold `serve --local`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function runEmulator(ctx: CommandContext): Promise<number>;
|
|
22
|
+
//# sourceMappingURL=emulator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emulator.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/emulator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD,wEAAwE;AACxE,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B;AAcD;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAmDtE"}
|
package/dist/cli/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AAMA,OAAO,EAAmC,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AAMA,OAAO,EAAmC,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAkB9E;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CA2LpD"}
|
package/dist/lexicon.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { ArtifactIntegrity } from "./lexicon-integrity.js";
|
|
|
8
8
|
import type { CompletionContext, CompletionItem, HoverContext, HoverInfo, CodeActionContext, CodeAction } from "./lsp/types.js";
|
|
9
9
|
import type { McpToolContribution, McpResourceContribution } from "./mcp/types.js";
|
|
10
10
|
import type { DriverComponent } from "./components/driver.js";
|
|
11
|
+
import type { EmulatorCapability } from "./op/emulator-lifecycle.js";
|
|
11
12
|
import type { RuleMeta } from "./audit/catalog.js";
|
|
12
13
|
import type { ReferenceCatalog } from "./graph-refs.js";
|
|
13
14
|
export type { ReferenceCatalog, IdentityRule, RefRule } from "./graph-refs.js";
|
|
@@ -233,6 +234,11 @@ export interface LexiconPlugin {
|
|
|
233
234
|
verbose?: boolean;
|
|
234
235
|
force?: boolean;
|
|
235
236
|
}): Promise<void>;
|
|
237
|
+
/** Local emulator (#920), if this lexicon has one (Floci for aws, floci-az/gcp,
|
|
238
|
+
* mudflaps/spritzer for fly). Drives `chant emulator up|down|status` and lets a
|
|
239
|
+
* consumer (behold `--local`) boot it + point apply/observe at it — no cloud
|
|
240
|
+
* account. Absent when the lexicon has no local emulator. */
|
|
241
|
+
readonly emulator?: EmulatorCapability;
|
|
236
242
|
/** Return lint rules provided by this lexicon */
|
|
237
243
|
lintRules?(): LintRule[];
|
|
238
244
|
/** Return declarative rule specs for compilation via rule() */
|
package/dist/lexicon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexicon.d.ts","sourceRoot":"","sources":["../src/lexicon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,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AgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAkBtE"}
|
|
@@ -17,6 +17,17 @@ export interface EmulatorSpec {
|
|
|
17
17
|
/** Extra `docker run` args inserted before the image (e.g. a socket mount). */
|
|
18
18
|
runArgs?: readonly string[];
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* A lexicon's local-emulator capability (#920) — what `chant emulator` needs to
|
|
22
|
+
* boot it and point tooling at it. The `spec` drives the Docker lifecycle; `env`
|
|
23
|
+
* returns the variables that redirect the SDK / `chant graph --live` / a triggered
|
|
24
|
+
* Op at the running emulator (e.g. `AWS_ENDPOINT_URL`). `env` is `{}` when the
|
|
25
|
+
* emulator is reached only via an explicit apply argument, not a global variable.
|
|
26
|
+
*/
|
|
27
|
+
export interface EmulatorCapability {
|
|
28
|
+
spec: EmulatorSpec;
|
|
29
|
+
env(endpoint: string): Record<string, string>;
|
|
30
|
+
}
|
|
20
31
|
/** Per-call overrides for {@link EmulatorLifecycle.up} / `runCommand`. */
|
|
21
32
|
export interface EmulatorUpArgs {
|
|
22
33
|
name?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emulator-lifecycle.d.ts","sourceRoot":"","sources":["../../src/op/emulator-lifecycle.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,2EAA2E;IAC3E,aAAa,EAAE,MAAM,CAAC;IACtB,sFAAsF;IACtF,UAAU,EAAE,MAAM,CAAC;IACnB,oFAAoF;IACpF,KAAK,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;IACxC,+EAA+E;IAC/E,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B;AAED,0EAA0E;AAC1E,MAAM,WAAW,cAAc;IAC7B,IAAI,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GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,iBAAiB,CA2EvE"}
|
package/dist/op/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { Op, phase, activity, gate, build, kubectlApply, helmInstall, waitForSta
|
|
|
2
2
|
export { OpResource } from "./resource.js";
|
|
3
3
|
export { safeHeartbeat, sleep } from "./activity-runtime.js";
|
|
4
4
|
export { emulatorLifecycle } from "./emulator-lifecycle.js";
|
|
5
|
-
export type { EmulatorSpec, EmulatorUpArgs, EmulatorLifecycle } from "./emulator-lifecycle.js";
|
|
5
|
+
export type { EmulatorSpec, EmulatorCapability, EmulatorUpArgs, EmulatorLifecycle } from "./emulator-lifecycle.js";
|
|
6
6
|
export type { OpConfig, PhaseDefinition, StepDefinition, ActivityStep, GateStep } from "./types.js";
|
|
7
7
|
export { discoverOps } from "./discover.js";
|
|
8
8
|
export type { DiscoveredOp, OpDiscoveryResult } from "./discover.js";
|
package/dist/op/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/op/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EACzE,cAAc,EAAE,iBAAiB,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EACtF,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAC3D,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EACrG,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EACzF,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAC5D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D,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAChH,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACpF,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAClH,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { describe, test, expect, vi, beforeEach } from "vitest";
|
|
2
|
+
import { promisify } from "node:util";
|
|
3
|
+
import type { ParsedArgs } from "../registry";
|
|
4
|
+
import type { LexiconPlugin } from "../../lexicon";
|
|
5
|
+
import type { EmulatorCapability } from "../../op";
|
|
6
|
+
|
|
7
|
+
// `up`/`down`/`endpoint` come from the shared lifecycle — stub it so the handler's
|
|
8
|
+
// wiring (filtering, --json shape, action dispatch) is tested without Docker.
|
|
9
|
+
const upMock = vi.fn();
|
|
10
|
+
const downMock = vi.fn();
|
|
11
|
+
|
|
12
|
+
vi.mock("../../op", async () => {
|
|
13
|
+
const actual = await vi.importActual<typeof import("../../op")>("../../op");
|
|
14
|
+
return {
|
|
15
|
+
...actual,
|
|
16
|
+
emulatorLifecycle: () => ({
|
|
17
|
+
up: (...a: unknown[]) => upMock(...a),
|
|
18
|
+
down: (...a: unknown[]) => downMock(...a),
|
|
19
|
+
endpoint: (port: number) => `http://localhost:${port}`,
|
|
20
|
+
}),
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// `status` shells `docker ps -q -f name=…` via promisify(exec); drive its stdout.
|
|
25
|
+
let dockerPsStdout = "";
|
|
26
|
+
const execWithCustom = Object.assign(() => {}, {
|
|
27
|
+
[promisify.custom]: (_cmd: string) => Promise.resolve({ stdout: dockerPsStdout }),
|
|
28
|
+
});
|
|
29
|
+
vi.mock("node:child_process", async () => {
|
|
30
|
+
const actual = await vi.importActual<typeof import("node:child_process")>("node:child_process");
|
|
31
|
+
return { ...actual, exec: execWithCustom };
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const { runEmulator } = await import("./emulator");
|
|
35
|
+
|
|
36
|
+
function cap(): EmulatorCapability {
|
|
37
|
+
return {
|
|
38
|
+
spec: { name: "chant-floci", image: "floci/floci:latest", containerPort: 4566, healthPath: "/_localstack/health" },
|
|
39
|
+
env: (endpoint) => ({ AWS_ENDPOINT_URL: endpoint, AWS_REGION: "us-east-1" }),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function plugin(name: string, emulator?: EmulatorCapability): LexiconPlugin {
|
|
44
|
+
return { name, emulator } as unknown as LexiconPlugin;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function makeArgs(overrides: Partial<ParsedArgs> = {}): ParsedArgs {
|
|
48
|
+
return {
|
|
49
|
+
command: "emulator", path: ".",
|
|
50
|
+
format: "", fix: false, watch: false, verbose: false, help: false, live: false,
|
|
51
|
+
...overrides,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function stdout(): string[] {
|
|
56
|
+
const buf: string[] = [];
|
|
57
|
+
vi.spyOn(console, "log").mockImplementation((s: string) => { buf.push(s); });
|
|
58
|
+
return buf;
|
|
59
|
+
}
|
|
60
|
+
function stderr(): string[] {
|
|
61
|
+
const buf: string[] = [];
|
|
62
|
+
vi.spyOn(console, "error").mockImplementation((s: string) => { buf.push(s); });
|
|
63
|
+
return buf;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
describe("runEmulator (#920)", () => {
|
|
67
|
+
beforeEach(() => {
|
|
68
|
+
upMock.mockReset();
|
|
69
|
+
downMock.mockReset();
|
|
70
|
+
dockerPsStdout = "";
|
|
71
|
+
vi.restoreAllMocks();
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
test("rejects a missing / unknown action with usage and exit 1", async () => {
|
|
75
|
+
const err = stderr();
|
|
76
|
+
expect(await runEmulator({ args: makeArgs(), plugins: [plugin("aws", cap())], serializers: [] })).toBe(1);
|
|
77
|
+
expect(err.join("\n")).toContain("Usage: chant emulator");
|
|
78
|
+
expect(await runEmulator({ args: makeArgs({ path: "restart" }), plugins: [], serializers: [] })).toBe(1);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test("up boots each emulator and reports endpoint + redirect env as JSON", async () => {
|
|
82
|
+
upMock.mockResolvedValue({ endpoint: "http://localhost:4566" });
|
|
83
|
+
const out = stdout();
|
|
84
|
+
const exit = await runEmulator({
|
|
85
|
+
args: makeArgs({ path: "up", json: true }),
|
|
86
|
+
plugins: [plugin("aws", cap()), plugin("gitlab")],
|
|
87
|
+
serializers: [],
|
|
88
|
+
});
|
|
89
|
+
expect(exit).toBe(0);
|
|
90
|
+
expect(upMock).toHaveBeenCalledTimes(1); // gitlab has no emulator → skipped
|
|
91
|
+
expect(JSON.parse(out.join(""))).toEqual({
|
|
92
|
+
emulators: [{
|
|
93
|
+
lexicon: "aws",
|
|
94
|
+
name: "chant-floci",
|
|
95
|
+
endpoint: "http://localhost:4566",
|
|
96
|
+
env: { AWS_ENDPOINT_URL: "http://localhost:4566", AWS_REGION: "us-east-1" },
|
|
97
|
+
}],
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
test("--lexicon narrows to the named lexicon", async () => {
|
|
102
|
+
upMock.mockResolvedValue({ endpoint: "http://localhost:4566" });
|
|
103
|
+
const out = stdout();
|
|
104
|
+
await runEmulator({
|
|
105
|
+
args: makeArgs({ path: "up", json: true, lexicon: "azure" }),
|
|
106
|
+
plugins: [plugin("aws", cap()), plugin("azure", cap())],
|
|
107
|
+
serializers: [],
|
|
108
|
+
});
|
|
109
|
+
const parsed = JSON.parse(out.join(""));
|
|
110
|
+
expect(parsed.emulators).toHaveLength(1);
|
|
111
|
+
expect(parsed.emulators[0].lexicon).toBe("azure");
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
test("down stops the emulator and reports it as down (no endpoint/env)", async () => {
|
|
115
|
+
downMock.mockResolvedValue(undefined);
|
|
116
|
+
const out = stdout();
|
|
117
|
+
const exit = await runEmulator({
|
|
118
|
+
args: makeArgs({ path: "down", json: true }),
|
|
119
|
+
plugins: [plugin("aws", cap())],
|
|
120
|
+
serializers: [],
|
|
121
|
+
});
|
|
122
|
+
expect(exit).toBe(0);
|
|
123
|
+
expect(downMock).toHaveBeenCalledTimes(1);
|
|
124
|
+
expect(JSON.parse(out.join("")).emulators[0]).toEqual({
|
|
125
|
+
lexicon: "aws", name: "chant-floci", endpoint: "", env: {},
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
test("status reports up when the container is running, down otherwise", async () => {
|
|
130
|
+
dockerPsStdout = "abc123\n";
|
|
131
|
+
let out = stdout();
|
|
132
|
+
await runEmulator({ args: makeArgs({ path: "status", json: true }), plugins: [plugin("aws", cap())], serializers: [] });
|
|
133
|
+
expect(JSON.parse(out.join("")).emulators[0].endpoint).toBe("http://localhost:4566");
|
|
134
|
+
expect(upMock).not.toHaveBeenCalled(); // status never boots
|
|
135
|
+
|
|
136
|
+
vi.restoreAllMocks();
|
|
137
|
+
dockerPsStdout = "";
|
|
138
|
+
out = stdout();
|
|
139
|
+
await runEmulator({ args: makeArgs({ path: "status", json: true }), plugins: [plugin("aws", cap())], serializers: [] });
|
|
140
|
+
const rep = JSON.parse(out.join("")).emulators[0];
|
|
141
|
+
expect(rep.endpoint).toBe("");
|
|
142
|
+
expect(rep.env).toEqual({});
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test("no configured lexicon has an emulator → empty JSON, exit 0", async () => {
|
|
146
|
+
const out = stdout();
|
|
147
|
+
const exit = await runEmulator({
|
|
148
|
+
args: makeArgs({ path: "up", json: true }),
|
|
149
|
+
plugins: [plugin("gitlab"), plugin("github")],
|
|
150
|
+
serializers: [],
|
|
151
|
+
});
|
|
152
|
+
expect(exit).toBe(0);
|
|
153
|
+
expect(JSON.parse(out.join(""))).toEqual({ emulators: [] });
|
|
154
|
+
expect(upMock).not.toHaveBeenCalled();
|
|
155
|
+
});
|
|
156
|
+
});
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { exec } from "node:child_process";
|
|
2
|
+
import { promisify } from "node:util";
|
|
3
|
+
import { emulatorLifecycle } from "../../op";
|
|
4
|
+
import { formatError, formatWarning, formatSuccess } from "../format";
|
|
5
|
+
import type { CommandContext } from "../registry";
|
|
6
|
+
|
|
7
|
+
const execAsync = promisify(exec);
|
|
8
|
+
|
|
9
|
+
/** One emulator's state — the machine-readable `--json` unit (#920). */
|
|
10
|
+
export interface EmulatorReport {
|
|
11
|
+
lexicon: string;
|
|
12
|
+
/** Container name (e.g. `chant-floci`). */
|
|
13
|
+
name: string;
|
|
14
|
+
/** `http://localhost:<port>` when up; empty when down. */
|
|
15
|
+
endpoint: string;
|
|
16
|
+
/** Env that points the SDK / `chant graph --live` / a triggered Op at it. */
|
|
17
|
+
env: Record<string, string>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const ACTIONS = new Set(["up", "down", "status"]);
|
|
21
|
+
|
|
22
|
+
/** True if a container of this name is running. */
|
|
23
|
+
async function isRunning(name: string): Promise<boolean> {
|
|
24
|
+
try {
|
|
25
|
+
const { stdout } = await execAsync(`docker ps -q -f name=${name}`);
|
|
26
|
+
return Boolean(stdout.trim());
|
|
27
|
+
} catch {
|
|
28
|
+
return false; // docker missing / not running — treat as down
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* chant emulator up|down|status [--lexicon <name>] [--json] (#920)
|
|
34
|
+
*
|
|
35
|
+
* Boot / stop / inspect the local emulators of the project's configured lexicons
|
|
36
|
+
* (Floci for aws, floci-az/gcp, mudflaps/spritzer for fly). `up` leaves them
|
|
37
|
+
* running (persistent, unlike the in-Op boot/teardown) so a consumer can deploy to
|
|
38
|
+
* and observe them; `--json` reports each one's endpoint + the env that redirects
|
|
39
|
+
* tooling at it. Consumed by behold `serve --local`.
|
|
40
|
+
*/
|
|
41
|
+
export async function runEmulator(ctx: CommandContext): Promise<number> {
|
|
42
|
+
const { args, plugins } = ctx;
|
|
43
|
+
// Registered as compound `emulator <up|down|status>`, so the action word lands
|
|
44
|
+
// in args.path; the bare `emulator` fallback leaves it as the "." default.
|
|
45
|
+
const action = args.path;
|
|
46
|
+
if (!action || !ACTIONS.has(action)) {
|
|
47
|
+
console.error(formatError({ message: "Usage: chant emulator <up|down|status> [--lexicon <name>] [--json]" }));
|
|
48
|
+
return 1;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const withEmulator = plugins.filter((p) => p.emulator && (!args.lexicon || p.name === args.lexicon));
|
|
52
|
+
if (withEmulator.length === 0) {
|
|
53
|
+
if (args.json) {
|
|
54
|
+
console.log(JSON.stringify({ emulators: [] }));
|
|
55
|
+
return 0;
|
|
56
|
+
}
|
|
57
|
+
console.error(formatWarning({
|
|
58
|
+
message: args.lexicon
|
|
59
|
+
? `Lexicon "${args.lexicon}" has no local emulator, or isn't configured for this project`
|
|
60
|
+
: "No configured lexicon has a local emulator",
|
|
61
|
+
}));
|
|
62
|
+
return 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const reports: EmulatorReport[] = [];
|
|
66
|
+
for (const p of withEmulator) {
|
|
67
|
+
const cap = p.emulator!;
|
|
68
|
+
const lc = emulatorLifecycle(cap.spec);
|
|
69
|
+
if (action === "up") {
|
|
70
|
+
const { endpoint } = await lc.up();
|
|
71
|
+
reports.push({ lexicon: p.name, name: cap.spec.name, endpoint, env: cap.env(endpoint) });
|
|
72
|
+
} else if (action === "down") {
|
|
73
|
+
await lc.down();
|
|
74
|
+
reports.push({ lexicon: p.name, name: cap.spec.name, endpoint: "", env: {} });
|
|
75
|
+
} else {
|
|
76
|
+
const running = await isRunning(cap.spec.name);
|
|
77
|
+
const endpoint = running ? lc.endpoint(cap.spec.containerPort) : "";
|
|
78
|
+
reports.push({ lexicon: p.name, name: cap.spec.name, endpoint, env: endpoint ? cap.env(endpoint) : {} });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (args.json) {
|
|
83
|
+
console.log(JSON.stringify({ emulators: reports }));
|
|
84
|
+
return 0;
|
|
85
|
+
}
|
|
86
|
+
for (const r of reports) {
|
|
87
|
+
if (action === "up") console.error(formatSuccess(`${r.lexicon}: ${r.name} up on ${r.endpoint}`));
|
|
88
|
+
else if (action === "down") console.error(formatSuccess(`${r.lexicon}: ${r.name} down`));
|
|
89
|
+
else console.error(`${r.lexicon}: ${r.name} — ${r.endpoint ? `up on ${r.endpoint}` : "down"}`);
|
|
90
|
+
}
|
|
91
|
+
return 0;
|
|
92
|
+
}
|
package/src/cli/main.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { runLifecycleSnapshot, runLifecycleShow, runLifecycleDiff, runLifecycleR
|
|
|
20
20
|
import { runComponentsStatus, runComponentsReleaseRecord, runComponentsUnknown } from "./handlers/components";
|
|
21
21
|
import { runGraph } from "./handlers/graph";
|
|
22
22
|
import { runOp, runOpList, runOpStatus, runOpSignal, runOpCancel, runOpLog } from "./handlers/run";
|
|
23
|
+
import { runEmulator } from "./handlers/emulator";
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* Parse command line arguments
|
|
@@ -309,6 +310,10 @@ Lexicon development:
|
|
|
309
310
|
latest, diff surface vs committed baseline, print delta + PR
|
|
310
311
|
label (dry run; --force bypasses the spec cache, --format json)
|
|
311
312
|
|
|
313
|
+
Local:
|
|
314
|
+
emulator <up|down|status> Boot/stop/inspect configured lexicons' local
|
|
315
|
+
emulators (Floci etc.); --lexicon <name>, --json
|
|
316
|
+
|
|
312
317
|
Servers:
|
|
313
318
|
serve lsp Start the LSP server (stdio)
|
|
314
319
|
serve mcp Start the MCP server (stdio)
|
|
@@ -454,11 +459,18 @@ const registry: CommandDef[] = [
|
|
|
454
459
|
{ name: "components status", requiresPlugins: true, handler: runComponentsStatus },
|
|
455
460
|
{ name: "components release", handler: runComponentsReleaseRecord },
|
|
456
461
|
|
|
462
|
+
// Local emulators of configured lexicons (#920). Compound so the action word
|
|
463
|
+
// lands in args.path (not consumed as a project dir) and projectPath is forced ".".
|
|
464
|
+
{ name: "emulator up", requiresPlugins: true, handler: runEmulator },
|
|
465
|
+
{ name: "emulator down", requiresPlugins: true, handler: runEmulator },
|
|
466
|
+
{ name: "emulator status", requiresPlugins: true, handler: runEmulator },
|
|
467
|
+
|
|
457
468
|
// Serve subcommands
|
|
458
469
|
{ name: "serve lsp", requiresPlugins: true, handler: runServeLsp },
|
|
459
470
|
{ name: "serve mcp", requiresPlugins: true, handler: runServeMcp },
|
|
460
471
|
|
|
461
472
|
// Fallback for unknown subcommands (must come after compound entries)
|
|
473
|
+
{ name: "emulator", requiresPlugins: true, handler: runEmulator },
|
|
462
474
|
{ name: "lifecycle", handler: runLifecycleUnknown },
|
|
463
475
|
{ name: "dev", handler: runDevUnknown },
|
|
464
476
|
{ name: "serve", handler: runServeUnknown },
|
|
@@ -527,8 +539,12 @@ async function main(): Promise<void> {
|
|
|
527
539
|
// missing plugins there is "no live evidence" (a warning), not a hard exit.
|
|
528
540
|
const isGenerateComponents = match.def.name === "build" && args.components && !!args.generate;
|
|
529
541
|
const isComponentsStatus = match.def.name === "components status";
|
|
542
|
+
// `emulator` (#920) is a property of the *configured* lexicons, not of any infra
|
|
543
|
+
// file — a fresh/local project with no declarables still boots Floci. Load from
|
|
544
|
+
// chant.config best-effort, like components status, rather than detectLexicon.
|
|
545
|
+
const isEmulator = match.def.name === "emulator" || match.def.name.startsWith("emulator ");
|
|
530
546
|
const plugins = match.def.requiresPlugins
|
|
531
|
-
? isGenerateComponents || isComponentsStatus
|
|
547
|
+
? isGenerateComponents || isComponentsStatus || isEmulator
|
|
532
548
|
? await loadPlugins(await resolveProjectLexicons(resolve(projectPath)).catch(() => [])).catch(() => [])
|
|
533
549
|
: await loadPluginsOrExit(projectPath)
|
|
534
550
|
: [];
|
package/src/lexicon.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { ArtifactIntegrity } from "./lexicon-integrity";
|
|
|
8
8
|
import type { CompletionContext, CompletionItem, HoverContext, HoverInfo, CodeActionContext, CodeAction } from "./lsp/types";
|
|
9
9
|
import type { McpToolContribution, McpResourceContribution } from "./mcp/types";
|
|
10
10
|
import type { DriverComponent } from "./components/driver";
|
|
11
|
+
import type { EmulatorCapability } from "./op/emulator-lifecycle";
|
|
11
12
|
import type { RuleMeta } from "./audit/catalog";
|
|
12
13
|
import type { ReferenceCatalog } from "./graph-refs";
|
|
13
14
|
|
|
@@ -250,6 +251,12 @@ export interface LexiconPlugin {
|
|
|
250
251
|
/** Package lexicon into distributable tarball */
|
|
251
252
|
package(options?: { verbose?: boolean; force?: boolean }): Promise<void>;
|
|
252
253
|
|
|
254
|
+
/** Local emulator (#920), if this lexicon has one (Floci for aws, floci-az/gcp,
|
|
255
|
+
* mudflaps/spritzer for fly). Drives `chant emulator up|down|status` and lets a
|
|
256
|
+
* consumer (behold `--local`) boot it + point apply/observe at it — no cloud
|
|
257
|
+
* account. Absent when the lexicon has no local emulator. */
|
|
258
|
+
readonly emulator?: EmulatorCapability;
|
|
259
|
+
|
|
253
260
|
// ── Optional extensions ───────────────────────────────────
|
|
254
261
|
/** Return lint rules provided by this lexicon */
|
|
255
262
|
lintRules?(): LintRule[];
|
|
@@ -24,6 +24,18 @@ export interface EmulatorSpec {
|
|
|
24
24
|
runArgs?: readonly string[];
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* A lexicon's local-emulator capability (#920) — what `chant emulator` needs to
|
|
29
|
+
* boot it and point tooling at it. The `spec` drives the Docker lifecycle; `env`
|
|
30
|
+
* returns the variables that redirect the SDK / `chant graph --live` / a triggered
|
|
31
|
+
* Op at the running emulator (e.g. `AWS_ENDPOINT_URL`). `env` is `{}` when the
|
|
32
|
+
* emulator is reached only via an explicit apply argument, not a global variable.
|
|
33
|
+
*/
|
|
34
|
+
export interface EmulatorCapability {
|
|
35
|
+
spec: EmulatorSpec;
|
|
36
|
+
env(endpoint: string): Record<string, string>;
|
|
37
|
+
}
|
|
38
|
+
|
|
27
39
|
/** Per-call overrides for {@link EmulatorLifecycle.up} / `runCommand`. */
|
|
28
40
|
export interface EmulatorUpArgs {
|
|
29
41
|
name?: string;
|
|
@@ -85,7 +97,9 @@ export function emulatorLifecycle(spec: EmulatorSpec): EmulatorLifecycle {
|
|
|
85
97
|
}
|
|
86
98
|
|
|
87
99
|
if (running) {
|
|
88
|
-
|
|
100
|
+
// Progress → stderr, so a `--json` consumer (chant emulator, behold) reads
|
|
101
|
+
// clean JSON on stdout. runOp/Op activities capture both streams regardless.
|
|
102
|
+
console.error(`emulator container "${name}" already running — reusing`);
|
|
89
103
|
} else {
|
|
90
104
|
await execAsync(runCommand({ ...args, name, port }), { signal });
|
|
91
105
|
}
|
|
@@ -112,7 +126,7 @@ export function emulatorLifecycle(spec: EmulatorSpec): EmulatorLifecycle {
|
|
|
112
126
|
}
|
|
113
127
|
|
|
114
128
|
const ep = endpoint(port);
|
|
115
|
-
console.
|
|
129
|
+
console.error(`emulator "${name}" ready on ${ep}`);
|
|
116
130
|
return { endpoint: ep };
|
|
117
131
|
}
|
|
118
132
|
|
package/src/op/index.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { Op, phase, activity, gate, build, kubectlApply, helmInstall, waitForSta
|
|
|
10
10
|
export { OpResource } from "./resource";
|
|
11
11
|
export { safeHeartbeat, sleep } from "./activity-runtime";
|
|
12
12
|
export { emulatorLifecycle } from "./emulator-lifecycle";
|
|
13
|
-
export type { EmulatorSpec, EmulatorUpArgs, EmulatorLifecycle } from "./emulator-lifecycle";
|
|
13
|
+
export type { EmulatorSpec, EmulatorCapability, EmulatorUpArgs, EmulatorLifecycle } from "./emulator-lifecycle";
|
|
14
14
|
export type { OpConfig, PhaseDefinition, StepDefinition, ActivityStep, GateStep } from "./types";
|
|
15
15
|
export { discoverOps } from "./discover";
|
|
16
16
|
export type { DiscoveredOp, OpDiscoveryResult } from "./discover";
|