@ai-pip/core 0.1.3 → 0.1.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 (43) hide show
  1. package/dist/cpe/index.d.ts +2 -2
  2. package/dist/cpe/index.d.ts.map +1 -1
  3. package/dist/cpe/index.js +1 -3
  4. package/dist/cpe/index.js.map +1 -1
  5. package/dist/cpe/value-objects/Metadata.js +1 -1
  6. package/dist/cpe/value-objects/index.d.ts +5 -3
  7. package/dist/cpe/value-objects/index.d.ts.map +1 -1
  8. package/dist/cpe/value-objects/index.js +3 -3
  9. package/dist/cpe/value-objects/index.js.map +1 -1
  10. package/dist/csl/exceptions/index.d.ts +2 -2
  11. package/dist/csl/exceptions/index.d.ts.map +1 -1
  12. package/dist/csl/exceptions/index.js +2 -2
  13. package/dist/csl/exceptions/index.js.map +1 -1
  14. package/dist/csl/index.d.ts +6 -3
  15. package/dist/csl/index.d.ts.map +1 -1
  16. package/dist/csl/index.js +4 -4
  17. package/dist/csl/index.js.map +1 -1
  18. package/dist/index.d.ts +8 -4
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +9 -5
  21. package/dist/index.js.map +1 -1
  22. package/dist/isl/exceptions/index.d.ts +1 -1
  23. package/dist/isl/exceptions/index.d.ts.map +1 -1
  24. package/dist/isl/exceptions/index.js +1 -1
  25. package/dist/isl/exceptions/index.js.map +1 -1
  26. package/dist/isl/index.d.ts +4 -3
  27. package/dist/isl/index.d.ts.map +1 -1
  28. package/dist/isl/index.js +2 -5
  29. package/dist/isl/index.js.map +1 -1
  30. package/dist/shared/index.d.ts +1 -1
  31. package/dist/shared/index.d.ts.map +1 -1
  32. package/dist/shared/index.js +1 -1
  33. package/dist/shared/index.js.map +1 -1
  34. package/package.json +1 -1
  35. package/src/cpe/index.ts +11 -2
  36. package/src/cpe/value-objects/Metadata.ts +1 -1
  37. package/src/cpe/value-objects/index.ts +5 -3
  38. package/src/csl/exceptions/index.ts +2 -2
  39. package/src/csl/index.ts +24 -3
  40. package/src/index.ts +79 -5
  41. package/src/isl/exceptions/index.ts +1 -1
  42. package/src/isl/index.ts +36 -3
  43. package/src/shared/index.ts +6 -1
@@ -19,6 +19,6 @@ export type { Nonce } from './value-objects/Nonce';
19
19
  export { createMetadata, isValidMetadata, CURRENT_PROTOCOL_VERSION } from './value-objects/Metadata';
20
20
  export { createSignature } from './value-objects/Signature';
21
21
  export type { SignatureVO } from './value-objects/Signature';
22
- export * from './exceptions';
23
- export * from './types';
22
+ export { EnvelopeError } from './exceptions/EnvelopeError';
23
+ export type { ProtocolVersion, Timestamp, NonceValue, SignatureAlgorithm, Signature, CPEMetadata, CPEEvelope, CPEResult } from './types';
24
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cpe/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGrC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC9E,YAAY,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAG5D,cAAc,cAAc,CAAA;AAG5B,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cpe/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGrC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC9E,YAAY,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAG5D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAG1D,YAAY,EACV,eAAe,EACf,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,UAAU,EACV,SAAS,EACV,MAAM,SAAS,CAAA"}
package/dist/cpe/index.js CHANGED
@@ -20,9 +20,7 @@ export { createNonce, isValidNonce, equalsNonce } from './value-objects/Nonce';
20
20
  export { createMetadata, isValidMetadata, CURRENT_PROTOCOL_VERSION } from './value-objects/Metadata';
21
21
  export { createSignature } from './value-objects/Signature';
22
22
  // Exceptions
23
- export * from './exceptions';
24
- // Types
25
- export * from './types';
23
+ export { EnvelopeError } from './exceptions/EnvelopeError';
26
24
  // Serialización y verificación NO son core - van al SDK
