@proofai/sdk 1.0.0 → 1.1.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/dist/index.d.mts +55 -2
- package/dist/index.d.ts +55 -2
- package/dist/index.js +18 -2
- package/dist/index.mjs +18 -2
- package/package.json +16 -3
package/dist/index.d.mts
CHANGED
|
@@ -133,6 +133,57 @@ interface VerifyResult {
|
|
|
133
133
|
};
|
|
134
134
|
timestamp: string;
|
|
135
135
|
}
|
|
136
|
+
interface BundleOptions {
|
|
137
|
+
subjectId?: string;
|
|
138
|
+
sessionId?: string;
|
|
139
|
+
ragSources?: Array<{
|
|
140
|
+
document_id: string;
|
|
141
|
+
document_name: string;
|
|
142
|
+
chunk_index: number;
|
|
143
|
+
relevance_score: number;
|
|
144
|
+
}>;
|
|
145
|
+
}
|
|
146
|
+
interface HumanReviewResult {
|
|
147
|
+
id: string;
|
|
148
|
+
bundleId: string;
|
|
149
|
+
reviewerIdHash: string;
|
|
150
|
+
role: string;
|
|
151
|
+
decision: 'approved' | 'rejected' | 'flagged';
|
|
152
|
+
notes: string | null;
|
|
153
|
+
reviewedAt: string;
|
|
154
|
+
}
|
|
155
|
+
interface MonitoringStats {
|
|
156
|
+
period: string;
|
|
157
|
+
generatedAt: string;
|
|
158
|
+
totalExecutions: number;
|
|
159
|
+
anomalyCount: number;
|
|
160
|
+
anomalies: Array<{
|
|
161
|
+
type: string;
|
|
162
|
+
description: string;
|
|
163
|
+
severity: string;
|
|
164
|
+
}>;
|
|
165
|
+
statusBreakdown: Record<string, number>;
|
|
166
|
+
humanReviews: {
|
|
167
|
+
total: number;
|
|
168
|
+
approved: number;
|
|
169
|
+
rejected: number;
|
|
170
|
+
flagged: number;
|
|
171
|
+
};
|
|
172
|
+
riskDistribution: {
|
|
173
|
+
low: number;
|
|
174
|
+
medium: number;
|
|
175
|
+
high: number;
|
|
176
|
+
};
|
|
177
|
+
gdpr: {
|
|
178
|
+
anonymizedBundles: number;
|
|
179
|
+
};
|
|
180
|
+
compliance: {
|
|
181
|
+
retentionPolicy: string;
|
|
182
|
+
loggingEnabled: boolean;
|
|
183
|
+
humanOversightActive: boolean;
|
|
184
|
+
blockchainAnchoringActive: boolean;
|
|
185
|
+
};
|
|
186
|
+
}
|
|
136
187
|
interface CertifyOptions {
|
|
137
188
|
provider?: Provider;
|
|
138
189
|
modelId?: string;
|
|
@@ -168,10 +219,12 @@ declare class ProofAI {
|
|
|
168
219
|
execute(promptRef: string, options: ExecuteOptions): Promise<ExecuteResult>;
|
|
169
220
|
analyze(executionId: string, analysisText: string): Promise<AnalyzeResult>;
|
|
170
221
|
sign(execution: ExecuteResult): Promise<SignResult>;
|
|
171
|
-
bundle(promptId: string, executionId: string, analysisId: string, signatureId: string, cognitiveHash: string): Promise<BundleResult>;
|
|
222
|
+
bundle(promptId: string, executionId: string, analysisId: string, signatureId: string, cognitiveHash: string, options?: BundleOptions): Promise<BundleResult>;
|
|
172
223
|
anchor(bundleId: string, network?: 'polygon' | 'ethereum'): Promise<AnchorResult>;
|
|
173
224
|
verify(bundleId: string): Promise<VerifyResult>;
|
|
225
|
+
review(bundleId: string, reviewerId: string, role: 'compliance_officer' | 'data_protection_officer' | 'manager', decision: 'approved' | 'rejected' | 'flagged', notes?: string): Promise<HumanReviewResult>;
|
|
226
|
+
monitor(): Promise<MonitoringStats>;
|
|
174
227
|
certify(prompt: string, options?: CertifyOptions): Promise<Certificate>;
|
|
175
228
|
}
|
|
176
229
|
|
|
177
|
-
export { type AnalyzeResult, type AnchorResult, type BundleResult, type Certificate, type CertifyOptions, type CompressOptions, type CompressResult, type CompressionLevel, type ExecuteOptions, type ExecuteResult, type Network, ProofAI, type ProofAIConfig, type Provider, type SignResult, type VerifyResult, ProofAI as default };
|
|
230
|
+
export { type AnalyzeResult, type AnchorResult, type BundleOptions, type BundleResult, type Certificate, type CertifyOptions, type CompressOptions, type CompressResult, type CompressionLevel, type ExecuteOptions, type ExecuteResult, type HumanReviewResult, type MonitoringStats, type Network, ProofAI, type ProofAIConfig, type Provider, type SignResult, type VerifyResult, ProofAI as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -133,6 +133,57 @@ interface VerifyResult {
|
|
|
133
133
|
};
|
|
134
134
|
timestamp: string;
|
|
135
135
|
}
|
|
136
|
+
interface BundleOptions {
|
|
137
|
+
subjectId?: string;
|
|
138
|
+
sessionId?: string;
|
|
139
|
+
ragSources?: Array<{
|
|
140
|
+
document_id: string;
|
|
141
|
+
document_name: string;
|
|
142
|
+
chunk_index: number;
|
|
143
|
+
relevance_score: number;
|
|
144
|
+
}>;
|
|
145
|
+
}
|
|
146
|
+
interface HumanReviewResult {
|
|
147
|
+
id: string;
|
|
148
|
+
bundleId: string;
|
|
149
|
+
reviewerIdHash: string;
|
|
150
|
+
role: string;
|
|
151
|
+
decision: 'approved' | 'rejected' | 'flagged';
|
|
152
|
+
notes: string | null;
|
|
153
|
+
reviewedAt: string;
|
|
154
|
+
}
|
|
155
|
+
interface MonitoringStats {
|
|
156
|
+
period: string;
|
|
157
|
+
generatedAt: string;
|
|
158
|
+
totalExecutions: number;
|
|
159
|
+
anomalyCount: number;
|
|
160
|
+
anomalies: Array<{
|
|
161
|
+
type: string;
|
|
162
|
+
description: string;
|
|
163
|
+
severity: string;
|
|
164
|
+
}>;
|
|
165
|
+
statusBreakdown: Record<string, number>;
|
|
166
|
+
humanReviews: {
|
|
167
|
+
total: number;
|
|
168
|
+
approved: number;
|
|
169
|
+
rejected: number;
|
|
170
|
+
flagged: number;
|
|
171
|
+
};
|
|
172
|
+
riskDistribution: {
|
|
173
|
+
low: number;
|
|
174
|
+
medium: number;
|
|
175
|
+
high: number;
|
|
176
|
+
};
|
|
177
|
+
gdpr: {
|
|
178
|
+
anonymizedBundles: number;
|
|
179
|
+
};
|
|
180
|
+
compliance: {
|
|
181
|
+
retentionPolicy: string;
|
|
182
|
+
loggingEnabled: boolean;
|
|
183
|
+
humanOversightActive: boolean;
|
|
184
|
+
blockchainAnchoringActive: boolean;
|
|
185
|
+
};
|
|
186
|
+
}
|
|
136
187
|
interface CertifyOptions {
|
|
137
188
|
provider?: Provider;
|
|
138
189
|
modelId?: string;
|
|
@@ -168,10 +219,12 @@ declare class ProofAI {
|
|
|
168
219
|
execute(promptRef: string, options: ExecuteOptions): Promise<ExecuteResult>;
|
|
169
220
|
analyze(executionId: string, analysisText: string): Promise<AnalyzeResult>;
|
|
170
221
|
sign(execution: ExecuteResult): Promise<SignResult>;
|
|
171
|
-
bundle(promptId: string, executionId: string, analysisId: string, signatureId: string, cognitiveHash: string): Promise<BundleResult>;
|
|
222
|
+
bundle(promptId: string, executionId: string, analysisId: string, signatureId: string, cognitiveHash: string, options?: BundleOptions): Promise<BundleResult>;
|
|
172
223
|
anchor(bundleId: string, network?: 'polygon' | 'ethereum'): Promise<AnchorResult>;
|
|
173
224
|
verify(bundleId: string): Promise<VerifyResult>;
|
|
225
|
+
review(bundleId: string, reviewerId: string, role: 'compliance_officer' | 'data_protection_officer' | 'manager', decision: 'approved' | 'rejected' | 'flagged', notes?: string): Promise<HumanReviewResult>;
|
|
226
|
+
monitor(): Promise<MonitoringStats>;
|
|
174
227
|
certify(prompt: string, options?: CertifyOptions): Promise<Certificate>;
|
|
175
228
|
}
|
|
176
229
|
|
|
177
|
-
export { type AnalyzeResult, type AnchorResult, type BundleResult, type Certificate, type CertifyOptions, type CompressOptions, type CompressResult, type CompressionLevel, type ExecuteOptions, type ExecuteResult, type Network, ProofAI, type ProofAIConfig, type Provider, type SignResult, type VerifyResult, ProofAI as default };
|
|
230
|
+
export { type AnalyzeResult, type AnchorResult, type BundleOptions, type BundleResult, type Certificate, type CertifyOptions, type CompressOptions, type CompressResult, type CompressionLevel, type ExecuteOptions, type ExecuteResult, type HumanReviewResult, type MonitoringStats, type Network, ProofAI, type ProofAIConfig, type Provider, type SignResult, type VerifyResult, ProofAI as default };
|
package/dist/index.js
CHANGED
|
@@ -84,8 +84,17 @@ var ProofAI = class {
|
|
|
84
84
|
timestamps: { request_received: now, execution_completed: now }
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
|
-
async bundle(promptId, executionId, analysisId, signatureId, cognitiveHash) {
|
|
88
|
-
return this.call("bundle", {
|
|
87
|
+
async bundle(promptId, executionId, analysisId, signatureId, cognitiveHash, options) {
|
|
88
|
+
return this.call("bundle", {
|
|
89
|
+
promptId,
|
|
90
|
+
executionId,
|
|
91
|
+
analysisId,
|
|
92
|
+
signatureId,
|
|
93
|
+
cognitiveHash,
|
|
94
|
+
subjectId: options?.subjectId,
|
|
95
|
+
sessionId: options?.sessionId,
|
|
96
|
+
ragSources: options?.ragSources
|
|
97
|
+
});
|
|
89
98
|
}
|
|
90
99
|
async anchor(bundleId, network = "polygon") {
|
|
91
100
|
return this.call("anchor", { bundleId, network });
|
|
@@ -93,6 +102,13 @@ var ProofAI = class {
|
|
|
93
102
|
async verify(bundleId) {
|
|
94
103
|
return this.call("verify", { bundleId });
|
|
95
104
|
}
|
|
105
|
+
// --- AI Act compliance endpoints ---
|
|
106
|
+
async review(bundleId, reviewerId, role, decision, notes) {
|
|
107
|
+
return this.call("review", { bundleId, reviewerId, role, decision, notes });
|
|
108
|
+
}
|
|
109
|
+
async monitor() {
|
|
110
|
+
return this.call("monitor", {});
|
|
111
|
+
}
|
|
96
112
|
// --- Full pipeline in one call ---
|
|
97
113
|
async certify(prompt, options = {}) {
|
|
98
114
|
const provider = options.provider || "anthropic";
|
package/dist/index.mjs
CHANGED
|
@@ -59,8 +59,17 @@ var ProofAI = class {
|
|
|
59
59
|
timestamps: { request_received: now, execution_completed: now }
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
async bundle(promptId, executionId, analysisId, signatureId, cognitiveHash) {
|
|
63
|
-
return this.call("bundle", {
|
|
62
|
+
async bundle(promptId, executionId, analysisId, signatureId, cognitiveHash, options) {
|
|
63
|
+
return this.call("bundle", {
|
|
64
|
+
promptId,
|
|
65
|
+
executionId,
|
|
66
|
+
analysisId,
|
|
67
|
+
signatureId,
|
|
68
|
+
cognitiveHash,
|
|
69
|
+
subjectId: options?.subjectId,
|
|
70
|
+
sessionId: options?.sessionId,
|
|
71
|
+
ragSources: options?.ragSources
|
|
72
|
+
});
|
|
64
73
|
}
|
|
65
74
|
async anchor(bundleId, network = "polygon") {
|
|
66
75
|
return this.call("anchor", { bundleId, network });
|
|
@@ -68,6 +77,13 @@ var ProofAI = class {
|
|
|
68
77
|
async verify(bundleId) {
|
|
69
78
|
return this.call("verify", { bundleId });
|
|
70
79
|
}
|
|
80
|
+
// --- AI Act compliance endpoints ---
|
|
81
|
+
async review(bundleId, reviewerId, role, decision, notes) {
|
|
82
|
+
return this.call("review", { bundleId, reviewerId, role, decision, notes });
|
|
83
|
+
}
|
|
84
|
+
async monitor() {
|
|
85
|
+
return this.call("monitor", {});
|
|
86
|
+
}
|
|
71
87
|
// --- Full pipeline in one call ---
|
|
72
88
|
async certify(prompt, options = {}) {
|
|
73
89
|
const provider = options.provider || "anthropic";
|
package/package.json
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proofai/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "ProofAI SDK — Cryptographic proof that AI thought before it answered",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
-
"files": [
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
9
11
|
"scripts": {
|
|
10
12
|
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
11
13
|
"prepublishOnly": "npm run build"
|
|
12
14
|
},
|
|
13
|
-
"keywords": [
|
|
15
|
+
"keywords": [
|
|
16
|
+
"ai",
|
|
17
|
+
"proof",
|
|
18
|
+
"blockchain",
|
|
19
|
+
"ed25519",
|
|
20
|
+
"evidence",
|
|
21
|
+
"compliance",
|
|
22
|
+
"audit"
|
|
23
|
+
],
|
|
14
24
|
"author": "HIRAM",
|
|
15
25
|
"license": "MIT",
|
|
16
26
|
"repository": {
|
|
@@ -20,5 +30,8 @@
|
|
|
20
30
|
"devDependencies": {
|
|
21
31
|
"tsup": "^8.0.0",
|
|
22
32
|
"typescript": "^5.8.0"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@supabase/supabase-js": "^2.100.1"
|
|
23
36
|
}
|
|
24
37
|
}
|