@adea-ai/runtime-sdk 3.0.1 → 3.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/adapter.d.ts +1 -0
- package/dist/adapter.js +1 -0
- package/dist/pi-durable-lead.d.ts +62 -0
- package/dist/pi-durable-lead.js +35 -0
- package/package.json +2 -2
package/dist/adapter.d.ts
CHANGED
|
@@ -511,6 +511,7 @@ export declare const RuntimeStartRequestSchema: z.ZodObject<{
|
|
|
511
511
|
maximumMicrounits: z.ZodNumber;
|
|
512
512
|
maximumTokens: z.ZodNumber;
|
|
513
513
|
}, z.core.$strict>>>;
|
|
514
|
+
traceId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@adea-ai/contracts").OpaqueIdentifier<"trace ID">, string>>>;
|
|
514
515
|
}, z.core.$strict>;
|
|
515
516
|
export declare const RuntimeInputRequestSchema: z.ZodObject<{
|
|
516
517
|
interactionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@adea-ai/contracts").OpaqueIdentifier<"interaction ID">, string>>;
|
package/dist/adapter.js
CHANGED
|
@@ -272,6 +272,7 @@ export const RuntimeStartRequestSchema = z
|
|
|
272
272
|
idempotencyKey: IdempotencyKeySchema,
|
|
273
273
|
executionPlan: RuntimeExecutionPlanSnapshotSchema,
|
|
274
274
|
attemptBudget: RuntimeAttemptBudgetAuthoritySchema.optional(),
|
|
275
|
+
traceId: IdentifierSchemas.traceId.optional(),
|
|
275
276
|
})
|
|
276
277
|
.strict()
|
|
277
278
|
.superRefine((request, context) => {
|
|
@@ -253,6 +253,7 @@ export declare const PiDurableSessionEventsRequestSchema: z.ZodObject<{
|
|
|
253
253
|
operation: z.ZodLiteral<"pi-durable.lead.session-events">;
|
|
254
254
|
parameters: z.ZodObject<{
|
|
255
255
|
runtimeSessionId: typeof PiDurableSessionIdSchema;
|
|
256
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
256
257
|
afterSeq: z.ZodNumber;
|
|
257
258
|
waitMs: z.ZodNumber;
|
|
258
259
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -332,6 +333,30 @@ export declare const PiDurableLeadApprovalAnswerRequestSchema: z.ZodObject<{
|
|
|
332
333
|
operation: z.ZodLiteral<"pi-durable.lead.approval-answer">;
|
|
333
334
|
payload: z.ZodObject<typeof PiDurableApprovalAnswerSchema.shape & typeof PiDurableApprovalAttestationSchema.shape, z.core.$strict>;
|
|
334
335
|
}, z.core.$strict>;
|
|
336
|
+
export declare const PiDurableChildMessageRequestIdSchema: z.ZodString;
|
|
337
|
+
export declare const PI_DURABLE_CHILD_MESSAGE_MAX_CHARS = 8192;
|
|
338
|
+
export declare const PiDurableLeadChildMessageRequestSchema: z.ZodObject<{
|
|
339
|
+
contractVersion: z.ZodObject<{
|
|
340
|
+
major: z.ZodNumber;
|
|
341
|
+
minor: z.ZodNumber;
|
|
342
|
+
}, z.core.$strict>;
|
|
343
|
+
requestId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@adea-ai/contracts").OpaqueIdentifier<"request ID">, string>>;
|
|
344
|
+
workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@adea-ai/contracts").OpaqueIdentifier<"workspace ID">, string>>;
|
|
345
|
+
projectId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@adea-ai/contracts").OpaqueIdentifier<"project ID">, string>>>;
|
|
346
|
+
commandId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@adea-ai/contracts").OpaqueIdentifier<"command ID">, string>>;
|
|
347
|
+
idempotencyKey: z.ZodString;
|
|
348
|
+
payloadHash: z.ZodString;
|
|
349
|
+
issuedAt: z.ZodISODateTime;
|
|
350
|
+
caller: typeof Caller;
|
|
351
|
+
correlation: typeof Correlation;
|
|
352
|
+
operation: z.ZodLiteral<"pi-durable.lead.child-message">;
|
|
353
|
+
payload: z.ZodObject<{
|
|
354
|
+
dispatchId: typeof PiDurableDispatchIdSchema;
|
|
355
|
+
delegationId: typeof IdentifierSchemas.delegationId;
|
|
356
|
+
requestId: typeof PiDurableChildMessageRequestIdSchema;
|
|
357
|
+
text: z.ZodString;
|
|
358
|
+
}, z.core.$strict>;
|
|
359
|
+
}, z.core.$strict>;
|
|
335
360
|
export declare const PiDurableLeadChildCancelRequestSchema: z.ZodObject<{
|
|
336
361
|
contractVersion: z.ZodObject<{
|
|
337
362
|
major: z.ZodNumber;
|
|
@@ -798,6 +823,34 @@ export declare const PiDurableLeadChildCancelResponseSchema: z.ZodObject<{
|
|
|
798
823
|
attributed: z.ZodBoolean;
|
|
799
824
|
}, z.core.$strict>;
|
|
800
825
|
}, z.core.$strict>;
|
|
826
|
+
export declare const PiDurableLeadChildMessageResponseSchema: z.ZodObject<{
|
|
827
|
+
contractVersion: z.ZodObject<{
|
|
828
|
+
major: z.ZodNumber;
|
|
829
|
+
minor: z.ZodNumber;
|
|
830
|
+
}, z.core.$strict>;
|
|
831
|
+
requestId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@adea-ai/contracts").OpaqueIdentifier<"request ID">, string>>;
|
|
832
|
+
correlation: z.ZodObject<{
|
|
833
|
+
traceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@adea-ai/contracts").OpaqueIdentifier<"trace ID">, string>>;
|
|
834
|
+
causationCommandId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@adea-ai/contracts").OpaqueIdentifier<"command ID">, string>>>;
|
|
835
|
+
parentEventId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@adea-ai/contracts").OpaqueIdentifier<"event ID">, string>>>;
|
|
836
|
+
}, z.core.$strict>;
|
|
837
|
+
data: z.ZodObject<{
|
|
838
|
+
schemaVersion: z.ZodLiteral<"pi-lead-dispatch/v1">;
|
|
839
|
+
dispatchId: typeof PiDurableDispatchIdSchema;
|
|
840
|
+
intentId: typeof IntentId;
|
|
841
|
+
executionId: typeof IdentifierSchemas.executionId;
|
|
842
|
+
attemptId: typeof IdentifierSchemas.attemptId;
|
|
843
|
+
runtimeSessionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@adea-ai/contracts").OpaqueIdentifier<"external-session ID">, string>>;
|
|
844
|
+
requestedTarget: z.ZodOptional<typeof PiDurableLeadRequestedTargetSchema>;
|
|
845
|
+
observedTarget: z.ZodOptional<typeof PiDurableLeadObservedTargetSchema>;
|
|
846
|
+
child: typeof PiDurableLeadChildSchema;
|
|
847
|
+
requestId: typeof PiDurableChildMessageRequestIdSchema;
|
|
848
|
+
outcome: z.ZodEnum<{
|
|
849
|
+
already_delivered: "already_delivered";
|
|
850
|
+
delivered: "delivered";
|
|
851
|
+
}>;
|
|
852
|
+
}, z.core.$strict>;
|
|
853
|
+
}, z.core.$strict>;
|
|
801
854
|
export declare const PiDurableLeadChildTargetSchema: z.ZodObject<{
|
|
802
855
|
source: z.ZodLiteral<"control_plane_reported">;
|
|
803
856
|
runtimeConnectionId: typeof IdentifierSchemas.runtimeConnectionId;
|
|
@@ -984,6 +1037,13 @@ export declare const PiDurableLeadHttpContract: Readonly<{
|
|
|
984
1037
|
requestSchema: typeof PiDurableLeadChildCancelRequestSchema;
|
|
985
1038
|
responseSchema: typeof PiDurableLeadChildCancelResponseSchema;
|
|
986
1039
|
}>;
|
|
1040
|
+
childMessage: Readonly<{
|
|
1041
|
+
route: "child-message";
|
|
1042
|
+
operation: "pi-durable.lead.child-message";
|
|
1043
|
+
scope: "execution:write";
|
|
1044
|
+
requestSchema: typeof PiDurableLeadChildMessageRequestSchema;
|
|
1045
|
+
responseSchema: typeof PiDurableLeadChildMessageResponseSchema;
|
|
1046
|
+
}>;
|
|
987
1047
|
}>;
|
|
988
1048
|
export type PiDurableLeadPrepareRequest = z.output<typeof PiDurableLeadPrepareRequestSchema>;
|
|
989
1049
|
export type PiDurableLeadPrepareResponse = z.output<typeof PiDurableLeadPrepareResponseSchema>;
|
|
@@ -1016,6 +1076,8 @@ export type PiDurableLeadApprovalAnswerRequest = z.output<typeof PiDurableLeadAp
|
|
|
1016
1076
|
export type PiDurableLeadApprovalAnswerResponse = z.output<typeof PiDurableLeadApprovalAnswerResponseSchema>;
|
|
1017
1077
|
export type PiDurableLeadChildCancelRequest = z.output<typeof PiDurableLeadChildCancelRequestSchema>;
|
|
1018
1078
|
export type PiDurableLeadChildCancelResponse = z.output<typeof PiDurableLeadChildCancelResponseSchema>;
|
|
1079
|
+
export type PiDurableLeadChildMessageRequest = z.output<typeof PiDurableLeadChildMessageRequestSchema>;
|
|
1080
|
+
export type PiDurableLeadChildMessageResponse = z.output<typeof PiDurableLeadChildMessageResponseSchema>;
|
|
1019
1081
|
export type PiDurableLeadChildTargetRequest = z.output<typeof PiDurableLeadChildTargetRequestSchema>;
|
|
1020
1082
|
export type PiDurableLeadChildTargetResponse = z.output<typeof PiDurableLeadChildTargetResponseSchema>;
|
|
1021
1083
|
export type PiDurableLeadChildTarget = z.output<typeof PiDurableLeadChildTargetSchema>;
|
package/dist/pi-durable-lead.js
CHANGED
|
@@ -173,6 +173,12 @@ export const PiDurableSessionEventsRequestSchema = PiDurableLeadReadEnvelopeSche
|
|
|
173
173
|
parameters: z
|
|
174
174
|
.object({
|
|
175
175
|
runtimeSessionId: PiDurableSessionIdSchema,
|
|
176
|
+
messageId: z
|
|
177
|
+
.string()
|
|
178
|
+
.min(1)
|
|
179
|
+
.max(128)
|
|
180
|
+
.regex(/^[A-Za-z0-9._:-]+$/)
|
|
181
|
+
.optional(),
|
|
176
182
|
afterSeq: LeadEventSeq,
|
|
177
183
|
waitMs: z.number().int().min(0).max(PI_DURABLE_LEAD_EVENTS_MAX_WAIT_MS),
|
|
178
184
|
limit: z.number().int().min(1).max(PI_DURABLE_LEAD_EVENTS_MAX_PAGE).optional(),
|
|
@@ -206,6 +212,21 @@ export const PiDurableLeadApprovalAnswerRequestSchema = PiDurableLeadCommandEnve
|
|
|
206
212
|
operation: z.literal('pi-durable.lead.approval-answer'),
|
|
207
213
|
payload: PiDurableApprovalAnswerSchema.extend(PiDurableApprovalAttestationSchema.shape),
|
|
208
214
|
});
|
|
215
|
+
export const PiDurableChildMessageRequestIdSchema = z
|
|
216
|
+
.string()
|
|
217
|
+
.regex(/^pi-child-message:[a-f0-9]{32}$/);
|
|
218
|
+
export const PI_DURABLE_CHILD_MESSAGE_MAX_CHARS = 8192;
|
|
219
|
+
export const PiDurableLeadChildMessageRequestSchema = PiDurableLeadCommandEnvelopeSchema.extend({
|
|
220
|
+
operation: z.literal('pi-durable.lead.child-message'),
|
|
221
|
+
payload: z
|
|
222
|
+
.object({
|
|
223
|
+
dispatchId: PiDurableDispatchIdSchema,
|
|
224
|
+
delegationId: IdentifierSchemas.delegationId,
|
|
225
|
+
requestId: PiDurableChildMessageRequestIdSchema,
|
|
226
|
+
text: z.string().trim().min(1).max(PI_DURABLE_CHILD_MESSAGE_MAX_CHARS),
|
|
227
|
+
})
|
|
228
|
+
.strict(),
|
|
229
|
+
});
|
|
209
230
|
export const PiDurableLeadChildCancelRequestSchema = PiDurableLeadCommandEnvelopeSchema.extend({
|
|
210
231
|
operation: z.literal('pi-durable.lead.child-cancel'),
|
|
211
232
|
payload: z
|
|
@@ -505,6 +526,13 @@ export const PiDurableLeadChildCancelResponseSchema = response.extend({
|
|
|
505
526
|
attributed: z.boolean(),
|
|
506
527
|
}),
|
|
507
528
|
});
|
|
529
|
+
export const PiDurableLeadChildMessageResponseSchema = response.extend({
|
|
530
|
+
data: PiDurableLeadReceiptResponseSchema.extend({
|
|
531
|
+
child: PiDurableLeadChildSchema,
|
|
532
|
+
requestId: PiDurableChildMessageRequestIdSchema,
|
|
533
|
+
outcome: z.enum(['delivered', 'already_delivered']),
|
|
534
|
+
}),
|
|
535
|
+
});
|
|
508
536
|
export const PiDurableLeadChildTargetSchema = z.strictObject({
|
|
509
537
|
source: z.literal('control_plane_reported'),
|
|
510
538
|
runtimeConnectionId: IdentifierSchemas.runtimeConnectionId,
|
|
@@ -698,4 +726,11 @@ export const PiDurableLeadHttpContract = Object.freeze({
|
|
|
698
726
|
requestSchema: PiDurableLeadChildCancelRequestSchema,
|
|
699
727
|
responseSchema: PiDurableLeadChildCancelResponseSchema,
|
|
700
728
|
}),
|
|
729
|
+
childMessage: Object.freeze({
|
|
730
|
+
route: 'child-message',
|
|
731
|
+
operation: 'pi-durable.lead.child-message',
|
|
732
|
+
scope: 'execution:write',
|
|
733
|
+
requestSchema: PiDurableLeadChildMessageRequestSchema,
|
|
734
|
+
responseSchema: PiDurableLeadChildMessageResponseSchema,
|
|
735
|
+
}),
|
|
701
736
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adea-ai/runtime-sdk",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "SDK for building Control Plane runtimes: adapters, capabilities, conformance, discovery, eligibility, health, sessions, transport, and routing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adapter",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"test": "bun test src"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@adea-ai/contracts": "^5.0.
|
|
45
|
+
"@adea-ai/contracts": "^5.0.3",
|
|
46
46
|
"zod": "4.6.6"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|