@intentius/chant-lexicon-docker 0.83.0 → 0.85.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ import type { CompositeEntry } from "@intentius/chant/lexicon";
2
+ export declare const compositeCatalog: CompositeEntry[];
3
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/composites/catalog.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,eAAO,MAAM,gBAAgB,EAAE,cAAc,EAsD5C,CAAC"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "69ae966cfc069e0538d3f2605664cca03b83d2130312023a24a434a2debd4823",
4
+ "manifest.json": "502441225f3db95fb32de3a99ba278b52a8caad164a58e4c275d40f315b59086",
5
5
  "meta.json": "2996be8fdb14f3f935e1e1441fed8f69af7b6aeeefb14dac96301cc41eba8046",
6
6
  "types/index.d.ts": "7b2e6f784b7dbecbbe7924fa1aec7e2520ac0547069311253a006bc2267a5646",
7
7
  "rules/no-latest-tag.ts": "efd060453d8ca3d5b85c3972906c6650b6f63eb5f67cb6cdb0f16a41cad91228",
@@ -15,5 +15,5 @@
15
15
  "skills/chant-docker.md": "3ff0708e3c76e245f202948949c768464563af2b60cc9aa2ca52f494ef8357f1",
16
16
  "skills/chant-docker-patterns.md": "ad1b0196d8150b2df579a699ff107f604340c799c04f3460ebf65003e287b12a"
17
17
  },
18
- "composite": "ca49efb991e68abfeca265e9c1b283888865fa21485911e69b2995b603daf245"
18
+ "composite": "ca92d6335ac15aad75bb7962f91d9d26c723a781c6743fc87d4cd9eecf54a953"
19
19
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docker",
3
- "version": "0.83.0",
3
+ "version": "0.85.0",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "Docker",
6
6
  "intrinsics": [
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAiC,MAAM,0BAA0B,CAAC;AAc7F,eAAO,MAAM,YAAY,EAAE,aA0O1B,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAiC,MAAM,0BAA0B,CAAC;AAc7F,eAAO,MAAM,YAAY,EAAE,aA8O1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-docker",
3
- "version": "0.83.0",
3
+ "version": "0.85.0",
4
4
  "description": "Docker lexicon for chant — declarative IaC in TypeScript",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -70,7 +70,7 @@
70
70
  "typescript": "^5.9.3"
71
71
  },
72
72
  "peerDependencies": {
73
- "@intentius/chant": "^0.83.0",
73
+ "@intentius/chant": "^0.85.0",
74
74
  "typescript": "^5.9.3"
75
75
  }
76
76
  }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * The composite catalog matches what this lexicon exports (#2662).
3
+ *
4
+ * `catalog.ts` is generated by `npm run generate:composite-catalogs` and is
5
+ * what `chant serve mcp` lists. A composite added without regenerating it would
6
+ * be invisible to an agent asking what docker offers; one renamed or removed
7
+ * would be offered and fail to import.
8
+ */
9
+
10
+ import { describe, expect, test } from "vitest";
11
+ import { isCompositeDefinition } from "@intentius/chant";
12
+ import * as composites from "./index";
13
+ import { compositeCatalog } from "./catalog";
14
+ import { dockerPlugin } from "../plugin";
15
+
16
+ const exported = Object.entries(composites)
17
+ .filter(([, value]) => isCompositeDefinition(value))
18
+ .map(([name]) => name)
19
+ .sort();
20
+ const catalogued = compositeCatalog.map((entry) => entry.name).sort();
21
+
22
+ describe("the docker composite catalog", () => {
23
+ test("every exported composite has an entry, and every entry names an exported composite", () => {
24
+ expect(exported.length).toBeGreaterThan(0);
25
+ expect(catalogued, "regenerate with `npm run generate:composite-catalogs -- docker`").toEqual(exported);
26
+ });
27
+
28
+ test("every entry says what it is and what it bundles", () => {
29
+ for (const entry of compositeCatalog) {
30
+ expect(entry.lexicon, entry.name).toBe("docker");
31
+ expect(entry.description.length, entry.name).toBeGreaterThan(0);
32
+ expect(entry.bundles.length, entry.name).toBeGreaterThan(0);
33
+ }
34
+ });
35
+
36
+ test("the plugin contributes it", () => {
37
+ expect(dockerPlugin.composites?.()).toBe(compositeCatalog);
38
+ });
39
+ });
@@ -0,0 +1,60 @@
1
+ // Generated by scripts/generate-composite-catalogs.ts (#2662) from this
2
+ // lexicon's composite exports. Do not edit by hand: run
3
+ // `npm run generate:composite-catalogs`. catalog.test.ts holds it to the exports.
4
+ import type { CompositeEntry } from "@intentius/chant/lexicon";
5
+
6
+ export const compositeCatalog: CompositeEntry[] = [
7
+ {
8
+ "name": "DockerOtelCollector",
9
+ "lexicon": "docker",
10
+ "description": "Create a DockerOtelCollector composite.",
11
+ "bundles": [
12
+ "DockerConfig",
13
+ "Service"
14
+ ],
15
+ "params": [
16
+ {
17
+ "name": "image",
18
+ "type": "string",
19
+ "required": false,
20
+ "description": "Collector image (default: the contrib image at the otel lexicon's pinned collector version)."
21
+ },
22
+ {
23
+ "name": "config",
24
+ "type": "Iterable<Declarable>",
25
+ "required": false,
26
+ "description": "The collector config, as otel lexicon entities (components and pipelines)."
27
+ },
28
+ {
29
+ "name": "exporters",
30
+ "type": "OTelComponent<\"exporter\", string, any>[]",
31
+ "required": false,
32
+ "description": "Exporters for the default config (default: one `debug` exporter)."
33
+ },
34
+ {
35
+ "name": "signals",
36
+ "type": "Signal[]",
37
+ "required": false,
38
+ "description": "Signals the default config has pipelines for (default: traces, metrics and logs)."
39
+ },
40
+ {
41
+ "name": "publishPorts",
42
+ "type": "boolean",
43
+ "required": false,
44
+ "description": "Publish the receiver ports on the host (default: true)."
45
+ },
46
+ {
47
+ "name": "restart",
48
+ "type": "string",
49
+ "required": false,
50
+ "description": "Restart policy (default: \"unless-stopped\")."
51
+ },
52
+ {
53
+ "name": "defaults",
54
+ "type": "{ service?: Partial<Record<string, unknown>>; config?: Partial<Record<string, unknown>>; }",
55
+ "required": false,
56
+ "description": "Per-member defaults for fine-grained overrides."
57
+ }
58
+ ]
59
+ }
60
+ ];
package/src/plugin.ts CHANGED
@@ -5,6 +5,7 @@
5
5
  * and code generation for Docker Compose and Dockerfile resources.
6
6
  */
7
7
 
8
+ import { compositeCatalog } from "./composites/catalog";
8
9
  import type { LexiconPlugin, IntrinsicDef, InitTemplateSet } from "@intentius/chant/lexicon";
9
10
  import { detectTemplate } from "./detect";
10
11
  import type { LintRule } from "@intentius/chant/lint/rule";
@@ -161,6 +162,10 @@ export const api = new Service({
161
162
  console.error(`Packaged ${stats.resources} entities, ${stats.ruleCount} rules, ${stats.skillCount} skills`);
162
163
  },
163
164
 
165
+ composites() {
166
+ return compositeCatalog;
167
+ },
168
+
164
169
  mcpTools() {
165
170
  return [createDiffTool(dockerSerializer, "Compare current build output against previous output for Docker Compose", "docker")];
166
171
  },