@nepopsx/cli 0.0.3 → 0.0.5

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 (168) hide show
  1. package/dist/agents/configuration.d.ts +9 -0
  2. package/dist/agents/configuration.d.ts.map +1 -0
  3. package/dist/agents/configuration.js +57 -0
  4. package/dist/agents/configuration.js.map +1 -0
  5. package/dist/agents/remote-config.d.ts +30 -0
  6. package/dist/agents/remote-config.d.ts.map +1 -0
  7. package/dist/agents/remote-config.js +102 -0
  8. package/dist/agents/remote-config.js.map +1 -0
  9. package/dist/commands/activate.d.ts.map +1 -1
  10. package/dist/commands/activate.js +4 -3
  11. package/dist/commands/activate.js.map +1 -1
  12. package/dist/commands/decode.js +2 -2
  13. package/dist/commands/decode.js.map +1 -1
  14. package/dist/commands/doctor.js +16 -16
  15. package/dist/commands/doctor.js.map +1 -1
  16. package/dist/commands/init.d.ts.map +1 -1
  17. package/dist/commands/init.js +353 -18
  18. package/dist/commands/init.js.map +1 -1
  19. package/dist/commands/install.d.ts +1 -0
  20. package/dist/commands/install.d.ts.map +1 -1
  21. package/dist/commands/install.js +253 -25
  22. package/dist/commands/install.js.map +1 -1
  23. package/dist/commands/login.d.ts +6 -0
  24. package/dist/commands/login.d.ts.map +1 -0
  25. package/dist/commands/login.js +108 -0
  26. package/dist/commands/login.js.map +1 -0
  27. package/dist/commands/push-learnings.d.ts +14 -0
  28. package/dist/commands/push-learnings.d.ts.map +1 -0
  29. package/dist/commands/push-learnings.js +186 -0
  30. package/dist/commands/push-learnings.js.map +1 -0
  31. package/dist/commands/scan.d.ts +2 -0
  32. package/dist/commands/scan.d.ts.map +1 -0
  33. package/dist/commands/scan.js +520 -0
  34. package/dist/commands/scan.js.map +1 -0
  35. package/dist/commands/sync.d.ts +2 -0
  36. package/dist/commands/sync.d.ts.map +1 -1
  37. package/dist/commands/sync.js +203 -234
  38. package/dist/commands/sync.js.map +1 -1
  39. package/dist/config/api-config.d.ts.map +1 -1
  40. package/dist/config/api-config.js +4 -0
  41. package/dist/config/api-config.js.map +1 -1
  42. package/dist/constants.d.ts +7 -0
  43. package/dist/constants.d.ts.map +1 -0
  44. package/dist/constants.js +7 -0
  45. package/dist/constants.js.map +1 -0
  46. package/dist/customs/instructions.d.ts +3 -0
  47. package/dist/customs/instructions.d.ts.map +1 -0
  48. package/dist/customs/instructions.js +51 -0
  49. package/dist/customs/instructions.js.map +1 -0
  50. package/dist/enrichment/confirm.d.ts +17 -0
  51. package/dist/enrichment/confirm.d.ts.map +1 -0
  52. package/dist/enrichment/confirm.js +44 -0
  53. package/dist/enrichment/confirm.js.map +1 -0
  54. package/dist/enrichment/state.d.ts +8 -0
  55. package/dist/enrichment/state.d.ts.map +1 -0
  56. package/dist/enrichment/state.js +107 -0
  57. package/dist/enrichment/state.js.map +1 -0
  58. package/dist/enrichment/types.d.ts +13 -0
  59. package/dist/enrichment/types.d.ts.map +1 -0
  60. package/dist/enrichment/types.js +2 -0
  61. package/dist/enrichment/types.js.map +1 -0
  62. package/dist/enrichment/workflow.d.ts +35 -0
  63. package/dist/enrichment/workflow.d.ts.map +1 -0
  64. package/dist/enrichment/workflow.js +305 -0
  65. package/dist/enrichment/workflow.js.map +1 -0
  66. package/dist/generator/builtin-templates.d.ts +2 -1
  67. package/dist/generator/builtin-templates.d.ts.map +1 -1
  68. package/dist/generator/builtin-templates.js +161 -2
  69. package/dist/generator/builtin-templates.js.map +1 -1
  70. package/dist/generator/package-renderer.d.ts +29 -0
  71. package/dist/generator/package-renderer.d.ts.map +1 -0
  72. package/dist/generator/package-renderer.js +123 -0
  73. package/dist/generator/package-renderer.js.map +1 -0
  74. package/dist/generator/render.d.ts +14 -63
  75. package/dist/generator/render.d.ts.map +1 -1
  76. package/dist/generator/render.js +30 -176
  77. package/dist/generator/render.js.map +1 -1
  78. package/dist/index.js +42 -2
  79. package/dist/index.js.map +1 -1
  80. package/dist/licensing/installer.d.ts +51 -0
  81. package/dist/licensing/installer.d.ts.map +1 -0
  82. package/dist/licensing/installer.js +112 -0
  83. package/dist/licensing/installer.js.map +1 -0
  84. package/dist/licensing/license-manager.d.ts +6 -0
  85. package/dist/licensing/license-manager.d.ts.map +1 -1
  86. package/dist/licensing/license-manager.js +12 -35
  87. package/dist/licensing/license-manager.js.map +1 -1
  88. package/dist/licensing/template-fetch.d.ts +3 -2
  89. package/dist/licensing/template-fetch.d.ts.map +1 -1
  90. package/dist/licensing/template-fetch.js +10 -41
  91. package/dist/licensing/template-fetch.js.map +1 -1
  92. package/dist/scan/__tests__/context-gatherer.test.d.ts +2 -0
  93. package/dist/scan/__tests__/context-gatherer.test.d.ts.map +1 -0
  94. package/dist/scan/__tests__/context-gatherer.test.js +111 -0
  95. package/dist/scan/__tests__/context-gatherer.test.js.map +1 -0
  96. package/dist/scan/__tests__/merge.test.d.ts +2 -0
  97. package/dist/scan/__tests__/merge.test.d.ts.map +1 -0
  98. package/dist/scan/__tests__/merge.test.js +163 -0
  99. package/dist/scan/__tests__/merge.test.js.map +1 -0
  100. package/dist/scan/auto-bootstrap.d.ts +3 -0
  101. package/dist/scan/auto-bootstrap.d.ts.map +1 -0
  102. package/dist/scan/auto-bootstrap.js +30 -0
  103. package/dist/scan/auto-bootstrap.js.map +1 -0
  104. package/dist/scan/config.d.ts +24 -0
  105. package/dist/scan/config.d.ts.map +1 -0
  106. package/dist/scan/config.js +77 -0
  107. package/dist/scan/config.js.map +1 -0
  108. package/dist/scan/context/gatherer.d.ts +13 -0
  109. package/dist/scan/context/gatherer.d.ts.map +1 -0
  110. package/dist/scan/context/gatherer.js +97 -0
  111. package/dist/scan/context/gatherer.js.map +1 -0
  112. package/dist/scan/context/gitignore.d.ts +9 -0
  113. package/dist/scan/context/gitignore.d.ts.map +1 -0
  114. package/dist/scan/context/gitignore.js +50 -0
  115. package/dist/scan/context/gitignore.js.map +1 -0
  116. package/dist/scan/context/patterns.d.ts +14 -0
  117. package/dist/scan/context/patterns.d.ts.map +1 -0
  118. package/dist/scan/context/patterns.js +159 -0
  119. package/dist/scan/context/patterns.js.map +1 -0
  120. package/dist/scan/customs/writer.d.ts +6 -0
  121. package/dist/scan/customs/writer.d.ts.map +1 -0
  122. package/dist/scan/customs/writer.js +149 -0
  123. package/dist/scan/customs/writer.js.map +1 -0
  124. package/dist/scan/llm/anthropic.d.ts +11 -0
  125. package/dist/scan/llm/anthropic.d.ts.map +1 -0
  126. package/dist/scan/llm/anthropic.js +89 -0
  127. package/dist/scan/llm/anthropic.js.map +1 -0
  128. package/dist/scan/llm/factory.d.ts +4 -0
  129. package/dist/scan/llm/factory.d.ts.map +1 -0
  130. package/dist/scan/llm/factory.js +20 -0
  131. package/dist/scan/llm/factory.js.map +1 -0
  132. package/dist/scan/llm/ollama.d.ts +11 -0
  133. package/dist/scan/llm/ollama.d.ts.map +1 -0
  134. package/dist/scan/llm/ollama.js +64 -0
  135. package/dist/scan/llm/ollama.js.map +1 -0
  136. package/dist/scan/llm/openai.d.ts +12 -0
  137. package/dist/scan/llm/openai.d.ts.map +1 -0
  138. package/dist/scan/llm/openai.js +78 -0
  139. package/dist/scan/llm/openai.js.map +1 -0
  140. package/dist/scan/llm/types.d.ts +23 -0
  141. package/dist/scan/llm/types.d.ts.map +1 -0
  142. package/dist/scan/llm/types.js +3 -0
  143. package/dist/scan/llm/types.js.map +1 -0
  144. package/dist/scan/merge/diff-display.d.ts +11 -0
  145. package/dist/scan/merge/diff-display.d.ts.map +1 -0
  146. package/dist/scan/merge/diff-display.js +72 -0
  147. package/dist/scan/merge/diff-display.js.map +1 -0
  148. package/dist/scan/prompt/agent.d.ts +23 -0
  149. package/dist/scan/prompt/agent.d.ts.map +1 -0
  150. package/dist/scan/prompt/agent.js +95 -0
  151. package/dist/scan/prompt/agent.js.map +1 -0
  152. package/dist/scan/prompt/builder.d.ts +16 -0
  153. package/dist/scan/prompt/builder.d.ts.map +1 -0
  154. package/dist/scan/prompt/builder.js +64 -0
  155. package/dist/scan/prompt/builder.js.map +1 -0
  156. package/dist/scan/prompt/schema.d.ts +7 -0
  157. package/dist/scan/prompt/schema.d.ts.map +1 -0
  158. package/dist/scan/prompt/schema.js +52 -0
  159. package/dist/scan/prompt/schema.js.map +1 -0
  160. package/dist/security/scanner.d.ts +3 -40
  161. package/dist/security/scanner.d.ts.map +1 -1
  162. package/dist/security/scanner.js +3 -169
  163. package/dist/security/scanner.js.map +1 -1
  164. package/dist/utils/fetch.d.ts +9 -0
  165. package/dist/utils/fetch.d.ts.map +1 -0
  166. package/dist/utils/fetch.js +18 -0
  167. package/dist/utils/fetch.js.map +1 -0
  168. package/package.json +15 -12
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Package renderer — maps already-rendered agent bundles into WriteOperations.
3
+ *
4
+ * Two rendering modes:
5
+ * renderBundleForInstall — all files land under .github/ (preserves bundle layout)
6
+ * renderAgentBundle — remaps schemas to openspec/ (used by sync)
7
+ *
8
+ * Backend bundles are already rendered server-side. The CLI only remaps paths.
9
+ */
10
+ import { join } from 'node:path';
11
+ import { isReservedBundleRootPath } from '../agents/configuration.js';
12
+ // ─── Install mode ───────────────────────────────────────────
13
+ /**
14
+ * Render a downloaded agent bundle for `nepopsx install`.
15
+ *
16
+ * All files are written under `.github/<relativePath>` with .hbs stripped.
17
+ * This preserves the bundle's directory layout (agents/, prompts/, schemas/,
18
+ * partials/) exactly as the agent author designed.
19
+ *
20
+ * Decrypted .hbs source is kept in memory only — never touches disk.
21
+ */
22
+ export function renderBundleForInstall(bundle) {
23
+ const operations = [];
24
+ for (const [relativePath, rawContent] of Object.entries(bundle.templates)) {
25
+ if (isReservedBundleRootPath(relativePath))
26
+ continue;
27
+ const isHbs = relativePath.endsWith('.hbs');
28
+ const outputPath = isHbs ? relativePath.replace(/\.hbs$/, '') : relativePath;
29
+ const content = rawContent;
30
+ if (content.trim().length === 0)
31
+ continue;
32
+ operations.push({
33
+ path: join('.github', outputPath),
34
+ content,
35
+ source: `remote:${bundle.agent}/${relativePath}`,
36
+ });
37
+ }
38
+ return operations;
39
+ }
40
+ // ─── Sync mode ──────────────────────────────────────────────
41
+ /**
42
+ * Render all templates from an agent bundle for `nepopsx sync`.
43
+ *
44
+ * Uses prefix-based remapping so schemas land in openspec/ and
45
+ * generated agent/prompt files land under .github/.
46
+ */
47
+ export function renderAgentBundle(bundle) {
48
+ const operations = [];
49
+ const handledPaths = new Set();
50
+ const templateDirs = [
51
+ { prefix: 'agents/', output: '.github/agents' },
52
+ { prefix: 'prompts/', output: '.github/prompts' },
53
+ { prefix: 'instructions/', output: '.github/instructions' },
54
+ { prefix: 'skills/', output: '.github/skills' },
55
+ ];
56
+ for (const { prefix, output } of templateDirs) {
57
+ for (const [relativePath, templateSource] of Object.entries(bundle.templates)) {
58
+ if (!relativePath.startsWith(prefix))
59
+ continue;
60
+ const outputFileName = relativePath.slice(prefix.length).replace(/\.hbs$/, '');
61
+ const content = templateSource;
62
+ if (content.trim().length === 0)
63
+ continue;
64
+ handledPaths.add(relativePath);
65
+ operations.push({
66
+ path: join(output, outputFileName),
67
+ content,
68
+ source: `remote:${bundle.agent}/${relativePath}`,
69
+ });
70
+ }
71
+ }
72
+ for (const [relativePath, rawContent] of Object.entries(bundle.templates)) {
73
+ if (!relativePath.startsWith('partials/'))
74
+ continue;
75
+ const baseName = relativePath.slice('partials/'.length);
76
+ const outputFileName = baseName.replace(/\.hbs$/, '');
77
+ const content = rawContent;
78
+ if (content.trim().length === 0)
79
+ continue;
80
+ handledPaths.add(relativePath);
81
+ operations.push({
82
+ path: join('.github/partials', outputFileName),
83
+ content,
84
+ source: `remote:${bundle.agent}/${relativePath}`,
85
+ });
86
+ }
87
+ copySyncSchemaFiles(bundle.templates, bundle.agent, operations);
88
+ for (const [relativePath, rawContent] of Object.entries(bundle.templates)) {
89
+ if (handledPaths.has(relativePath) || isReservedBundleRootPath(relativePath)) {
90
+ continue;
91
+ }
92
+ if (relativePath.startsWith('schemas/')) {
93
+ continue;
94
+ }
95
+ const outputPath = relativePath.replace(/\.hbs$/, '');
96
+ const content = rawContent;
97
+ if (content.trim().length === 0)
98
+ continue;
99
+ operations.push({
100
+ path: outputPath,
101
+ content,
102
+ source: `remote:${bundle.agent}/${relativePath}`,
103
+ });
104
+ }
105
+ return operations;
106
+ }
107
+ // ─── Internals ──────────────────────────────────────────────
108
+ function copySyncSchemaFiles(templateMap, agentName, operations) {
109
+ for (const [relativePath, rawContent] of Object.entries(templateMap)) {
110
+ if (!relativePath.startsWith('schemas/'))
111
+ continue;
112
+ const outputName = relativePath.slice('schemas/'.length).replace(/\.hbs$/, '');
113
+ const content = rawContent;
114
+ if (content.trim().length === 0)
115
+ continue;
116
+ operations.push({
117
+ path: `openspec/schemas/${agentName}/${outputName}`,
118
+ content,
119
+ source: `remote:${agentName}/${relativePath}`,
120
+ });
121
+ }
122
+ }
123
+ //# sourceMappingURL=package-renderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-renderer.js","sourceRoot":"","sources":["../../src/generator/package-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,+DAA+D;AAE/D;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CACpC,MAAsB;IAEtB,MAAM,UAAU,GAAqB,EAAE,CAAC;IAExC,KAAK,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;QAC1E,IAAI,wBAAwB,CAAC,YAAY,CAAC;YAAE,SAAS;QAErD,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC5C,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;QAE7E,MAAM,OAAO,GA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* Parsed custom instruction file.
4
- */
5
- export interface CustomInstruction {
6
- content: string;
7
- applies_to?: string[];
8
- scope?: string;
9
- source: string;
10
- }
11
1
  /**
12
- * Set the philosophy markdown block for the current sync run.
2
+ * CLI renderer wraps @nepopsx/core/renderer with disk access and license watermarking.
3
+ * Pure template rendering is delegated to core; this module adds:
4
+ * - disk-based partial registration (registerAgentPartials, clearPartials)
5
+ * - renderTemplateFile (reads template from disk)
6
+ * - applyLicenseWatermark (steganographic fingerprint)
13
7
  */