27
25
  // El core solo define la estructura del envelope, no implementa serialización
28
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cpe/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,8BAA8B;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,gBAAgB;AAChB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAE9E,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAG3D,aAAa;AACb,cAAc,cAAc,CAAA;AAE5B,QAAQ;AACR,cAAc,SAAS,CAAA;AAEvB,wDAAwD;AACxD,8EAA8E"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cpe/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,8BAA8B;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,gBAAgB;AAChB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAE9E,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAG3D,aAAa;AACb,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAc1D,wDAAwD;AACxD,8EAA8E"}
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Versión actual del protocolo
7
7
  */
8
- export const CURRENT_PROTOCOL_VERSION = '1.0.0';
8
+ export const CURRENT_PROTOCOL_VERSION = '0.1.4';
9
9
  /**
10
10
  * Crea metadata de seguridad para el envelope
11
11
  * Según especificación: timestamp, nonce, protocolVersion, previousSignatures opcionales
@@ -1,7 +1,9 @@
1
1
  /**
2
2
  * CPE Value Objects - Exports
3
3
  */
4
- export * from './Nonce';
5
- export * from './Metadata';
6
- export * from './Signature';
4
+ export type { Nonce } from './Nonce';
5
+ export { createNonce, isValidNonce, equalsNonce } from './Nonce';
6
+ export { createMetadata, isValidMetadata } from './Metadata';
7
+ export type { SignatureVO } from './Signature';
8
+ export { createSignature, verifySignature, isValidSignatureFormat } from './Signature';
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cpe/value-objects/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cpe/value-objects/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5D,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * CPE Value Objects - Exports
3
3
  */
4
- export * from './Nonce';
5
- export * from './Metadata';
6
- export * from './Signature';
4
+ export { createNonce, isValidNonce, equalsNonce } from './Nonce';
5
+ export { createMetadata, isValidMetadata } from './Metadata';
6
+ export { createSignature, verifySignature, isValidSignatureFormat } from './Signature';
7
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cpe/value-objects/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cpe/value-objects/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA"}
@@ -1,3 +1,3 @@
1
- export * from './ClassificationError';
2
- export * from './SegmentationError';
1
+ export { ClassificationError } from './ClassificationError';
2
+ export { SegmentationError } from './SegmentationError';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/csl/exceptions/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/csl/exceptions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA"}
@@ -1,3 +1,3 @@
1
- export * from './ClassificationError';
2
- export * from './SegmentationError';
1
+ export { ClassificationError } from './ClassificationError';
2
+ export { SegmentationError } from './SegmentationError';
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/csl/exceptions/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/csl/exceptions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA"}
@@ -17,8 +17,11 @@
17
17
  export { segment } from './segment';
18
18
  export { classifySource, classifyOrigin } from './classify';
19
19
  export { initLineage, createLineageEntry } from './lineage';
20
- export * from './value-objects';
21
- export * from './exceptions';
22
- export * from './types';
20
+ export type { TrustLevel, Origin, LineageEntry, ContentHash } from './value-objects';
21
+ export { createTrustLevel, isTrusted, isSemiTrusted, isUntrusted, createOrigin, isDom, isUser, isSystem, isInjected, isUnknown, isNetworkFetched, isExternal, isSha256, isSha512, originMap, createContentHash, validateOriginMap } from './value-objects';
22
+ export { ClassificationError } from './exceptions/ClassificationError';
23
+ export { SegmentationError } from './exceptions/SegmentationError';
24
+ export { OriginType, TrustLevelType } from './types';
25
+ export type { HashAlgorithm, Source, CSLInput, CSLSegment, CSLResult } from './types';
23
26
  export { generateId, splitByContextRules } from './utils';
24
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/csl/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAG3D,cAAc,iBAAiB,CAAA;AAG/B,cAAc,cAAc,CAAA;AAG5B,cAAc,SAAS,CAAA;AAGvB,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/csl/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAG3D,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AACpF,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,WAAW,EACX,YAAY,EACZ,KAAK,EACL,MAAM,EACN,QAAQ,EACR,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,iBAAiB,CAAA;AAGxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAGlE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACpD,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAGrF,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA"}
package/dist/csl/index.js CHANGED
@@ -18,12 +18,12 @@
18
18
  export { segment } from './segment';
