@intentrax/sdk 1.0.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/LICENSE +185 -0
- package/README.md +148 -0
- package/cli/intentrax.mjs +2412 -0
- package/examples/adapters/claude-code.md +27 -0
- package/examples/adapters/cursor.md +27 -0
- package/examples/adapters/langchain.md +27 -0
- package/examples/adapters/langgraph.md +28 -0
- package/examples/adapters/mcp.md +27 -0
- package/examples/adapters/vercel-ai-sdk.md +28 -0
- package/examples/agent-gateway-admission.md +72 -0
- package/examples/one-command-init.md +94 -0
- package/http.d.ts +392 -0
- package/http.js +667 -0
- package/http.ts +667 -0
- package/index.d.ts +235 -0
- package/index.js +626 -0
- package/index.ts +626 -0
- package/package.json +63 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
export declare const SDK_VERSION: "1.0.0";
|
|
2
|
+
export declare const API_VERSION: "v1";
|
|
3
|
+
export declare const VERIFY_REQUEST_HASH_DOMAIN: "INTENTRAX_PUBLIC_SDK_VERIFY_REQUEST_V1";
|
|
4
|
+
export declare const IDEMPOTENCY_KEY_DOMAIN: "INTENTRAX_PUBLIC_SDK_IDEMPOTENCY_V1";
|
|
5
|
+
export declare const AGENT_GATEWAY_ADMISSION_REQUEST_HASH_DOMAIN: "INTENTRAX_AGENT_GATEWAY_ADMISSION_REQUEST_V1";
|
|
6
|
+
export declare const AGENT_ADMISSION_SCHEMA_VERSION: "intentrax.runtime.agent_admission_request/1.0";
|
|
7
|
+
export declare const AGENT_ADMISSION_ENDPOINT: "/v1/agent/admissions";
|
|
8
|
+
export declare const INTENT_EXECUTE_REQUEST_SCHEMA_VERSION: "intentrax.runtime.intent_execute.request/1.0";
|
|
9
|
+
export declare const INTENT_EXECUTE_ENDPOINT: "/v1/intents/execute";
|
|
10
|
+
export declare const INTENT_EXECUTE_MAX_REQUEST_BYTES: 4096;
|
|
11
|
+
export declare const RECEIPT_VERIFICATION_REQUEST_SCHEMA_VERSION: "intentrax.runtime.proof_verification.request/1.0";
|
|
12
|
+
export declare const RECEIPT_VERIFICATION_ENDPOINT: "/v1/proofs/verify";
|
|
13
|
+
export declare const RECEIPT_VERIFICATION_REQUEST_HASH_DOMAIN: "INTENTRAX_RECEIPT_VERIFICATION_REQUEST_V1";
|
|
14
|
+
export declare const RECEIPT_VERIFICATION_IDEMPOTENCY_DOMAIN: "INTENTRAX_RECEIPT_VERIFICATION_IDEMPOTENCY_V1";
|
|
15
|
+
export declare const PROOF_EXPORT_ENDPOINT_PREFIX: "/v1/proofs";
|
|
16
|
+
export declare const PROOF_REPLAY_REQUEST_SCHEMA_VERSION: "intentrax.runtime.proof_replay.request/1.0";
|
|
17
|
+
export declare const PROOF_REPLAY_ENDPOINT: "/v1/proofs/replay";
|
|
18
|
+
export declare const VERIFIER_HANDOFF_ENDPOINT_PREFIX: "/v1/evidence/dry-run";
|
|
19
|
+
export declare const SDK_INPUT_ERROR_CODE: "INTX-SDK-INPUT-001";
|
|
20
|
+
|
|
21
|
+
export type VerifyProofRequest = {
|
|
22
|
+
action: string;
|
|
23
|
+
execution_id: string;
|
|
24
|
+
intent_id: string;
|
|
25
|
+
payload_hash: string;
|
|
26
|
+
principal_id: string;
|
|
27
|
+
proof_id: string;
|
|
28
|
+
request_body_hash: string;
|
|
29
|
+
request_method: string;
|
|
30
|
+
request_path: string;
|
|
31
|
+
required_tier: "TIER_1" | "TIER_2" | "TIER_3" | "TIER_4";
|
|
32
|
+
timestamp: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type AgentGatewayAdmissionRequest = {
|
|
36
|
+
schema_version: "intentrax.runtime.agent_admission_request/1.0";
|
|
37
|
+
tenant_id: string;
|
|
38
|
+
surface_id: string;
|
|
39
|
+
action: string;
|
|
40
|
+
adapter_id: string;
|
|
41
|
+
evidence_refs: string[];
|
|
42
|
+
proof_refs: string[];
|
|
43
|
+
request_payload_hash: string;
|
|
44
|
+
protocol_payload_ref: string;
|
|
45
|
+
idempotency_key_hash: string;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type IntentExecuteRequest = {
|
|
49
|
+
schema_version: "intentrax.runtime.intent_execute.request/1.0";
|
|
50
|
+
intent_id: string;
|
|
51
|
+
tenant_id: string;
|
|
52
|
+
action: string;
|
|
53
|
+
idempotency_key: string;
|
|
54
|
+
proof_chain_fixture_ref: string;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export type ReceiptVerificationRequest = {
|
|
58
|
+
schema_version: "intentrax.runtime.proof_verification.request/1.0";
|
|
59
|
+
receipt_id: string;
|
|
60
|
+
receipt_hash: string;
|
|
61
|
+
evidence_record_hash: string;
|
|
62
|
+
handoff_hash: string;
|
|
63
|
+
proof_chain_fixture_ref: string;
|
|
64
|
+
proof_chain_fixture_hash: string;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type ProofExportFormat = "json" | "aep-json" | "pdf";
|
|
68
|
+
|
|
69
|
+
export type ProofExportRequest = {
|
|
70
|
+
proof_id: string;
|
|
71
|
+
format?: ProofExportFormat | "";
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export type ProofReadRequest = {
|
|
75
|
+
proof_id: string;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export type ProofReplayRequest = {
|
|
79
|
+
schema_version: "intentrax.runtime.proof_replay.request/1.0";
|
|
80
|
+
proof_id: string;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export type ProofInclusionRequest = {
|
|
84
|
+
proof_id: string;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export type VerifierHandoffRequest = {
|
|
88
|
+
receipt_id: string;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export type SDKError = {
|
|
92
|
+
error_code: string;
|
|
93
|
+
error_type: "public_sdk_input_error";
|
|
94
|
+
message: string;
|
|
95
|
+
invalid_fields: string[];
|
|
96
|
+
retriable: false;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export declare function sha256Hex(value: string): string;
|
|
100
|
+
export declare function isSha256Hex(value: unknown): boolean;
|
|
101
|
+
export declare function isSha256Ref(value: unknown): boolean;
|
|
102
|
+
export declare function canonicalJson(value: unknown): string;
|
|
103
|
+
export declare function validateVerificationRequest(request: unknown): string[];
|
|
104
|
+
export declare function verificationRequestHash(request: VerifyProofRequest): string;
|
|
105
|
+
export declare function idempotencyInput(request: VerifyProofRequest): Record<string, unknown>;
|
|
106
|
+
export declare function createIdempotencyKey(request: VerifyProofRequest): string;
|
|
107
|
+
export declare function buildVerificationEnvelope(request: VerifyProofRequest): {
|
|
108
|
+
status: "PASS";
|
|
109
|
+
output: {
|
|
110
|
+
schema_version: "intentrax.public_sdk.verify/1.0";
|
|
111
|
+
request_hash: string;
|
|
112
|
+
idempotency_key: string;
|
|
113
|
+
request: VerifyProofRequest;
|
|
114
|
+
};
|
|
115
|
+
} | {
|
|
116
|
+
status: "FAIL";
|
|
117
|
+
error: SDKError;
|
|
118
|
+
};
|
|
119
|
+
export declare function validateReceiptVerificationRequest(request: unknown): string[];
|
|
120
|
+
export declare function receiptVerificationRequestHash(request: ReceiptVerificationRequest): string;
|
|
121
|
+
export declare function receiptVerificationIdempotencyInput(request: ReceiptVerificationRequest): Record<string, unknown>;
|
|
122
|
+
export declare function createReceiptVerificationIdempotencyKey(request: ReceiptVerificationRequest): string;
|
|
123
|
+
export declare function buildReceiptVerificationEnvelope(request: ReceiptVerificationRequest): {
|
|
124
|
+
status: "PASS";
|
|
125
|
+
output: {
|
|
126
|
+
schema_version: "intentrax.public_sdk.receipt_verification/1.0";
|
|
127
|
+
endpoint: "/v1/proofs/verify";
|
|
128
|
+
request_hash: string;
|
|
129
|
+
idempotency_key: string;
|
|
130
|
+
request: ReceiptVerificationRequest;
|
|
131
|
+
};
|
|
132
|
+
} | {
|
|
133
|
+
status: "FAIL";
|
|
134
|
+
error: SDKError;
|
|
135
|
+
};
|
|
136
|
+
export declare function normalizeProofExportFormat(format?: unknown): ProofExportFormat | string;
|
|
137
|
+
export declare function validateProofExportRequest(request: unknown): string[];
|
|
138
|
+
export declare function buildProofExportEnvelope(request: ProofExportRequest): {
|
|
139
|
+
status: "PASS";
|
|
140
|
+
output: {
|
|
141
|
+
schema_version: "intentrax.public_sdk.proof_export/1.0";
|
|
142
|
+
endpoint: string;
|
|
143
|
+
format: ProofExportFormat;
|
|
144
|
+
authoritative_json: boolean;
|
|
145
|
+
pdf_receipt_non_authoritative: boolean;
|
|
146
|
+
request: {
|
|
147
|
+
proof_id: string;
|
|
148
|
+
format: ProofExportFormat;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
} | {
|
|
152
|
+
status: "FAIL";
|
|
153
|
+
error: SDKError;
|
|
154
|
+
};
|
|
155
|
+
export declare function validateProofReadRequest(request: unknown): string[];
|
|
156
|
+
export declare function buildProofReadEnvelope(request: ProofReadRequest): {
|
|
157
|
+
status: "PASS";
|
|
158
|
+
output: {
|
|
159
|
+
schema_version: "intentrax.public_sdk.proof_read/1.0";
|
|
160
|
+
endpoint: string;
|
|
161
|
+
request: {
|
|
162
|
+
proof_id: string;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
} | {
|
|
166
|
+
status: "FAIL";
|
|
167
|
+
error: SDKError;
|
|
168
|
+
};
|
|
169
|
+
export declare function validateProofReplayRequest(request: unknown): string[];
|
|
170
|
+
export declare function buildProofReplayEnvelope(request: ProofReplayRequest): {
|
|
171
|
+
status: "PASS";
|
|
172
|
+
output: {
|
|
173
|
+
schema_version: "intentrax.public_sdk.proof_replay/1.0";
|
|
174
|
+
endpoint: "/v1/proofs/replay";
|
|
175
|
+
request: ProofReplayRequest;
|
|
176
|
+
};
|
|
177
|
+
} | {
|
|
178
|
+
status: "FAIL";
|
|
179
|
+
error: SDKError;
|
|
180
|
+
};
|
|
181
|
+
export declare function validateProofInclusionRequest(request: unknown): string[];
|
|
182
|
+
export declare function buildProofInclusionEnvelope(request: ProofInclusionRequest): {
|
|
183
|
+
status: "PASS";
|
|
184
|
+
output: {
|
|
185
|
+
schema_version: "intentrax.public_sdk.proof_inclusion/1.0";
|
|
186
|
+
endpoint: string;
|
|
187
|
+
request: {
|
|
188
|
+
proof_id: string;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
} | {
|
|
192
|
+
status: "FAIL";
|
|
193
|
+
error: SDKError;
|
|
194
|
+
};
|
|
195
|
+
export declare function validateVerifierHandoffRequest(request: unknown): string[];
|
|
196
|
+
export declare function buildVerifierHandoffEnvelope(request: VerifierHandoffRequest): {
|
|
197
|
+
status: "PASS";
|
|
198
|
+
output: {
|
|
199
|
+
schema_version: "intentrax.public_sdk.verifier_handoff/1.0";
|
|
200
|
+
endpoint: string;
|
|
201
|
+
request: {
|
|
202
|
+
receipt_id: string;
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
} | {
|
|
206
|
+
status: "FAIL";
|
|
207
|
+
error: SDKError;
|
|
208
|
+
};
|
|
209
|
+
export declare function validateIntentExecuteRequest(request: unknown): string[];
|
|
210
|
+
export declare function buildIntentExecuteEnvelope(request: IntentExecuteRequest): {
|
|
211
|
+
status: "PASS";
|
|
212
|
+
output: {
|
|
213
|
+
schema_version: "intentrax.public_sdk.intent_execute/1.0";
|
|
214
|
+
endpoint: "/v1/intents/execute";
|
|
215
|
+
request: IntentExecuteRequest;
|
|
216
|
+
};
|
|
217
|
+
} | {
|
|
218
|
+
status: "FAIL";
|
|
219
|
+
error: SDKError;
|
|
220
|
+
};
|
|
221
|
+
export declare function validateAgentGatewayAdmissionRequest(request: unknown): string[];
|
|
222
|
+
export declare function agentGatewayAdmissionRequestHash(request: AgentGatewayAdmissionRequest): string;
|
|
223
|
+
export declare function buildAgentGatewayAdmissionEnvelope(request: AgentGatewayAdmissionRequest): {
|
|
224
|
+
status: "PASS";
|
|
225
|
+
output: {
|
|
226
|
+
schema_version: "intentrax.public_sdk.agent_gateway_admission/1.0";
|
|
227
|
+
request_hash: string;
|
|
228
|
+
idempotency_key_hash: string;
|
|
229
|
+
endpoint: "/v1/agent/admissions";
|
|
230
|
+
request: AgentGatewayAdmissionRequest;
|
|
231
|
+
};
|
|
232
|
+
} | {
|
|
233
|
+
status: "FAIL";
|
|
234
|
+
error: SDKError;
|
|
235
|
+
};
|