14
- export declare function setPhilosophyBlock(block: string): void;
15
- /**
16
- * Set the custom instructions for the current sync run.
17
- */
18
- export declare function setCustomInstructions(customs: CustomInstruction[]): void;
19
- export interface RenderContext {
20
- config: WorkspaceConfig;
21
- agent?: {
22
- name: string;
23
- version: string;
24
- };
25
- timestamp: string;
26
- }
8
+ import type { WorkspaceConfig, WatermarkData } from '@nepopsx/core';
9
+ import { renderTemplate, registerAgentPartialsFromMap, clearPartialNames, renderTemplateMap, setPhilosophyBlock, setCustomInstructions, type AgentRenderContext, type CustomInstruction, type RenderContext } from '@nepopsx/core';
10
+ export { renderTemplate, registerAgentPartialsFromMap, clearPartialNames, renderTemplateMap, setPhilosophyBlock, setCustomInstructions, type AgentRenderContext, type CustomInstruction, type RenderContext, };
27
11
  /**
28
- * Register all partials from an agent package's partials/ directory.
29
- * .hbs partials are pre-rendered with config context; .md partials are included as-is.
12
+ * Register all partials from a package's partials/ directory on disk.
30
13
  */
31
- export declare function registerAgentPartials(partialsDir: string, config: WorkspaceConfig, agentMeta?: {
32
- name: string;
33
- version: string;
34
- }): void;
14
+ export declare function registerAgentPartials(partialsDir: string, config: WorkspaceConfig, agentMeta?: AgentRenderContext): void;
35
15
  /**
36
- * Unregister all partials (call between agent packages to avoid cross-contamination).
16
+ * Unregister all partials loaded from a partials/ directory.
37
17
  */
