@ai-pip/core 0.1.6 → 0.1.8
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 +264 -0
- package/README.md +488 -100
- package/dist/cpe/envelope.d.ts +2 -2
- package/dist/cpe/envelope.d.ts.map +1 -1
- package/dist/cpe/envelope.js +6 -6
- package/dist/cpe/envelope.js.map +1 -1
- package/dist/cpe/exceptions/index.d.ts +1 -1
- package/dist/cpe/exceptions/index.d.ts.map +1 -1
- package/dist/cpe/exceptions/index.js +1 -1
- package/dist/cpe/exceptions/index.js.map +1 -1
- package/dist/cpe/index.d.ts +8 -8
- package/dist/cpe/index.d.ts.map +1 -1
- package/dist/cpe/index.js +5 -5
- package/dist/cpe/index.js.map +1 -1
- package/dist/cpe/types.d.ts +1 -1
- package/dist/cpe/types.d.ts.map +1 -1
- package/dist/cpe/value-objects/Metadata.d.ts +2 -2
- package/dist/cpe/value-objects/Metadata.d.ts.map +1 -1
- package/dist/cpe/value-objects/Signature.d.ts +1 -1
- package/dist/cpe/value-objects/Signature.d.ts.map +1 -1
- package/dist/cpe/value-objects/index.d.ts +5 -5
- package/dist/cpe/value-objects/index.d.ts.map +1 -1
- package/dist/cpe/value-objects/index.js +3 -3
- package/dist/cpe/value-objects/index.js.map +1 -1
- package/dist/csl/classify.d.ts +6 -6
- package/dist/csl/classify.d.ts.map +1 -1
- package/dist/csl/classify.js +9 -9
- package/dist/csl/classify.js.map +1 -1
- package/dist/csl/exceptions/index.d.ts +2 -2
- package/dist/csl/exceptions/index.d.ts.map +1 -1
- package/dist/csl/exceptions/index.js +2 -2
- package/dist/csl/exceptions/index.js.map +1 -1
- package/dist/csl/index.d.ts +10 -10
- package/dist/csl/index.d.ts.map +1 -1
- package/dist/csl/index.js +8 -8
- package/dist/csl/index.js.map +1 -1
- package/dist/csl/lineage.d.ts +2 -2
- package/dist/csl/lineage.d.ts.map +1 -1
- package/dist/csl/lineage.js +1 -1
- package/dist/csl/lineage.js.map +1 -1
- package/dist/csl/segment.d.ts +1 -1
- package/dist/csl/segment.d.ts.map +1 -1
- package/dist/csl/segment.js +4 -4
- package/dist/csl/segment.js.map +1 -1
- package/dist/csl/types.d.ts +1 -1
- package/dist/csl/types.d.ts.map +1 -1
- package/dist/csl/value-objects/ContentHash.d.ts +1 -1
- package/dist/csl/value-objects/ContentHash.d.ts.map +1 -1
- package/dist/csl/value-objects/Origin-map.d.ts +1 -1
- package/dist/csl/value-objects/Origin-map.d.ts.map +1 -1
- package/dist/csl/value-objects/Origin-map.js +6 -6
- package/dist/csl/value-objects/Origin-map.js.map +1 -1
- package/dist/csl/value-objects/Origin.d.ts +1 -1
- package/dist/csl/value-objects/Origin.d.ts.map +1 -1
- package/dist/csl/value-objects/Origin.js +1 -1
- package/dist/csl/value-objects/Origin.js.map +1 -1
- package/dist/csl/value-objects/TrustLevel.d.ts +1 -1
- package/dist/csl/value-objects/TrustLevel.d.ts.map +1 -1
- package/dist/csl/value-objects/TrustLevel.js +1 -1
- package/dist/csl/value-objects/TrustLevel.js.map +1 -1
- package/dist/csl/value-objects/index.d.ts +9 -9
- package/dist/csl/value-objects/index.d.ts.map +1 -1
- package/dist/csl/value-objects/index.js +5 -5
- package/dist/csl/value-objects/index.js.map +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/isl/exceptions/index.d.ts +1 -1
- package/dist/isl/exceptions/index.d.ts.map +1 -1
- package/dist/isl/exceptions/index.js +1 -1
- package/dist/isl/exceptions/index.js.map +1 -1
- package/dist/isl/index.d.ts +5 -5
- package/dist/isl/index.d.ts.map +1 -1
- package/dist/isl/index.js +3 -3
- package/dist/isl/index.js.map +1 -1
- package/dist/isl/sanitize.d.ts +2 -2
- package/dist/isl/sanitize.d.ts.map +1 -1
- package/dist/isl/sanitize.js +3 -3
- package/dist/isl/sanitize.js.map +1 -1
- package/dist/isl/types.d.ts +3 -3
- package/dist/isl/types.d.ts.map +1 -1
- package/dist/isl/value-objects/AnomalyScore.d.ts +1 -1
- package/dist/isl/value-objects/AnomalyScore.d.ts.map +1 -1
- package/dist/isl/value-objects/Pattern.d.ts +1 -1
- package/dist/isl/value-objects/Pattern.d.ts.map +1 -1
- package/dist/isl/value-objects/PiDetection.d.ts +1 -1
- package/dist/isl/value-objects/PiDetection.d.ts.map +1 -1
- package/dist/isl/value-objects/PiDetectionResult.d.ts +2 -2
- package/dist/isl/value-objects/PiDetectionResult.d.ts.map +1 -1
- package/dist/isl/value-objects/PolicyRule.d.ts +1 -1
- package/dist/isl/value-objects/PolicyRule.d.ts.map +1 -1
- package/dist/isl/value-objects/index.d.ts +8 -8
- package/dist/isl/value-objects/index.d.ts.map +1 -1
- package/dist/isl/value-objects/index.js +4 -4
- package/dist/isl/value-objects/index.js.map +1 -1
- package/dist/shared/index.d.ts +1 -1
- 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/dist/shared/lineage.d.ts +1 -1
- package/dist/shared/lineage.d.ts.map +1 -1
- package/package.json +3 -2
- package/tsconfig.json +0 -30
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## [0.1.8] - 2026-01-04
|
|
11
|
+
|
|
12
|
+
### 🐛 Critical Fixes - Origin Classification
|
|
13
|
+
|
|
14
|
+
- **Fixed source classification mapping**: Corrected the deterministic trust level classification for all content sources to align with AI-PIP protocol specification
|
|
15
|
+
- **Updated trust level assignments**:
|
|
16
|
+
- `SYSTEM` → `TC` (Trusted Content) - System-generated content, fully trusted
|
|
17
|
+
- `UI` → `STC` (Semi-Trusted Content) - User interface content, moderate trust
|
|
18
|
+
- `API` → `STC` (Semi-Trusted Content) - External API content, moderate trust
|
|
19
|
+
- `DOM` → `UC` (Untrusted Content) - DOM/WEB/SCRAPED content, untrusted by default
|
|
20
|
+
- **Corrected sanitization levels**: Updated sanitization logic to match the corrected trust levels (TC → minimal, STC → moderate, UC → aggressive)
|
|
21
|
+
- **Fixed test suite**: Updated all tests to reflect the correct classification, ensuring consistency across the codebase
|
|
22
|
+
|
|
23
|
+
#### What This Fixes
|
|
24
|
+
|
|
25
|
+
**Problem**: During documentation review, inconsistencies were discovered between:
|
|
26
|
+
- The actual source classification implementation
|
|
27
|
+
- The AI-PIP protocol specification
|
|
28
|
+
- Test expectations and assertions
|
|
29
|
+
- Documentation examples
|
|
30
|
+
|
|
31
|
+
**Solution**:
|
|
32
|
+
- Aligned source-to-trust-level mapping with AI-PIP protocol specification
|
|
33
|
+
- Updated `classifySource()` function to use correct deterministic mappings
|
|
34
|
+
- Corrected all test cases to match the proper classification
|
|
35
|
+
- Updated documentation examples to reflect accurate trust levels
|
|
36
|
+
|
|
37
|
+
**Impact**:
|
|
38
|
+
- ✅ Deterministic trust level classification now matches AI-PIP specification
|
|
39
|
+
- ✅ Consistent behavior across all layers (CSL, ISL, CPE)
|
|
40
|
+
- ✅ All tests pass with correct expectations
|
|
41
|
+
- ✅ Documentation accurately reflects actual behavior
|
|
42
|
+
- ✅ Proper sanitization levels applied based on correct trust classification
|
|
43
|
+
|
|
44
|
+
### 📚 Documentation Improvements
|
|
45
|
+
|
|
46
|
+
- **Enhanced usage examples**: Added detailed explanations below each code example describing what each script does and how it works in real-world scenarios
|
|
47
|
+
- **Layer-specific imports documentation**: Updated examples to show practical usage of layer-specific imports with step-by-step explanations
|
|
48
|
+
- **Official SDK announcement**: Added section explaining that `@ai-pip/core` will be used as the foundation for the official AI-PIP SDK
|
|
49
|
+
- **Improved example clarity**: Each example now includes context about when and why to use specific functions, making it easier for users to understand the complete processing pipeline
|
|
50
|
+
- **Updated source classification examples**: All examples now correctly show the trust levels and sanitization levels for each source type
|
|
51
|
+
|
|
52
|
+
#### What This Improves
|
|
53
|
+
|
|
54
|
+
**Problem**: Users visiting the package on npmjs could see code examples but lacked context about:
|
|
55
|
+
- What each example actually does in practice
|
|
56
|
+
- How the processing pipeline works end-to-end
|
|
57
|
+
- When to use specific functions or import strategies
|
|
58
|
+
- The relationship between the core package and the official SDK
|
|
59
|
+
- Correct trust level classification for different sources
|
|
60
|
+
|
|
61
|
+
**Solution**:
|
|
62
|
+
- Added detailed explanations below each code example
|
|
63
|
+
- Explained the purpose and workflow of each processing step
|
|
64
|
+
- Documented the relationship between core and SDK
|
|
65
|
+
- Added professional context about real-world usage
|
|
66
|
+
- Corrected all source classification examples
|
|
67
|
+
|
|
68
|
+
**Impact**:
|
|
69
|
+
- ✅ Users can now understand examples without prior knowledge
|
|
70
|
+
- ✅ Better onboarding experience for new users
|
|
71
|
+
- ✅ Clearer documentation for npmjs visitors
|
|
72
|
+
- ✅ Professional presentation of the package capabilities
|
|
73
|
+
- ✅ Accurate trust level information in all examples
|
|
74
|
+
|
|
75
|
+
### 📦 Package Changes
|
|
76
|
+
|
|
77
|
+
- **Source classification fixes**: Updated `src/csl/classify.ts` with correct source-to-trust-level mappings
|
|
78
|
+
- **Test suite updates**: Fixed all test files to match correct classification:
|
|
79
|
+
- `test/core/csl/classify.test.ts`
|
|
80
|
+
- `test/core/csl/segment.test.ts`
|
|
81
|
+
- `test/core/isl/sanitize.test.ts`
|
|
82
|
+
- `test/core/cpe/envelope.test.ts`
|
|
83
|
+
- `test/core/integration.test.ts`
|
|
84
|
+
- **README.md updated**: Enhanced with practical examples, explanations, and correct source classification
|
|
85
|
+
- **Professional presentation**: Improved clarity and context for all usage examples
|
|
86
|
+
|
|
87
|
+
### ⚠️ Breaking Changes
|
|
88
|
+
|
|
89
|
+
**None** - This is a patch version that fixes classification inconsistencies and improves documentation. The API remains unchanged, but the trust level classification behavior is now correct and consistent with the AI-PIP protocol specification.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## [0.1.7] - 2026-01-04
|
|
94
|
+
|
|
95
|
+
### 🐛 Critical Fixes
|
|
96
|
+
|
|
97
|
+
#### Type Resolution Fix
|
|
98
|
+
- **Fixed nested type resolution**: Changed `moduleResolution` from `"bundler"` to `"nodenext"` in `tsconfig.json`
|
|
99
|
+
- **Added explicit file extensions**: All relative imports now include `.js` extension (required by `nodenext`)
|
|
100
|
+
- **Fixed type accessibility**: Types with nested properties (e.g., `TrustLevel.value`) now resolve correctly in consuming projects
|
|
101
|
+
|
|
102
|
+
#### What This Fixes
|
|
103
|
+
|
|
104
|
+
**Problem**: When importing types from `@ai-pip/core` in SDK projects, TypeScript could not resolve nested type properties:
|
|
105
|
+
- `this.data.trust.value` appeared as `any` instead of `TrustLevelType`
|
|
106
|
+
- No autocompletado for nested properties
|
|
107
|
+
- Type inference failed for complex types
|
|
108
|
+
|
|
109
|
+
**Root Cause**: Incompatibility between `moduleResolution: "bundler"` (used in `@ai-pip-core`) and `moduleResolution: "nodenext"` (used in SDK projects). TypeScript couldn't follow the chain of type imports correctly.
|
|
110
|
+
|
|
111
|
+
**Solution**:
|
|
112
|
+
- Aligned `moduleResolution` to `"nodenext"` in both projects
|
|
113
|
+
- Added explicit `.js` extensions to all relative imports (required by Node.js ESM resolution)
|
|
114
|
+
- Changed `module` from `"ESNext"` to `"NodeNext"` for consistency
|
|
115
|
+
|
|
116
|
+
**Impact**:
|
|
117
|
+
- ✅ Nested types now resolve correctly
|
|
118
|
+
- ✅ Autocompletado works for all type properties
|
|
119
|
+
- ✅ Type inference works correctly in consuming projects
|
|
120
|
+
- ✅ Better compatibility with Node.js ESM module resolution
|
|
121
|
+
|
|
122
|
+
### 🔧 Technical Changes
|
|
123
|
+
|
|
124
|
+
- **Removed `tsconfig.json` from package files**: `tsconfig.json` is only needed for development, not for published packages
|
|
125
|
+
- **Updated `tsconfig.json`**:
|
|
126
|
+
- `module: "ESNext"` → `module: "NodeNext"`
|
|
127
|
+
- `moduleResolution: "bundler"` → `moduleResolution: "nodenext"`
|
|
128
|
+
- **Updated all source files**: Added `.js` extension to 107+ relative imports across the codebase
|
|
129
|
+
|
|
130
|
+
### 📦 Package Changes
|
|
131
|
+
|
|
132
|
+
- **Removed from `files` array**: `tsconfig.json` (only needed for development)
|
|
133
|
+
- **Package now includes**: `dist/`, `README.md`, `LICENSE` only
|
|
134
|
+
|
|
135
|
+
### ⚠️ Breaking Changes
|
|
136
|
+
|
|
137
|
+
**None** - This is a patch version that fixes type resolution issues without changing the API.
|
|
138
|
+
|
|
139
|
+
### 📚 Documentation
|
|
140
|
+
|
|
141
|
+
- Updated README to reference centralized CHANGELOG.md
|
|
142
|
+
- Added detailed explanation of type resolution fixes
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## [0.1.6] - 2025-12-28
|
|
147
|
+
|
|
148
|
+
### 📚 Documentation Improvements
|
|
149
|
+
- **Centralized documentation**: Moved all protocol documentation to `ai-pip-docs` repository
|
|
150
|
+
- **Updated README**: Added comprehensive links to centralized documentation
|
|
151
|
+
- **Documentation structure**: Reorganized documentation section with links to whitepaper, architecture, roadmap, and SDK guides
|
|
152
|
+
|
|
153
|
+
### 🔧 Package Improvements
|
|
154
|
+
- **Documentation links**: All documentation now points to `ai-pip-docs` repository
|
|
155
|
+
- **README cleanup**: Removed redundant documentation sections, kept only code-specific documentation
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## [0.1.5] - 2025-12-28
|
|
160
|
+
|
|
161
|
+
### 📚 Documentation Improvements
|
|
162
|
+
- **Updated README**: Added links to whitepaper, roadmap, and complete layer documentation
|
|
163
|
+
- **Updated Roadmap**: Added SDK-browser in Phase 4, updated Phase 1 status to 100% completed
|
|
164
|
+
- **Architecture clarification**: Corrected documentation about Shared (not a layer, but shared features)
|
|
165
|
+
- **SDK note**: Updated explanation about AAL and Model Gateway (they are SDK components, not core)
|
|
166
|
+
|
|
167
|
+
### 🔧 Optimizations
|
|
168
|
+
- **Package size reduction**: Removed `src/` from `files` field in `package.json` to make the package lighter
|
|
169
|
+
- **Optimized package**: Only necessary files are included (`dist/`, `tsconfig.json`, `README.md`, `LICENSE`)
|
|
170
|
+
|
|
171
|
+
### ✨ Improvements
|
|
172
|
+
- **Layer documentation**: Added link to Shared documentation (shared features)
|
|
173
|
+
- **Documentation organization**: Reorganized documentation section with priority on whitepaper and roadmap
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## [0.1.3] - 2025-12-28
|
|
178
|
+
|
|
179
|
+
### ✨ New Features
|
|
180
|
+
- **JavaScript compilation**: The package now compiles to JavaScript (`dist/`) for better compatibility
|
|
181
|
+
- **Type declaration files**: `.d.ts` files are generated for full TypeScript support
|
|
182
|
+
- **Source maps**: Included for better debugging
|
|
183
|
+
|
|
184
|
+
### 🔧 Technical Changes
|
|
185
|
+
- **Publication structure**: Changed from publishing `.ts` files directly to compiling to `dist/`
|
|
186
|
+
- **Improved exports**: Exports now point to compiled files (`.js` and `.d.ts`)
|
|
187
|
+
- **Relative paths**: Replaced path aliases (`@/`) with relative paths for compatibility
|
|
188
|
+
- **Build configuration**: Fixed generation of `.d.ts` files in `dist/` instead of `src/`
|
|
189
|
+
- **ESLint**: Configured to ignore generated `.d.ts` files
|
|
190
|
+
|
|
191
|
+
### 🐛 Fixes
|
|
192
|
+
- **Type resolution**: TypeScript types now resolve correctly from `node_modules`
|
|
193
|
+
- **Imports from subpaths**: Fixed imports from `@ai-pip/core/csl`, `@ai-pip/core/isl`, etc.
|
|
194
|
+
- **Complete exports**: Added `default` field to all exports for Node.js ESM
|
|
195
|
+
- **File generation**: `.d.ts` files now generate correctly in `dist/`
|
|
196
|
+
|
|
197
|
+
### 📚 Documentation
|
|
198
|
+
- **TypeScript requirements**: Improved documentation about required configuration
|
|
199
|
+
- **Updated examples**: Usage examples updated for new structure
|
|
200
|
+
- **Complete CHANGELOG**: Documentation of all versions and deprecations
|
|
201
|
+
|
|
202
|
+
### 🛠️ Development Improvements
|
|
203
|
+
- **test:install script**: Script to verify installation before publishing
|
|
204
|
+
- **prepublishOnly script**: Automatically runs build, lint, tests, and test:install before publishing
|
|
205
|
+
|
|
206
|
+
### ⚠️ Breaking Changes
|
|
207
|
+
- **TypeScript configuration required**: It's now **mandatory** to use `module: "NodeNext"` and `moduleResolution: "nodenext"` in `tsconfig.json`
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## [0.1.2] - 2025-12-28
|
|
212
|
+
|
|
213
|
+
### ⚠️ DEPRECATED
|
|
214
|
+
|
|
215
|
+
**Deprecation reason**: This version had issues with compilation and `.d.ts` file generation. Files were generated in incorrect locations (`src/` instead of `dist/`), causing linting errors and type resolution problems.
|
|
216
|
+
|
|
217
|
+
**Known issues**:
|
|
218
|
+
- `.d.ts` files were generated in `src/` instead of `dist/`
|
|
219
|
+
- ESLint tried to lint generated `.d.ts` files, causing errors
|
|
220
|
+
- Incomplete build configuration (`declarationDir` misconfigured)
|
|
221
|
+
- Types did not resolve correctly in some cases
|
|
222
|
+
|
|
223
|
+
**Recommendation**: Update to `0.1.3` or higher.
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## [0.1.1] - 2025-12-28
|
|
228
|
+
|
|
229
|
+
### ⚠️ DEPRECATED
|
|
230
|
+
|
|
231
|
+
**Deprecation reason**: This version had issues with path alias resolution (`@/`) that caused errors when importing from other projects. Types did not resolve correctly when the package was installed from npm.
|
|
232
|
+
|
|
233
|
+
**Known issues**:
|
|
234
|
+
- Errors: `Module '"@ai-pip/core/csl"' has no exported member 'CSLResult'`
|
|
235
|
+
- Path aliases did not work in consumer projects
|
|
236
|
+
- Types did not resolve correctly from `node_modules`
|
|
237
|
+
|
|
238
|
+
**Recommendation**: Update to `0.1.3` or higher.
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## [0.1.0] - 2025-12-28
|
|
243
|
+
|
|
244
|
+
### ⚠️ DEPRECATED
|
|
245
|
+
|
|
246
|
+
**Deprecation reason**: Initial version with fundamental compatibility issues. Exports did not include the `default` field required by Node.js ESM, causing `ERR_PACKAGE_PATH_NOT_EXPORTED` errors.
|
|
247
|
+
|
|
248
|
+
**Known issues**:
|
|
249
|
+
- Errors: `ERR_PACKAGE_PATH_NOT_EXPORTED` when importing subpaths
|
|
250
|
+
- Incomplete exports: Missing `default` field in exports
|
|
251
|
+
- Path aliases did not work correctly
|
|
252
|
+
|
|
253
|
+
**Recommendation**: Update to `0.1.3` or higher.
|
|
254
|
+
|
|
255
|
+
### 📦 Initial Content
|
|
256
|
+
- **CSL (Context Segmentation Layer)**: Content segmentation and classification
|
|
257
|
+
- **ISL (Instruction Sanitization Layer)**: Instruction sanitization
|
|
258
|
+
- **CPE (Cryptographic Prompt Envelope)**: Cryptographic envelope with HMAC-SHA256
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
**Current Version**: 0.1.8
|
|
263
|
+
**Status**: Phase 1 - Core Layers (100% completed)
|
|
264
|
+
|