19
19
  export { classifySource, classifyOrigin } from './classify';
20
20
  export { initLineage, createLineageEntry } from './lineage';
21
- // Value objects
22
- export * from './value-objects';
21
+ export { createTrustLevel, isTrusted, isSemiTrusted, isUntrusted, createOrigin, isDom, isUser, isSystem, isInjected, isUnknown, isNetworkFetched, isExternal, isSha256, isSha512, originMap, createContentHash, validateOriginMap } from './value-objects';
23
22
  // Exceptions
24
- export * from './exceptions';
23
+ export { ClassificationError } from './exceptions/ClassificationError';
24
+ export { SegmentationError } from './exceptions/SegmentationError';
25
25
  // Types
26
- export * from './types';
26
+ export { OriginType, TrustLevelType } from './types';
27
27
  // Utils
28
28
  export { generateId, splitByContextRules } from './utils';
29
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/csl/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,8BAA8B;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAE3D,gBAAgB;AAChB,cAAc,iBAAiB,CAAA;AAE/B,aAAa;AACb,cAAc,cAAc,CAAA;AAE5B,QAAQ;AACR,cAAc,SAAS,CAAA;AAEvB,QAAQ;AACR,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/csl/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,8BAA8B;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAI3D,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,WAAW,EACX,YAAY,EACZ,KAAK,EACL,MAAM,EACN,QAAQ,EACR,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,iBAAiB,CAAA;AAExB,aAAa;AACb,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAElE,QAAQ;AACR,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAGpD,QAAQ;AACR,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA"}
package/dist/index.d.ts CHANGED
@@ -10,8 +10,12 @@
10
10
  * - import { addLineageEntry } from '@ai-pip/core/shared'
11
11
  * - import { envelope } from '@ai-pip/core/cpe'
12
12
  */
13
- export * from './csl';
14
- export * from './isl';
15
- export * from './shared';
16
- export * from './cpe';
13
+ export { segment, classifySource, classifyOrigin, initLineage, createLineageEntry, generateId, splitByContextRules, OriginType, TrustLevelType, ClassificationError, SegmentationError } from './csl';
14
+ export type { HashAlgorithm, Source, CSLInput, CSLSegment, CSLResult, TrustLevel, Origin, LineageEntry, ContentHash } from './csl';
15
+ export { sanitize } from './isl';
16
+ export type { RiskScore, AnomalyAction, Position, BlockedIntent, SensitiveScope, ProtectedRole, ImmutableInstruction, RemovedInstruction, ISLSegment, ISLResult, PiDetection, PiDetectionResult, AnomalyScore, Pattern } from './isl';
17
+ export { createPiDetection, getDetectionLength, isHighConfidence, isMediumConfidence, isLowConfidence, createPiDetectionResult, hasDetections, getDetectionCount, getDetectionsByType, getHighestConfidenceDetection, createAnomalyScore, isHighRisk, isWarnRisk, isLowRisk, createPattern, matchesPattern, findMatch, MAX_CONTENT_LENGTH, MAX_PATTERN_LENGTH, MAX_MATCHES, SanitizationError } from './isl';
18
+ export { addLineageEntry, addLineageEntries, filterLineageByStep, getLastLineageEntry } from './shared';
19
+ export { envelope, createNonce, isValidNonce, equalsNonce, createMetadata, isValidMetadata, CURRENT_PROTOCOL_VERSION, createSignature, EnvelopeError } from './cpe';
20
+ export type { Nonce, SignatureVO, ProtocolVersion, Timestamp, NonceValue, SignatureAlgorithm, Signature, CPEMetadata, CPEEvelope, CPEResult } from './cpe';
17
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,cAAc,OAAO,CAAA;AACrB,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,OAAO,CAAA;AACd,YAAY,EACV,aAAa,EACb,MAAM,EACN,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,MAAM,EACN,YAAY,EACZ,WAAW,EACZ,MAAM,OAAO,CAAA;AAGd,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,YAAY,EACV,SAAS,EACT,aAAa,EACb,QAAQ,EACR,aAAa,EACb,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,OAAO,EACR,MAAM,OAAO,CAAA;AACd,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,6BAA6B,EAC7B,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,SAAS,EACT,aAAa,EACb,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EAClB,MAAM,OAAO,CAAA;AAGd,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,UAAU,CAAA;AAGjB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,wBAAwB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACnK,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,UAAU,EAAE,kBAAkB,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA"}
package/dist/index.js CHANGED
@@ -10,9 +10,13 @@
10
10
  * - import { addLineageEntry } from '@ai-pip/core/shared'