38
18
  export declare function clearPartials(partialsDir: string): void;
39
19
  /**
40
- * Register partials from a remote template map keyed by relative file path.
41
- * Returns the partial names so they can be unregistered after rendering.
42
- */
43
- export declare function registerAgentPartialsFromMap(templateMap: Record<string, string>, config: WorkspaceConfig, agentMeta?: {
44
- name: string;
45
- version: string;
46
- }): string[];
47
- export declare function clearPartialNames(partialNames: string[]): void;
48
- /**
49
- * Render a Handlebars template string with workspace config context.
50
- * Context is sanitized to prevent prototype pollution attacks.
51
- */
52
- export declare function renderTemplate(templateSource: string, config: WorkspaceConfig, agentMeta?: {
53
- name: string;
54
- version: string;
55
- }): string;
56
- /**
57
- * Render a template file.
58
- */
59
- export declare function renderTemplateFile(templatePath: string, config: WorkspaceConfig, agentMeta?: {
60
- name: string;
61
- version: string;
62
- }): string;
63
- /**
64
- * Set watermark data for the current sync run.
65
- * When set, every rendered file gets a watermark header + steganographic fingerprint.
66
- * Pass null to disable (e.g., dev mode / free tier).
20
+ * Render a template file from disk.
67
21
  */
