@better-openclaw/core 1.0.30 → 1.0.31

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.
Files changed (96) hide show
  1. package/README.md +2 -1
  2. package/dist/deployers/coolify.test.cjs +156 -0
  3. package/dist/deployers/coolify.test.cjs.map +1 -0
  4. package/dist/deployers/coolify.test.d.cts +1 -0
  5. package/dist/deployers/coolify.test.d.mts +1 -0
  6. package/dist/deployers/coolify.test.mjs +157 -0
  7. package/dist/deployers/coolify.test.mjs.map +1 -0
  8. package/dist/deployers/dokploy.test.cjs +108 -0
  9. package/dist/deployers/dokploy.test.cjs.map +1 -0
  10. package/dist/deployers/dokploy.test.d.cts +1 -0
  11. package/dist/deployers/dokploy.test.d.mts +1 -0
  12. package/dist/deployers/dokploy.test.mjs +109 -0
  13. package/dist/deployers/dokploy.test.mjs.map +1 -0
  14. package/dist/frameworks/frameworks.test.cjs +94 -0
  15. package/dist/frameworks/frameworks.test.cjs.map +1 -0
  16. package/dist/frameworks/frameworks.test.d.cts +1 -0
  17. package/dist/frameworks/frameworks.test.d.mts +1 -0
  18. package/dist/frameworks/frameworks.test.mjs +94 -0
  19. package/dist/frameworks/frameworks.test.mjs.map +1 -0
  20. package/dist/generators/cloud-init.test.cjs +58 -0
  21. package/dist/generators/cloud-init.test.cjs.map +1 -0
  22. package/dist/generators/cloud-init.test.d.cts +1 -0
  23. package/dist/generators/cloud-init.test.d.mts +1 -0
  24. package/dist/generators/cloud-init.test.mjs +59 -0
  25. package/dist/generators/cloud-init.test.mjs.map +1 -0
  26. package/dist/generators/get-shit-done.test.cjs +48 -0
  27. package/dist/generators/get-shit-done.test.cjs.map +1 -0
  28. package/dist/generators/get-shit-done.test.d.cts +1 -0
  29. package/dist/generators/get-shit-done.test.d.mts +1 -0
  30. package/dist/generators/get-shit-done.test.mjs +49 -0
  31. package/dist/generators/get-shit-done.test.mjs.map +1 -0
  32. package/dist/generators/grafana.test.cjs +74 -0
  33. package/dist/generators/grafana.test.cjs.map +1 -0
  34. package/dist/generators/grafana.test.d.cts +1 -0
  35. package/dist/generators/grafana.test.d.mts +1 -0
  36. package/dist/generators/grafana.test.mjs +74 -0
  37. package/dist/generators/grafana.test.mjs.map +1 -0
  38. package/dist/generators/n8n-workflows.test.cjs +75 -0
  39. package/dist/generators/n8n-workflows.test.cjs.map +1 -0
  40. package/dist/generators/n8n-workflows.test.d.cts +1 -0
  41. package/dist/generators/n8n-workflows.test.d.mts +1 -0
  42. package/dist/generators/n8n-workflows.test.mjs +76 -0
  43. package/dist/generators/n8n-workflows.test.mjs.map +1 -0
  44. package/dist/generators/openclaw-install-script.test.cjs +35 -0
  45. package/dist/generators/openclaw-install-script.test.cjs.map +1 -0
  46. package/dist/generators/openclaw-install-script.test.d.cts +1 -0
  47. package/dist/generators/openclaw-install-script.test.d.mts +1 -0
  48. package/dist/generators/openclaw-install-script.test.mjs +36 -0
  49. package/dist/generators/openclaw-install-script.test.mjs.map +1 -0
  50. package/dist/generators/postgres-init.test.cjs +111 -0
  51. package/dist/generators/postgres-init.test.cjs.map +1 -0
  52. package/dist/generators/postgres-init.test.d.cts +1 -0
  53. package/dist/generators/postgres-init.test.d.mts +1 -0
  54. package/dist/generators/postgres-init.test.mjs +112 -0
  55. package/dist/generators/postgres-init.test.mjs.map +1 -0
  56. package/dist/generators/prometheus.test.cjs +99 -0
  57. package/dist/generators/prometheus.test.cjs.map +1 -0
  58. package/dist/generators/prometheus.test.d.cts +1 -0
  59. package/dist/generators/prometheus.test.d.mts +1 -0
  60. package/dist/generators/prometheus.test.mjs +99 -0
  61. package/dist/generators/prometheus.test.mjs.map +1 -0
  62. package/dist/generators/stack-manifest.test.cjs +97 -0
  63. package/dist/generators/stack-manifest.test.cjs.map +1 -0
  64. package/dist/generators/stack-manifest.test.d.cts +1 -0
  65. package/dist/generators/stack-manifest.test.d.mts +1 -0
  66. package/dist/generators/stack-manifest.test.mjs +98 -0
  67. package/dist/generators/stack-manifest.test.mjs.map +1 -0
  68. package/dist/index.cjs +0 -2
  69. package/dist/index.d.cts +1 -2
  70. package/dist/index.d.mts +1 -2
  71. package/dist/index.mjs +1 -2
  72. package/dist/logger/index.cjs +0 -2
  73. package/dist/logger/index.d.cts +1 -2
  74. package/dist/logger/index.d.mts +1 -2
  75. package/dist/logger/index.mjs +1 -2
  76. package/dist/port-scanner.test.cjs +155 -0
  77. package/dist/port-scanner.test.cjs.map +1 -0
  78. package/dist/port-scanner.test.d.cts +1 -0
  79. package/dist/port-scanner.test.d.mts +1 -0
  80. package/dist/port-scanner.test.mjs +156 -0
  81. package/dist/port-scanner.test.mjs.map +1 -0
  82. package/package.json +1 -1
  83. package/src/deployers/coolify.test.ts +180 -0
  84. package/src/deployers/dokploy.test.ts +120 -0
  85. package/src/frameworks/frameworks.test.ts +119 -0
  86. package/src/generators/cloud-init.test.ts +70 -0
  87. package/src/generators/get-shit-done.test.ts +54 -0
  88. package/src/generators/grafana.test.ts +90 -0
  89. package/src/generators/n8n-workflows.test.ts +80 -0
  90. package/src/generators/openclaw-install-script.test.ts +42 -0
  91. package/src/generators/postgres-init.test.ts +116 -0
  92. package/src/generators/prometheus.test.ts +108 -0
  93. package/src/generators/stack-manifest.test.ts +104 -0
  94. package/src/index.ts +3 -2
  95. package/src/logger/index.ts +2 -1
  96. package/src/port-scanner.test.ts +167 -0
