@intentius/behold 0.29.57 → 0.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +388 -57
- package/README.md +67 -50
- package/demos.json +1 -1
- package/dist/cli.js +9958 -3080
- package/example-choudoufu-estate/chant.workspace.json +1 -1
- package/example-terraform-estate/README.md +10 -10
- package/example-terraform-estate/chant.workspace.json +1 -1
- package/example-three-cloud/README.md +17 -9
- package/example-three-cloud/aws/chant.config.ts +1 -1
- package/example-three-cloud/aws/site.component.ts +13 -0
- package/example-three-cloud/azure/chant.config.ts +1 -1
- package/example-three-cloud/azure/src/site.component.ts +13 -0
- package/example-three-cloud/azure/src/site.ts +5 -7
- package/example-three-cloud/dns/chant.config.ts +1 -1
- package/example-three-cloud/dns/src/records.component.ts +14 -0
- package/example-three-cloud/dns/src/route53.ts +4 -5
- package/example-three-cloud/gcp/chant.config.ts +1 -1
- package/example-three-cloud/gcp/src/site.component.ts +13 -0
- package/example-three-cloud/gcp/src/site.ts +7 -7
- package/example-three-cloud/package-lock.json +19 -19
- package/example-three-cloud/package.json +4 -4
- package/example-three-cloud/scripts/front-door.ts +89 -15
- package/package.json +10 -11
- package/web/agent-move.js +60 -0
- package/web/agent-move.test.js +55 -0
- package/web/app.js +622 -79
- package/web/dots-lod.js +1 -1
- package/web/embed.d.ts +3 -0
- package/web/embed.js +5 -3
- package/web/embed.test.js +8 -0
- package/web/index.html +64 -9
- package/web/layout-store.js +3 -3
- package/web/panel.js +28 -4
- package/web/release.js +6 -4
- package/web/release.test.js +2 -2
- package/web/search-view.d.ts +27 -0
- package/web/search-view.js +213 -0
- package/web/search-view.test.js +144 -0
- package/web/shot-frame.d.ts +5 -0
- package/web/shot-frame.js +116 -0
- package/web/shot-frame.test.js +90 -0
- package/web/themes.js +1 -1
- package/web/view-url.d.ts +18 -0
- package/web/view-url.js +153 -6
- package/web/view-url.test.js +72 -1
- package/example-three-cloud/azure/composites/container-app-site.ts +0 -77
- package/example-three-cloud/dns/composites/latency-entry.ts +0 -73
- package/example-three-cloud/gcp/composites/public-cloud-run.ts +0 -102
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { AGENT_STACK_MAX, agentBanner, agentEntry, clockTime, wholeQuestion } from "./agent-move.js";
|
|
3
|
+
|
|
4
|
+
describe("agentBanner (#914)", () => {
|
|
5
|
+
const at = new Date(2026, 9, 23, 14, 2, 11);
|
|
6
|
+
it("says who asked what, when, and which request", () => {
|
|
7
|
+
expect(agentBanner({ by: "claude-code", q: "attr:internetFacing=true", id: "7f3a" }, at).text).toBe(
|
|
8
|
+
"Moved by an agent: claude-code asked `attr:internetFacing=true` at 14:02:11 (request 7f3a).",
|
|
9
|
+
);
|
|
10
|
+
});
|
|
11
|
+
it("without a question, says the view moved", () => {
|
|
12
|
+
expect(agentBanner({ by: "curl/8.7.1", q: "", id: "1" }, at).text).toBe("Moved by an agent: curl/8.7.1 moved this view at 14:02:11 (request 1).");
|
|
13
|
+
expect(agentBanner({}, new Date("nope")).text).toBe("Moved by an agent: an agent moved this view.");
|
|
14
|
+
});
|
|
15
|
+
it("clockTime pads", () => {
|
|
16
|
+
expect(clockTime(new Date(2026, 0, 1, 3, 4, 5))).toBe("03:04:05");
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
describe("agentEntry (#914)", () => {
|
|
21
|
+
it("pushes a numbered entry over the person's own", () => {
|
|
22
|
+
const e = agentEntry({ other: 1 }, { id: "a" });
|
|
23
|
+
expect(e).toEqual({ push: true, state: { other: 1, beholdMove: { id: "a", depth: 1 } } });
|
|
24
|
+
expect(agentEntry(e.state, { id: "b" })).toEqual({ push: true, state: { other: 1, beholdMove: { id: "b", depth: 2 } } });
|
|
25
|
+
expect(agentEntry(null, { id: "c" }).push).toBe(true);
|
|
26
|
+
});
|
|
27
|
+
it("stops pushing at the cap of 20, replacing the newest agent entry instead", () => {
|
|
28
|
+
let state = null;
|
|
29
|
+
let pushes = 0;
|
|
30
|
+
for (let i = 0; i < 30; i++) {
|
|
31
|
+
const e = agentEntry(state, { id: String(i) });
|
|
32
|
+
if (e.push) pushes++;
|
|
33
|
+
state = e.state;
|
|
34
|
+
}
|
|
35
|
+
expect(AGENT_STACK_MAX).toBe(20);
|
|
36
|
+
expect(pushes).toBe(20);
|
|
37
|
+
expect(state.beholdMove).toEqual({ id: "29", depth: 20 });
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe("wholeQuestion (#908 stage 3)", () => {
|
|
42
|
+
it("clears the question keys a question move leaves out and the tab holds", () => {
|
|
43
|
+
const tab = { q: "kind:aws_", countBy: "module", plan: true, env: "prod", zoom: "resources" };
|
|
44
|
+
expect(wholeQuestion({ q: "cap:internet-reachable(22)" }, tab)).toEqual({ q: "cap:internet-reachable(22)", countBy: null, plan: false });
|
|
45
|
+
expect(wholeQuestion({ countBy: "kind" }, tab)).toEqual({ countBy: "kind", q: null, plan: false });
|
|
46
|
+
expect(wholeQuestion({ q: "a", plan: true }, { q: "b", countBy: "kind" })).toEqual({ q: "a", plan: true, countBy: null });
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it("leaves a move that asks no question, and keys the tab doesn't hold, as they are", () => {
|
|
50
|
+
const tab = { q: "kind:aws_", countBy: "module" };
|
|
51
|
+
expect(wholeQuestion({ zoom: "attributes" }, tab)).toEqual({ zoom: "attributes" });
|
|
52
|
+
expect(wholeQuestion({ q: "a" }, { zoom: "resources" })).toEqual({ q: "a" });
|
|
53
|
+
expect(wholeQuestion({ q: "a" }, undefined)).toEqual({ q: "a" });
|
|
54
|
+
});
|
|
55
|
+
});
|