22
+ export declare function renderTemplateFile(templatePath: string, config: WorkspaceConfig, agentMeta?: AgentRenderContext): string;
68
23
  export declare function setWatermarkData(data: WatermarkData | null): void;
69
- /**
70
- * Apply watermark header + steganographic fingerprint to rendered content.
71
- * Should be called AFTER Handlebars rendering, on the final output.
72
- */
73
- export declare function applyLicenseWatermark(content: string): string;
24
+ export declare function applyLicenseWatermark(content: string, outputPath?: string): string;
74
25
  //# sourceMappingURL=render.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/generator/render.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAW,aAAa,EAAE,MAAM,eAAe,CAAC;AAyE7E;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAKD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAEtD;AAED;;GAEG;AACH,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,gBAAgB,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI,CAEjE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAW7D"}
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/generator/render.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAEL,cAAc,EACd,4BAA4B,EAC5B,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EAErB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AAIvB,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,aAAa,GACnB,CAAC;AAIF;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,eAAe,EACvB,SAAS,CAAC,EAAE,kBAAkB,GAC7B,IAAI,CAiBN;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAQvD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,eAAe,EACvB,SAAS,CAAC,EAAE,kBAAkB,GAC7B,MAAM,CAGR;AAMD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI,CAEjE;AAeD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAMlF"}
@@ -1,118 +1,20 @@
1
+ /**
2
+ * CLI renderer — wraps @nepopsx/core/renderer with disk access and license watermarking.
3
+ * Pure template rendering is delegated to core; this module adds:
4
+ * - disk-based partial registration (registerAgentPartials, clearPartials)
5
+ * - renderTemplateFile (reads template from disk)
6
+ * - applyLicenseWatermark (steganographic fingerprint)
7
+ */
1
8
  import Handlebars from 'handlebars';
