@cuzfrog/pi-module-gates 0.13.2 → 0.13.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuzfrog/pi-module-gates",
3
- "version": "0.13.2",
3
+ "version": "0.13.3",
4
4
  "description": "pi extension that controls the entropy of the codebase by enforcing code module boundaries.",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -5,14 +5,14 @@ export function buildSystemPromptHint(
5
5
  index: ModuleIndex,
6
6
  systemPrompt: string,
7
7
  descriptorFileName: string,
8
- moduleDescriptorReadonly: ModuleGateConfig["moduleDescriptorReadonly"],
8
+ config: ModuleGateConfig,
9
9
  ): string {
10
10
  if (index.contracts.length === 0) return systemPrompt;
11
11
 
12
12
  const descriptorNote =
13
- moduleDescriptorReadonly === "frontmatter"
13
+ config.moduleDescriptorReadonly === "frontmatter"
14
14
  ? ` The frontmatter of \`${descriptorFileName}\` is readonly.`
15
- : moduleDescriptorReadonly === "file"
15
+ : config.moduleDescriptorReadonly === "file"
16
16
  ? ` The \`${descriptorFileName}\` file itself is readonly.`
17
17
  : "";
18
18
 
@@ -23,6 +23,6 @@ This project uses \`${descriptorFileName}\`(case-insensitive) files to declare v
23
23
  If you cannot comply, reconsider your design, if impossible, raise to the user with tradeoffs.
24
24
  Each \`${descriptorFileName}\` gates its branching point in the tree.
25
25
  A \`${descriptorFileName}\` with a \`visible\` list means only entries in the list are allowed to be visible outside the module.
26
- \`readonly\` files are readonly; \`frozen\` files cannot grow their surface size (no new exports).${descriptorNote}
26
+ \`readonly\` files are readonly; \`frozen\` files cannot add new exports.${descriptorNote}
27
27
  Violations will be blocked.`;
28
28
  }
package/src/index.ts CHANGED
@@ -37,7 +37,7 @@ export default function (pi: ExtensionAPI): void {
37
37
  pi.on("before_agent_start", async (event): Promise<BeforeAgentStartEventResult | void> => {
38
38
  if (index.contracts.length === 0) return;
39
39
  return {
40
- systemPrompt: buildSystemPromptHint(index, event.systemPrompt, config.moduleDescriptorFileName, config.moduleDescriptorReadonly),
40
+ systemPrompt: buildSystemPromptHint(index, event.systemPrompt, config.moduleDescriptorFileName, config),
41
41
  };
42
42
  });
43
43