11
11
  * - import { envelope } from '@ai-pip/core/cpe'
12
12
  */
13
- // Re-export all layers
14
- export * from './csl';
15
- export * from './isl';
16
- export * from './shared';
17
- export * from './cpe';
13
+ // Re-export CSL
14
+ export { segment, classifySource, classifyOrigin, initLineage, createLineageEntry, generateId, splitByContextRules, OriginType, TrustLevelType, ClassificationError, SegmentationError } from './csl';
15
+ // Re-export ISL
16
+ export { sanitize } from './isl';
17
+ export { createPiDetection, getDetectionLength, isHighConfidence, isMediumConfidence, isLowConfidence, createPiDetectionResult, hasDetections, getDetectionCount, getDetectionsByType, getHighestConfidenceDetection, createAnomalyScore, isHighRisk, isWarnRisk, isLowRisk, createPattern, matchesPattern, findMatch, MAX_CONTENT_LENGTH, MAX_PATTERN_LENGTH, MAX_MATCHES, SanitizationError } from './isl';
18
+ // Re-export Shared
19
+ export { addLineageEntry, addLineageEntries, filterLineageByStep, getLastLineageEntry } from './shared';
20
+ // Re-export CPE
21
+ export { envelope, createNonce, isValidNonce, equalsNonce, createMetadata, isValidMetadata, CURRENT_PROTOCOL_VERSION, createSignature, EnvelopeError } from './cpe';
18
22
  //# 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;;;;;;;;;;;GAWG;AAEH,uBAAuB;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,gBAAgB;AAChB,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,OAAO,CAAA;AAad,gBAAgB;AAChB,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAiBhC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,6BAA6B,EAC7B,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,SAAS,EACT,aAAa,EACb,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EAClB,MAAM,OAAO,CAAA;AAEd,mBAAmB;AACnB,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,UAAU,CAAA;AAEjB,gBAAgB;AAChB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,wBAAwB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA"}
@@ -1,2 +1,2 @@
1
- export * from './SanitizationError';
1
+ export { SanitizationError } from './SanitizationError';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/isl/exceptions/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/isl/exceptions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA"}
@@ -1,2 +1,2 @@
1
- export * from './SanitizationError';
1
+ export { SanitizationError } from './SanitizationError';
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/isl/exceptions/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/isl/exceptions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA"}
@@ -6,7 +6,8 @@
6
6
  * aplicando diferentes niveles de sanitización según el nivel de confianza.
7
7
  */
8
8
  export { sanitize } from './sanitize';
