@ai-pip/core 0.2.0 → 0.4.0
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/CHANGELOG.md +106 -3
- package/README.md +52 -951
- package/dist/AAL/constants.d.ts +15 -0
- package/dist/AAL/constants.d.ts.map +1 -0
- package/dist/AAL/constants.js +20 -0
- package/dist/AAL/constants.js.map +1 -0
- package/dist/AAL/index.d.ts +5 -4
- package/dist/AAL/index.d.ts.map +1 -1
- package/dist/AAL/index.js +4 -2
- package/dist/AAL/index.js.map +1 -1
- package/dist/AAL/process/applyRemovalPlan.d.ts +23 -0
- package/dist/AAL/process/applyRemovalPlan.d.ts.map +1 -0
- package/dist/AAL/process/applyRemovalPlan.js +157 -0
- package/dist/AAL/process/applyRemovalPlan.js.map +1 -0
- package/dist/AAL/process/buildDecisionReason.d.ts.map +1 -1
- package/dist/AAL/process/buildDecisionReason.js +24 -4
- package/dist/AAL/process/buildDecisionReason.js.map +1 -1
- package/dist/AAL/process/buildRemediationPlan.d.ts +22 -0
- package/dist/AAL/process/buildRemediationPlan.d.ts.map +1 -0
- package/dist/AAL/process/buildRemediationPlan.js +81 -0
- package/dist/AAL/process/buildRemediationPlan.js.map +1 -0
- package/dist/AAL/process/buildRemovalPlan.d.ts +27 -9
- package/dist/AAL/process/buildRemovalPlan.d.ts.map +1 -1
- package/dist/AAL/process/buildRemovalPlan.js +95 -29
- package/dist/AAL/process/buildRemovalPlan.js.map +1 -1
- package/dist/AAL/process/index.d.ts +2 -2
- package/dist/AAL/process/index.d.ts.map +1 -1
- package/dist/AAL/process/index.js +2 -1
- package/dist/AAL/process/index.js.map +1 -1
- package/dist/AAL/process/resolveAgentAction.d.ts.map +1 -1
- package/dist/AAL/process/resolveAgentAction.js +13 -0
- package/dist/AAL/process/resolveAgentAction.js.map +1 -1
- package/dist/AAL/process/validatePolicy.d.ts +20 -0
- package/dist/AAL/process/validatePolicy.d.ts.map +1 -0
- package/dist/AAL/process/validatePolicy.js +40 -0
- package/dist/AAL/process/validatePolicy.js.map +1 -0
- package/dist/AAL/types.d.ts +18 -31
- package/dist/AAL/types.d.ts.map +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/isl/detect/detect.d.ts +39 -0
- package/dist/isl/detect/detect.d.ts.map +1 -0
- package/dist/isl/detect/detect.js +369 -0
- package/dist/isl/detect/detect.js.map +1 -0
- package/dist/isl/detect/index.d.ts +6 -0
- package/dist/isl/detect/index.d.ts.map +1 -0
- package/dist/isl/detect/index.js +5 -0
- package/dist/isl/detect/index.js.map +1 -0
- package/dist/isl/index.d.ts +8 -1
- package/dist/isl/index.d.ts.map +1 -1
- package/dist/isl/index.js +5 -0
- package/dist/isl/index.js.map +1 -1
- package/dist/isl/process/emitSignal.d.ts +19 -10
- package/dist/isl/process/emitSignal.d.ts.map +1 -1
- package/dist/isl/process/emitSignal.js +25 -23
- package/dist/isl/process/emitSignal.js.map +1 -1
- package/dist/isl/process/index.d.ts +1 -0
- package/dist/isl/process/index.d.ts.map +1 -1
- package/dist/isl/riskScore/calculators.d.ts +19 -0
- package/dist/isl/riskScore/calculators.d.ts.map +1 -0
- package/dist/isl/riskScore/calculators.js +50 -0
- package/dist/isl/riskScore/calculators.js.map +1 -0
- package/dist/isl/riskScore/index.d.ts +14 -0
- package/dist/isl/riskScore/index.d.ts.map +1 -0
- package/dist/isl/riskScore/index.js +26 -0
- package/dist/isl/riskScore/index.js.map +1 -0
- package/dist/isl/riskScore/types.d.ts +20 -0
- package/dist/isl/riskScore/types.d.ts.map +1 -0
- package/dist/isl/riskScore/types.js +12 -0
- package/dist/isl/riskScore/types.js.map +1 -0
- package/dist/isl/sanitize.d.ts +8 -1
- package/dist/isl/sanitize.d.ts.map +1 -1
- package/dist/isl/sanitize.js +13 -5
- package/dist/isl/sanitize.js.map +1 -1
- package/dist/isl/signals.d.ts +16 -1
- package/dist/isl/signals.d.ts.map +1 -1
- package/dist/isl/signals.js +4 -2
- package/dist/isl/signals.js.map +1 -1
- package/dist/isl/value-objects/Pattern.d.ts +21 -0
- package/dist/isl/value-objects/Pattern.d.ts.map +1 -1
- package/dist/isl/value-objects/Pattern.js +36 -0
- package/dist/isl/value-objects/Pattern.js.map +1 -1
- package/dist/isl/value-objects/index.d.ts +2 -2
- package/dist/isl/value-objects/index.d.ts.map +1 -1
- package/dist/isl/value-objects/index.js +1 -1
- package/dist/isl/value-objects/index.js.map +1 -1
- package/dist/shared/audit.d.ts +126 -28
- package/dist/shared/audit.d.ts.map +1 -1
- package/dist/shared/audit.js +322 -44
- package/dist/shared/audit.js.map +1 -1
- package/dist/shared/envelope/envelope.d.ts +23 -0
- package/dist/shared/envelope/envelope.d.ts.map +1 -0
- package/dist/shared/envelope/envelope.js +58 -0
- package/dist/shared/envelope/envelope.js.map +1 -0
- package/dist/shared/envelope/exceptions/EnvelopeError.d.ts +8 -0
- package/dist/shared/envelope/exceptions/EnvelopeError.d.ts.map +1 -0
- package/dist/shared/envelope/exceptions/EnvelopeError.js +13 -0
- package/dist/shared/envelope/exceptions/EnvelopeError.js.map +1 -0
- package/dist/shared/envelope/exceptions/index.d.ts +2 -0
- package/dist/shared/envelope/exceptions/index.d.ts.map +1 -0
- package/dist/shared/envelope/exceptions/index.js +2 -0
- package/dist/shared/envelope/exceptions/index.js.map +1 -0
- package/dist/shared/envelope/index.d.ts +18 -0
- package/dist/shared/envelope/index.d.ts.map +1 -0
- package/dist/shared/envelope/index.js +15 -0
- package/dist/shared/envelope/index.js.map +1 -0
- package/dist/shared/envelope/types.d.ts +45 -0
- package/dist/shared/envelope/types.d.ts.map +1 -0
- package/dist/shared/envelope/types.js +10 -0
- package/dist/shared/envelope/types.js.map +1 -0
- package/dist/shared/envelope/value-objects/Metadata.d.ts +27 -0
- package/dist/shared/envelope/value-objects/Metadata.d.ts.map +1 -0
- package/dist/shared/envelope/value-objects/Metadata.js +57 -0
- package/dist/shared/envelope/value-objects/Metadata.js.map +1 -0
- package/dist/shared/envelope/value-objects/Nonce.d.ts +26 -0
- package/dist/shared/envelope/value-objects/Nonce.d.ts.map +1 -0
- package/dist/shared/envelope/value-objects/Nonce.js +38 -0
- package/dist/shared/envelope/value-objects/Nonce.js.map +1 -0
- package/dist/shared/envelope/value-objects/Signature.d.ts +28 -0
- package/dist/shared/envelope/value-objects/Signature.d.ts.map +1 -0
- package/dist/shared/envelope/value-objects/Signature.js +50 -0
- package/dist/shared/envelope/value-objects/Signature.js.map +1 -0
- package/dist/shared/envelope/value-objects/index.d.ts +9 -0
- package/dist/shared/envelope/value-objects/index.d.ts.map +1 -0
- package/dist/shared/envelope/value-objects/index.js +7 -0
- package/dist/shared/envelope/value-objects/index.js.map +1 -0
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/index.js.map +1 -1
- package/package.json +11 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/shared/envelope/exceptions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Envelope (transversal) – integrity and anti-replay for pipeline results
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* CPE is a cross-cutting concern, not a layer. It wraps the output of the pipeline
|
|
6
|
+
* (e.g. ISL or AAL result) with metadata, nonce, and HMAC-SHA256 signature.
|
|
7
|
+
* Use `envelope(islResult, secretKey)` to produce a CPEResult; serialization
|
|
8
|
+
* and verification are the responsibility of the SDK.
|
|
9
|
+
*/
|
|
10
|
+
export { envelope } from './envelope.js';
|
|
11
|
+
export { createNonce, isValidNonce, equalsNonce } from './value-objects/Nonce.js';
|
|
12
|
+
export type { Nonce } from './value-objects/Nonce.js';
|
|
13
|
+
export { createMetadata, isValidMetadata, CURRENT_PROTOCOL_VERSION } from './value-objects/Metadata.js';
|
|
14
|
+
export { createSignature, verifySignature, isValidSignatureFormat } from './value-objects/Signature.js';
|
|
15
|
+
export type { SignatureVO } from './value-objects/Signature.js';
|
|
16
|
+
export { EnvelopeError } from './exceptions/index.js';
|
|
17
|
+
export type { ProtocolVersion, Timestamp, NonceValue, SignatureAlgorithm, Signature, CPEMetadata, CPEEvelope, CPEResult, } from './types.js';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/envelope/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACjF,YAAY,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AACvG,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACvG,YAAY,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,YAAY,EACV,eAAe,EACf,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,UAAU,EACV,SAAS,GACV,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Envelope (transversal) – integrity and anti-replay for pipeline results
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* CPE is a cross-cutting concern, not a layer. It wraps the output of the pipeline
|
|
6
|
+
* (e.g. ISL or AAL result) with metadata, nonce, and HMAC-SHA256 signature.
|
|
7
|
+
* Use `envelope(islResult, secretKey)` to produce a CPEResult; serialization
|
|
8
|
+
* and verification are the responsibility of the SDK.
|
|
9
|
+
*/
|
|
10
|
+
export { envelope } from './envelope.js';
|
|
11
|
+
export { createNonce, isValidNonce, equalsNonce } from './value-objects/Nonce.js';
|
|
12
|
+
export { createMetadata, isValidMetadata, CURRENT_PROTOCOL_VERSION } from './value-objects/Metadata.js';
|
|
13
|
+
export { createSignature, verifySignature, isValidSignatureFormat } from './value-objects/Signature.js';
|
|
14
|
+
export { EnvelopeError } from './exceptions/index.js';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/envelope/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAEjF,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AACvG,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAEvG,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Envelope types (transversal) – integrity and anti-replay
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* The envelope is a cross-cutting concern: it wraps the pipeline result
|
|
6
|
+
* (e.g. ISL or AAL output) with metadata, nonce, and HMAC signature.
|
|
7
|
+
* It is not a processing layer; it applies to the result of the pipeline.
|
|
8
|
+
*/
|
|
9
|
+
import type { LineageEntry } from '../../csl/value-objects/index.js';
|
|
10
|
+
/** Protocol version string (e.g. "0.1.4") */
|
|
11
|
+
export type ProtocolVersion = string;
|
|
12
|
+
/** Unix timestamp in milliseconds */
|
|
13
|
+
export type Timestamp = number;
|
|
14
|
+
/** Nonce value for replay prevention */
|
|
15
|
+
export type NonceValue = string;
|
|
16
|
+
/** Supported signature algorithm */
|
|
17
|
+
export type SignatureAlgorithm = 'HMAC-SHA256';
|
|
18
|
+
/** Signature value (hex string) */
|
|
19
|
+
export type Signature = string;
|
|
20
|
+
/** Envelope security metadata: timestamp, nonce, protocol version, optional previous signatures */
|
|
21
|
+
export interface CPEMetadata {
|
|
22
|
+
readonly timestamp: Timestamp;
|
|
23
|
+
readonly nonce: NonceValue;
|
|
24
|
+
readonly protocolVersion: ProtocolVersion;
|
|
25
|
+
readonly previousSignatures?: {
|
|
26
|
+
readonly csl?: string | undefined;
|
|
27
|
+
readonly isl?: string | undefined;
|
|
28
|
+
} | undefined;
|
|
29
|
+
}
|
|
30
|
+
/** Full cryptographic envelope: payload, metadata, signature, lineage */
|
|
31
|
+
export interface CPEEvelope {
|
|
32
|
+
readonly payload: unknown;
|
|
33
|
+
readonly metadata: CPEMetadata;
|
|
34
|
+
readonly signature: {
|
|
35
|
+
readonly value: string;
|
|
36
|
+
readonly algorithm: string;
|
|
37
|
+
};
|
|
38
|
+
readonly lineage: readonly LineageEntry[];
|
|
39
|
+
}
|
|
40
|
+
/** Result of envelope generation (envelope + optional processing time) */
|
|
41
|
+
export interface CPEResult {
|
|
42
|
+
readonly envelope: CPEEvelope;
|
|
43
|
+
readonly processingTimeMs?: number;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/shared/envelope/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAEpE,6CAA6C;AAC7C,MAAM,MAAM,eAAe,GAAG,MAAM,CAAA;AAEpC,qCAAqC;AACrC,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAE9B,wCAAwC;AACxC,MAAM,MAAM,UAAU,GAAG,MAAM,CAAA;AAE/B,oCAAoC;AACpC,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAA;AAE9C,mCAAmC;AACnC,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAE9B,mGAAmG;AACnG,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;IAC1B,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAA;IACzC,QAAQ,CAAC,kBAAkB,CAAC,EAAE;QAC5B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;QACjC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAClC,GAAG,SAAS,CAAA;CACd;AAED,yEAAyE;AACzE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAA;IAC9B,QAAQ,CAAC,SAAS,EAAE;QAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;QACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;KAC3B,CAAA;IACD,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAA;CAC1C;AAED,0EAA0E;AAC1E,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAA;IAC7B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CACnC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Envelope types (transversal) – integrity and anti-replay
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* The envelope is a cross-cutting concern: it wraps the pipeline result
|
|
6
|
+
* (e.g. ISL or AAL output) with metadata, nonce, and HMAC signature.
|
|
7
|
+
* It is not a processing layer; it applies to the result of the pipeline.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/shared/envelope/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Envelope metadata – security metadata value object (timestamp, nonce, version).
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Immutable; validates timestamp (positive, not in the future) and protocol version.
|
|
6
|
+
*/
|
|
7
|
+
import type { CPEMetadata, ProtocolVersion, Timestamp } from '../types.js';
|
|
8
|
+
import type { Nonce as NonceVO } from './Nonce.js';
|
|
9
|
+
/** Current protocol version for envelope metadata */
|
|
10
|
+
export declare const CURRENT_PROTOCOL_VERSION: ProtocolVersion;
|
|
11
|
+
/**
|
|
12
|
+
* Creates envelope metadata (frozen).
|
|
13
|
+
*
|
|
14
|
+
* @param timestamp - Unix timestamp in ms
|
|
15
|
+
* @param nonce - Nonce value object
|
|
16
|
+
* @param protocolVersion - Protocol version (default: CURRENT_PROTOCOL_VERSION)
|
|
17
|
+
* @param previousSignatures - Optional previous layer signatures (csl, isl)
|
|
18
|
+
*/
|
|
19
|
+
export declare function createMetadata(timestamp: Timestamp, nonce: NonceVO, protocolVersion?: ProtocolVersion, previousSignatures?: {
|
|
20
|
+
csl?: string;
|
|
21
|
+
isl?: string;
|
|
22
|
+
}): CPEMetadata;
|
|
23
|
+
/**
|
|
24
|
+
* Validates metadata shape and values.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isValidMetadata(metadata: CPEMetadata): boolean;
|
|
27
|
+
//# sourceMappingURL=Metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Metadata.d.ts","sourceRoot":"","sources":["../../../../src/shared/envelope/value-objects/Metadata.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC1E,OAAO,KAAK,EAAE,KAAK,IAAI,OAAO,EAAE,MAAM,YAAY,CAAA;AAElD,qDAAqD;AACrD,eAAO,MAAM,wBAAwB,EAAE,eAAyB,CAAA;AAEhE;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,OAAO,EACd,eAAe,GAAE,eAA0C,EAC3D,kBAAkB,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAClD,WAAW,CAyBb;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,WAAW,GAAG,OAAO,CAS9D"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Envelope metadata – security metadata value object (timestamp, nonce, version).
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Immutable; validates timestamp (positive, not in the future) and protocol version.
|
|
6
|
+
*/
|
|
7
|
+
/** Current protocol version for envelope metadata */
|
|
8
|
+
export const CURRENT_PROTOCOL_VERSION = '0.1.4';
|
|
9
|
+
/**
|
|
10
|
+
* Creates envelope metadata (frozen).
|
|
11
|
+
*
|
|
12
|
+
* @param timestamp - Unix timestamp in ms
|
|
13
|
+
* @param nonce - Nonce value object
|
|
14
|
+
* @param protocolVersion - Protocol version (default: CURRENT_PROTOCOL_VERSION)
|
|
15
|
+
* @param previousSignatures - Optional previous layer signatures (csl, isl)
|
|
16
|
+
*/
|
|
17
|
+
export function createMetadata(timestamp, nonce, protocolVersion = CURRENT_PROTOCOL_VERSION, previousSignatures) {
|
|
18
|
+
if (timestamp <= 0) {
|
|
19
|
+
throw new Error('Timestamp must be a positive number');
|
|
20
|
+
}
|
|
21
|
+
const maxFutureTimestamp = Date.now() + 5 * 60 * 1000;
|
|
22
|
+
if (timestamp > maxFutureTimestamp) {
|
|
23
|
+
throw new Error('Timestamp cannot be in the future');
|
|
24
|
+
}
|
|
25
|
+
if (!protocolVersion || typeof protocolVersion !== 'string') {
|
|
26
|
+
throw new Error('Protocol version must be a non-empty string');
|
|
27
|
+
}
|
|
28
|
+
return Object.freeze({
|
|
29
|
+
timestamp,
|
|
30
|
+
nonce: nonce.value,
|
|
31
|
+
protocolVersion,
|
|
32
|
+
previousSignatures: previousSignatures
|
|
33
|
+
? Object.freeze({
|
|
34
|
+
csl: previousSignatures.csl ?? undefined,
|
|
35
|
+
isl: previousSignatures.isl ?? undefined,
|
|
36
|
+
})
|
|
37
|
+
: undefined,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Validates metadata shape and values.
|
|
42
|
+
*/
|
|
43
|
+
export function isValidMetadata(metadata) {
|
|
44
|
+
try {
|
|
45
|
+
if (metadata.timestamp <= 0)
|
|
46
|
+
return false;
|
|
47
|
+
if (!metadata.nonce || metadata.nonce.length < 16)
|
|
48
|
+
return false;
|
|
49
|
+
if (!metadata.protocolVersion)
|
|
50
|
+
return false;
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=Metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Metadata.js","sourceRoot":"","sources":["../../../../src/shared/envelope/value-objects/Metadata.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,qDAAqD;AACrD,MAAM,CAAC,MAAM,wBAAwB,GAAoB,OAAO,CAAA;AAEhE;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,SAAoB,EACpB,KAAc,EACd,kBAAmC,wBAAwB,EAC3D,kBAAmD;IAEnD,IAAI,SAAS,IAAI,CAAC,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;IACxD,CAAC;IAED,MAAM,kBAAkB,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAA;IACrD,IAAI,SAAS,GAAG,kBAAkB,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAA;IACtD,CAAC;IAED,IAAI,CAAC,eAAe,IAAI,OAAO,eAAe,KAAK,QAAQ,EAAE,CAAC;QAC5D,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAA;IAChE,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,SAAS;QACT,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,eAAe;QACf,kBAAkB,EAAE,kBAAkB;YACpC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;gBACZ,GAAG,EAAE,kBAAkB,CAAC,GAAG,IAAI,SAAS;gBACxC,GAAG,EAAE,kBAAkB,CAAC,GAAG,IAAI,SAAS;aACzC,CAAC;YACJ,CAAC,CAAC,SAAS;KACd,CAAC,CAAA;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,QAAqB;IACnD,IAAI,CAAC;QACH,IAAI,QAAQ,CAAC,SAAS,IAAI,CAAC;YAAE,OAAO,KAAK,CAAA;QACzC,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE;YAAE,OAAO,KAAK,CAAA;QAC/D,IAAI,CAAC,QAAQ,CAAC,eAAe;YAAE,OAAO,KAAK,CAAA;QAC3C,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nonce – unique value for replay prevention. Immutable value object.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Used by the envelope to bind each wrapped result to a unique value;
|
|
6
|
+
* verification layer (SDK) should reject duplicate nonces within a time window.
|
|
7
|
+
*/
|
|
8
|
+
export type Nonce = {
|
|
9
|
+
readonly value: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Creates a unique nonce (default 16 bytes, hex-encoded).
|
|
13
|
+
*
|
|
14
|
+
* @param length - Length in bytes (8–64)
|
|
15
|
+
* @returns Frozen Nonce value object
|
|
16
|
+
*/
|
|
17
|
+
export declare function createNonce(length?: number): Nonce;
|
|
18
|
+
/**
|
|
19
|
+
* Validates that a string is a valid nonce format (hex, 16–128 chars).
|
|
20
|
+
*/
|
|
21
|
+
export declare function isValidNonce(value: string): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Compares two nonces for equality.
|
|
24
|
+
*/
|
|
25
|
+
export declare function equalsNonce(nonce1: Nonce, nonce2: Nonce): boolean;
|
|
26
|
+
//# sourceMappingURL=Nonce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Nonce.d.ts","sourceRoot":"","sources":["../../../../src/shared/envelope/value-objects/Nonce.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,GAAE,MAAW,GAAG,KAAK,CAYtD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,GAAG,OAAO,CAEjE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nonce – unique value for replay prevention. Immutable value object.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Used by the envelope to bind each wrapped result to a unique value;
|
|
6
|
+
* verification layer (SDK) should reject duplicate nonces within a time window.
|
|
7
|
+
*/
|
|
8
|
+
import { randomBytes } from 'node:crypto';
|
|
9
|
+
/**
|
|
10
|
+
* Creates a unique nonce (default 16 bytes, hex-encoded).
|
|
11
|
+
*
|
|
12
|
+
* @param length - Length in bytes (8–64)
|
|
13
|
+
* @returns Frozen Nonce value object
|
|
14
|
+
*/
|
|
15
|
+
export function createNonce(length = 16) {
|
|
16
|
+
if (length < 8) {
|
|
17
|
+
throw new Error('Nonce length must be at least 8 bytes');
|
|
18
|
+
}
|
|
19
|
+
if (length > 64) {
|
|
20
|
+
throw new Error('Nonce length must be at most 64 bytes');
|
|
21
|
+
}
|
|
22
|
+
const bytes = randomBytes(length);
|
|
23
|
+
const value = bytes.toString('hex');
|
|
24
|
+
return Object.freeze({ value });
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Validates that a string is a valid nonce format (hex, 16–128 chars).
|
|
28
|
+
*/
|
|
29
|
+
export function isValidNonce(value) {
|
|
30
|
+
return /^[a-f0-9]{16,128}$/i.test(value);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Compares two nonces for equality.
|
|
34
|
+
*/
|
|
35
|
+
export function equalsNonce(nonce1, nonce2) {
|
|
36
|
+
return nonce1.value === nonce2.value;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=Nonce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Nonce.js","sourceRoot":"","sources":["../../../../src/shared/envelope/value-objects/Nonce.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAMzC;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,SAAiB,EAAE;IAC7C,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAA;IAC1D,CAAC;IACD,IAAI,MAAM,GAAG,EAAE,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAA;IAC1D,CAAC;IAED,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,CAAA;IACjC,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IAEnC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,OAAO,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,MAAa,EAAE,MAAa;IACtD,OAAO,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAA;AACtC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signature – HMAC-SHA256 cryptographic signature. Immutable value object.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Used by the envelope to sign payload + metadata; verification is responsibility of the SDK.
|
|
6
|
+
*/
|
|
7
|
+
import type { SignatureAlgorithm } from '../types.js';
|
|
8
|
+
export type SignatureVO = {
|
|
9
|
+
readonly value: string;
|
|
10
|
+
readonly algorithm: SignatureAlgorithm;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Creates HMAC-SHA256 signature of the given content.
|
|
14
|
+
*
|
|
15
|
+
* @param content - String to sign (e.g. JSON.stringify(payload + metadata))
|
|
16
|
+
* @param secretKey - Secret key for HMAC (must not be logged or serialized)
|
|
17
|
+
* @returns Frozen Signature value object
|
|
18
|
+
*/
|
|
19
|
+
export declare function createSignature(content: string, secretKey: string): SignatureVO;
|
|
20
|
+
/**
|
|
21
|
+
* Verifies that a signature matches the content (constant-time comparison should be used in production).
|
|
22
|
+
*/
|
|
23
|
+
export declare function verifySignature(content: string, signature: string, secretKey: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Validates signature format (64 hex chars for HMAC-SHA256).
|
|
26
|
+
*/
|
|
27
|
+
export declare function isValidSignatureFormat(signature: string): boolean;
|
|
28
|
+
//# sourceMappingURL=Signature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Signature.d.ts","sourceRoot":"","sources":["../../../../src/shared/envelope/value-objects/Signature.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErD,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAA;CACvC,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,WAAW,CAiB/E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAQT;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEjE"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signature – HMAC-SHA256 cryptographic signature. Immutable value object.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Used by the envelope to sign payload + metadata; verification is responsibility of the SDK.
|
|
6
|
+
*/
|
|
7
|
+
import { createHmac } from 'node:crypto';
|
|
8
|
+
/**
|
|
9
|
+
* Creates HMAC-SHA256 signature of the given content.
|
|
10
|
+
*
|
|
11
|
+
* @param content - String to sign (e.g. JSON.stringify(payload + metadata))
|
|
12
|
+
* @param secretKey - Secret key for HMAC (must not be logged or serialized)
|
|
13
|
+
* @returns Frozen Signature value object
|
|
14
|
+
*/
|
|
15
|
+
export function createSignature(content, secretKey) {
|
|
16
|
+
if (!secretKey || secretKey.length === 0) {
|
|
17
|
+
throw new Error('Secret key is required for signature generation');
|
|
18
|
+
}
|
|
19
|
+
if (typeof content !== 'string') {
|
|
20
|
+
throw new TypeError('Content must be a string');
|
|
21
|
+
}
|
|
22
|
+
const hmac = createHmac('sha256', secretKey);
|
|
23
|
+
hmac.update(content);
|
|
24
|
+
const signature = hmac.digest('hex');
|
|
25
|
+
return Object.freeze({
|
|
26
|
+
value: signature,
|
|
27
|
+
algorithm: 'HMAC-SHA256',
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Verifies that a signature matches the content (constant-time comparison should be used in production).
|
|
32
|
+
*/
|
|
33
|
+
export function verifySignature(content, signature, secretKey) {
|
|
34
|
+
if (!secretKey || secretKey.length === 0)
|
|
35
|
+
return false;
|
|
36
|
+
try {
|
|
37
|
+
const expected = createSignature(content, secretKey);
|
|
38
|
+
return expected.value === signature;
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Validates signature format (64 hex chars for HMAC-SHA256).
|
|
46
|
+
*/
|
|
47
|
+
export function isValidSignatureFormat(signature) {
|
|
48
|
+
return /^[a-f0-9]{64}$/i.test(signature);
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=Signature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Signature.js","sourceRoot":"","sources":["../../../../src/shared/envelope/value-objects/Signature.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAQxC;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe,EAAE,SAAiB;IAChE,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAA;IACpE,CAAC;IAED,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,0BAA0B,CAAC,CAAA;IACjD,CAAC;IAED,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAA;IAC5C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IACpB,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAEpC,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,KAAK,EAAE,SAAS;QAChB,SAAS,EAAE,aAAa;KACzB,CAAC,CAAA;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAe,EACf,SAAiB,EACjB,SAAiB;IAEjB,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IACtD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;QACpD,OAAO,QAAQ,CAAC,KAAK,KAAK,SAAS,CAAA;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,SAAiB;IACtD,OAAO,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;AAC1C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Envelope value objects – nonce, metadata, signature
|
|
3
|
+
*/
|
|
4
|
+
export type { Nonce } from './Nonce.js';
|
|
5
|
+
export { createNonce, isValidNonce, equalsNonce } from './Nonce.js';
|
|
6
|
+
export { createMetadata, isValidMetadata } from './Metadata.js';
|
|
7
|
+
export type { SignatureVO } from './Signature.js';
|
|
8
|
+
export { createSignature, verifySignature, isValidSignatureFormat } from './Signature.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared/envelope/value-objects/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/D,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Envelope value objects – nonce, metadata, signature
|
|
3
|
+
*/
|
|
4
|
+
export { createNonce, isValidNonce, equalsNonce } from './Nonce.js';
|
|
5
|
+
export { createMetadata, isValidMetadata } from './Metadata.js';
|
|
6
|
+
export { createSignature, verifySignature, isValidSignatureFormat } from './Signature.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/shared/envelope/value-objects/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Lineage handling and AI-PIP audit formatting for clear, flexible auditing.
|
|
6
6
|
*/
|
|
7
7
|
export { addLineageEntry, addLineageEntries, filterLineageByStep, getLastLineageEntry } from './lineage.js';
|
|
8
|
-
export { formatLineageForAudit, formatCSLForAudit, formatISLForAudit, formatISLSignalForAudit, formatAALForAudit, formatCPEForAudit, formatPipelineAudit } from './audit.js';
|
|
9
|
-
export type { LineageEntryLike, CSLResultLike, ISLResultLike, ISLSignalLike, DecisionReasonLike,
|
|
8
|
+
export { formatLineageForAudit, formatCSLForAudit, formatISLForAudit, formatISLSignalForAudit, formatAALForAudit, formatCPEForAudit, formatPipelineAudit, formatPipelineAuditFull, formatPipelineAuditAsJson, createAuditRunId, buildAuditLogEntry, buildFullAuditPayload } from './audit.js';
|
|
9
|
+
export type { LineageEntryLike, CSLResultLike, ISLResultLike, ISLSignalLike, DecisionReasonLike, RemediationPlanLike, CPEResultLike, AuditRunInfo, AuditLogSummary, FullPipelineAuditOptions, PipelineAuditJsonOptions } from './audit.js';
|
|
10
10
|
export type { Position, SegmentRef } from './types.js';
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,cAAc,CAAA;AAGrB,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,cAAc,CAAA;AAGrB,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,EACvB,yBAAyB,EACzB,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,YAAY,CAAA;AAEnB,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,eAAe,EACf,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,YAAY,CAAA;AAEnB,YAAY,EACV,QAAQ,EACR,UAAU,EACX,MAAM,YAAY,CAAA"}
|
package/dist/shared/index.js
CHANGED
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
// Lineage
|
|
8
8
|
export { addLineageEntry, addLineageEntries, filterLineageByStep, getLastLineageEntry } from './lineage.js';
|
|
9
9
|
// Audit / pretty-print for AI-PIP layers (ordered, human-readable)
|
|
10
|
-
export { formatLineageForAudit, formatCSLForAudit, formatISLForAudit, formatISLSignalForAudit, formatAALForAudit, formatCPEForAudit, formatPipelineAudit } from './audit.js';
|
|
10
|
+
export { formatLineageForAudit, formatCSLForAudit, formatISLForAudit, formatISLSignalForAudit, formatAALForAudit, formatCPEForAudit, formatPipelineAudit, formatPipelineAuditFull, formatPipelineAuditAsJson, createAuditRunId, buildAuditLogEntry, buildFullAuditPayload } from './audit.js';
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
package/dist/shared/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,UAAU;AACV,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,cAAc,CAAA;AAErB,mEAAmE;AACnE,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,UAAU;AACV,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,cAAc,CAAA;AAErB,mEAAmE;AACnE,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,EACvB,yBAAyB,EACzB,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,YAAY,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-pip/core",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Core implementation of the AI-PIP protocol. Provides layered, zero-trust context processing (CSL, ISL, AAL
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "Core implementation of the AI-PIP protocol. Provides layered, zero-trust context processing (CSL, ISL, AAL)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"default": "./dist/AAL/index.js"
|
|
28
28
|
},
|
|
29
29
|
"./cpe": {
|
|
30
|
-
"types": "./dist/
|
|
31
|
-
"import": "./dist/
|
|
32
|
-
"default": "./dist/
|
|
30
|
+
"types": "./dist/shared/envelope/index.d.ts",
|
|
31
|
+
"import": "./dist/shared/envelope/index.js",
|
|
32
|
+
"default": "./dist/shared/envelope/index.js"
|
|
33
33
|
},
|
|
34
34
|
"./shared": {
|
|
35
35
|
"types": "./dist/shared/index.d.ts",
|
|
@@ -86,6 +86,11 @@
|
|
|
86
86
|
"test:watch": "vitest --watch",
|
|
87
87
|
"test:ui": "vitest --ui",
|
|
88
88
|
"test:coverage": "vitest --coverage",
|
|
89
|
-
"test:install": "node test-package-install.js"
|
|
89
|
+
"test:install": "node test-package-install.js",
|
|
90
|
+
"verify-risk": "node scripts/verify-risk-score.mjs",
|
|
91
|
+
"demo-menu": "node scripts/interactive-risk-menu.mjs",
|
|
92
|
+
"demo-full": "node scripts/demo-full-flow.mjs",
|
|
93
|
+
"audit-report": "node scripts/audit-report.mjs",
|
|
94
|
+
"scan-removal": "node scripts/scan-removal.mjs"
|
|
90
95
|
}
|
|
91
96
|
}
|