@adea-ai/contracts 2.1.0 → 2.2.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.
|
@@ -2,6 +2,15 @@ import { z } from 'zod';
|
|
|
2
2
|
/** One short, plain-text conclusion attested by the canonical child result producer.
|
|
3
3
|
* Arbitrary runtime JSON and artifact references are never publication content. */
|
|
4
4
|
export declare const PiChildConclusionSchema: z.ZodString;
|
|
5
|
+
/**
|
|
6
|
+
* A conclusion sealed under the workspace content key by the device that ran the child, for the
|
|
7
|
+
* lead's prompt message and the field `conclusion:<delegationId>`. Only the user's sessions open it.
|
|
8
|
+
*/
|
|
9
|
+
export declare const PiChildSealedConclusionSchema: z.ZodObject<{
|
|
10
|
+
ckv: z.ZodNumber;
|
|
11
|
+
nonce: z.ZodString;
|
|
12
|
+
ciphertext: z.ZodString;
|
|
13
|
+
}, z.core.$strict>;
|
|
5
14
|
/** A retained terminal inbox event plus the exact admitted parent and child attempt. */
|
|
6
15
|
export declare const PiChildPublicationSchema: z.ZodObject<{
|
|
7
16
|
schemaVersion: z.ZodLiteral<"pi-child-publication/v1">;
|
|
@@ -23,6 +32,11 @@ export declare const PiChildPublicationSchema: z.ZodObject<{
|
|
|
23
32
|
}>;
|
|
24
33
|
resultRef: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"Artifact reference ID">, string>>>;
|
|
25
34
|
conclusion: z.ZodOptional<z.ZodString>;
|
|
35
|
+
sealedConclusion: z.ZodOptional<z.ZodObject<{
|
|
36
|
+
ckv: z.ZodNumber;
|
|
37
|
+
nonce: z.ZodString;
|
|
38
|
+
ciphertext: z.ZodString;
|
|
39
|
+
}, z.core.$strict>>;
|
|
26
40
|
failureCode: z.ZodOptional<z.ZodString>;
|
|
27
41
|
occurredAt: z.ZodISODateTime;
|
|
28
42
|
authorityRevision: z.ZodNumber;
|
|
@@ -83,6 +97,11 @@ export declare const PiChildPublicationResponseSchema: z.ZodObject<{
|
|
|
83
97
|
}>;
|
|
84
98
|
resultRef: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"Artifact reference ID">, string>>>;
|
|
85
99
|
conclusion: z.ZodOptional<z.ZodString>;
|
|
100
|
+
sealedConclusion: z.ZodOptional<z.ZodObject<{
|
|
101
|
+
ckv: z.ZodNumber;
|
|
102
|
+
nonce: z.ZodString;
|
|
103
|
+
ciphertext: z.ZodString;
|
|
104
|
+
}, z.core.$strict>>;
|
|
86
105
|
failureCode: z.ZodOptional<z.ZodString>;
|
|
87
106
|
occurredAt: z.ZodISODateTime;
|
|
88
107
|
authorityRevision: z.ZodNumber;
|
|
@@ -11,6 +11,22 @@ export const PiChildConclusionSchema = z
|
|
|
11
11
|
.max(1024)
|
|
12
12
|
.refine((text) => text === text.trim() && !/[\p{Cc}\p{Cf}]/u.test(text))
|
|
13
13
|
.refine((text) => new TextEncoder().encode(text).byteLength <= 1024);
|
|
14
|
+
/**
|
|
15
|
+
* A conclusion sealed under the workspace content key by the device that ran the child, for the
|
|
16
|
+
* lead's prompt message and the field `conclusion:<delegationId>`. Only the user's sessions open it.
|
|
17
|
+
*/
|
|
18
|
+
export const PiChildSealedConclusionSchema = z.strictObject({
|
|
19
|
+
ckv: z.number().int().min(1),
|
|
20
|
+
nonce: z
|
|
21
|
+
.string()
|
|
22
|
+
.length(16)
|
|
23
|
+
.regex(/^[A-Za-z0-9_-]+$/),
|
|
24
|
+
ciphertext: z
|
|
25
|
+
.string()
|
|
26
|
+
.min(1)
|
|
27
|
+
.max(4096)
|
|
28
|
+
.regex(/^[A-Za-z0-9_-]+$/),
|
|
29
|
+
});
|
|
14
30
|
/** A retained terminal inbox event plus the exact admitted parent and child attempt. */
|
|
15
31
|
export const PiChildPublicationSchema = z
|
|
16
32
|
.strictObject({
|
|
@@ -33,6 +49,7 @@ export const PiChildPublicationSchema = z
|
|
|
33
49
|
state: z.enum(['completed', 'failed', 'cancelled']),
|
|
34
50
|
resultRef: IdentifierSchemas.artifactId.optional(),
|
|
35
51
|
conclusion: PiChildConclusionSchema.optional(),
|
|
52
|
+
sealedConclusion: PiChildSealedConclusionSchema.optional(),
|
|
36
53
|
failureCode: z
|
|
37
54
|
.string()
|
|
38
55
|
.min(1)
|
|
@@ -50,8 +67,11 @@ export const PiChildPublicationSchema = z
|
|
|
50
67
|
context.addIssue({ code: 'custom', message: 'Terminal outcome is inconsistent' });
|
|
51
68
|
if (value.state !== 'failed' && value.failureCode !== undefined)
|
|
52
69
|
context.addIssue({ code: 'custom', message: 'Failure code requires failure' });
|
|
53
|
-
if (value.state !== 'completed' &&
|
|
70
|
+
if (value.state !== 'completed' &&
|
|
71
|
+
(value.conclusion !== undefined || value.sealedConclusion !== undefined))
|
|
54
72
|
context.addIssue({ code: 'custom', message: 'Only completion may carry a conclusion' });
|
|
73
|
+
if (value.conclusion !== undefined && value.sealedConclusion !== undefined)
|
|
74
|
+
context.addIssue({ code: 'custom', message: 'A conclusion is either sealed or not' });
|
|
55
75
|
});
|
|
56
76
|
export const PiChildPublicationRequestSchema = ReadRequestEnvelopeSchema.omit({ projectId: true })
|
|
57
77
|
.extend({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adea-ai/contracts",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Runtime-independent service boundary between Adea and the Control Plane: canonical identifiers, envelopes, Control API schemas, pagination, and versioning.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agents",
|