9
- export * from './value-objects';
10
- export * from './exceptions';
11
- export * from './types';
9
+ export type { PiDetection, PiDetectionResult, AnomalyScore, Pattern } from './value-objects';
10
+ export { createPiDetection, getDetectionLength, isHighConfidence, isMediumConfidence, isLowConfidence, createPiDetectionResult, hasDetections, getDetectionCount, getDetectionsByType, getHighestConfidenceDetection, createAnomalyScore, isHighRisk, isWarnRisk, isLowRisk, createPattern, matchesPattern, findMatch, MAX_CONTENT_LENGTH, MAX_PATTERN_LENGTH, MAX_MATCHES } from './value-objects';
11
+ export { SanitizationError } from './exceptions/SanitizationError';
12
+ export type { RiskScore, AnomalyAction, Position, BlockedIntent, SensitiveScope, ProtectedRole, ImmutableInstruction, RemovedInstruction, ISLSegment, ISLResult } from './types';
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/isl/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGrC,cAAc,iBAAiB,CAAA;AAG/B,cAAc,cAAc,CAAA;AAG5B,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/isl/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGrC,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAC5F,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,6BAA6B,EAC7B,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,SAAS,EACT,aAAa,EACb,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACZ,MAAM,iBAAiB,CAAA;AAGxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAGlE,YAAY,EACV,SAAS,EACT,aAAa,EACb,QAAQ,EACR,aAAa,EACb,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,UAAU,EACV,SAAS,EACV,MAAM,SAAS,CAAA"}
package/dist/isl/index.js CHANGED
@@ -7,10 +7,7 @@
7
7
  */
8
8
  // Funciones puras principales
9
9
  export { sanitize } from './sanitize';
10
- // Value objects
11
- export * from './value-objects';
10
+ export { createPiDetection, getDetectionLength, isHighConfidence, isMediumConfidence, isLowConfidence, createPiDetectionResult, hasDetections, getDetectionCount, getDetectionsByType, getHighestConfidenceDetection, createAnomalyScore, isHighRisk, isWarnRisk, isLowRisk, createPattern, matchesPattern, findMatch, MAX_CONTENT_LENGTH, MAX_PATTERN_LENGTH, MAX_MATCHES } from './value-objects';
12
11
  // Exceptions
13
- export * from './exceptions';
14
- // Types
15
- export * from './types';
12
+ export { SanitizationError } from './exceptions/SanitizationError';
16
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/isl/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,8BAA8B;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,gBAAgB;AAChB,cAAc,iBAAiB,CAAA;AAE/B,aAAa;AACb,cAAc,cAAc,CAAA;AAE5B,QAAQ;AACR,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/isl/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,8BAA8B;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIrC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,6BAA6B,EAC7B,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,SAAS,EACT,aAAa,EACb,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACZ,MAAM,iBAAiB,CAAA;AAExB,aAAa;AACb,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA"}
@@ -5,5 +5,5 @@
5
5
  * Solo funciones básicas de manejo de linaje.
6
6
  * Auditoría y análisis avanzado van al SDK.
7
7
  */
8
- export * from './lineage';
8
+ export { addLineageEntry, addLineageEntries, filterLineageByStep, getLastLineageEntry } from './lineage';
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,WAAW,CAAA"}
@@ -6,7 +6,7 @@
6
6
  * Auditoría y análisis avanzado van al SDK.
7
7
  */
8
8
  // Lineage básico
9
- export * from './lineage';
9
+ export { addLineageEntry, addLineageEntries, filterLineageByStep, getLastLineageEntry } from './lineage';
10
10
  // Funciones de auditoría NO son core - van al SDK/tooling
11
11
  // El core solo preserva linaje, no lo analiza
12
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,iBAAiB;AACjB,cAAc,WAAW,CAAA;AAEzB,0DAA0D;AAC1D,8CAA8C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,iBAAiB;AACjB,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,WAAW,CAAA;AAElB,0DAA0D;AAC1D,8CAA8C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-pip/core",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Core implementation of the AI-PIP protocol. Provides layered, zero-trust context processing (CSL, ISL, CPE, ALL, ModelGateway)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/cpe/index.ts CHANGED
@@ -25,10 +25,19 @@ export { createSignature } from './value-objects/Signature'
25
25
  export type { SignatureVO } from './value-objects/Signature'
26
26
 
27
27
  // Exceptions
28
- export * from './exceptions'
28
+ export { EnvelopeError } from './exceptions/EnvelopeError'
29
29
 
30
30
  // Types
31
- export * from './types'
31
+ export type {
32
+ ProtocolVersion,
33
+ Timestamp,
34
+ NonceValue,
35
+ SignatureAlgorithm,
36
+ Signature,
37
+ CPEMetadata,
38
+ CPEEvelope,
39
+ CPEResult
40
+ } from './types'
32
41
 
