@kya-os/contracts 1.2.2 → 1.3.1-canary.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/cli.d.ts.map +1 -0
- package/dist/delegation/constraints.d.ts +25 -15
- package/dist/delegation/constraints.d.ts.map +1 -0
- package/dist/delegation/constraints.js +23 -18
- package/dist/delegation/index.d.ts.map +1 -0
- package/dist/delegation/schemas.d.ts +513 -219
- package/dist/delegation/schemas.d.ts.map +1 -0
- package/dist/did/index.d.ts.map +1 -0
- package/dist/did/resolve-contract.d.ts.map +1 -0
- package/dist/did/types.d.ts.map +1 -0
- package/dist/env/constants.d.ts.map +1 -0
- package/dist/env/index.d.ts.map +1 -0
- package/dist/handshake.d.ts +8 -2
- package/dist/handshake.d.ts.map +1 -0
- package/dist/handshake.js +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/proof/index.d.ts.map +1 -0
- package/dist/proof/proof-record.d.ts +12 -12
- package/dist/proof/proof-record.d.ts.map +1 -0
- package/dist/proof/signing-spec.d.ts +4 -4
- package/dist/proof/signing-spec.d.ts.map +1 -0
- package/dist/proof.d.ts +24 -17
- package/dist/proof.d.ts.map +1 -0
- package/dist/proof.js +10 -3
- package/dist/registry.d.ts.map +1 -0
- package/dist/runtime/errors.d.ts.map +1 -0
- package/dist/runtime/headers.d.ts.map +1 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/test.d.ts.map +1 -0
- package/dist/tlkrc/index.d.ts.map +1 -0
- package/dist/tlkrc/rotation.d.ts +24 -24
- package/dist/tlkrc/rotation.d.ts.map +1 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/vc/index.d.ts.map +1 -0
- package/dist/vc/schemas.d.ts.map +1 -0
- package/dist/vc/statuslist.d.ts.map +1 -0
- package/dist/verifier.d.ts.map +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources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AK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAGtE,eAAO,MAAM,WAAW;;;;;;;;;CASd,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,WAAW,CAAC;AAGjD,eAAO,MAAM,cAAc;;;;;;;;;;CAUjB,CAAC"}
|
|
@@ -112,8 +112,10 @@ export declare const DelegationConstraintsSchema: z.ZodObject<{
|
|
|
112
112
|
notBefore: z.ZodOptional<z.ZodNumber>;
|
|
113
113
|
/** Not valid after (Unix timestamp in seconds) */
|
|
114
114
|
notAfter: z.ZodOptional<z.ZodNumber>;
|
|
115
|
-
/**
|
|
116
|
-
|
|
115
|
+
/** Simple scopes array (for Phase 1 bouncer - simplified model) */
|
|
116
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
117
|
+
/** CRISP-specific constraints (full model) */
|
|
118
|
+
crisp: z.ZodOptional<z.ZodObject<{
|
|
117
119
|
/** Optional budget constraint */
|
|
118
120
|
budget: z.ZodOptional<z.ZodObject<{
|
|
119
121
|
/** Unit of the budget */
|
|
@@ -269,14 +271,16 @@ export declare const DelegationConstraintsSchema: z.ZodObject<{
|
|
|
269
271
|
matcher: "exact" | "prefix" | "regex";
|
|
270
272
|
constraints?: Record<string, any> | undefined;
|
|
271
273
|
}>, "many">;
|
|
272
|
-
}, z.ZodTypeAny, "passthrough"
|
|
274
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
273
275
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
274
276
|
/** Not valid before (Unix timestamp in seconds) */
|
|
275
277
|
notBefore: z.ZodOptional<z.ZodNumber>;
|
|
276
278
|
/** Not valid after (Unix timestamp in seconds) */
|
|
277
279
|
notAfter: z.ZodOptional<z.ZodNumber>;
|
|
278
|
-
/**
|
|
279
|
-
|
|
280
|
+
/** Simple scopes array (for Phase 1 bouncer - simplified model) */
|
|
281
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
282
|
+
/** CRISP-specific constraints (full model) */
|
|
283
|
+
crisp: z.ZodOptional<z.ZodObject<{
|
|
280
284
|
/** Optional budget constraint */
|
|
281
285
|
budget: z.ZodOptional<z.ZodObject<{
|
|
282
286
|
/** Unit of the budget */
|
|
@@ -432,14 +436,16 @@ export declare const DelegationConstraintsSchema: z.ZodObject<{
|
|
|
432
436
|
matcher: "exact" | "prefix" | "regex";
|
|
433
437
|
constraints?: Record<string, any> | undefined;
|
|
434
438
|
}>, "many">;
|
|
435
|
-
}, z.ZodTypeAny, "passthrough"
|
|
439
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
436
440
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
437
441
|
/** Not valid before (Unix timestamp in seconds) */
|
|
438
442
|
notBefore: z.ZodOptional<z.ZodNumber>;
|
|
439
443
|
/** Not valid after (Unix timestamp in seconds) */
|
|
440
444
|
notAfter: z.ZodOptional<z.ZodNumber>;
|
|
441
|
-
/**
|
|
442
|
-
|
|
445
|
+
/** Simple scopes array (for Phase 1 bouncer - simplified model) */
|
|
446
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
447
|
+
/** CRISP-specific constraints (full model) */
|
|
448
|
+
crisp: z.ZodOptional<z.ZodObject<{
|
|
443
449
|
/** Optional budget constraint */
|
|
444
450
|
budget: z.ZodOptional<z.ZodObject<{
|
|
445
451
|
/** Unit of the budget */
|
|
@@ -595,7 +601,7 @@ export declare const DelegationConstraintsSchema: z.ZodObject<{
|
|
|
595
601
|
matcher: "exact" | "prefix" | "regex";
|
|
596
602
|
constraints?: Record<string, any> | undefined;
|
|
597
603
|
}>, "many">;
|
|
598
|
-
}, z.ZodTypeAny, "passthrough"
|
|
604
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
599
605
|
}, z.ZodTypeAny, "passthrough">>;
|
|
600
606
|
export type DelegationConstraints = z.infer<typeof DelegationConstraintsSchema>;
|
|
601
607
|
/**
|
|
@@ -612,8 +618,10 @@ export declare function validateDelegationConstraints(constraints: unknown): z.S
|
|
|
612
618
|
notBefore: z.ZodOptional<z.ZodNumber>;
|
|
613
619
|
/** Not valid after (Unix timestamp in seconds) */
|
|
614
620
|
notAfter: z.ZodOptional<z.ZodNumber>;
|
|
615
|
-
/**
|
|
616
|
-
|
|
621
|
+
/** Simple scopes array (for Phase 1 bouncer - simplified model) */
|
|
622
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
623
|
+
/** CRISP-specific constraints (full model) */
|
|
624
|
+
crisp: z.ZodOptional<z.ZodObject<{
|
|
617
625
|
/** Optional budget constraint */
|
|
618
626
|
budget: z.ZodOptional<z.ZodObject<{
|
|
619
627
|
/** Unit of the budget */
|
|
@@ -769,14 +777,16 @@ export declare function validateDelegationConstraints(constraints: unknown): z.S
|
|
|
769
777
|
matcher: "exact" | "prefix" | "regex";
|
|
770
778
|
constraints?: Record<string, any> | undefined;
|
|
771
779
|
}>, "many">;
|
|
772
|
-
}, z.ZodTypeAny, "passthrough"
|
|
780
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
773
781
|
}, z.ZodTypeAny, "passthrough">, z.objectOutputType<{
|
|
774
782
|
/** Not valid before (Unix timestamp in seconds) */
|
|
775
783
|
notBefore: z.ZodOptional<z.ZodNumber>;
|
|
776
784
|
/** Not valid after (Unix timestamp in seconds) */
|
|
777
785
|
notAfter: z.ZodOptional<z.ZodNumber>;
|
|
778
|
-
/**
|
|
779
|
-
|
|
786
|
+
/** Simple scopes array (for Phase 1 bouncer - simplified model) */
|
|
787
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
788
|
+
/** CRISP-specific constraints (full model) */
|
|
789
|
+
crisp: z.ZodOptional<z.ZodObject<{
|
|
780
790
|
/** Optional budget constraint */
|
|
781
791
|
budget: z.ZodOptional<z.ZodObject<{
|
|
782
792
|
/** Unit of the budget */
|
|
@@ -932,7 +942,7 @@ export declare function validateDelegationConstraints(constraints: unknown): z.S
|
|
|
932
942
|
matcher: "exact" | "prefix" | "regex";
|
|
933
943
|
constraints?: Record<string, any> | undefined;
|
|
934
944
|
}>, "many">;
|
|
935
|
-
}, z.ZodTypeAny, "passthrough"
|
|
945
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
936
946
|
}, z.ZodTypeAny, "passthrough">>;
|
|
937
947
|
/**
|
|
938
948
|
* Check if constraints have a valid time range
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constraints.d.ts","sourceRoot":"","sources":["../../src/delegation/constraints.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,cAAc,qCAAmC,CAAC;AAC/D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,gBAAgB,iCAA+B,CAAC;AAC7D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;I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cAAc,QAA0B,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,uBAAuB,QAA0B,CAAC"}
|
|
@@ -74,14 +74,16 @@ exports.DelegationConstraintsSchema = zod_1.z.object({
|
|
|
74
74
|
notBefore: zod_1.z.number().int().optional(),
|
|
75
75
|
/** Not valid after (Unix timestamp in seconds) */
|
|
76
76
|
notAfter: zod_1.z.number().int().optional(),
|
|
77
|
-
/**
|
|
77
|
+
/** Simple scopes array (for Phase 1 bouncer - simplified model) */
|
|
78
|
+
scopes: zod_1.z.array(zod_1.z.string()).optional(),
|
|
79
|
+
/** CRISP-specific constraints (full model) */
|
|
78
80
|
crisp: zod_1.z.object({
|
|
79
81
|
/** Optional budget constraint */
|
|
80
82
|
budget: exports.CrispBudgetSchema.optional(),
|
|
81
83
|
/** Required: at least one scope */
|
|
82
84
|
scopes: zod_1.z.array(exports.CrispScopeSchema).min(1),
|
|
83
85
|
/** Optional additional CRISP fields */
|
|
84
|
-
}).passthrough(),
|
|
86
|
+
}).passthrough().optional(),
|
|
85
87
|
}).passthrough(); // Allow extensibility
|
|
86
88
|
/**
|
|
87
89
|
* Validation Helpers
|
|
@@ -133,8 +135,8 @@ function areChildConstraintsValid(parent, child) {
|
|
|
133
135
|
}
|
|
134
136
|
}
|
|
135
137
|
// Budget: child must be ≤ parent (if same unit)
|
|
136
|
-
if (parent.crisp
|
|
137
|
-
child.crisp
|
|
138
|
+
if (parent.crisp?.budget &&
|
|
139
|
+
child.crisp?.budget &&
|
|
138
140
|
parent.crisp.budget.unit === child.crisp.budget.unit) {
|
|
139
141
|
if (child.crisp.budget.cap > parent.crisp.budget.cap) {
|
|
140
142
|
return false;
|
|
@@ -142,21 +144,24 @@ function areChildConstraintsValid(parent, child) {
|
|
|
142
144
|
}
|
|
143
145
|
// Scopes: child scopes must be subset of parent scopes
|
|
144
146
|
// This is a simplified check - full validation is complex
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
147
|
+
if (parent.crisp && child.crisp) {
|
|
148
|
+
const parentResources = new Set(parent.crisp.scopes.map((s) => s.resource));
|
|
149
|
+
const allChildResourcesInParent = child.crisp.scopes.every((childScope) => {
|
|
150
|
+
// Check if child resource matches any parent resource
|
|
151
|
+
return parent.crisp.scopes.some((parentScope) => {
|
|
152
|
+
if (parentScope.matcher === 'exact') {
|
|
153
|
+
return parentScope.resource === childScope.resource;
|
|
154
|
+
}
|
|
155
|
+
if (parentScope.matcher === 'prefix') {
|
|
156
|
+
return childScope.resource.startsWith(parentScope.resource);
|
|
157
|
+
}
|
|
158
|
+
// regex matching would require runtime regex evaluation
|
|
159
|
+
return true; // Can't validate regex at type level
|
|
160
|
+
});
|
|
157
161
|
});
|
|
158
|
-
|
|
159
|
-
|
|
162
|
+
return allChildResourcesInParent;
|
|
163
|
+
}
|
|
164
|
+
return true; // Can't validate if crisp is not present
|
|
160
165
|
}
|
|
161
166
|
/**
|
|
162
167
|
* Check if a resource matches a scope
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/delegation/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC"}
|