2
9
  import { existsSync, readFileSync, readdirSync } from 'node:fs';
3
- import { join, basename } from 'node:path';
4
- import { generateWatermark } from '@nepopsx/core';
10
+ import { extname, join } from 'node:path';
11
+ import { generateWatermark, renderTemplate, registerAgentPartialsFromMap, clearPartialNames, renderTemplateMap, setPhilosophyBlock, setCustomInstructions, } from '@nepopsx/core';
5
12
  import { applySteganography } from '../licensing/fingerprint.js';
6
- // ─── Prototype pollution guard ──────────────────────────────
7
- const BANNED_KEYS = new Set(['__proto__', 'constructor', 'prototype']);
8
- /**
9
- * Deep-clone an object while stripping keys that could trigger
10
- * Handlebars prototype pollution (e.g., {{constructor.constructor}}).
11
- */
12
- function sanitizeContext(obj) {
13
- if (obj === null || obj === undefined)
14
- return obj;
15
- if (typeof obj !== 'object')
16
- return obj;
17
- if (Array.isArray(obj)) {
18
- return obj.map(sanitizeContext);
19
- }
20
- const clean = {};
21
- for (const [key, value] of Object.entries(obj)) {
22
- if (BANNED_KEYS.has(key))
23
- continue;
24
- clean[key] = sanitizeContext(value);
25
- }
26
- return clean;
27
- }
28
- // ─── Register helpers ───────────────────────────────────────
29
- Handlebars.registerHelper('eq', (a, b) => a === b);
30
- Handlebars.registerHelper('neq', (a, b) => a !== b);
31
- Handlebars.registerHelper('includes', (arr, val) => Array.isArray(arr) && arr.includes(val));
32
- Handlebars.registerHelper('join', (arr, sep) => Array.isArray(arr) ? arr.join(sep) : '');
33
- Handlebars.registerHelper('uppercase', (str) => str?.toUpperCase());
34
- Handlebars.registerHelper('lowercase', (str) => str?.toLowerCase());
35
- Handlebars.registerHelper('capitalize', (str) => str ? str.charAt(0).toUpperCase() + str.slice(1) : '');
36
- // Index helper for numbered lists: {{idx @index}} → 1
37
- Handlebars.registerHelper('idx', (i) => i + 1);
38
- // Service filtering: {{#servicesByLang services "typescript"}}
39
- Handlebars.registerHelper('servicesByLang', function (services, lang, options) {
40
- const filtered = services.filter((s) => s.language === lang);
41
- if (filtered.length === 0)
42
- return '';
43
- return filtered.map((s) => options.fn(s)).join('');
44
- });
45
- // Conditional block if workspace has a specific language
46
- Handlebars.registerHelper('hasLanguage', function (services, lang, options) {
47
- return services.some((s) => s.language === lang) ? options.fn(this) : '';
48
- });
49
- // Maturity badge
50
- Handlebars.registerHelper('maturityBadge', (maturity) => {
51
- switch (maturity) {
52
- case 'production': return '[Mature]';
53
- case 'evolving': return '[Evolving]';
54
- case 'prototype': return '[Prototype]';
55
- case 'legacy': return '[Legacy]';
56
- default: return '';
57
- }
58
- });
59
- // Safety rules block
60
- Handlebars.registerHelper('safetyRules', function (config, options) {
61
- const safety = config.safety;
62
- if (!safety)
63
- return '';
64
- return options.fn(safety);
65
- });
66
- let _customInstructions = [];
67
- let _philosophyBlock = '';
68
- /**
69
- * Set the philosophy markdown block for the current sync run.
70
- */
71
- export function setPhilosophyBlock(block) {
72
- _philosophyBlock = block;
73
- }
13
+ // Re-export core renderer API so callers only need to import from this module
14
+ export { renderTemplate, registerAgentPartialsFromMap, clearPartialNames, renderTemplateMap, setPhilosophyBlock, setCustomInstructions, };
15
+ // ─── Disk-based partial helpers ─────────────────────────────
74
16
  /**
75
- * Set the custom instructions for the current sync run.
76
- */
77
- export function setCustomInstructions(customs) {
78
- _customInstructions = customs;
79
- }
80
- // Helper: {{philosophyBlock}} — renders the philosophy as markdown
81
- Handlebars.registerHelper('philosophyBlock', () => _philosophyBlock);
82
- // Helper: {{customInstructions agentName}} — renders applicable custom instructions
83
- // Pass "all" or omit to include all instructions. Pass an agent name to filter by applies_to.
84
- Handlebars.registerHelper('customInstructions', (agentFileNameOrOptions) => {
85
- if (_customInstructions.length === 0)
86
- return '';
87
- // When called as {{customInstructions}} with no args, Handlebars passes options as first arg
88
- const agentFileName = typeof agentFileNameOrOptions === 'string' ? agentFileNameOrOptions : 'all';
89
- const applicable = _customInstructions.filter((ci) => {
90
- if (agentFileName === 'all' || agentFileName === 'worker') {
91
- // Include all customs — no filtering by applies_to
92
- return true;
93
- }
94
- // Filter by applies_to (if specified, agent name must match)
95
- if (ci.applies_to && ci.applies_to.length > 0) {
96
- return ci.applies_to.some((a) => agentFileName.includes(a));
97
- }
98
- return true;
99
- });
100
- if (applicable.length === 0)
101
- return '';
102
- const parts = [
103
- '<!-- BEGIN CUSTOM INSTRUCTIONS -->',
104
- '',
105
- ];
106
- for (const ci of applicable) {
107
- parts.push(ci.content);
108
- parts.push('');
109
- }
110
- parts.push('<!-- END CUSTOM INSTRUCTIONS -->');
111
- return parts.join('\n');
112
- });
113
- /**
114
- * Register all partials from an agent package's partials/ directory.
115
- * .hbs partials are pre-rendered with config context; .md partials are included as-is.
17
+ * Register all partials from a package's partials/ directory on disk.
116
18
  */
