@neurcode-ai/cli 0.20.3 → 0.20.4

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 (59) hide show
  1. package/LICENSE +201 -0
  2. package/dist/commands/brain.d.ts.map +1 -1
  3. package/dist/commands/brain.js +109 -1
  4. package/dist/commands/brain.js.map +1 -1
  5. package/dist/commands/eval.d.ts.map +1 -1
  6. package/dist/commands/eval.js +6 -100
  7. package/dist/commands/eval.js.map +1 -1
  8. package/dist/commands/onboard.d.ts.map +1 -1
  9. package/dist/commands/onboard.js +3 -2
  10. package/dist/commands/onboard.js.map +1 -1
  11. package/dist/commands/pilot.d.ts +6 -0
  12. package/dist/commands/pilot.d.ts.map +1 -0
  13. package/dist/commands/pilot.js +110 -0
  14. package/dist/commands/pilot.js.map +1 -0
  15. package/dist/commands/session-hook.d.ts.map +1 -1
  16. package/dist/commands/session-hook.js +146 -0
  17. package/dist/commands/session-hook.js.map +1 -1
  18. package/dist/index.js +3 -1
  19. package/dist/index.js.map +1 -1
  20. package/dist/runtime-build.json +5 -5
  21. package/dist/utils/cli-startup.d.ts.map +1 -1
  22. package/dist/utils/cli-startup.js +25 -1
  23. package/dist/utils/cli-startup.js.map +1 -1
  24. package/dist/utils/enterprise-eval-report.d.ts +31 -0
  25. package/dist/utils/enterprise-eval-report.d.ts.map +1 -1
  26. package/dist/utils/enterprise-eval-report.js +41 -1
  27. package/dist/utils/enterprise-eval-report.js.map +1 -1
  28. package/dist/utils/eval-demo-command.d.ts +27 -0
  29. package/dist/utils/eval-demo-command.d.ts.map +1 -0
  30. package/dist/utils/eval-demo-command.js +137 -0
  31. package/dist/utils/eval-demo-command.js.map +1 -0
  32. package/dist/utils/eval-demo.d.ts.map +1 -1
  33. package/dist/utils/eval-demo.js +57 -0
  34. package/dist/utils/eval-demo.js.map +1 -1
  35. package/dist/utils/local-repo-brain.d.ts +1 -0
  36. package/dist/utils/local-repo-brain.d.ts.map +1 -1
  37. package/dist/utils/local-repo-brain.js +33 -4
  38. package/dist/utils/local-repo-brain.js.map +1 -1
  39. package/dist/utils/pilot-setup-commands.d.ts +13 -0
  40. package/dist/utils/pilot-setup-commands.d.ts.map +1 -0
  41. package/dist/utils/pilot-setup-commands.js +48 -0
  42. package/dist/utils/pilot-setup-commands.js.map +1 -0
  43. package/dist/utils/pilot-setup-contract.d.ts +11 -0
  44. package/dist/utils/pilot-setup-contract.d.ts.map +1 -0
  45. package/dist/utils/pilot-setup-contract.js +131 -0
  46. package/dist/utils/pilot-setup-contract.js.map +1 -0
  47. package/dist/utils/repo-brain-impact.d.ts +1 -1
  48. package/dist/utils/repo-brain-impact.d.ts.map +1 -1
  49. package/dist/utils/repo-brain-impact.js +31 -5
  50. package/dist/utils/repo-brain-impact.js.map +1 -1
  51. package/dist/utils/repo-graph-impact.d.ts +60 -0
  52. package/dist/utils/repo-graph-impact.d.ts.map +1 -0
  53. package/dist/utils/repo-graph-impact.js +330 -0
  54. package/dist/utils/repo-graph-impact.js.map +1 -0
  55. package/dist/utils/runtime-safety-check.d.ts +24 -0
  56. package/dist/utils/runtime-safety-check.d.ts.map +1 -0
  57. package/dist/utils/runtime-safety-check.js +50 -0
  58. package/dist/utils/runtime-safety-check.js.map +1 -0
  59. package/package.json +7 -8
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ENTERPRISE_RUNTIME_SAFETY_V1_POLICY = void 0;
4
+ exports.evaluateRuntimeSafetyCheck = evaluateRuntimeSafetyCheck;
5
+ const governance_runtime_1 = require("@neurcode-ai/governance-runtime");
6
+ Object.defineProperty(exports, "ENTERPRISE_RUNTIME_SAFETY_V1_POLICY", { enumerable: true, get: function () { return governance_runtime_1.ENTERPRISE_RUNTIME_SAFETY_V1_POLICY; } });
7
+ function evaluateRuntimeSafetyCheck(input) {
8
+ const policy = (0, governance_runtime_1.parseRuntimeSafetyPolicyProfile)(input.policy ?? input.profile?.runtimeConfig?.runtimeSafetyPolicy);
9
+ const phase = input.phase ?? 'implementation';
10
+ const classifierInput = {
11
+ filePath: input.filePath,
12
+ sensitiveBoundaries: input.profile?.sensitiveBoundaries,
13
+ ownershipBoundaries: input.profile?.ownershipBoundaries,
14
+ approvalRequiredGlobs: input.profile?.approvalRequiredPaths ?? [],
15
+ sensitiveGlobs: input.profile?.sensitiveBoundaries.map((b) => b.glob) ?? [],
16
+ allowedGlobs: input.allowedGlobs,
17
+ approvedPaths: input.approvedPaths,
18
+ };
19
+ const classification = (0, governance_runtime_1.classifyRuntimeSafetySurface)(classifierInput);
20
+ const credential = input.proposedContent != null
21
+ ? (0, governance_runtime_1.evaluateCredentialPreWrite)({
22
+ filePath: input.filePath,
23
+ proposedContent: input.proposedContent,
24
+ policyAction: (0, governance_runtime_1.resolvePolicyActionForFamily)('credential_or_secret', policy),
25
+ })
26
+ : null;
27
+ const dependency = input.proposedContent != null &&
28
+ classification.primaryFamily === 'dependency_supply_chain'
29
+ ? (0, governance_runtime_1.classifyDependencyManifestChange)({
30
+ filePath: input.filePath,
31
+ previousContent: input.previousContent,
32
+ proposedContent: input.proposedContent,
33
+ policyAction: (0, governance_runtime_1.resolvePolicyActionForFamily)('dependency_supply_chain', policy),
34
+ })
35
+ : null;
36
+ const effectivePolicy = {
37
+ ...policy,
38
+ planMode: input.planMode ?? input.profile?.runtimeConfig?.planMode ?? policy.planMode,
39
+ };
40
+ const enforcement = (0, governance_runtime_1.resolveRuntimeSafetyEnforcement)({
41
+ classification,
42
+ credential,
43
+ dependency,
44
+ policy: effectivePolicy,
45
+ phase,
46
+ planFiles: input.planFiles,
47
+ });
48
+ return { classification, credential, dependency, enforcement, policy: effectivePolicy };
49
+ }
50
+ //# sourceMappingURL=runtime-safety-check.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-safety-check.js","sourceRoot":"","sources":["../../src/utils/runtime-safety-check.ts"],"names":[],"mappings":";;;AAqCA,gEA6CC;AAlFD,wEAayC;AAuEhC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KAAK,CAAC,eAAe;YACtC,eAAe,EAAE,KAAK,CAAC,eAAe;YACtC,YAAY,EAAE,IAAA,iDAA4B,EAAC,yBAAyB,EAAE,MAAM,CAAC;SAC9E,CAAC;QACJ,CAAC,CAAC,IAAI,CAAC;IACX,MAAM,eAAe,GAA+B;QAClD,GAAG,MAAM;QACT,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,IAAI,MAAM,CAAC,QAAQ;KACtF,CAAC;IACF,MAAM,WAAW,GAAG,IAAA,oDAA+B,EAAC;QAClD,cAAc;QACd,UAAU;QACV,UAAU;QACV,MAAM,EAAE,eAAe;QACvB,KAAK;QACL,SAAS,EAAE,KAAK,CAAC,SAAS;KAC3B,CAAC,CAAC;IACH,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC;AAC1F,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neurcode-ai/cli",
3
- "version": "0.20.3",
3
+ "version": "0.20.4",
4
4
  "description": "Neurcode CLI — deterministic operational governance runtime for AI-assisted engineering (intent contracts, import-edge governance, replay continuity)",
5
5
  "bin": {
6
6
  "neurcode": "dist/index.js"
@@ -11,12 +11,6 @@
11
11
  "dist",
12
12
  "README.md"
13
13
  ],
14
- "scripts": {
15
- "build": "node ../../scripts/sync-cli-telemetry-vendor.mjs && rm -rf dist && tsc && node ../../scripts/write-cli-build-manifest.mjs && chmod +x dist/index.js",
16
- "dev": "tsc --watch",
17
- "start": "node dist/index.js",
18
- "prepublishOnly": "npm run build"
19
- },
20
14
  "keywords": [
21
15
  "cli",
22
16
  "code-governance",
@@ -72,5 +66,10 @@
72
66
  "@types/node": "^20.10.0",
73
67
  "@types/uuid": "^9.0.8",
74
68
  "typescript": "^5.3.0"
69
+ },
70
+ "scripts": {
71
+ "build": "node ../../scripts/sync-cli-telemetry-vendor.mjs && rm -rf dist && tsc && node ../../scripts/write-cli-build-manifest.mjs && chmod +x dist/index.js",
72
+ "dev": "tsc --watch",
73
+ "start": "node dist/index.js"
75
74
  }
76
- }
75
+ }