@intentius/chant-lexicon-fountain 0.34.0 → 0.37.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "1f8298cb243abce8502bb115152fd11c88547289737f0c2fa0df7b8129639f53",
4
+ "manifest.json": "e8c6c85ccd37d39fa2ae657405f188426b14ab789564164377eec93daa5918ed",
5
5
  "meta.json": "6666b7a77db9210a329219c6a5e107e5ae8794a34542f7310ce16d9bf95c64f5",
6
6
  "types/index.d.ts": "1dfdcba184fffcf464dac7d1d71ef7abed2ae02a8d638c0de50e0b0317b7eb01",
7
7
  "rules/ftn001-no-secret-literals.ts": "897a4ce1ec790b3c1540d32892603bd33ff4bf30eb6ba4cd2565dee356d4962e",
@@ -17,5 +17,5 @@
17
17
  "skills/chant-fountain-secrets.md": "27e349a91589510a92e518c7d7824a4a322cab5ef242cf5799373a55cbfcd1cd",
18
18
  "skills/chant-fountain-locked-sandboxes.md": "de82f06cb3a08ba6bf3ae45fb9869e21d6da18b9ebe0fc769da8aebaceea7dd1"
19
19
  },
20
- "composite": "3321e342144da2914f44f7085c4bccfc85055c16cf8435288283c28019b4149b"
20
+ "composite": "79ded5765d9afa86a5c159afe97f192472c3aaedfa93144b8f39d62529d06d47"
21
21
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fountain",
3
- "version": "0.34.0",
3
+ "version": "0.37.0",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "Fountain"
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-fountain",
3
- "version": "0.34.0",
3
+ "version": "0.37.0",
4
4
  "type": "module",
5
5
  "description": "Fountain lexicon for chant — sandboxed agent environments, vaults, and agents as typed estate",
6
6
  "license": "Apache-2.0",
@@ -50,7 +50,7 @@
50
50
  "bundle": "tsx src/package-cli.ts"
51
51
  },
52
52
  "peerDependencies": {
53
- "@intentius/chant": "^0.34.0",
53
+ "@intentius/chant": "^0.37.0",
54
54
  "typescript": "^5.9.3"
55
55
  },
56
56
  "devDependencies": {
@@ -1,5 +1,6 @@
1
1
  import { describe, expect, it } from "vitest";
2
2
  import { fountainSerializer } from "./serializer";
3
+ import { parseManifest } from "./op/activities/fountain-apply";
3
4
  import type { Declarable } from "@intentius/chant";
4
5
 
5
6
  function entity(entityType: string, props: Record<string, unknown>): Declarable {
@@ -85,6 +86,56 @@ describe("fountain serializer", () => {
85
86
  expect(out).toContain('description: "true"');
86
87
  });
87
88
 
89
+ it("folds the first line of a map list item onto the dash", () => {
90
+ const agent = entity("Fountain::V1::Agent", {
91
+ name: "a",
92
+ model: "anthropic/claude-sonnet-4-6",
93
+ runtime: "claude",
94
+ skills: [{ source: "anthropics/skills", name: "frontend-design" }],
95
+ });
96
+
97
+ const out = fountainSerializer.serialize(new Map([["a", agent]])) as string;
98
+ expect(out).toContain(" - source: anthropics/skills\n name: frontend-design");
99
+ expect(out).not.toMatch(/^\s*-$/m);
100
+ });
101
+
102
+ it("round-trips its own output through parseManifest", () => {
103
+ // A list-of-maps field plus a spec-level `metadata` key is the shape
104
+ // that used to collapse in parseYAML (#1286): the list item's keys
105
+ // leaked to the top level and spec.metadata clobbered the document
106
+ // metadata, blanking every resource name.
107
+ const env = entity("Fountain::V1::Environment", {
108
+ name: "e",
109
+ secrets: [{ key: "GITHUB_TOKEN", value: "infisical:///dev/GITHUB_TOKEN" }],
110
+ metadata: { "managed-by": "chant" },
111
+ });
112
+ const agent = entity("Fountain::V1::Agent", {
113
+ name: "a",
114
+ model: "anthropic/claude-sonnet-4-6",
115
+ runtime: "claude",
116
+ environment: env,
117
+ skills: [{ source: "anthropics/skills", name: "frontend-design" }],
118
+ metadata: { "managed-by": "chant" },
119
+ });
120
+
121
+ const out = fountainSerializer.serialize(
122
+ new Map([
123
+ ["e", env],
124
+ ["a", agent],
125
+ ]),
126
+ ) as string;
127
+ const resources = parseManifest(out);
128
+
129
+ expect(resources.map((r) => `${r.kind}/${r.name}`)).toEqual(["Environment/e", "Agent/a"]);
130
+ expect(resources[0].spec.secrets).toEqual([
131
+ { key: "GITHUB_TOKEN", value: "infisical:///dev/GITHUB_TOKEN" },
132
+ ]);
133
+ expect(resources[1].spec.skills).toEqual([
134
+ { source: "anthropics/skills", name: "frontend-design" },
135
+ ]);
136
+ expect(resources[1].spec.metadata).toEqual({ "managed-by": "chant" });
137
+ });
138
+
88
139
  it("does not use YAML aliases or tags for substitution references", () => {
89
140
  const agent = entity("Fountain::V1::Agent", {
90
141
  name: "a",
package/src/serializer.ts CHANGED
@@ -90,8 +90,12 @@ function toYaml(value: unknown, indent = 0): string {
90
90
  if (isScalar(item)) {
91
91
  out += `${pad}- ${scalar(item)}\n`;
92
92
  } else {
93
+ // Fold the item's first line onto the dash (`- key: value`) rather
94
+ // than emitting the dash on its own line: `- ` is exactly as wide
95
+ // as one indent level, so continuation lines already align, and
96
+ // parseYAML can't read the dash-alone form (#1286).
93
97
  const body = toYaml(item, indent + 1);
94
- out += `${pad}-\n${body}`;
98
+ out += `${pad}- ${body.slice(pad.length + 2)}`;
95
99
  }
96
100
  }
97
101
  return out;