33
42
  // Serialización y verificación NO son core - van al SDK
34
43
  // El core solo define la estructura del envelope, no implementa serialización
@@ -9,7 +9,7 @@ import type { Nonce as NonceVO } from './Nonce'
9
9
  /**
10
10
  * Versión actual del protocolo
11
11
  */
12
- export const CURRENT_PROTOCOL_VERSION: ProtocolVersion = '1.0.0'
12
+ export const CURRENT_PROTOCOL_VERSION: ProtocolVersion = '0.1.4'
13
13
 
14
14
  /**
15
15
  * Crea metadata de seguridad para el envelope
@@ -2,7 +2,9 @@
2
2
  * CPE Value Objects - Exports
3
3
  */
4
4
 
5
- export * from './Nonce'
6
- export * from './Metadata'
7
- export * from './Signature'
5
+ export type { Nonce } from './Nonce'
6
+ export { createNonce, isValidNonce, equalsNonce } from './Nonce'
7
+ export { createMetadata, isValidMetadata } from './Metadata'
8
+ export type { SignatureVO } from './Signature'
9
+ export { createSignature, verifySignature, isValidSignatureFormat } from './Signature'
8
10
 
@@ -1,3 +1,3 @@
1
- export * from './ClassificationError'
2
- export * from './SegmentationError'
1
+ export { ClassificationError } from './ClassificationError'
2
+ export { SegmentationError } from './SegmentationError'
3
3
 
package/src/csl/index.ts CHANGED
@@ -21,13 +21,34 @@ export { classifySource, classifyOrigin } from './classify'
21
21
  export { initLineage, createLineageEntry } from './lineage'
22
22
 
23
23
  // Value objects
24
- export * from './value-objects'
24
+ export type { TrustLevel, Origin, LineageEntry, ContentHash } from './value-objects'
25
+ export {
26
+ createTrustLevel,
27
+ isTrusted,
28
+ isSemiTrusted,
29
+ isUntrusted,
30
+ createOrigin,
31
+ isDom,
32
+ isUser,
33
+ isSystem,
34
+ isInjected,
35
+ isUnknown,
36
+ isNetworkFetched,
37
+ isExternal,
38
+ isSha256,
39
+ isSha512,
40
+ originMap,
41
+ createContentHash,
42
+ validateOriginMap
43
+ } from './value-objects'
25
44
 
26
45
  // Exceptions
27
- export * from './exceptions'
46
+ export { ClassificationError } from './exceptions/ClassificationError'
47
+ export { SegmentationError } from './exceptions/SegmentationError'
28
48
 
29
49
  // Types
30
- export * from './types'
50
+ export { OriginType, TrustLevelType } from './types'
51
+ export type { HashAlgorithm, Source, CSLInput, CSLSegment, CSLResult } from './types'
31
52
 
32
53
  // Utils
33
54
  export { generateId, splitByContextRules } from './utils'
package/src/index.ts CHANGED
@@ -11,10 +11,84 @@
11
11
  * - import { envelope } from '@ai-pip/core/cpe'
12
12
  */
13
13
 