@@ -0,0 +1,94 @@
1
+ require("../skills-uPxJVmKk.cjs");
2
+ const require_test_CTcmp4Su = require("../test.CTcmp4Su-BWSPM8ZQ.cjs");
3
+ const require_frameworks_registry = require("./registry.cjs");
4
+ const require_generate = require("../generate.cjs");
5
+ let yaml = require("yaml");
6
+ //#region src/frameworks/frameworks.test.ts
7
+ /**
8
+ * Smoke tests for all registered framework definitions.
9
+ *
10
+ * Each framework's buildGatewayService, generateConfig, and getBaseEnvVars
11
+ * should produce valid output when invoked through the generate() pipeline.
12
+ */
13
+ require_test_CTcmp4Su.describe("framework smoke tests via generate()", () => {
14
+ const primaryFrameworks = require_frameworks_registry.getAllFrameworks().filter((fw) => fw.canBePrimary);
15
+ for (const fw of primaryFrameworks) require_test_CTcmp4Su.describe(`${fw.name} (${fw.id})`, () => {
16
+ require_test_CTcmp4Su.it("generates a valid stack with this framework as primary", () => {
17
+ const result = require_generate.generate({
18
+ projectName: `${fw.id}-test`,
19
+ services: ["redis"],
20
+ skillPacks: [],
21
+ proxy: "none",
22
+ gpu: false,
23
+ platform: "linux/amd64",
24
+ deployment: "local",
25
+ generateSecrets: true,
26
+ openclawVersion: "latest",
27
+ primaryFramework: fw.id
28
+ });
29
+ require_test_CTcmp4Su.globalExpect(result.files).toHaveProperty("docker-compose.yml");
30
+ const composed = (0, yaml.parse)(result.files["docker-compose.yml"]);
31
+ require_test_CTcmp4Su.globalExpect(composed.services).toBeDefined();
32
+ const gatewayKey = `${fw.id}-gateway`;
33
+ require_test_CTcmp4Su.globalExpect(composed.services).toHaveProperty(gatewayKey);
34
+ });
35
+ require_test_CTcmp4Su.it("produces a docker-compose with the framework's network", () => {
36
+ const composed = (0, yaml.parse)(require_generate.generate({
37
+ projectName: `${fw.id}-net-test`,
38
+ services: ["redis"],
39
+ skillPacks: [],
40
+ proxy: "none",
41
+ gpu: false,
42
+ platform: "linux/amd64",
43
+ deployment: "local",
44
+ generateSecrets: true,
45
+ openclawVersion: "latest",
46
+ primaryFramework: fw.id
47
+ }).files["docker-compose.yml"]);
48
+ if (fw.networkName) require_test_CTcmp4Su.globalExpect(composed.networks).toHaveProperty(fw.networkName);
49
+ });
50
+ require_test_CTcmp4Su.it("getBaseEnvVars returns an array", () => {
51
+ require_test_CTcmp4Su.globalExpect(fw.getBaseEnvVars({
52
+ generateSecrets: true,
53
+ domain: "example.com"
54
+ })).toBeInstanceOf(Array);
55
+ });
56
+ require_test_CTcmp4Su.it("getMandatoryServices returns an array", () => {
57
+ require_test_CTcmp4Su.globalExpect(fw.getMandatoryServices()).toBeInstanceOf(Array);
58
+ });
59
+ require_test_CTcmp4Su.it("getRecommendedServices returns an array", () => {
60
+ require_test_CTcmp4Su.globalExpect(fw.getRecommendedServices()).toBeInstanceOf(Array);
61
+ });
62
+ require_test_CTcmp4Su.it("getEnvSectionName returns a non-empty string", () => {
63
+ const section = fw.getEnvSectionName();
64
+ require_test_CTcmp4Su.globalExpect(typeof section).toBe("string");
65
+ require_test_CTcmp4Su.globalExpect(section.length).toBeGreaterThan(0);
66
+ });
67
+ require_test_CTcmp4Su.it("getProviderEnvKeys returns an array", () => {
68
+ require_test_CTcmp4Su.globalExpect(fw.getProviderEnvKeys()).toBeInstanceOf(Array);
69
+ });
70
+ });
71
+ });
72
+ require_test_CTcmp4Su.describe("companion frameworks via generate()", () => {
73
+ const companionFrameworks = require_frameworks_registry.getAllFrameworks().filter((fw) => fw.canBeCompanion);
74
+ for (const fw of companionFrameworks) require_test_CTcmp4Su.it(`${fw.name} can be added as companion`, () => {
75
+ const composed = (0, yaml.parse)(require_generate.generate({
76
+ projectName: `companion-${fw.id}-test`,
77
+ services: ["redis"],
78
+ skillPacks: [],
79
+ proxy: "none",
80
+ gpu: false,
81
+ platform: "linux/amd64",
82
+ deployment: "local",
83
+ generateSecrets: true,
84
+ openclawVersion: "latest",
85
+ companionFrameworks: [fw.id]
86
+ }).files["docker-compose.yml"]);
87
+ require_test_CTcmp4Su.globalExpect(composed.services).toBeDefined();
88
+ const companionKey = `${fw.id}-companion`;
89
+ require_test_CTcmp4Su.globalExpect(composed.services).toHaveProperty(companionKey);
90
+ });
91
+ });
92
+ //#endregion
93
+
94
+ //# sourceMappingURL=frameworks.test.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frameworks.test.cjs","names":["describe","getAllFrameworks","generate"],"sources":["../../src/frameworks/frameworks.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport { parse } from \"yaml\";\nimport { generate } from \"../generate.js\";\nimport { getAllFrameworks, getFrameworkById } from \"./registry.js\";\n\n/**\n * Smoke tests for all registered framework definitions.\n *\n * Each framework's buildGatewayService, generateConfig, and getBaseEnvVars\n * should produce valid output when invoked through the generate() pipeline.\n */\n\ndescribe(\"framework smoke tests via generate()\", () => {\n\tconst primaryFrameworks = getAllFrameworks().filter((fw) => fw.canBePrimary);\n\n\tfor (const fw of primaryFrameworks) {\n\t\tdescribe(`${fw.name} (${fw.id})`, () => {\n\t\t\tit(\"generates a valid stack with this framework as primary\", () => {\n\t\t\t\tconst result = generate({\n\t\t\t\t\tprojectName: `${fw.id}-test`,\n\t\t\t\t\tservices: [\"redis\"],\n\t\t\t\t\tskillPacks: [],\n\t\t\t\t\tproxy: \"none\",\n\t\t\t\t\tgpu: false,\n\t\t\t\t\tplatform: \"linux/amd64\",\n\t\t\t\t\tdeployment: \"local\",\n\t\t\t\t\tgenerateSecrets: true,\n\t\t\t\t\topenclawVersion: \"latest\",\n\t\t\t\t\tprimaryFramework: fw.id,\n\t\t\t\t});\n\n\t\t\t\texpect(result.files).toHaveProperty(\"docker-compose.yml\");\n\t\t\t\tconst composed = parse(result.files[\"docker-compose.yml\"]!);\n\t\t\t\texpect(composed.services).toBeDefined();\n\n\t\t\t\t// Gateway service should exist with the framework's naming pattern\n\t\t\t\tconst gatewayKey = `${fw.id}-gateway`;\n\t\t\t\texpect(composed.services).toHaveProperty(gatewayKey);\n\t\t\t});\n\n\t\t\tit(\"produces a docker-compose with the framework's network\", () => {\n\t\t\t\tconst result = generate({\n\t\t\t\t\tprojectName: `${fw.id}-net-test`,\n\t\t\t\t\tservices: [\"redis\"],\n\t\t\t\t\tskillPacks: [],\n\t\t\t\t\tproxy: \"none\",\n\t\t\t\t\tgpu: false,\n\t\t\t\t\tplatform: \"linux/amd64\",\n\t\t\t\t\tdeployment: \"local\",\n\t\t\t\t\tgenerateSecrets: true,\n\t\t\t\t\topenclawVersion: \"latest\",\n\t\t\t\t\tprimaryFramework: fw.id,\n\t\t\t\t});\n\n\t\t\t\tconst composed = parse(result.files[\"docker-compose.yml\"]!);\n\t\t\t\tif (fw.networkName) {\n\t\t\t\t\texpect(composed.networks).toHaveProperty(fw.networkName);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tit(\"getBaseEnvVars returns an array\", () => {\n\t\t\t\tconst envVars = fw.getBaseEnvVars({\n\t\t\t\t\tgenerateSecrets: true,\n\t\t\t\t\tdomain: \"example.com\",\n\t\t\t\t});\n\t\t\t\texpect(envVars).toBeInstanceOf(Array);\n\t\t\t});\n\n\t\t\tit(\"getMandatoryServices returns an array\", () => {\n\t\t\t\tconst mandatory = fw.getMandatoryServices();\n\t\t\t\texpect(mandatory).toBeInstanceOf(Array);\n\t\t\t});\n\n\t\t\tit(\"getRecommendedServices returns an array\", () => {\n\t\t\t\tconst recommended = fw.getRecommendedServices();\n\t\t\t\texpect(recommended).toBeInstanceOf(Array);\n\t\t\t});\n\n\t\t\tit(\"getEnvSectionName returns a non-empty string\", () => {\n\t\t\t\tconst section = fw.getEnvSectionName();\n\t\t\t\texpect(typeof section).toBe(\"string\");\n\t\t\t\texpect(section.length).toBeGreaterThan(0);\n\t\t\t});\n\n\t\t\tit(\"getProviderEnvKeys returns an array\", () => {\n\t\t\t\tconst keys = fw.getProviderEnvKeys();\n\t\t\t\texpect(keys).toBeInstanceOf(Array);\n\t\t\t});\n\t\t});\n\t}\n});\n\ndescribe(\"companion frameworks via generate()\", () => {\n\tconst companionFrameworks = getAllFrameworks().filter((fw) => fw.canBeCompanion);\n\n\tfor (const fw of companionFrameworks) {\n\t\tit(`${fw.name} can be added as companion`, () => {\n\t\t\tconst result = generate({\n\t\t\t\tprojectName: `companion-${fw.id}-test`,\n\t\t\t\tservices: [\"redis\"],\n\t\t\t\tskillPacks: [],\n\t\t\t\tproxy: \"none\",\n\t\t\t\tgpu: false,\n\t\t\t\tplatform: \"linux/amd64\",\n\t\t\t\tdeployment: \"local\",\n\t\t\t\tgenerateSecrets: true,\n\t\t\t\topenclawVersion: \"latest\",\n\t\t\t\tcompanionFrameworks: [fw.id],\n\t\t\t});\n\n\t\t\tconst composed = parse(result.files[\"docker-compose.yml\"]!);\n\t\t\texpect(composed.services).toBeDefined();\n\n\t\t\t// Companion should appear in compose\n\t\t\tconst companionKey = `${fw.id}-companion`;\n\t\t\texpect(composed.services).toHaveProperty(companionKey);\n\t\t});\n\t}\n});\n"],"mappings":";;;;;;;;;;;;AAYAA,sBAAAA,SAAS,8CAA8C;CACtD,MAAM,oBAAoBC,4BAAAA,kBAAkB,CAAC,QAAQ,OAAO,GAAG,aAAa;AAE5E,MAAK,MAAM,MAAM,kBAChB,uBAAA,SAAS,GAAG,GAAG,KAAK,IAAI,GAAG,GAAG,UAAU;AACvC,wBAAA,GAAG,gEAAgE;GAClE,MAAM,SAASC,iBAAAA,SAAS;IACvB,aAAa,GAAG,GAAG,GAAG;IACtB,UAAU,CAAC,QAAQ;IACnB,YAAY,EAAE;IACd,OAAO;IACP,KAAK;IACL,UAAU;IACV,YAAY;IACZ,iBAAiB;IACjB,iBAAiB;IACjB,kBAAkB,GAAG;IACrB,CAAC;AAEF,yBAAA,aAAO,OAAO,MAAM,CAAC,eAAe,qBAAqB;GACzD,MAAM,YAAA,GAAA,KAAA,OAAiB,OAAO,MAAM,sBAAuB;AAC3D,yBAAA,aAAO,SAAS,SAAS,CAAC,aAAa;GAGvC,MAAM,aAAa,GAAG,GAAG,GAAG;AAC5B,yBAAA,aAAO,SAAS,SAAS,CAAC,eAAe,WAAW;IACnD;AAEF,wBAAA,GAAG,gEAAgE;GAclE,MAAM,YAAA,GAAA,KAAA,OAbSA,iBAAAA,SAAS;IACvB,aAAa,GAAG,GAAG,GAAG;IACtB,UAAU,CAAC,QAAQ;IACnB,YAAY,EAAE;IACd,OAAO;IACP,KAAK;IACL,UAAU;IACV,YAAY;IACZ,iBAAiB;IACjB,iBAAiB;IACjB,kBAAkB,GAAG;IACrB,CAAC,CAE4B,MAAM,sBAAuB;AAC3D,OAAI,GAAG,YACN,uBAAA,aAAO,SAAS,SAAS,CAAC,eAAe,GAAG,YAAY;IAExD;AAEF,wBAAA,GAAG,yCAAyC;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it, t as globalExpect } from "../test.CTcmp4Su-BRa7-bTj.mjs";
2
+ import { getAllFrameworks } from "./registry.mjs";
3
+ import { generate } from "../generate.mjs";
4
+ import { parse } from "yaml";
5
+ //#region src/frameworks/frameworks.test.ts
6
+ /**
7
+ * Smoke tests for all registered framework definitions.
8
+ *
9
+ * Each framework's buildGatewayService, generateConfig, and getBaseEnvVars
10
+ * should produce valid output when invoked through the generate() pipeline.
11
+ */
12
+ describe("framework smoke tests via generate()", () => {
13
+ const primaryFrameworks = getAllFrameworks().filter((fw) => fw.canBePrimary);
14
+ for (const fw of primaryFrameworks) describe(`${fw.name} (${fw.id})`, () => {
15
+ it("generates a valid stack with this framework as primary", () => {
16
+ const result = generate({
17
+ projectName: `${fw.id}-test`,
18
+ services: ["redis"],
19
+ skillPacks: [],
20
+ proxy: "none",
21
+ gpu: false,
22
+ platform: "linux/amd64",
23
+ deployment: "local",
24
+ generateSecrets: true,
25
+ openclawVersion: "latest",
26
+ primaryFramework: fw.id
27
+ });
28
+ globalExpect(result.files).toHaveProperty("docker-compose.yml");
29
+ const composed = parse(result.files["docker-compose.yml"]);
30
+ globalExpect(composed.services).toBeDefined();
31
+ const gatewayKey = `${fw.id}-gateway`;
32
+ globalExpect(composed.services).toHaveProperty(gatewayKey);
33
+ });
34
+ it("produces a docker-compose with the framework's network", () => {
35
+ const composed = parse(generate({
36
+ projectName: `${fw.id}-net-test`,
37
+ services: ["redis"],
38
+ skillPacks: [],
39
+ proxy: "none",
40
+ gpu: false,
41
+ platform: "linux/amd64",
42
+ deployment: "local",
43
+ generateSecrets: true,
44
+ openclawVersion: "latest",
45
+ primaryFramework: fw.id
46
+ }).files["docker-compose.yml"]);
47
+ if (fw.networkName) globalExpect(composed.networks).toHaveProperty(fw.networkName);
48
+ });
49
+ it("getBaseEnvVars returns an array", () => {
50
+ globalExpect(fw.getBaseEnvVars({
51
+ generateSecrets: true,
52
+ domain: "example.com"
53
+ })).toBeInstanceOf(Array);
54
+ });
55
+ it("getMandatoryServices returns an array", () => {
56
+ globalExpect(fw.getMandatoryServices()).toBeInstanceOf(Array);
57
+ });
58
+ it("getRecommendedServices returns an array", () => {
59
+ globalExpect(fw.getRecommendedServices()).toBeInstanceOf(Array);
60
+ });
61
+ it("getEnvSectionName returns a non-empty string", () => {
62
+ const section = fw.getEnvSectionName();
63
+ globalExpect(typeof section).toBe("string");
64
+ globalExpect(section.length).toBeGreaterThan(0);
65
+ });
66
+ it("getProviderEnvKeys returns an array", () => {
67
+ globalExpect(fw.getProviderEnvKeys()).toBeInstanceOf(Array);
68
+ });
69
+ });
70
+ });
71
+ describe("companion frameworks via generate()", () => {
72
+ const companionFrameworks = getAllFrameworks().filter((fw) => fw.canBeCompanion);
73
+ for (const fw of companionFrameworks) it(`${fw.name} can be added as companion`, () => {
74
+ const composed = parse(generate({
75
+ projectName: `companion-${fw.id}-test`,
76
+ services: ["redis"],
77
+ skillPacks: [],
78
+ proxy: "none",
79
+ gpu: false,
80
+ platform: "linux/amd64",
81
+ deployment: "local",
82
+ generateSecrets: true,
83
+ openclawVersion: "latest",
84
+ companionFrameworks: [fw.id]
85
+ }).files["docker-compose.yml"]);
86
+ globalExpect(composed.services).toBeDefined();
87
+ const companionKey = `${fw.id}-companion`;
88
+ globalExpect(composed.services).toHaveProperty(companionKey);
89
+ });
90
+ });
91
+ //#endregion
92
+ export {};
93
+
94
+ //# sourceMappingURL=frameworks.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frameworks.test.mjs","names":[],"sources":["../../src/frameworks/frameworks.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport { parse } from \"yaml\";\nimport { generate } from \"../generate.js\";\nimport { getAllFrameworks, getFrameworkById } from \"./registry.js\";\n\n/**\n * Smoke tests for all registered framework definitions.\n *\n * Each framework's buildGatewayService, generateConfig, and getBaseEnvVars\n * should produce valid output when invoked through the generate() pipeline.\n */\n\ndescribe(\"framework smoke tests via generate()\", () => {\n\tconst primaryFrameworks = getAllFrameworks().filter((fw) => fw.canBePrimary);\n\n\tfor (const fw of primaryFrameworks) {\n\t\tdescribe(`${fw.name} (${fw.id})`, () => {\n\t\t\tit(\"generates a valid stack with this framework as primary\", () => {\n\t\t\t\tconst result = generate({\n\t\t\t\t\tprojectName: `${fw.id}-test`,\n\t\t\t\t\tservices: [\"redis\"],\n\t\t\t\t\tskillPacks: [],\n\t\t\t\t\tproxy: \"none\",\n\t\t\t\t\tgpu: false,\n\t\t\t\t\tplatform: \"linux/amd64\",\n\t\t\t\t\tdeployment: \"local\",\n\t\t\t\t\tgenerateSecrets: true,\n\t\t\t\t\topenclawVersion: \"latest\",\n\t\t\t\t\tprimaryFramework: fw.id,\n\t\t\t\t});\n\n\t\t\t\texpect(result.files).toHaveProperty(\"docker-compose.yml\");\n\t\t\t\tconst composed = parse(result.files[\"docker-compose.yml\"]!);\n\t\t\t\texpect(composed.services).toBeDefined();\n\n\t\t\t\t// Gateway service should exist with the framework's naming pattern\n\t\t\t\tconst gatewayKey = `${fw.id}-gateway`;\n\t\t\t\texpect(composed.services).toHaveProperty(gatewayKey);\n\t\t\t});\n\n\t\t\tit(\"produces a docker-compose with the framework's network\", () => {\n\t\t\t\tconst result = generate({\n\t\t\t\t\tprojectName: `${fw.id}-net-test`,\n\t\t\t\t\tservices: [\"redis\"],\n\t\t\t\t\tskillPacks: [],\n\t\t\t\t\tproxy: \"none\",\n\t\t\t\t\tgpu: false,\n\t\t\t\t\tplatform: \"linux/amd64\",\n\t\t\t\t\tdeployment: \"local\",\n\t\t\t\t\tgenerateSecrets: true,\n\t\t\t\t\topenclawVersion: \"latest\",\n\t\t\t\t\tprimaryFramework: fw.id,\n\t\t\t\t});\n\n\t\t\t\tconst composed = parse(result.files[\"docker-compose.yml\"]!);\n\t\t\t\tif (fw.networkName) {\n\t\t\t\t\texpect(composed.networks).toHaveProperty(fw.networkName);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tit(\"getBaseEnvVars returns an array\", () => {\n\t\t\t\tconst envVars = fw.getBaseEnvVars({\n\t\t\t\t\tgenerateSecrets: true,\n\t\t\t\t\tdomain: \"example.com\",\n\t\t\t\t});\n\t\t\t\texpect(envVars).toBeInstanceOf(Array);\n\t\t\t});\n\n\t\t\tit(\"getMandatoryServices returns an array\", () => {\n\t\t\t\tconst mandatory = fw.getMandatoryServices();\n\t\t\t\texpect(mandatory).toBeInstanceOf(Array);\n\t\t\t});\n\n\t\t\tit(\"getRecommendedServices returns an array\", () => {\n\t\t\t\tconst recommended = fw.getRecommendedServices();\n\t\t\t\texpect(recommended).toBeInstanceOf(Array);\n\t\t\t});\n\n\t\t\tit(\"getEnvSectionName returns a non-empty string\", () => {\n\t\t\t\tconst section = fw.getEnvSectionName();\n\t\t\t\texpect(typeof section).toBe(\"string\");\n\t\t\t\texpect(section.length).toBeGreaterThan(0);\n\t\t\t});\n\n\t\t\tit(\"getProviderEnvKeys returns an array\", () => {\n\t\t\t\tconst keys = fw.getProviderEnvKeys();\n\t\t\t\texpect(keys).toBeInstanceOf(Array);\n\t\t\t});\n\t\t});\n\t}\n});\n\ndescribe(\"companion frameworks via generate()\", () => {\n\tconst companionFrameworks = getAllFrameworks().filter((fw) => fw.canBeCompanion);\n\n\tfor (const fw of companionFrameworks) {\n\t\tit(`${fw.name} can be added as companion`, () => {\n\t\t\tconst result = generate({\n\t\t\t\tprojectName: `companion-${fw.id}-test`,\n\t\t\t\tservices: [\"redis\"],\n\t\t\t\tskillPacks: [],\n\t\t\t\tproxy: \"none\",\n\t\t\t\tgpu: false,\n\t\t\t\tplatform: \"linux/amd64\",\n\t\t\t\tdeployment: \"local\",\n\t\t\t\tgenerateSecrets: true,\n\t\t\t\topenclawVersion: \"latest\",\n\t\t\t\tcompanionFrameworks: [fw.id],\n\t\t\t});\n\n\t\t\tconst composed = parse(result.files[\"docker-compose.yml\"]!);\n\t\t\texpect(composed.services).toBeDefined();\n\n\t\t\t// Companion should appear in compose\n\t\t\tconst companionKey = `${fw.id}-companion`;\n\t\t\texpect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,CAC5B,CAAC,eAAe,MAAM;IACxC;AAEF,KAAG,sDAAsD;GACxD,MAAM,UAAU,GAAG,mBAAmB;AACtC,gBAAO,OAAO,QAAQ,CAAC,KAAK,SAAS;AACrC,gBAAO,QAAQ,OAAO,CAAC,gBAAgB,EAAE;IACxC;AAEF,KAAG,6CAA6C;AAE/C,gBADa,GAAG,oBAAoB,CACxB,CAAC,eAAe,MAAM;IACjC;GACD;EAEF;AAEF,SAAS,6CAA6C;CACrD,MAAM,sBAAsB,kBAAkB,CAAC,QAAQ,OAAO,GAAG,eAAe;AAEhF,MAAK,MAAM,MAAM,oBAChB,IAAG,GAAG,GAAG,KAAK,mCAAmC;EAchD,MAAM,WAAW,MAbF,SAAS;GACvB,aAAa,aAAa,GAAG,GAAG;GAChC,UAAU,CAAC,QAAQ;GACnB,YAAY,EAAE;GACd,OAAO;GACP,KAAK;GACL,UAAU;GACV,YAAY;GACZ,iBAAiB;GACjB,iBAAiB;GACjB,qBAAqB,CAAC,GAAG,GAAG;GAC5B,CAAC,CAE4B,MAAM,sBAAuB;AAC3D,eAAO,SAAS,SAAS,CAAC,aAAa;EAGvC,MAAM,eAAe,GAAG,GAAG,GAAG;AAC9B,eAAO,SAAS,SAAS,CAAC,eAAe,aAAa;GACrD;EAEF"}
@@ -0,0 +1,58 @@
1
+ const require_test_CTcmp4Su = require("../test.CTcmp4Su-BWSPM8ZQ.cjs");
2
+ const require_generators_cloud_init = require("./cloud-init.cjs");
3
+ //#region src/generators/cloud-init.test.ts
4
+ require_test_CTcmp4Su.describe("generateCloudInit", () => {
5
+ const baseOptions = {
6
+ composeYaml: "version: '3'\nservices:\n redis:\n image: redis:7",
7
+ envContent: "REDIS_PASSWORD=secret123",
8
+ projectName: "my-stack"
9
+ };
10
+ require_test_CTcmp4Su.it("generates valid cloud-init YAML starting with #cloud-config", () => {
11
+ require_test_CTcmp4Su.globalExpect(require_generators_cloud_init.generateCloudInit(baseOptions)).toMatch(/^#cloud-config/);
12
+ });
13
+ require_test_CTcmp4Su.it("embeds the compose YAML content", () => {
14
+ require_test_CTcmp4Su.globalExpect(require_generators_cloud_init.generateCloudInit(baseOptions)).toContain("redis:7");
15
+ });
16
+ require_test_CTcmp4Su.it("embeds the env content with restrictive permissions", () => {
17
+ const result = require_generators_cloud_init.generateCloudInit(baseOptions);
18
+ require_test_CTcmp4Su.globalExpect(result).toContain("REDIS_PASSWORD=secret123");
19
+ require_test_CTcmp4Su.globalExpect(result).toContain("\"0600\"");
20
+ });
21
+ require_test_CTcmp4Su.it("includes project name in the output", () => {
22
+ require_test_CTcmp4Su.globalExpect(require_generators_cloud_init.generateCloudInit(baseOptions)).toContain("my-stack");
23
+ });
24
+ require_test_CTcmp4Su.it("uses default gateway port 18789 when not specified", () => {
25
+ require_test_CTcmp4Su.globalExpect(require_generators_cloud_init.generateCloudInit(baseOptions)).toContain("18789");
26
+ });
27
+ require_test_CTcmp4Su.it("uses custom gateway port when specified", () => {
28
+ const result = require_generators_cloud_init.generateCloudInit({
29
+ ...baseOptions,
30
+ gatewayPort: 9999
31
+ });
32
+ require_test_CTcmp4Su.globalExpect(result).toContain("9999");
33
+ require_test_CTcmp4Su.globalExpect(result).not.toContain("18789");
34
+ });
35
+ require_test_CTcmp4Su.it("includes Docker installation via convenience script", () => {
36
+ require_test_CTcmp4Su.globalExpect(require_generators_cloud_init.generateCloudInit(baseOptions)).toContain("get.docker.com");
37
+ });
38
+ require_test_CTcmp4Su.it("includes health check polling logic", () => {
39
+ const result = require_generators_cloud_init.generateCloudInit(baseOptions);
40
+ require_test_CTcmp4Su.globalExpect(result).toContain("RETRIES=");
41
+ require_test_CTcmp4Su.globalExpect(result).toContain("curl");
42
+ });
43
+ require_test_CTcmp4Su.it("includes runcmd section", () => {
44
+ require_test_CTcmp4Su.globalExpect(require_generators_cloud_init.generateCloudInit(baseOptions)).toContain("runcmd:");
45
+ });
46
+ require_test_CTcmp4Su.it("includes final_message", () => {
47
+ require_test_CTcmp4Su.globalExpect(require_generators_cloud_init.generateCloudInit(baseOptions)).toContain("final_message:");
48
+ });
49
+ require_test_CTcmp4Su.it("includes required packages", () => {
50
+ const result = require_generators_cloud_init.generateCloudInit(baseOptions);
51
+ require_test_CTcmp4Su.globalExpect(result).toContain("packages:");
52
+ require_test_CTcmp4Su.globalExpect(result).toContain("curl");
53
+ require_test_CTcmp4Su.globalExpect(result).toContain("git");
54
+ });
55
+ });
56
+ //#endregion
57
+
58
+ //# sourceMappingURL=cloud-init.test.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud-init.test.cjs","names":["describe","generateCloudInit"],"sources":["../../src/generators/cloud-init.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport { generateCloudInit } from \"./cloud-init.js\";\n\ndescribe(\"generateCloudInit\", () => {\n\tconst baseOptions = {\n\t\tcomposeYaml: \"version: '3'\\nservices:\\n redis:\\n image: redis:7\",\n\t\tenvContent: \"REDIS_PASSWORD=secret123\",\n\t\tprojectName: \"my-stack\",\n\t};\n\n\tit(\"generates valid cloud-init YAML starting with #cloud-config\", () => {\n\t\tconst result = generateCloudInit(baseOptions);\n\t\texpect(result).toMatch(/^#cloud-config/);\n\t});\n\n\tit(\"embeds the compose YAML content\", () => {\n\t\tconst result = generateCloudInit(baseOptions);\n\t\texpect(result).toContain(\"redis:7\");\n\t});\n\n\tit(\"embeds the env content with restrictive permissions\", () => {\n\t\tconst result = generateCloudInit(baseOptions);\n\t\texpect(result).toContain(\"REDIS_PASSWORD=secret123\");\n\t\texpect(result).toContain('\"0600\"');\n\t});\n\n\tit(\"includes project name in the output\", () => {\n\t\tconst result = generateCloudInit(baseOptions);\n\t\texpect(result).toContain(\"my-stack\");\n\t});\n\n\tit(\"uses default gateway port 18789 when not specified\", () => {\n\t\tconst result = generateCloudInit(baseOptions);\n\t\texpect(result).toContain(\"18789\");\n\t});\n\n\tit(\"uses custom gateway port when specified\", () => {\n\t\tconst result = generateCloudInit({ ...baseOptions, gatewayPort: 9999 });\n\t\texpect(result).toContain(\"9999\");\n\t\texpect(result).not.toContain(\"18789\");\n\t});\n\n\tit(\"includes Docker installation via convenience script\", () => {\n\t\tconst result = generateCloudInit(baseOptions);\n\t\texpect(result).toContain(\"get.docker.com\");\n\t});\n\n\tit(\"includes health check polling logic\", () => {\n\t\tconst result = generateCloudInit(baseOptions);\n\t\texpect(result).toContain(\"RETRIES=\");\n\t\texpect(result).toContain(\"curl\");\n\t});\n\n\tit(\"includes runcmd section\", () => {\n\t\tconst result = generateCloudInit(baseOptions);\n\t\texpect(result).toContain(\"runcmd:\");\n\t});\n\n\tit(\"includes final_message\", () => {\n\t\tconst result = generateCloudInit(baseOptions);\n\t\texpect(result).toContain(\"final_message:\");\n\t});\n\n\tit(\"includes required packages\", () => {\n\t\tconst result = generateCloudInit(baseOptions);\n\t\texpect(result).toContain(\"packages:\");\n\t\texpect(result).toContain(\"curl\");\n\t\texpect(result).toContain(\"git\");\n\t});\n});\n"],"mappings":";;;AAGAA,sBAAAA,SAAS,2BAA2B;CACnC,MAAM,cAAc;EACnB,aAAa;EACb,YAAY;EACZ,aAAa;EACb;AAED,uBAAA,GAAG,qEAAqE;AAEvE,wBAAA,aADeC,8BAAAA,kBAAkB,YAAY,CAC/B,CAAC,QAAQ,iBAAiB;GACvC;AAEF,uBAAA,GAAG,yCAAyC;AAE3C,wBAAA,aADeA,8BAAAA,kBAAkB,YAAY,CAC/B,CAAC,UAAU,UAAU;GAClC;AAEF,uBAAA,GAAG,6DAA6D;EAC/D,MAAM,SAASA,8BAAAA,kBAAkB,YAAY;AAC7C,wBAAA,aAAO,OAAO,CAAC,UAAU,2BAA2B;AACpD,wBAAA,aAAO,OAAO,CAAC,UAAU,WAAS;GACjC;AAEF,uBAAA,GAAG,6CAA6C;AAE/C,wBAAA,aADeA,8BAAAA,kBAAkB,YAAY,CAC/B,CAAC,UAAU,WAAW;GACnC;AAEF,uBAAA,GAAG,4DAA4D;AAE9D,wBAAA,aADeA,8BAAAA,kBAAkB,YAAY,CAC/B,CAAC,UAAU,QAAQ;GAChC;AAEF,uBAAA,GAAG,iDAAiD;EACnD,MAAM,SAASA,8BAAAA,kBAAkB;GAAE,GAAG;GAAa,aAAa;GAAM,CAAC;AACvE,wBAAA,aAAO,OAAO,CAAC,UAAU,OAAO;AAChC,wBAAA,aAAO,OAAO,CAAC,IAAI,UAAU,QAAQ;GACpC;AAEF,uBAAA,GAAG,6DAA6D;AAE/D,wBAAA,aADeA,8BAAAA,kBAAkB,YAAY,CAC/B,CAAC,UAAU,iBAAiB;GACzC;AAEF,uBAAA,GAAG,6CAA6C;EAC/C,MAAM,SAASA,8BAAAA,kBAAkB,YAAY;AAC7C,wBAAA,aAAO,OAAO,CAAC,UAAU,WAAW;AACpC,wBAAA,aAAO,OAAO,CAAC,UAAU,OAAO;GAC/B;AAEF,uBAAA,GAAG,iCAAiC;AAEnC,wBAAA,aADeA,8BAAAA,kBAAkB,YAAY,CAC/B,CAAC,UAAU,UAAU;GAClC;AAEF,uBAAA,GAAG,gCAAgC;AAElC,wBAAA,aADeA,8BAAAA,kBAAkB,YAAY,CAC/B,CAAC,UAAU,iBAAiB;GACzC;AAEF,uBAAA,GAAG,oCAAoC;EACtC,MAAM,SAASA,8BAAAA,kBAAkB,YAAY;AAC7C,wBAAA,aAAO,OAAO,CAAC,UAAU,YAAY;AACrC,wBAAA,aAAO,OAAO,CAAC,UAAU,OAAO;AAChC,wBAAA,aAAO,OAAO,CAAC,UAAU,MAAM;GAC9B;EACD"}
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,59 @@
1
+ import { a as describe, o as it, t as globalExpect } from "../test.CTcmp4Su-BRa7-bTj.mjs";
2
+ import { generateCloudInit } from "./cloud-init.mjs";
3
+ //#region src/generators/cloud-init.test.ts
4
+ describe("generateCloudInit", () => {
5
+ const baseOptions = {
6
+ composeYaml: "version: '3'\nservices:\n redis:\n image: redis:7",
7
+ envContent: "REDIS_PASSWORD=secret123",
8
+ projectName: "my-stack"
9
+ };
10
+ it("generates valid cloud-init YAML starting with #cloud-config", () => {
11
+ globalExpect(generateCloudInit(baseOptions)).toMatch(/^#cloud-config/);
12
+ });
13
+ it("embeds the compose YAML content", () => {
14
+ globalExpect(generateCloudInit(baseOptions)).toContain("redis:7");
15
+ });
16
+ it("embeds the env content with restrictive permissions", () => {
17
+ const result = generateCloudInit(baseOptions);
18
+ globalExpect(result).toContain("REDIS_PASSWORD=secret123");
19
+ globalExpect(result).toContain("\"0600\"");
20
+ });
21
+ it("includes project name in the output", () => {
22
+ globalExpect(generateCloudInit(baseOptions)).toContain("my-stack");
23
+ });
24
+ it("uses default gateway port 18789 when not specified", () => {
25
+ globalExpect(generateCloudInit(baseOptions)).toContain("18789");
26
+ });
27
+ it("uses custom gateway port when specified", () => {
28
+ const result = generateCloudInit({
29
+ ...baseOptions,
30
+ gatewayPort: 9999
31
+ });
32
+ globalExpect(result).toContain("9999");
33
+ globalExpect(result).not.toContain("18789");
34
+ });
35
+ it("includes Docker installation via convenience script", () => {
36
+ globalExpect(generateCloudInit(baseOptions)).toContain("get.docker.com");
37
+ });
38
+ it("includes health check polling logic", () => {
39
+ const result = generateCloudInit(baseOptions);
40
+ globalExpect(result).toContain("RETRIES=");
41
+ globalExpect(result).toContain("curl");
42
+ });
43
+ it("includes runcmd section", () => {
44
+ globalExpect(generateCloudInit(baseOptions)).toContain("runcmd:");
45
+ });
46
+ it("includes final_message", () => {
47
+ globalExpect(generateCloudInit(baseOptions)).toContain("final_message:");
48
+ });
49
+ it("includes required packages", () => {
50
+ const result = generateCloudInit(baseOptions);
51
+ globalExpect(result).toContain("packages:");
52
+ globalExpect(result).toContain("curl");
53
+ globalExpect(result).toContain("git");
54
+ });
55
+ });
56
+ //#endregion
57
+ export {};
58
+
59
+ //# sourceMappingURL=cloud-init.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud-init.test.mjs","names":[],"sources":["../../src/generators/cloud-init.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport { generateCloudInit } from \"./cloud-init.js\";\n\ndescribe(\"generateCloudInit\", () => {\n\tconst baseOptions = {\n\t\tcomposeYaml: \"version: '3'\\nservices:\\n redis:\\n image: redis:7\",\n\t\tenvContent: \"REDIS_PASSWORD=secret123\",\n\t\tprojectName: \"my-stack\",\n\t};\n\n\tit(\"generates valid cloud-init YAML starting with #cloud-config\", () => {\n\t\tconst result = generateCloudInit(baseOptions);\n\t\texpect(result).toMatch(/^#cloud-config/);\n\t});\n\n\tit(\"embeds the compose YAML content\", () => {\n\t\tconst result = generateCloudInit(baseOptions);\n\t\texpect(result).toContain(\"redis:7\");\n\t});\n\n\tit(\"embeds the env content with restrictive permissions\", () => {\n\t\tconst result = generateCloudInit(baseOptions);\n\t\texpect(result).toContain(\"REDIS_PASSWORD=secret123\");\n\t\texpect(result).toContain('\"0600\"');\n\t});\n\n\tit(\"includes project name in the output\", () => {\n\t\tconst result = generateCloudInit(baseOptions);\n\t\texpect(result).toContain(\"my-stack\");\n\t});\n\n\tit(\"uses default gateway port 18789 when not specified\", () => {\n\t\tconst result = generateCloudInit(baseOptions);\n\t\texpect(result).toContain(\"18789\");\n\t});\n\n\tit(\"uses custom gateway port when specified\", () => {\n\t\tconst result = generateCloudInit({ ...baseOptions, gatewayPort: 9999 });\n\t\texpect(result).toContain(\"9999\");\n\t\texpect(result).not.toContain(\"18789\");\n\t});\n\n\tit(\"includes Docker installation via convenience script\", () => {\n\t\tconst result = generateCloudInit(baseOptions);\n\t\texpect(result).toContain(\"get.docker.com\");\n\t});\n\n\tit(\"includes health check polling logic\", () => {\n\t\tconst result = generateCloudInit(baseOptions);\n\t\texpect(result).toContain(\"RETRIES=\");\n\t\texpect(result).toContain(\"curl\");\n\t});\n\n\tit(\"includes runcmd section\", () => {\n\t\tconst result = generateCloudInit(baseOptions);\n\t\texpect(result).toContain(\"runcmd:\");\n\t});\n\n\tit(\"includes final_message\", () => {\n\t\tconst result = generateCloudInit(baseOptions);\n\t\texpect(result).toContain(\"final_message:\");\n\t});\n\n\tit(\"includes required packages\", () => {\n\t\tconst result = generateCloudInit(baseOptions);\n\t\texpect(result).toContain(\"packages:\");\n\t\texpect(result).toContain(\"curl\");\n\t\texpect(result).toContain(\"git\");\n\t});\n});\n"],"mappings":";;;AAGA,SAAS,2BAA2B;CACnC,MAAM,cAAc;EACnB,aAAa;EACb,YAAY;EACZ,aAAa;EACb;AAED,IAAG,qEAAqE;AAEvE,eADe,kBAAkB,YAAY,CAC/B,CAAC,QAAQ,iBAAiB;GACvC;AAEF,IAAG,yCAAyC;AAE3C,eADe,kBAAkB,YAAY,CAC/B,CAAC,UAAU,UAAU;GAClC;AAEF,IAAG,6DAA6D;EAC/D,MAAM,SAAS,kBAAkB,YAAY;AAC7C,eAAO,OAAO,CAAC,UAAU,2BAA2B;AACpD,eAAO,OAAO,CAAC,UAAU,WAAS;GACjC;AAEF,IAAG,6CAA6C;AAE/C,eADe,kBAAkB,YAAY,CAC/B,CAAC,UAAU,WAAW;GACnC;AAEF,IAAG,4DAA4D;AAE9D,eADe,kBAAkB,YAAY,CAC/B,CAAC,UAAU,QAAQ;GAChC;AAEF,IAAG,iDAAiD;EACnD,MAAM,SAAS,kBAAkB;GAAE,GAAG;GAAa,aAAa;GAAM,CAAC;AACvE,eAAO,OAAO,CAAC,UAAU,OAAO;AAChC,eAAO,OAAO,CAAC,IAAI,UAAU,QAAQ;GACpC;AAEF,IAAG,6DAA6D;AAE/D,eADe,kBAAkB,YAAY,CAC/B,CAAC,UAAU,iBAAiB;GACzC;AAEF,IAAG,6CAA6C;EAC/C,MAAM,SAAS,kBAAkB,YAAY;AAC7C,eAAO,OAAO,CAAC,UAAU,WAAW;AACpC,eAAO,OAAO,CAAC,UAAU,OAAO;GAC/B;AAEF,IAAG,iCAAiC;AAEnC,eADe,kBAAkB,YAAY,CAC/B,CAAC,UAAU,UAAU;GAClC;AAEF,IAAG,gCAAgC;AAElC,eADe,kBAAkB,YAAY,CAC/B,CAAC,UAAU,iBAAiB;GACzC;AAEF,IAAG,oCAAoC;EACtC,MAAM,SAAS,kBAAkB,YAAY;AAC7C,eAAO,OAAO,CAAC,UAAU,YAAY;AACrC,eAAO,OAAO,CAAC,UAAU,OAAO;AAChC,eAAO,OAAO,CAAC,UAAU,MAAM;GAC9B;EACD"}
@@ -0,0 +1,48 @@
1
+ const require_test_CTcmp4Su = require("../test.CTcmp4Su-BWSPM8ZQ.cjs");
2
+ const require_generators_get_shit_done = require("./get-shit-done.cjs");
3
+ //#region src/generators/get-shit-done.test.ts
4
+ require_test_CTcmp4Su.describe("generateGsdScripts", () => {
5
+ require_test_CTcmp4Su.it("returns undefined when runtimes is undefined", () => {
6
+ require_test_CTcmp4Su.globalExpect(require_generators_get_shit_done.generateGsdScripts(void 0)).toBeUndefined();
7
+ });
8
+ require_test_CTcmp4Su.it("returns undefined when runtimes is empty", () => {
9
+ require_test_CTcmp4Su.globalExpect(require_generators_get_shit_done.generateGsdScripts([])).toBeUndefined();
10
+ });
11
+ require_test_CTcmp4Su.it("generates both sh and ps1 scripts", () => {
12
+ const result = require_generators_get_shit_done.generateGsdScripts(["claude"]);
13
+ require_test_CTcmp4Su.globalExpect(result).toBeDefined();
14
+ require_test_CTcmp4Su.globalExpect(result.sh).toBeDefined();
15
+ require_test_CTcmp4Su.globalExpect(result.ps1).toBeDefined();
16
+ });
17
+ require_test_CTcmp4Su.it("sh script starts with shebang", () => {
18
+ require_test_CTcmp4Su.globalExpect(require_generators_get_shit_done.generateGsdScripts(["claude"]).sh).toMatch(/^#!/);
19
+ });
20
+ require_test_CTcmp4Su.it("includes runtime flags in sh script", () => {
21
+ const result = require_generators_get_shit_done.generateGsdScripts(["claude", "codex"]);
22
+ require_test_CTcmp4Su.globalExpect(result.sh).toContain("--claude");
23
+ require_test_CTcmp4Su.globalExpect(result.sh).toContain("--codex");
24
+ });
25
+ require_test_CTcmp4Su.it("includes runtime flags in ps1 script", () => {
26
+ const result = require_generators_get_shit_done.generateGsdScripts(["claude", "codex"]);
27
+ require_test_CTcmp4Su.globalExpect(result.ps1).toContain("--claude");
28
+ require_test_CTcmp4Su.globalExpect(result.ps1).toContain("--codex");
29
+ });
30
+ require_test_CTcmp4Su.it("uses npx to run get-shit-done", () => {
31
+ const result = require_generators_get_shit_done.generateGsdScripts(["claude"]);
32
+ require_test_CTcmp4Su.globalExpect(result.sh).toContain("npx get-shit-done-cc@latest");
33
+ require_test_CTcmp4Su.globalExpect(result.ps1).toContain("npx get-shit-done-cc@latest");
34
+ });
35
+ require_test_CTcmp4Su.it("includes npx availability check", () => {
36
+ const result = require_generators_get_shit_done.generateGsdScripts(["claude"]);
37
+ require_test_CTcmp4Su.globalExpect(result.sh).toContain("command -v npx");
38
+ require_test_CTcmp4Su.globalExpect(result.ps1).toContain("Get-Command npx");
39
+ });
40
+ require_test_CTcmp4Su.it("lists runtimes in output message", () => {
41
+ const result = require_generators_get_shit_done.generateGsdScripts(["claude", "codex"]);
42
+ require_test_CTcmp4Su.globalExpect(result.sh).toContain("claude, codex");
43
+ require_test_CTcmp4Su.globalExpect(result.ps1).toContain("claude, codex");
44
+ });
45
+ });
46
+ //#endregion
47
+
48
+ //# sourceMappingURL=get-shit-done.test.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-shit-done.test.cjs","names":["describe","generateGsdScripts"],"sources":["../../src/generators/get-shit-done.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport { generateGsdScripts } from \"./get-shit-done.js\";\n\ndescribe(\"generateGsdScripts\", () => {\n\tit(\"returns undefined when runtimes is undefined\", () => {\n\t\texpect(generateGsdScripts(undefined)).toBeUndefined();\n\t});\n\n\tit(\"returns undefined when runtimes is empty\", () => {\n\t\texpect(generateGsdScripts([])).toBeUndefined();\n\t});\n\n\tit(\"generates both sh and ps1 scripts\", () => {\n\t\tconst result = generateGsdScripts([\"claude\" as any]);\n\t\texpect(result).toBeDefined();\n\t\texpect(result!.sh).toBeDefined();\n\t\texpect(result!.ps1).toBeDefined();\n\t});\n\n\tit(\"sh script starts with shebang\", () => {\n\t\tconst result = generateGsdScripts([\"claude\" as any]);\n\t\texpect(result!.sh).toMatch(/^#!/);\n\t});\n\n\tit(\"includes runtime flags in sh script\", () => {\n\t\tconst result = generateGsdScripts([\"claude\", \"codex\"] as any[]);\n\t\texpect(result!.sh).toContain(\"--claude\");\n\t\texpect(result!.sh).toContain(\"--codex\");\n\t});\n\n\tit(\"includes runtime flags in ps1 script\", () => {\n\t\tconst result = generateGsdScripts([\"claude\", \"codex\"] as any[]);\n\t\texpect(result!.ps1).toContain(\"--claude\");\n\t\texpect(result!.ps1).toContain(\"--codex\");\n\t});\n\n\tit(\"uses npx to run get-shit-done\", () => {\n\t\tconst result = generateGsdScripts([\"claude\"] as any[]);\n\t\texpect(result!.sh).toContain(\"npx get-shit-done-cc@latest\");\n\t\texpect(result!.ps1).toContain(\"npx get-shit-done-cc@latest\");\n\t});\n\n\tit(\"includes npx availability check\", () => {\n\t\tconst result = generateGsdScripts([\"claude\"] as any[]);\n\t\texpect(result!.sh).toContain(\"command -v npx\");\n\t\texpect(result!.ps1).toContain(\"Get-Command npx\");\n\t});\n\n\tit(\"lists runtimes in output message\", () => {\n\t\tconst result = generateGsdScripts([\"claude\", \"codex\"] as any[]);\n\t\texpect(result!.sh).toContain(\"claude, codex\");\n\t\texpect(result!.ps1).toContain(\"claude, codex\");\n\t});\n});\n"],"mappings":";;;AAGAA,sBAAAA,SAAS,4BAA4B;AACpC,uBAAA,GAAG,sDAAsD;AACxD,wBAAA,aAAOC,iCAAAA,mBAAmB,KAAA,EAAU,CAAC,CAAC,eAAe;GACpD;AAEF,uBAAA,GAAG,kDAAkD;AACpD,wBAAA,aAAOA,iCAAAA,mBAAmB,EAAE,CAAC,CAAC,CAAC,eAAe;GAC7C;AAEF,uBAAA,GAAG,2CAA2C;EAC7C,MAAM,SAASA,iCAAAA,mBAAmB,CAAC,SAAgB,CAAC;AACpD,wBAAA,aAAO,OAAO,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,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,49 @@
1
+ import { a as describe, o as it, t as globalExpect } from "../test.CTcmp4Su-BRa7-bTj.mjs";
2
+ import { generateGsdScripts } from "./get-shit-done.mjs";
3
+ //#region src/generators/get-shit-done.test.ts
4
+ describe("generateGsdScripts", () => {
5
+ it("returns undefined when runtimes is undefined", () => {
6
+ globalExpect(generateGsdScripts(void 0)).toBeUndefined();
7
+ });
8
+ it("returns undefined when runtimes is empty", () => {
9
+ globalExpect(generateGsdScripts([])).toBeUndefined();
10
+ });
11
+ it("generates both sh and ps1 scripts", () => {
12
+ const result = generateGsdScripts(["claude"]);
13
+ globalExpect(result).toBeDefined();
14
+ globalExpect(result.sh).toBeDefined();
15
+ globalExpect(result.ps1).toBeDefined();
16
+ });
17
+ it("sh script starts with shebang", () => {
18
+ globalExpect(generateGsdScripts(["claude"]).sh).toMatch(/^#!/);
19
+ });
20
+ it("includes runtime flags in sh script", () => {
21
+ const result = generateGsdScripts(["claude", "codex"]);
22
+ globalExpect(result.sh).toContain("--claude");
23
+ globalExpect(result.sh).toContain("--codex");
24
+ });
25
+ it("includes runtime flags in ps1 script", () => {
26
+ const result = generateGsdScripts(["claude", "codex"]);
27
+ globalExpect(result.ps1).toContain("--claude");
28
+ globalExpect(result.ps1).toContain("--codex");
29
+ });
30
+ it("uses npx to run get-shit-done", () => {
31
+ const result = generateGsdScripts(["claude"]);
32
+ globalExpect(result.sh).toContain("npx get-shit-done-cc@latest");
33
+ globalExpect(result.ps1).toContain("npx get-shit-done-cc@latest");
34
+ });
35
+ it("includes npx availability check", () => {
36
+ const result = generateGsdScripts(["claude"]);
37
+ globalExpect(result.sh).toContain("command -v npx");
38
+ globalExpect(result.ps1).toContain("Get-Command npx");
39
+ });
40
+ it("lists runtimes in output message", () => {
41
+ const result = generateGsdScripts(["claude", "codex"]);
42
+ globalExpect(result.sh).toContain("claude, codex");
43
+ globalExpect(result.ps1).toContain("claude, codex");
44
+ });
45
+ });
46
+ //#endregion
47
+ export {};
48
+
49
+ //# sourceMappingURL=get-shit-done.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-shit-done.test.mjs","names":[],"sources":["../../src/generators/get-shit-done.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport { generateGsdScripts } from \"./get-shit-done.js\";\n\ndescribe(\"generateGsdScripts\", () => {\n\tit(\"returns undefined when runtimes is undefined\", () => {\n\t\texpect(generateGsdScripts(undefined)).toBeUndefined();\n\t});\n\n\tit(\"returns undefined when runtimes is empty\", () => {\n\t\texpect(generateGsdScripts([])).toBeUndefined();\n\t});\n\n\tit(\"generates both sh and ps1 scripts\", () => {\n\t\tconst result = generateGsdScripts([\"claude\" as any]);\n\t\texpect(result).toBeDefined();\n\t\texpect(result!.sh).toBeDefined();\n\t\texpect(result!.ps1).toBeDefined();\n\t});\n\n\tit(\"sh script starts with shebang\", () => {\n\t\tconst result = generateGsdScripts([\"claude\" as any]);\n\t\texpect(result!.sh).toMatch(/^#!/);\n\t});\n\n\tit(\"includes runtime flags in sh script\", () => {\n\t\tconst result = generateGsdScripts([\"claude\", \"codex\"] as any[]);\n\t\texpect(result!.sh).toContain(\"--claude\");\n\t\texpect(result!.sh).toContain(\"--codex\");\n\t});\n\n\tit(\"includes runtime flags in ps1 script\", () => {\n\t\tconst result = generateGsdScripts([\"claude\", \"codex\"] as any[]);\n\t\texpect(result!.ps1).toContain(\"--claude\");\n\t\texpect(result!.ps1).toContain(\"--codex\");\n\t});\n\n\tit(\"uses npx to run get-shit-done\", () => {\n\t\tconst result = generateGsdScripts([\"claude\"] as any[]);\n\t\texpect(result!.sh).toContain(\"npx get-shit-done-cc@latest\");\n\t\texpect(result!.ps1).toContain(\"npx get-shit-done-cc@latest\");\n\t});\n\n\tit(\"includes npx availability check\", () => {\n\t\tconst result = generateGsdScripts([\"claude\"] as any[]);\n\t\texpect(result!.sh).toContain(\"command -v npx\");\n\t\texpect(result!.ps1).toContain(\"Get-Command npx\");\n\t});\n\n\tit(\"lists runtimes in output message\", () => {\n\t\tconst result = generateGsdScripts([\"claude\", \"codex\"] as any[]);\n\t\texpect(result!.sh).toContain(\"claude, codex\");\n\t\texpect(result!.ps1).toContain(\"claude, codex\");\n\t});\n});\n"],"mappings":";;;AAGA,SAAS,4BAA4B;AACpC,IAAG,sDAAsD;AACxD,eAAO,mBAAmB,KAAA,EAAU,CAAC,CAAC,eAAe;GACpD;AAEF,IAAG,kDAAkD;AACpD,eAAO,mBAAmB,EAAE,CAAC,CAAC,CAAC,eAAe;GAC7C;AAEF,IAAG,2CAA2C;EAC7C,MAAM,SAAS,mBAAmB,CAAC,SAAgB,CAAC;AACpD,eAAO,OAAO,CAAC,aAAa;AAC5B,eAAO,OAAQ,GAAG,CAAC,aAAa;AAChC,eAAO,OAAQ,IAAI,CAAC,aAAa;GAChC;AAEF,IAAG,uCAAuC;AAEzC,eADe,mBAAmB,CAAC,SAAgB,CAAC,CACrC,GAAG,CAAC,QAAQ,MAAM;GAChC;AAEF,IAAG,6CAA6C;EAC/C,MAAM,SAAS,mBAAmB,CAAC,UAAU,QAAQ,CAAU;AAC/D,eAAO,OAAQ,GAAG,CAAC,UAAU,WAAW;AACxC,eAAO,OAAQ,GAAG,CAAC,UAAU,UAAU;GACtC;AAEF,IAAG,8CAA8C;EAChD,MAAM,SAAS,mBAAmB,CAAC,UAAU,QAAQ,CAAU;AAC/D,eAAO,OAAQ,IAAI,CAAC,UAAU,WAAW;AACzC,eAAO,OAAQ,IAAI,CAAC,UAAU,UAAU;GACvC;AAEF,IAAG,uCAAuC;EACzC,MAAM,SAAS,mBAAmB,CAAC,SAAS,CAAU;AACtD,eAAO,OAAQ,GAAG,CAAC,UAAU,8BAA8B;AAC3D,eAAO,OAAQ,IAAI,CAAC,UAAU,8BAA8B;GAC3D;AAEF,IAAG,yCAAyC;EAC3C,MAAM,SAAS,mBAAmB,CAAC,SAAS,CAAU;AACtD,eAAO,OAAQ,GAAG,CAAC,UAAU,iBAAiB;AAC9C,eAAO,OAAQ,IAAI,CAAC,UAAU,kBAAkB;GAC/C;AAEF,IAAG,0CAA0C;EAC5C,MAAM,SAAS,mBAAmB,CAAC,UAAU,QAAQ,CAAU;AAC/D,eAAO,OAAQ,GAAG,CAAC,UAAU,gBAAgB;AAC7C,eAAO,OAAQ,IAAI,CAAC,UAAU,gBAAgB;GAC7C;EACD"}
@@ -0,0 +1,74 @@
1
+ require("../skills-uPxJVmKk.cjs");
2
+ const require_test_CTcmp4Su = require("../test.CTcmp4Su-BWSPM8ZQ.cjs");
3
+ const require_generators_grafana = require("./grafana.cjs");
4
+ let yaml = require("yaml");
5
+ //#region src/generators/grafana.test.ts
6
+ require_test_CTcmp4Su.describe("generateGrafanaConfig", () => {
7
+ require_test_CTcmp4Su.it("returns multiple config files", () => {
8
+ const files = require_generators_grafana.generateGrafanaConfig();
9
+ require_test_CTcmp4Su.globalExpect(Object.keys(files).length).toBeGreaterThanOrEqual(3);
10
+ });
11
+ require_test_CTcmp4Su.it("generates datasource provisioning YAML", () => {
12
+ const dsFile = require_generators_grafana.generateGrafanaConfig()["config/grafana/provisioning/datasources/prometheus.yml"];
13
+ require_test_CTcmp4Su.globalExpect(dsFile).toBeDefined();
14
+ const parsed = (0, yaml.parse)(dsFile);
15
+ require_test_CTcmp4Su.globalExpect(parsed.datasources).toBeInstanceOf(Array);
16
+ require_test_CTcmp4Su.globalExpect(parsed.datasources[0].type).toBe("prometheus");
17
+ require_test_CTcmp4Su.globalExpect(parsed.datasources[0].isDefault).toBe(true);
18
+ });
19
+ require_test_CTcmp4Su.it("generates dashboard provisioning YAML", () => {
20
+ const dashFile = require_generators_grafana.generateGrafanaConfig()["config/grafana/provisioning/dashboards/default.yml"];
21
+ require_test_CTcmp4Su.globalExpect(dashFile).toBeDefined();
22
+ const parsed = (0, yaml.parse)(dashFile);
23
+ require_test_CTcmp4Su.globalExpect(parsed.providers).toBeInstanceOf(Array);
24
+ require_test_CTcmp4Su.globalExpect(parsed.providers[0].name).toContain("OpenClaw");
25
+ });
26
+ require_test_CTcmp4Su.it("generates grafana.ini configuration", () => {
27
+ const iniFile = require_generators_grafana.generateGrafanaConfig()["config/grafana/grafana.ini"];
28
+ require_test_CTcmp4Su.globalExpect(iniFile).toBeDefined();
29
+ require_test_CTcmp4Su.globalExpect(iniFile).toContain("[server]");
30
+ require_test_CTcmp4Su.globalExpect(iniFile).toContain("[security]");
31
+ require_test_CTcmp4Su.globalExpect(iniFile).toContain("[alerting]");
32
+ });
33
+ require_test_CTcmp4Su.it("disables anonymous auth", () => {
34
+ const iniFile = require_generators_grafana.generateGrafanaConfig()["config/grafana/grafana.ini"];
35
+ require_test_CTcmp4Su.globalExpect(iniFile).toContain("[auth.anonymous]");
36
+ require_test_CTcmp4Su.globalExpect(iniFile).toContain("enabled = false");
37
+ });
38
+ });
39
+ require_test_CTcmp4Su.describe("generateGrafanaDashboard", () => {
40
+ require_test_CTcmp4Su.it("returns valid JSON", () => {
41
+ const json = require_generators_grafana.generateGrafanaDashboard();
42
+ require_test_CTcmp4Su.globalExpect(JSON.parse(json)).toBeDefined();
43
+ });
44
+ require_test_CTcmp4Su.it("includes expected panels", () => {
45
+ const dashboard = JSON.parse(require_generators_grafana.generateGrafanaDashboard());
46
+ require_test_CTcmp4Su.globalExpect(dashboard.panels).toBeInstanceOf(Array);
47
+ require_test_CTcmp4Su.globalExpect(dashboard.panels.length).toBe(3);
48
+ const titles = dashboard.panels.map((p) => p.title);
49
+ require_test_CTcmp4Su.globalExpect(titles).toContain("Service Health");
50
+ require_test_CTcmp4Su.globalExpect(titles).toContain("Memory Usage");
51
+ require_test_CTcmp4Su.globalExpect(titles).toContain("Request Rate");
52
+ });
53
+ require_test_CTcmp4Su.it("uses prometheus as datasource", () => {
54
+ const dashboard = JSON.parse(require_generators_grafana.generateGrafanaDashboard());
55
+ for (const panel of dashboard.panels) require_test_CTcmp4Su.globalExpect(panel.datasource.type).toBe("prometheus");
56
+ });
57
+ require_test_CTcmp4Su.it("has openclaw tag", () => {
58
+ require_test_CTcmp4Su.globalExpect(JSON.parse(require_generators_grafana.generateGrafanaDashboard()).tags).toContain("openclaw");
59
+ });
60
+ require_test_CTcmp4Su.it("has correct schema version", () => {
61
+ require_test_CTcmp4Su.globalExpect(JSON.parse(require_generators_grafana.generateGrafanaDashboard()).schemaVersion).toBe(39);
62
+ });
63
+ require_test_CTcmp4Su.it("panels have proper grid positions", () => {
64
+ const dashboard = JSON.parse(require_generators_grafana.generateGrafanaDashboard());
65
+ for (const panel of dashboard.panels) {
66
+ require_test_CTcmp4Su.globalExpect(panel.gridPos).toBeDefined();
67
+ require_test_CTcmp4Su.globalExpect(panel.gridPos.h).toBeGreaterThan(0);
68
+ require_test_CTcmp4Su.globalExpect(panel.gridPos.w).toBeGreaterThan(0);
69
+ }
70
+ });
71
+ });
72
+ //#endregion
73
+
74
+ //# sourceMappingURL=grafana.test.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grafana.test.cjs","names":["describe","generateGrafanaConfig","generateGrafanaDashboard"],"sources":["../../src/generators/grafana.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport { parse } from \"yaml\";\nimport { generateGrafanaConfig, generateGrafanaDashboard } from \"./grafana.js\";\n\ndescribe(\"generateGrafanaConfig\", () => {\n\tit(\"returns multiple config files\", () => {\n\t\tconst files = generateGrafanaConfig();\n\t\texpect(Object.keys(files).length).toBeGreaterThanOrEqual(3);\n\t});\n\n\tit(\"generates datasource provisioning YAML\", () => {\n\t\tconst files = generateGrafanaConfig();\n\t\tconst dsFile = files[\"config/grafana/provisioning/datasources/prometheus.yml\"];\n\t\texpect(dsFile).toBeDefined();\n\t\tconst parsed = parse(dsFile!);\n\t\texpect(parsed.datasources).toBeInstanceOf(Array);\n\t\texpect(parsed.datasources[0].type).toBe(\"prometheus\");\n\t\texpect(parsed.datasources[0].isDefault).toBe(true);\n\t});\n\n\tit(\"generates dashboard provisioning YAML\", () => {\n\t\tconst files = generateGrafanaConfig();\n\t\tconst dashFile = files[\"config/grafana/provisioning/dashboards/default.yml\"];\n\t\texpect(dashFile).toBeDefined();\n\t\tconst parsed = parse(dashFile!);\n\t\texpect(parsed.providers).toBeInstanceOf(Array);\n\t\texpect(parsed.providers[0].name).toContain(\"OpenClaw\");\n\t});\n\n\tit(\"generates grafana.ini configuration\", () => {\n\t\tconst files = generateGrafanaConfig();\n\t\tconst iniFile = files[\"config/grafana/grafana.ini\"];\n\t\texpect(iniFile).toBeDefined();\n\t\texpect(iniFile).toContain(\"[server]\");\n\t\texpect(iniFile).toContain(\"[security]\");\n\t\texpect(iniFile).toContain(\"[alerting]\");\n\t});\n\n\tit(\"disables anonymous auth\", () => {\n\t\tconst files = generateGrafanaConfig();\n\t\tconst iniFile = files[\"config/grafana/grafana.ini\"]!;\n\t\texpect(iniFile).toContain(\"[auth.anonymous]\");\n\t\texpect(iniFile).toContain(\"enabled = false\");\n\t});\n});\n\ndescribe(\"generateGrafanaDashboard\", () => {\n\tit(\"returns valid JSON\", () => {\n\t\tconst json = generateGrafanaDashboard();\n\t\tconst dashboard = JSON.parse(json);\n\t\texpect(dashboard).toBeDefined();\n\t});\n\n\tit(\"includes expected panels\", () => {\n\t\tconst dashboard = JSON.parse(generateGrafanaDashboard());\n\t\texpect(dashboard.panels).toBeInstanceOf(Array);\n\t\texpect(dashboard.panels.length).toBe(3);\n\n\t\tconst titles = dashboard.panels.map((p: { title: string }) => p.title);\n\t\texpect(titles).toContain(\"Service Health\");\n\t\texpect(titles).toContain(\"Memory Usage\");\n\t\texpect(titles).toContain(\"Request Rate\");\n\t});\n\n\tit(\"uses prometheus as datasource\", () => {\n\t\tconst dashboard = JSON.parse(generateGrafanaDashboard());\n\t\tfor (const panel of dashboard.panels) {\n\t\t\texpect(panel.datasource.type).toBe(\"prometheus\");\n\t\t}\n\t});\n\n\tit(\"has openclaw tag\", () => {\n\t\tconst dashboard = JSON.parse(generateGrafanaDashboard());\n\t\texpect(dashboard.tags).toContain(\"openclaw\");\n\t});\n\n\tit(\"has correct schema version\", () => {\n\t\tconst dashboard = JSON.parse(generateGrafanaDashboard());\n\t\texpect(dashboard.schemaVersion).toBe(39);\n\t});\n\n\tit(\"panels have proper grid positions\", () => {\n\t\tconst dashboard = JSON.parse(generateGrafanaDashboard());\n\t\tfor (const panel of dashboard.panels) {\n\t\t\texpect(panel.gridPos).toBeDefined();\n\t\t\texpect(panel.gridPos.h).toBeGreaterThan(0);\n\t\t\texpect(panel.gridPos.w).toBeGreaterThan(0);\n\t\t}\n\t});\n});\n"],"mappings":";;;;;AAIAA,sBAAAA,SAAS,+BAA+B;AACvC,uBAAA,GAAG,uCAAuC;EACzC,MAAM,QAAQC,2BAAAA,uBAAuB;AACrC,wBAAA,aAAO,OAAO,KAAK,MAAM,CAAC,OAAO,CAAC,uBAAuB,EAAE;GAC1D;AAEF,uBAAA,GAAG,gDAAgD;EAElD,MAAM,SADQA,2BAAAA,uBAAuB,CAChB;AACrB,wBAAA,aAAO,OAAO,CAAC,aAAa;EAC5B,MAAM,UAAA,GAAA,KAAA,OAAe,OAAQ;AAC7B,wBAAA,aAAO,OAAO,YAAY,CAAC,eAAe,MAAM;AAChD,wBAAA,aAAO,OAAO,YAAY,GAAG,KAAK,CAAC,KAAK,aAAa;AACrD,wBAAA,aAAO,OAAO,YAAY,GAAG,UAAU,CAAC,KAAK,KAAK;GACjD;AAEF,uBAAA,GAAG,+CAA+C;EAEjD,MAAM,WADQA,2BAAAA,uBAAuB,CACd;AACvB,wBAAA,aAAO,SAAS,CAAC,aAAa;EAC9B,MAAM,UAAA,GAAA,KAAA,OAAe,SAAU;AAC/B,wBAAA,aAAO,OAAO,UAAU,CAAC,eAAe,MAAM;AAC9C,wBAAA,aAAO,OAAO,UAAU,GAAG,KAAK,CAAC,UAAU,WAAW;GACrD;AAEF,uBAAA,GAAG,6CAA6C;EAE/C,MAAM,UADQA,2BAAAA,uBAAuB,CACf;AACtB,wBAAA,aAAO,QAAQ,C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