@solaqua/skul 0.1.0 → 0.1.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.
@@ -0,0 +1,38 @@
1
+ /** Formats one expected root-instruction bundle block with Skul boundary markers. */
2
+ export declare function formatRootInstructionBundleBlock(bundle: string, content: string, source?: string): string;
3
+ /** Formats one expected tracked root-instruction shadow block. */
4
+ export declare function formatTrackedRootInstructionShadowBlock(bundle: string, content: string): string;
5
+ /** Joins expected root-instruction document parts using the production document layout. */
6
+ export declare function formatExpectedRootInstructionDocument(...parts: string[]): string;
7
+ /** Writes one root-instruction test bundle fixture into the local cache layout. */
8
+ export declare function writeRootInstructionBundleFixture(homeDir: string, options: {
9
+ bundle: string;
10
+ content: string;
11
+ source?: string;
12
+ agent?: "codex" | "claude-code";
13
+ filePath?: string;
14
+ extraTools?: Record<string, object>;
15
+ extraFiles?: Record<string, string>;
16
+ }, helpers: {
17
+ writeManifest: (homeDir: string, source: string, bundle: string, manifest: object) => void;
18
+ writeBundleFile: (homeDir: string, source: string | undefined, bundle: string, relativePath: string, content: string) => void;
19
+ }): void;
20
+ /** Writes multiple shared root-instruction test bundle fixtures into the local cache layout. */
21
+ export declare function setupSharedRootInstructionBundles(homeDir: string, bundles: Array<{
22
+ bundle: string;
23
+ content: string;
24
+ source?: string;
25
+ agent?: "codex" | "claude-code";
26
+ filePath?: string;
27
+ extraTools?: Record<string, object>;
28
+ extraFiles?: Record<string, string>;
29
+ }>, helpers: {
30
+ writeManifest: (homeDir: string, source: string, bundle: string, manifest: object) => void;
31
+ writeBundleFile: (homeDir: string, source: string | undefined, bundle: string, relativePath: string, content: string) => void;
32
+ }): void;
33
+ /** Asserts the exact rendered contents of one managed root-instruction file. */
34
+ export declare function expectRootInstructionDocument(repoRoot: string, fileName: "AGENTS.md" | "CLAUDE.md", ...parts: string[]): void;
35
+ /** Asserts the exact rendered contents of `AGENTS.md`. */
36
+ export declare function expectAgentsDocument(repoRoot: string, ...parts: string[]): void;
37
+ /** Asserts the exact rendered contents of `CLAUDE.md`. */
38
+ export declare function expectClaudeDocument(repoRoot: string, ...parts: string[]): void;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.formatRootInstructionBundleBlock = formatRootInstructionBundleBlock;
7
+ exports.formatTrackedRootInstructionShadowBlock = formatTrackedRootInstructionShadowBlock;
8
+ exports.formatExpectedRootInstructionDocument = formatExpectedRootInstructionDocument;
9
+ exports.writeRootInstructionBundleFixture = writeRootInstructionBundleFixture;
10
+ exports.setupSharedRootInstructionBundles = setupSharedRootInstructionBundles;
11
+ exports.expectRootInstructionDocument = expectRootInstructionDocument;
12
+ exports.expectAgentsDocument = expectAgentsDocument;
13
+ exports.expectClaudeDocument = expectClaudeDocument;
14
+ const node_fs_1 = __importDefault(require("node:fs"));
15
+ const node_path_1 = __importDefault(require("node:path"));
16
+ const vitest_1 = require("vitest");
17
+ /** Formats one expected root-instruction bundle block with Skul boundary markers. */
18
+ function formatRootInstructionBundleBlock(bundle, content, source) {
19
+ const label = source ? `${bundle} (${source})` : bundle;
20
+ const normalizedContent = content.replace(/\s+$/, "");
21
+ return `<!-- BEGIN SKUL BUNDLE: ${label} -->\n${normalizedContent}\n<!-- END SKUL BUNDLE: ${label} -->`;
22
+ }
23
+ /** Formats one expected tracked root-instruction shadow block. */
24
+ function formatTrackedRootInstructionShadowBlock(bundle, content) {
25
+ const normalizedContent = content.replace(/\s+$/, "");
26
+ return `<!-- SKUL SHADOW START bundle=${bundle} -->\n${normalizedContent}\n<!-- SKUL SHADOW END -->`;
27
+ }
28
+ /** Joins expected root-instruction document parts using the production document layout. */
29
+ function formatExpectedRootInstructionDocument(...parts) {
30
+ return `${parts
31
+ .map((part) => part.replace(/\s+$/, ""))
32
+ .filter((part) => part.length > 0)
33
+ .join("\n\n")}\n`;
34
+ }
35
+ /** Writes one root-instruction test bundle fixture into the local cache layout. */
36
+ function writeRootInstructionBundleFixture(homeDir, options, helpers) {
37
+ const source = options.source ?? "github.com/user/ai-vault";
38
+ const agent = options.agent ?? "codex";
39
+ const filePath = options.filePath ?? (agent === "codex" ? "AGENTS.md" : "CLAUDE.md");
40
+ helpers.writeManifest(homeDir, source, options.bundle, {
41
+ name: options.bundle,
42
+ tools: {
43
+ ...options.extraTools,
44
+ [agent]: { root_instruction: { path: filePath } },
45
+ },
46
+ });
47
+ helpers.writeBundleFile(homeDir, source, options.bundle, filePath, options.content);
48
+ for (const [relativePath, content] of Object.entries(options.extraFiles ?? {})) {
49
+ helpers.writeBundleFile(homeDir, source, options.bundle, relativePath, content);
50
+ }
51
+ }
52
+ /** Writes multiple shared root-instruction test bundle fixtures into the local cache layout. */
53
+ function setupSharedRootInstructionBundles(homeDir, bundles, helpers) {
54
+ for (const bundle of bundles) {
55
+ writeRootInstructionBundleFixture(homeDir, bundle, helpers);
56
+ }
57
+ }
58
+ /** Asserts the exact rendered contents of one managed root-instruction file. */
59
+ function expectRootInstructionDocument(repoRoot, fileName, ...parts) {
60
+ (0, vitest_1.expect)(node_fs_1.default.readFileSync(node_path_1.default.join(repoRoot, fileName), "utf8")).toBe(formatExpectedRootInstructionDocument(...parts));
61
+ }
62
+ /** Asserts the exact rendered contents of `AGENTS.md`. */
63
+ function expectAgentsDocument(repoRoot, ...parts) {
64
+ expectRootInstructionDocument(repoRoot, "AGENTS.md", ...parts);
65
+ }
66
+ /** Asserts the exact rendered contents of `CLAUDE.md`. */
67
+ function expectClaudeDocument(repoRoot, ...parts) {
68
+ expectRootInstructionDocument(repoRoot, "CLAUDE.md", ...parts);
69
+ }
70
+ //# sourceMappingURL=testing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.js","sourceRoot":"","sources":["../../src/utils/testing.ts"],"names":[],"mappings":";;;;;AAMA,4EAQC;AAGD,0FAMC;AAGD,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gB,oBAAoB,CAClC,QAAgB,EAChB,GAAG,KAAe;IAElB,6BAA6B,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,CAAC;AACjE,CAAC;AAED,0DAA0D;AAC1D,SAAgB,oBAAoB,CAClC,QAAgB,EAChB,GAAG,KAAe;IAElB,6BAA6B,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,CAAC;AACjE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solaqua/skul",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "AI configuration layer manager for project-scoped bundles (project setup only)",
5
5
  "homepage": "https://sjquant.github.io/skul/",
6
6
  "bugs": {