14
- // Re-export all layers
15
- export * from './csl'
16
- export * from './isl'
17
- export * from './shared'
18
- export * from './cpe'
14
+ // Re-export CSL
15
+ export {
16
+ segment,
17
+ classifySource,
18
+ classifyOrigin,
19
+ initLineage,
20
+ createLineageEntry,
21
+ generateId,
22
+ splitByContextRules,
23
+ OriginType,
24
+ TrustLevelType,
25
+ ClassificationError,
26
+ SegmentationError
27
+ } from './csl'
28
+ export type {
29
+ HashAlgorithm,
30
+ Source,
31
+ CSLInput,
32
+ CSLSegment,
33
+ CSLResult,
34
+ TrustLevel,
35
+ Origin,
36
+ LineageEntry,
37
+ ContentHash
38
+ } from './csl'
39
+
40
+ // Re-export ISL
41
+ export { sanitize } from './isl'
42
+ export type {
43
+ RiskScore,
44
+ AnomalyAction,
45
+ Position,
46
+ BlockedIntent,
47
+ SensitiveScope,
48
+ ProtectedRole,
49
+ ImmutableInstruction,
50
+ RemovedInstruction,
51
+ ISLSegment,
52
+ ISLResult,
53
+ PiDetection,
54
+ PiDetectionResult,
55
+ AnomalyScore,
56
+ Pattern
57
+ } from './isl'
58
+ export {
59
+ createPiDetection,
60
+ getDetectionLength,
61
+ isHighConfidence,
62
+ isMediumConfidence,
63
+ isLowConfidence,
64
+ createPiDetectionResult,
65
+ hasDetections,
66
+ getDetectionCount,
67
+ getDetectionsByType,
68
+ getHighestConfidenceDetection,
69
+ createAnomalyScore,
70
+ isHighRisk,
71
+ isWarnRisk,
72
+ isLowRisk,
73
+ createPattern,
74
+ matchesPattern,
75
+ findMatch,
76
+ MAX_CONTENT_LENGTH,
77
+ MAX_PATTERN_LENGTH,
78
+ MAX_MATCHES,
79
+ SanitizationError
80
+ } from './isl'
81
+
82
+ // Re-export Shared
83
+ export {
84
+ addLineageEntry,
85
+ addLineageEntries,
86
+ filterLineageByStep,
87
+ getLastLineageEntry
88
+ } from './shared'
89
+
90
+ // Re-export CPE
91
+ export { envelope, createNonce, isValidNonce, equalsNonce, createMetadata, isValidMetadata, CURRENT_PROTOCOL_VERSION, createSignature, EnvelopeError } from './cpe'
92
+ export type { Nonce, SignatureVO, ProtocolVersion, Timestamp, NonceValue, SignatureAlgorithm, Signature, CPEMetadata, CPEEvelope, CPEResult } from './cpe'
19
93
 
20
94
 
@@ -1,2 +1,2 @@
1
- export * from './SanitizationError'
1
+ export { SanitizationError } from './SanitizationError'
2
2
 
package/src/isl/index.ts CHANGED
@@ -10,11 +10,44 @@
10
10
  export { sanitize } from './sanitize'
11
11
 
12
12
  // Value objects
13
- export * from './value-objects'
13
+ export type { PiDetection, PiDetectionResult, AnomalyScore, Pattern } from './value-objects'
14
+ export {
15
+ createPiDetection,
16
+ getDetectionLength,
17
+ isHighConfidence,
18
+ isMediumConfidence,
19
+ isLowConfidence,
20
+ createPiDetectionResult,
21
+ hasDetections,
22
+ getDetectionCount,
23
+ getDetectionsByType,
24
+ getHighestConfidenceDetection,
25
+ createAnomalyScore,
26
+ isHighRisk,
27
+ isWarnRisk,
28
+ isLowRisk,
29
+ createPattern,
30
+ matchesPattern,
31
+ findMatch,
32
+ MAX_CONTENT_LENGTH,
33
+ MAX_PATTERN_LENGTH,
34
+ MAX_MATCHES
35
+ } from './value-objects'
14
36
 
15
37
  // Exceptions
16
- export * from './exceptions'
38
+ export { SanitizationError } from './exceptions/SanitizationError'
17
39
 
18
40
  // Types
19
- export * from './types'
41
+ export type {
42
+ RiskScore,
43
+ AnomalyAction,
44
+ Position,
45
+ BlockedIntent,
46
+ SensitiveScope,
47
+ ProtectedRole,
48
+ ImmutableInstruction,
49
+ RemovedInstruction,
50
+ ISLSegment,
51
+ ISLResult
52
+ } from './types'
20
53
 
@@ -7,7 +7,12 @@
7
7
  */
8
8
 
9
9
  // Lineage básico
10
- export * from './lineage'
10
+ export {
11
+ addLineageEntry,
12
+ addLineageEntries,
13
+ filterLineageByStep,
14
+ getLastLineageEntry
15
+ } from './lineage'
11
16
 
12
17
  // Funciones de auditoría NO son core - van al SDK/tooling
13
18
  // El core solo preserva linaje, no lo analiza