@principles/core 1.277.2 → 1.277.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 (31) hide show
  1. package/dist/runtime-v2/__tests__/architecture-regression.test.js +15 -0
  2. package/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -1
  3. package/dist/runtime-v2/adapter/__tests__/pd-stream-simple.test.d.ts +2 -0
  4. package/dist/runtime-v2/adapter/__tests__/pd-stream-simple.test.d.ts.map +1 -0
  5. package/dist/runtime-v2/adapter/__tests__/pd-stream-simple.test.js +71 -0
  6. package/dist/runtime-v2/adapter/__tests__/pd-stream-simple.test.js.map +1 -0
  7. package/dist/runtime-v2/adapter/__tests__/pi-ai-http-transport.test.d.ts +2 -0
  8. package/dist/runtime-v2/adapter/__tests__/pi-ai-http-transport.test.d.ts.map +1 -0
  9. package/dist/runtime-v2/adapter/__tests__/pi-ai-http-transport.test.js +219 -0
  10. package/dist/runtime-v2/adapter/__tests__/pi-ai-http-transport.test.js.map +1 -0
  11. package/dist/runtime-v2/adapter/artificer-l2-adapter.d.ts.map +1 -1
  12. package/dist/runtime-v2/adapter/artificer-l2-adapter.js +2 -3
  13. package/dist/runtime-v2/adapter/artificer-l2-adapter.js.map +1 -1
  14. package/dist/runtime-v2/adapter/l2-agent-loop-adapter.d.ts +12 -1
  15. package/dist/runtime-v2/adapter/l2-agent-loop-adapter.d.ts.map +1 -1
  16. package/dist/runtime-v2/adapter/l2-agent-loop-adapter.js +15 -2
  17. package/dist/runtime-v2/adapter/l2-agent-loop-adapter.js.map +1 -1
  18. package/dist/runtime-v2/adapter/pi-ai-http-transport.d.ts +50 -0
  19. package/dist/runtime-v2/adapter/pi-ai-http-transport.d.ts.map +1 -0
  20. package/dist/runtime-v2/adapter/pi-ai-http-transport.js +93 -0
  21. package/dist/runtime-v2/adapter/pi-ai-http-transport.js.map +1 -0
  22. package/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts.map +1 -1
  23. package/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js +5 -0
  24. package/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js.map +1 -1
  25. package/dist/runtime-v2/internalization/__tests__/owner-decision.test.js +152 -0
  26. package/dist/runtime-v2/internalization/__tests__/owner-decision.test.js.map +1 -1
  27. package/dist/runtime-v2/internalization/owner-review.d.ts +7 -1
  28. package/dist/runtime-v2/internalization/owner-review.d.ts.map +1 -1
  29. package/dist/runtime-v2/internalization/owner-review.js +22 -3
  30. package/dist/runtime-v2/internalization/owner-review.js.map +1 -1
  31. package/package.json +3 -2
@@ -3722,6 +3722,16 @@ describe('SEC-BASE-4: log secret redaction & SQL injection guards', () => {
3722
3722
  describe('SEC-BASE-5: network & config isolation guards', () => {
3723
3723
  const REPO_ROOT = pathSync.resolve(__dirname, '../../../../..');
3724
3724
  it('core does not import node:http / node:https / undici / fetch for business', () => {
3725
+ // PRI-683: pi-ai-http-transport.ts is the registered exception
3726
+ // (io-seam-registry.json `pi-ai-http-transport` seam). It owns the LLM
3727
+ // transport's undici Agent config; requests still originate from pi-ai.
3728
+ const registryPath = pathSync.join(REPO_ROOT, 'packages', 'principles-core', 'io-seam-registry.json');
3729
+ const registry = JSON.parse(fsSync.readFileSync(registryPath, 'utf8'));
3730
+ const registeredFiles = new Set();
3731
+ for (const seam of registry.seams) {
3732
+ for (const file of seam.files)
3733
+ registeredFiles.add(file);
3734
+ }
3725
3735
  const coreDir = pathSync.join(REPO_ROOT, 'packages', 'principles-core', 'src');
3726
3736
  const files = fsSync.readdirSync(coreDir, { recursive: true, encoding: 'utf8' })
3727
3737
  .filter((f) => typeof f === 'string' && f.endsWith('.ts') && !f.includes('__tests__'));
@@ -3729,14 +3739,19 @@ describe('SEC-BASE-5: network & config isolation guards', () => {
3729
3739
  for (const f of files) {
3730
3740
  const content = fsSync.readFileSync(pathSync.join(coreDir, f), 'utf8');
3731
3741
  const lines = content.split('\n');
3742
+ const isRegisteredSeam = registeredFiles.has(f.replace(/\\/g, '/'));
3732
3743
  lines.forEach((line, idx) => {
3733
3744
  if (/^import\s+type/.test(line.trim()))
3734
3745
  return;
3735
3746
  if (/from\s+['"]node:http['"]/.test(line) || /from\s+['"]node:https['"]/.test(line)
3736
3747
  || /from\s+['"]undici['"]/.test(line) || /from\s+['"]node-fetch['"]/.test(line)) {
3748
+ if (isRegisteredSeam)
3749
+ return;
3737
3750
  violations.push(`${f}:${idx + 1}: ${line.trim()}`);
3738
3751
  }
3739
3752
  if (!/^\s*(\/\/|\/\*|\*)/.test(line) && /\bfetch\s*\(/.test(line) && !/import/.test(line)) {
3753
+ if (isRegisteredSeam)
3754
+ return;
3740
3755
  violations.push(`${f}:${idx + 1}: ${line.trim()}`);
3741
3756
  }
3742
3757
  });