117
19
  export function registerAgentPartials(partialsDir, config, agentMeta) {
118
20
  if (!existsSync(partialsDir))
@@ -120,25 +22,21 @@ export function registerAgentPartials(partialsDir, config, agentMeta) {
120
22
  for (const file of readdirSync(partialsDir)) {
121
23
  const fullPath = join(partialsDir, file);
122
24
  const raw = readFileSync(fullPath, 'utf-8');
123
- // Derive partial name: "constitutional.md" → "constitutional", "worker-context.md.hbs" → "worker-context"
124
25
  let partialName = file;
125
26
  if (partialName.endsWith('.hbs'))
126
- partialName = partialName.slice(0, -4); // strip .hbs
27
+ partialName = partialName.slice(0, -4);
127
28
  if (partialName.endsWith('.md'))
128
- partialName = partialName.slice(0, -3); // strip .md
29
+ partialName = partialName.slice(0, -3);
129
30
  if (file.endsWith('.hbs')) {
130
- // Pre-render the Handlebars partial with config context, then register the output
131
- const rendered = renderTemplate(raw, config, agentMeta);
132
- Handlebars.registerPartial(partialName, rendered);
31
+ Handlebars.registerPartial(partialName, renderTemplate(raw, config, agentMeta));
133
32
  }
134
33
  else {
135
- // Plain markdown — register as-is
136
34
  Handlebars.registerPartial(partialName, raw);
137
35
  }
138
36
  }
139
37
  }
140
38
  /**
141
- * Unregister all partials (call between agent packages to avoid cross-contamination).
39
+ * Unregister all partials loaded from a partials/ directory.
142
40
  */
143
41
  export function clearPartials(partialsDir) {
144
42
  if (!existsSync(partialsDir))
@@ -153,50 +51,7 @@ export function clearPartials(partialsDir) {
153
51
  }
154
52
  }
155
53
  /**
156
- * Register partials from a remote template map keyed by relative file path.
157
- * Returns the partial names so they can be unregistered after rendering.
158
- */
159
- export function registerAgentPartialsFromMap(templateMap, config, agentMeta) {
160
- const partialNames = [];
161
- for (const [relativePath, raw] of Object.entries(templateMap)) {
162
- if (!relativePath.startsWith('partials/'))
163
- continue;
164
- let partialName = basename(relativePath);
165
- if (partialName.endsWith('.hbs'))
166
- partialName = partialName.slice(0, -4);
167
- if (partialName.endsWith('.md'))
168
- partialName = partialName.slice(0, -3);
169
- if (relativePath.endsWith('.hbs')) {
170
- Handlebars.registerPartial(partialName, renderTemplate(raw, config, agentMeta));
171
- }
172
- else {
173
- Handlebars.registerPartial(partialName, raw);
174
- }
175
- partialNames.push(partialName);
176
- }
177
- return partialNames;
178
- }
179
- export function clearPartialNames(partialNames) {
180
- for (const partialName of partialNames) {
181
- Handlebars.unregisterPartial(partialName);
182
- }
183
- }
184
- /**
185
- * Render a Handlebars template string with workspace config context.
186
- * Context is sanitized to prevent prototype pollution attacks.
187
- */
188
- export function renderTemplate(templateSource, config, agentMeta) {
189
- const context = {
190
- config,
191
- agent: agentMeta,
192
- timestamp: new Date().toISOString().split('T')[0],
193
- };
194
- const safeContext = sanitizeContext(context);
195
- const template = Handlebars.compile(templateSource, { noEscape: true });
196
- return template(safeContext);
197
- }
198
- /**
199
- * Render a template file.
54
+ * Render a template file from disk.
200
55
  */
201
56
  export function renderTemplateFile(templatePath, config, agentMeta) {
202
57
  const source = readFileSync(templatePath, 'utf-8');
@@ -204,25 +59,24 @@ export function renderTemplateFile(templatePath, config, agentMeta) {
204
59
  }
205
60
  // ─── Watermark + fingerprint post-processing ────────────────
206
61
  let _watermarkData = null;
207
- /**
208
- * Set watermark data for the current sync run.
209
- * When set, every rendered file gets a watermark header + steganographic fingerprint.
210
- * Pass null to disable (e.g., dev mode / free tier).
211
- */
212
62
  export function setWatermarkData(data) {
213
63
  _watermarkData = data;
214
64
  }
215
- /**
216
- * Apply watermark header + steganographic fingerprint to rendered content.
217
- * Should be called AFTER Handlebars rendering, on the final output.
218
- */
219
- export function applyLicenseWatermark(content) {
65
+ function detectWatermarkCommentStyle(outputPath) {
66
+ if (!outputPath) {
67
+ return 'html';
68
+ }
69
+ const extension = extname(outputPath).toLowerCase();
70
+ if (extension === '.yaml' || extension === '.yml' || extension === '.toml' || extension === '.env') {
71
+ return 'hash';
72
+ }
73
+ return 'html';
74
+ }
75
+ export function applyLicenseWatermark(content, outputPath) {
220
76
  if (!_watermarkData)
221
77
  return content;
222
- // 1. Prepend visible watermark as first line
223
- const watermarkLine = generateWatermark(_watermarkData);
78
+ const watermarkLine = generateWatermark(_watermarkData, detectWatermarkCommentStyle(outputPath));
224
79
  let result = watermarkLine + '\n' + content;
225
- // 2. Apply steganographic fingerprint
226
80
  result = applySteganography(result, _watermarkData.fingerprint);
227
81
  return result;
228
82
  }
@@ -1 +1 @@
1
- {"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/generator/render.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAW,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,+DAA+D;AAE/D,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC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2BAA2B,CAAC,UAAmB;IACtD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC;IACpD,IAAI,SAAS,KAAK,OAAO,IAAI,SAAS,KAAK,MAAM,IAAI,SAAS,KAAK,OAAO,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC;QACnG,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,OAAe,EAAE,UAAmB;IACxE,IAAI,CAAC,cAAc;QAAE,OAAO,OAAO,CAAC;IACpC,MAAM,aAAa,GAAG,iBAAiB,CAAC,cAAc,EAAE,2BAA2B,CAAC,UAAU,CAAC,CAAC,CAAC;IACjG,IAAI,MAAM,GAAG,aAAa,GAAG,IAAI,GAAG,OAAO,CAAC;IAC5C,MAAM,GAAG,kBAAkB,CAAC,MAAM,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;IAChE,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/dist/index.js CHANGED
@@ -5,12 +5,15 @@ import { doctorCommand } from './commands/doctor.js';
5
5
  import { installCommand } from './commands/install.js';
6
6
  import { activateCommand } from './commands/activate.js';
7
7
  import { decodeCommand } from './commands/decode.js';
8
+ import { loginCommand } from './commands/login.js';
9
+ import { scanCommand } from './commands/scan.js';
10
+ import { pushLearningsCommand } from './commands/push-learnings.js';
8
11
  import { serverClearCommand, serverSetCommand, serverShowCommand, } from './commands/server.js';
9
12
  const program = new Command();
10
13
  program
11
14
  .name('nepopsx')
12
15
  .description('NEPOPSX — AI Agent Platform for Engineering Teams')
13
- .version('0.0.3');
16
+ .version('0.0.5');
14
17
  program
15
18
  .command('init')
16
19
  .description('Initialize a new NEPOPSX workspace (interactive setup)')
@@ -18,8 +21,10 @@ program
18
21
  .action(initCommand);
19
22
  program
20
23
  .command('sync')
21
- .description('Generate .github/ files from workspace config + installed agents')
24
+ .description('Render generated files from the current workspace config + installed agents')
22
25
  .option('-c, --config <path>', 'Path to workspace.yaml', '.nepopsx/workspace.yaml')
26
+ .option('--remote', 'Fetch workspace config from backend API instead of local file')
27
+ .option('--workspace <slug>', 'Workspace slug to fetch (used with --remote)')
23
28
  .option('--dry-run', 'Preview changes without writing files')
24
29
  .option('--dev', 'Dev mode — bypass license checks (for NEPOPSX agent developers)')
25
30
  .action(syncCommand);
@@ -27,6 +32,7 @@ program
27
32
  .command('install <agent>')
28
33
  .description('Install an agent package (e.g., feature-factory, qa-commander)')
29
34
  .option('--version <ver>', 'Specific version to install')
35
+ .option('-y, --yes', 'Skip confirmations when auto-enriching agent config')
30
36
  .action(installCommand);
31
37
  program
32
38
  .command('doctor')
@@ -42,6 +48,11 @@ program
42
48
  .command('decode <file>')
43
49
  .description('Forensic decode — extract fingerprint from a generated file')
44
50
  .action(decodeCommand);
51
+ program
52
+ .command('login')
53
+ .description('Log in to NEPOPSX and save credentials to .nepopsx/config.json')
54
+ .option('--email <email>', 'Your NEPOPSX account email')
55
+ .action(loginCommand);
45
56
  const serverProgram = program
46
57
  .command('server')
47
58
  .description('Manage the NEPOPSX backend server URL for this workspace');
@@ -57,5 +68,34 @@ serverProgram
57
68
  .command('clear')
58
69
  .description('Remove the persisted NEPOPSX backend server URL override')
59
70
  .action(serverClearCommand);
71
+ function collectRepeatable(value, previous) {
72
+ return [...previous, value];
73
+ }
74
+ program
75
+ .command('push-learnings')
76
+ .description('Push local reflector learnings (customs/auto/) to the platform')
77
+ .option('-c, --config <path>', 'Path to workspace.yaml', '.nepopsx/workspace.yaml')
78
+ .option('--workspace <slug>', 'Workspace slug')
79
+ .option('--agent <name>', 'Only push learnings for a specific agent')
80
+ .option('-y, --yes', 'Skip confirmations')
81
+ .action(pushLearningsCommand);
82
+ program
83
+ .command('scan')
84
+ .description('LLM-powered analysis — enrich workspace.yaml and installed agent configs')
85
+ .option('-y, --yes', 'Skip all confirmations')
86
+ .option('--provider <name>', 'LLM provider (openai, anthropic, ollama, compatible)')
87
+ .option('--model <name>', 'Model override')
88
+ .option('--endpoint <url>', 'Custom API endpoint (OpenAI-compatible or Ollama base URL)')
89
+ .option('--budget <tokens>', 'Per-service token budget', '30000')
90
+ .option('--agent-budget <tokens>', 'Total context budget for agent mode', '60000')
91
+ .option('--parallel <n>', 'Concurrent service analysis', '1')
92
+ .option('--customs', 'Generate/update customs directory files')
93
+ .option('--dry-run', 'Show what would change without writing')
94
+ .option('-v, --verbose', 'Show LLM prompts and raw responses')
95
+ .option('--service <name>', 'Scan only specific service(s)', collectRepeatable, [])
96
+ .option('--agent', 'Agent-assisted mode (generate prompt file for VS Code AI)')
97
+ .option('--apply <path>', 'Apply a JSON response file from agent-assisted mode')
98
+ .option('--resume', 'Resume a previously interrupted scan using cached service results')
99
+ .action(scanCommand);
60
100
  program.parse();
61
101
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,SAAS,CAAC;KACf,WAAW,CAAC,mD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