@adea-ai/runtime-sdk 1.5.2

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.
Files changed (67) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +53 -0
  3. package/dist/adapter.d.ts +526 -0
  4. package/dist/adapter.d.ts.map +1 -0
  5. package/dist/adapter.js +278 -0
  6. package/dist/adapter.js.map +1 -0
  7. package/dist/capabilities.d.ts +132 -0
  8. package/dist/capabilities.d.ts.map +1 -0
  9. package/dist/capabilities.js +86 -0
  10. package/dist/capabilities.js.map +1 -0
  11. package/dist/compatibility.d.ts +182 -0
  12. package/dist/compatibility.d.ts.map +1 -0
  13. package/dist/compatibility.js +243 -0
  14. package/dist/compatibility.js.map +1 -0
  15. package/dist/conformance.d.ts +14 -0
  16. package/dist/conformance.d.ts.map +1 -0
  17. package/dist/conformance.js +73 -0
  18. package/dist/conformance.js.map +1 -0
  19. package/dist/discovery.d.ts +26 -0
  20. package/dist/discovery.d.ts.map +1 -0
  21. package/dist/discovery.js +253 -0
  22. package/dist/discovery.js.map +1 -0
  23. package/dist/eligibility.d.ts +334 -0
  24. package/dist/eligibility.d.ts.map +1 -0
  25. package/dist/eligibility.js +310 -0
  26. package/dist/eligibility.js.map +1 -0
  27. package/dist/fixtures.d.ts +90 -0
  28. package/dist/fixtures.d.ts.map +1 -0
  29. package/dist/fixtures.js +48 -0
  30. package/dist/fixtures.js.map +1 -0
  31. package/dist/health.d.ts +182 -0
  32. package/dist/health.d.ts.map +1 -0
  33. package/dist/health.js +441 -0
  34. package/dist/health.js.map +1 -0
  35. package/dist/index.d.ts +17 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +17 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/inventory.d.ts +21 -0
  40. package/dist/inventory.d.ts.map +1 -0
  41. package/dist/inventory.js +33 -0
  42. package/dist/inventory.js.map +1 -0
  43. package/dist/mock.d.ts +24 -0
  44. package/dist/mock.d.ts.map +1 -0
  45. package/dist/mock.js +261 -0
  46. package/dist/mock.js.map +1 -0
  47. package/dist/models.d.ts +285 -0
  48. package/dist/models.d.ts.map +1 -0
  49. package/dist/models.js +241 -0
  50. package/dist/models.js.map +1 -0
  51. package/dist/registry.d.ts +195 -0
  52. package/dist/registry.d.ts.map +1 -0
  53. package/dist/registry.js +298 -0
  54. package/dist/registry.js.map +1 -0
  55. package/dist/routing.d.ts +408 -0
  56. package/dist/routing.d.ts.map +1 -0
  57. package/dist/routing.js +314 -0
  58. package/dist/routing.js.map +1 -0
  59. package/dist/sessions.d.ts +251 -0
  60. package/dist/sessions.d.ts.map +1 -0
  61. package/dist/sessions.js +411 -0
  62. package/dist/sessions.js.map +1 -0
  63. package/dist/transport.d.ts +55 -0
  64. package/dist/transport.d.ts.map +1 -0
  65. package/dist/transport.js +73 -0
  66. package/dist/transport.js.map +1 -0
  67. package/package.json +53 -0
@@ -0,0 +1,182 @@
1
+ import { z } from 'zod';
2
+ import { type RuntimeConnection } from './models.js';
3
+ export declare const RuntimeCertificationClassificationSchema: z.ZodEnum<{
4
+ supported: "supported";
5
+ degraded: "degraded";
6
+ revoked: "revoked";
7
+ untested: "untested";
8
+ incompatible: "incompatible";
9
+ preview: "preview";
10
+ }>;
11
+ export declare const RuntimeCertificationSchema: z.ZodObject<{
12
+ certificationId: z.ZodString;
13
+ runtimeFamily: z.ZodString;
14
+ connectionType: z.ZodEnum<{
15
+ managed_cloud: "managed_cloud";
16
+ managed_local: "managed_local";
17
+ external_local: "external_local";
18
+ }>;
19
+ classification: z.ZodEnum<{
20
+ supported: "supported";
21
+ degraded: "degraded";
22
+ revoked: "revoked";
23
+ untested: "untested";
24
+ incompatible: "incompatible";
25
+ preview: "preview";
26
+ }>;
27
+ versions: z.ZodObject<{
28
+ adapter: z.ZodString;
29
+ driver: z.ZodString;
30
+ harness: z.ZodString;
31
+ protocol: z.ZodString;
32
+ }, z.core.$strict>;
33
+ verifiedCapabilities: z.ZodArray<z.ZodEnum<{
34
+ "stream.output": "stream.output";
35
+ "stream.events": "stream.events";
36
+ "tool.call": "tool.call";
37
+ "tool.parallel": "tool.parallel";
38
+ "output.structured": "output.structured";
39
+ "filesystem.read": "filesystem.read";
40
+ "filesystem.write": "filesystem.write";
41
+ "project.read": "project.read";
42
+ "project.write": "project.write";
43
+ "execution.cancel": "execution.cancel";
44
+ "interaction.user-input": "interaction.user-input";
45
+ "interaction.approval": "interaction.approval";
46
+ "session.create": "session.create";
47
+ "session.list": "session.list";
48
+ "session.resume": "session.resume";
49
+ "session.close": "session.close";
50
+ "session.history": "session.history";
51
+ "session.load": "session.load";
52
+ "model.select": "model.select";
53
+ "execution.child": "execution.child";
54
+ }>>;
55
+ limitations: z.ZodArray<z.ZodString>;
56
+ testedPlatform: z.ZodObject<{
57
+ operatingSystem: z.ZodEnum<{
58
+ linux: "linux";
59
+ macos: "macos";
60
+ windows: "windows";
61
+ portable: "portable";
62
+ }>;
63
+ architecture: z.ZodEnum<{
64
+ portable: "portable";
65
+ x64: "x64";
66
+ arm64: "arm64";
67
+ }>;
68
+ location: z.ZodEnum<{
69
+ local_device: "local_device";
70
+ agent_hq_cloud: "agent_hq_cloud";
71
+ }>;
72
+ environment: z.ZodString;
73
+ }, z.core.$strict>;
74
+ certifiedAt: z.ZodISODateTime;
75
+ evidence: z.ZodArray<z.ZodObject<{
76
+ suite: z.ZodEnum<{
77
+ "runtime-adapter-conformance": "runtime-adapter-conformance";
78
+ "direct-local-transport-integration": "direct-local-transport-integration";
79
+ "runtime-gateway-integration": "runtime-gateway-integration";
80
+ "hosted-runtime-integration": "hosted-runtime-integration";
81
+ }>;
82
+ source: z.ZodString;
83
+ command: z.ZodString;
84
+ }, z.core.$strict>>;
85
+ }, z.core.$strict>;
86
+ export declare const RuntimeCompatibilityMatrixSchema: z.ZodObject<{
87
+ schemaVersion: z.ZodLiteral<1>;
88
+ matrixVersion: z.ZodString;
89
+ updatedAt: z.ZodISODateTime;
90
+ classifications: z.ZodTuple<[z.ZodLiteral<"supported">, z.ZodLiteral<"preview">, z.ZodLiteral<"degraded">, z.ZodLiteral<"incompatible">, z.ZodLiteral<"revoked">, z.ZodLiteral<"untested">], null>;
91
+ minimumSupportedVersions: z.ZodArray<z.ZodObject<{
92
+ runtimeFamily: z.ZodString;
93
+ adapter: z.ZodString;
94
+ driver: z.ZodString;
95
+ harness: z.ZodString;
96
+ protocol: z.ZodString;
97
+ }, z.core.$strict>>;
98
+ certifications: z.ZodArray<z.ZodObject<{
99
+ certificationId: z.ZodString;
100
+ runtimeFamily: z.ZodString;
101
+ connectionType: z.ZodEnum<{
102
+ managed_cloud: "managed_cloud";
103
+ managed_local: "managed_local";
104
+ external_local: "external_local";
105
+ }>;
106
+ classification: z.ZodEnum<{
107
+ supported: "supported";
108
+ degraded: "degraded";
109
+ revoked: "revoked";
110
+ untested: "untested";
111
+ incompatible: "incompatible";
112
+ preview: "preview";
113
+ }>;
114
+ versions: z.ZodObject<{
115
+ adapter: z.ZodString;
116
+ driver: z.ZodString;
117
+ harness: z.ZodString;
118
+ protocol: z.ZodString;
119
+ }, z.core.$strict>;
120
+ verifiedCapabilities: z.ZodArray<z.ZodEnum<{
121
+ "stream.output": "stream.output";
122
+ "stream.events": "stream.events";
123
+ "tool.call": "tool.call";
124
+ "tool.parallel": "tool.parallel";
125
+ "output.structured": "output.structured";
126
+ "filesystem.read": "filesystem.read";
127
+ "filesystem.write": "filesystem.write";
128
+ "project.read": "project.read";
129
+ "project.write": "project.write";
130
+ "execution.cancel": "execution.cancel";
131
+ "interaction.user-input": "interaction.user-input";
132
+ "interaction.approval": "interaction.approval";
133
+ "session.create": "session.create";
134
+ "session.list": "session.list";
135
+ "session.resume": "session.resume";
136
+ "session.close": "session.close";
137
+ "session.history": "session.history";
138
+ "session.load": "session.load";
139
+ "model.select": "model.select";
140
+ "execution.child": "execution.child";
141
+ }>>;
142
+ limitations: z.ZodArray<z.ZodString>;
143
+ testedPlatform: z.ZodObject<{
144
+ operatingSystem: z.ZodEnum<{
145
+ linux: "linux";
146
+ macos: "macos";
147
+ windows: "windows";
148
+ portable: "portable";
149
+ }>;
150
+ architecture: z.ZodEnum<{
151
+ portable: "portable";
152
+ x64: "x64";
153
+ arm64: "arm64";
154
+ }>;
155
+ location: z.ZodEnum<{
156
+ local_device: "local_device";
157
+ agent_hq_cloud: "agent_hq_cloud";
158
+ }>;
159
+ environment: z.ZodString;
160
+ }, z.core.$strict>;
161
+ certifiedAt: z.ZodISODateTime;
162
+ evidence: z.ZodArray<z.ZodObject<{
163
+ suite: z.ZodEnum<{
164
+ "runtime-adapter-conformance": "runtime-adapter-conformance";
165
+ "direct-local-transport-integration": "direct-local-transport-integration";
166
+ "runtime-gateway-integration": "runtime-gateway-integration";
167
+ "hosted-runtime-integration": "hosted-runtime-integration";
168
+ }>;
169
+ source: z.ZodString;
170
+ command: z.ZodString;
171
+ }, z.core.$strict>>;
172
+ }, z.core.$strict>>;
173
+ }, z.core.$strict>;
174
+ export type RuntimeCompatibilityMatrix = z.output<typeof RuntimeCompatibilityMatrixSchema>;
175
+ export type RuntimeCertification = z.output<typeof RuntimeCertificationSchema>;
176
+ export interface RuntimeCompatibilityCertificationInput {
177
+ readonly matrix: unknown;
178
+ readonly runtimeFamily: string;
179
+ readonly connection: unknown;
180
+ }
181
+ export declare function applyRuntimeCompatibilityCertification(input: RuntimeCompatibilityCertificationInput): RuntimeConnection;
182
+ //# sourceMappingURL=compatibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compatibility.d.ts","sourceRoot":"","sources":["../src/compatibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAOL,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAA;AASpB,eAAO,MAAM,wCAAwC;;;;;;;EAOnD,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA6EnC,CAAA;AAIJ,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAwDzC,CAAA;AAEJ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,gCAAgC,CAAC,CAAA;AAC1F,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAE9E,MAAM,WAAW,sCAAsC;IACrD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;CAC7B;AAED,wBAAgB,sCAAsC,CACpD,KAAK,EAAE,sCAAsC,GAC5C,iBAAiB,CAqGnB"}
@@ -0,0 +1,243 @@
1
+ import { z } from 'zod';
2
+ import { RuntimeCapabilityNameSchema, RuntimeCapabilitySchema } from './capabilities.js';
3
+ import { RuntimeConnectionLocationSchema, RuntimeConnectionSchema, RuntimeConnectionTypeSchema, RuntimeDiagnosticCodeSchema, RuntimeSemanticVersionSchema, RuntimeTimestampSchema, } from './models.js';
4
+ const RuntimeFamilySchema = z
5
+ .string()
6
+ .min(1)
7
+ .max(64)
8
+ .regex(/^[a-z][a-z0-9-]*$/);
9
+ const unique = (values) => new Set(values).size === values.length;
10
+ export const RuntimeCertificationClassificationSchema = z.enum([
11
+ 'supported',
12
+ 'preview',
13
+ 'degraded',
14
+ 'incompatible',
15
+ 'revoked',
16
+ 'untested',
17
+ ]);
18
+ export const RuntimeCertificationSchema = z
19
+ .object({
20
+ certificationId: z
21
+ .string()
22
+ .min(1)
23
+ .max(128)
24
+ .regex(/^[a-z][a-z0-9-]*$/),
25
+ runtimeFamily: RuntimeFamilySchema,
26
+ connectionType: RuntimeConnectionTypeSchema,
27
+ classification: RuntimeCertificationClassificationSchema,
28
+ versions: z
29
+ .object({
30
+ adapter: RuntimeSemanticVersionSchema,
31
+ driver: RuntimeSemanticVersionSchema,
32
+ harness: RuntimeSemanticVersionSchema,
33
+ protocol: RuntimeSemanticVersionSchema,
34
+ })
35
+ .strict(),
36
+ verifiedCapabilities: z
37
+ .array(RuntimeCapabilityNameSchema)
38
+ .min(1)
39
+ .max(64)
40
+ .refine(unique, 'Certified capabilities must be unique'),
41
+ limitations: z.array(RuntimeDiagnosticCodeSchema).max(64).refine(unique),
42
+ testedPlatform: z
43
+ .object({
44
+ operatingSystem: z.enum(['linux', 'macos', 'windows', 'portable']),
45
+ architecture: z.enum(['x64', 'arm64', 'portable']),
46
+ location: RuntimeConnectionLocationSchema,
47
+ environment: z.string().min(1).max(128),
48
+ })
49
+ .strict(),
50
+ certifiedAt: RuntimeTimestampSchema,
51
+ evidence: z
52
+ .array(z
53
+ .object({
54
+ suite: z.enum([
55
+ 'runtime-adapter-conformance',
56
+ 'direct-local-transport-integration',
57
+ 'runtime-gateway-integration',
58
+ 'hosted-runtime-integration',
59
+ ]),
60
+ source: z
61
+ .string()
62
+ .min(1)
63
+ .max(256)
64
+ .regex(/^(apps|packages|tests)\/[A-Za-z0-9_./-]+$/)
65
+ .refine((source) => !source.split('/').includes('..'), 'Evidence source cannot traverse directories'),
66
+ command: z.string().min(1).max(512),
67
+ })
68
+ .strict())
69
+ .min(1)
70
+ .max(16),
71
+ })
72
+ .strict()
73
+ .superRefine((certification, context) => {
74
+ if (certification.classification === 'supported' &&
75
+ (!certification.evidence.some((entry) => entry.suite === 'runtime-adapter-conformance') ||
76
+ !certification.evidence.some((entry) => ['direct-local-transport-integration', 'runtime-gateway-integration'].includes(entry.suite) || entry.suite === 'hosted-runtime-integration'))) {
77
+ context.addIssue({
78
+ code: 'custom',
79
+ path: ['evidence'],
80
+ message: 'Supported certification requires conformance and transport evidence',
81
+ });
82
+ }
83
+ });
84
+ const classifications = RuntimeCertificationClassificationSchema.options;
85
+ export const RuntimeCompatibilityMatrixSchema = z
86
+ .object({
87
+ schemaVersion: z.literal(1),
88
+ matrixVersion: RuntimeSemanticVersionSchema,
89
+ updatedAt: RuntimeTimestampSchema,
90
+ classifications: z.tuple(classifications.map((classification) => z.literal(classification))),
91
+ minimumSupportedVersions: z
92
+ .array(z
93
+ .object({
94
+ runtimeFamily: RuntimeFamilySchema,
95
+ adapter: RuntimeSemanticVersionSchema,
96
+ driver: RuntimeSemanticVersionSchema,
97
+ harness: RuntimeSemanticVersionSchema,
98
+ protocol: RuntimeSemanticVersionSchema,
99
+ })
100
+ .strict())
101
+ .min(1)
102
+ .max(64),
103
+ certifications: z.array(RuntimeCertificationSchema).min(1).max(256),
104
+ })
105
+ .strict()
106
+ .superRefine((matrix, context) => {
107
+ const certificationIds = matrix.certifications.map(({ certificationId }) => certificationId);
108
+ if (!unique(certificationIds)) {
109
+ context.addIssue({
110
+ code: 'custom',
111
+ path: ['certifications'],
112
+ message: 'Certification IDs must be unique',
113
+ });
114
+ }
115
+ const identities = matrix.certifications.map(certificationIdentity);
116
+ if (!unique(identities)) {
117
+ context.addIssue({
118
+ code: 'custom',
119
+ path: ['certifications'],
120
+ message: 'Certification version and platform identities must be unique',
121
+ });
122
+ }
123
+ if (!unique(matrix.minimumSupportedVersions.map(({ runtimeFamily }) => runtimeFamily))) {
124
+ context.addIssue({
125
+ code: 'custom',
126
+ path: ['minimumSupportedVersions'],
127
+ message: 'Minimum version policies must be unique by runtime family',
128
+ });
129
+ }
130
+ });
131
+ export function applyRuntimeCompatibilityCertification(input) {
132
+ const matrix = RuntimeCompatibilityMatrixSchema.parse(input.matrix);
133
+ const runtimeFamily = RuntimeFamilySchema.parse(input.runtimeFamily);
134
+ const connection = RuntimeConnectionSchema.parse(input.connection);
135
+ const certification = matrix.certifications.find((entry) => entry.runtimeFamily === runtimeFamily &&
136
+ entry.connectionType === connection.connectionType &&
137
+ entry.testedPlatform.location === connection.location &&
138
+ entry.versions.adapter === connection.adapterVersion &&
139
+ entry.versions.driver === connection.driverVersion &&
140
+ entry.versions.harness === connection.harnessVersion &&
141
+ entry.versions.protocol === connection.protocolVersion);
142
+ if (!certification) {
143
+ return RuntimeConnectionSchema.parse(degradeConnection(connection, 'untested', ['COMPATIBILITY_UNTESTED']));
144
+ }
145
+ if (certification.classification === 'revoked') {
146
+ return RuntimeConnectionSchema.parse({
147
+ ...connection,
148
+ status: 'revoked',
149
+ health: 'unavailable',
150
+ compatibilityState: 'revoked',
151
+ availabilityState: 'revoked',
152
+ limitations: limitations(connection, certification, ['CERTIFICATION_REVOKED']),
153
+ });
154
+ }
155
+ if (certification.classification === 'incompatible') {
156
+ return RuntimeConnectionSchema.parse({
157
+ ...connection,
158
+ status: 'unavailable',
159
+ health: 'unavailable',
160
+ compatibilityState: 'incompatible',
161
+ availabilityState: 'incompatible',
162
+ limitations: limitations(connection, certification, ['CERTIFICATION_INCOMPATIBLE']),
163
+ });
164
+ }
165
+ const certifiedCapabilities = new Set(certification.verifiedCapabilities);
166
+ const reportedCapabilities = new Map(connection.capabilities.map((capability) => [capability.name, capability]));
167
+ const missingCertified = certification.verifiedCapabilities.some((name) => {
168
+ const capability = reportedCapabilities.get(name);
169
+ return capability === undefined || capability.support === 'unsupported';
170
+ });
171
+ if (missingCertified) {
172
+ return RuntimeConnectionSchema.parse({
173
+ ...connection,
174
+ status: 'unavailable',
175
+ health: 'unavailable',
176
+ compatibilityState: 'capability_missing',
177
+ availabilityState: 'incompatible',
178
+ limitations: limitations(connection, certification, ['CERTIFIED_CAPABILITY_MISSING']),
179
+ });
180
+ }
181
+ const capabilities = RuntimeCapabilitySchema.array().parse(connection.capabilities.map((capability) => certifiedCapabilities.has(capability.name)
182
+ ? capability
183
+ : {
184
+ name: capability.name,
185
+ support: 'unsupported',
186
+ limitations: ['UNCERTIFIED_CAPABILITY'],
187
+ }));
188
+ const unverifiedClaim = capabilities.some((capability) => capability.limitations?.includes('UNCERTIFIED_CAPABILITY'));
189
+ if (unverifiedClaim) {
190
+ return RuntimeConnectionSchema.parse({
191
+ ...degradeConnection(connection, 'degraded', ['UNCERTIFIED_CAPABILITY']),
192
+ capabilities,
193
+ limitations: limitations(connection, certification, ['UNCERTIFIED_CAPABILITY']),
194
+ });
195
+ }
196
+ if (certification.classification === 'supported') {
197
+ return RuntimeConnectionSchema.parse({
198
+ ...connection,
199
+ compatibilityState: 'compatible',
200
+ limitations: limitations(connection, certification),
201
+ });
202
+ }
203
+ if (certification.classification === 'untested') {
204
+ return RuntimeConnectionSchema.parse({
205
+ ...degradeConnection(connection, 'untested', ['COMPATIBILITY_UNTESTED']),
206
+ limitations: limitations(connection, certification, ['COMPATIBILITY_UNTESTED']),
207
+ });
208
+ }
209
+ const code = certification.classification === 'preview' ? 'CERTIFICATION_PREVIEW' : 'CERTIFICATION_DEGRADED';
210
+ return RuntimeConnectionSchema.parse({
211
+ ...degradeConnection(connection, 'degraded', [code]),
212
+ limitations: limitations(connection, certification, [code]),
213
+ });
214
+ }
215
+ function degradeConnection(connection, compatibilityState, addedLimitations) {
216
+ const available = connection.status === 'connected' || connection.status === 'degraded';
217
+ return {
218
+ ...connection,
219
+ ...(available
220
+ ? {
221
+ status: 'degraded',
222
+ health: 'degraded',
223
+ availabilityState: 'degraded',
224
+ }
225
+ : {}),
226
+ compatibilityState,
227
+ limitations: [...new Set([...connection.limitations, ...addedLimitations])].sort(),
228
+ };
229
+ }
230
+ function limitations(connection, certification, additional = []) {
231
+ return [
232
+ ...new Set([...connection.limitations, ...certification.limitations, ...additional]),
233
+ ].sort();
234
+ }
235
+ function certificationIdentity(certification) {
236
+ return JSON.stringify({
237
+ runtimeFamily: certification.runtimeFamily,
238
+ connectionType: certification.connectionType,
239
+ versions: certification.versions,
240
+ platform: certification.testedPlatform,
241
+ });
242
+ }
243
+ //# sourceMappingURL=compatibility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compatibility.js","sourceRoot":"","sources":["../src/compatibility.ts"],"names":[],"mappings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 -0,0 +1,14 @@
1
+ import { type RuntimeAdapter, type RuntimeExecutionHandle, type RuntimeExecutionPlanSnapshot, type RuntimeExecutionStatus } from './adapter.js';
2
+ export declare const RuntimeAdapterConformanceChecks: readonly ["inspection", "capabilities", "idempotent-start", "normalized-error", "immutable-plan", "progress", "status-reconcile", "terminal-result", "idempotent-cleanup"];
3
+ export interface RuntimeAdapterConformanceInput {
4
+ readonly adapter: RuntimeAdapter;
5
+ readonly executionPlan: RuntimeExecutionPlanSnapshot;
6
+ readonly attemptId: string;
7
+ readonly complete: (handle: RuntimeExecutionHandle) => RuntimeExecutionStatus | Promise<RuntimeExecutionStatus>;
8
+ }
9
+ export interface RuntimeAdapterConformanceReport {
10
+ readonly passed: true;
11
+ readonly checks: typeof RuntimeAdapterConformanceChecks;
12
+ }
13
+ export declare function runRuntimeAdapterConformance(input: RuntimeAdapterConformanceInput): Promise<RuntimeAdapterConformanceReport>;
14
+ //# sourceMappingURL=conformance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conformance.d.ts","sourceRoot":"","sources":["../src/conformance.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EACjC,KAAK,sBAAsB,EAC5B,MAAM,cAAc,CAAA;AAErB,eAAO,MAAM,+BAA+B,4KAUjC,CAAA;AAEX,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAA;IAChC,QAAQ,CAAC,aAAa,EAAE,4BAA4B,CAAA;IACpD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,QAAQ,EAAE,CACjB,MAAM,EAAE,sBAAsB,KAC3B,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAA;CAC9D;AAED,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,OAAO,+BAA+B,CAAA;CACxD;AAED,wBAAsB,4BAA4B,CAChD,KAAK,EAAE,8BAA8B,GACpC,OAAO,CAAC,+BAA+B,CAAC,CA8D1C"}
@@ -0,0 +1,73 @@
1
+ import { RuntimeAdapterError, RuntimeAdapterInspectionSchema, RuntimeErrorSchema, RuntimeExecutionHandleSchema, RuntimeExecutionProgressSchema, RuntimeExecutionStatusSchema, } from './adapter.js';
2
+ export const RuntimeAdapterConformanceChecks = Object.freeze([
3
+ 'inspection',
4
+ 'capabilities',
5
+ 'idempotent-start',
6
+ 'normalized-error',
7
+ 'immutable-plan',
8
+ 'progress',
9
+ 'status-reconcile',
10
+ 'terminal-result',
11
+ 'idempotent-cleanup',
12
+ ]);
13
+ export async function runRuntimeAdapterConformance(input) {
14
+ RuntimeAdapterInspectionSchema.parse(await input.adapter.inspect());
15
+ const inspection = RuntimeAdapterInspectionSchema.parse(await input.adapter.inspect([
16
+ { capability: 'stream.output', necessity: 'required', minimumSupport: 'supported' },
17
+ { capability: 'session.history', necessity: 'optional', minimumSupport: 'degraded' },
18
+ ]));
19
+ assert(inspection.capabilityEvaluation?.eligible === true, 'REQUIRED_CAPABILITY_INELIGIBLE');
20
+ const before = fingerprint(input.executionPlan);
21
+ const request = {
22
+ attemptId: input.attemptId,
23
+ idempotencyKey: `conformance:${input.attemptId}`,
24
+ executionPlan: structuredClone(input.executionPlan),
25
+ };
26
+ const first = RuntimeExecutionHandleSchema.parse(await input.adapter.start(request));
27
+ const replay = RuntimeExecutionHandleSchema.parse(await input.adapter.start(request));
28
+ assert(fingerprint(first) === fingerprint(replay), 'START_NOT_IDEMPOTENT');
29
+ let normalizedConflict = false;
30
+ try {
31
+ await input.adapter.start({
32
+ ...request,
33
+ executionPlan: {
34
+ ...request.executionPlan,
35
+ contentDigest: `sha256:${'f'.repeat(64)}`,
36
+ },
37
+ });
38
+ }
39
+ catch (error) {
40
+ if (error instanceof RuntimeAdapterError) {
41
+ RuntimeErrorSchema.parse(error.toJSON());
42
+ normalizedConflict = error.classification === 'conflict' && !error.retryable;
43
+ }
44
+ }
45
+ assert(normalizedConflict, 'IDEMPOTENCY_ERROR_NOT_NORMALIZED');
46
+ assert(before === fingerprint(input.executionPlan), 'EXECUTION_PLAN_MUTATED');
47
+ const progress = [];
48
+ for await (const eventInput of input.adapter.progress(first, { afterSequence: 0 })) {
49
+ progress.push(RuntimeExecutionProgressSchema.parse(eventInput));
50
+ }
51
+ assert(progress.length > 0, 'PROGRESS_MISSING');
52
+ let previousSequence = 0;
53
+ for (const event of progress) {
54
+ assert(event.sequence > previousSequence, 'PROGRESS_NOT_STRICTLY_ORDERED');
55
+ previousSequence = event.sequence;
56
+ }
57
+ const status = RuntimeExecutionStatusSchema.parse(await input.adapter.status(first));
58
+ const reconciled = RuntimeExecutionStatusSchema.parse(await input.adapter.reconcile(first));
59
+ assert(fingerprint(status) === fingerprint(reconciled), 'RECONCILIATION_MISMATCH');
60
+ const completed = RuntimeExecutionStatusSchema.parse(await input.complete(first));
61
+ assert(completed.state === 'completed' && completed.result?.outcome === 'completed', 'RESULT_MISSING');
62
+ await input.adapter.cleanup(first);
63
+ await input.adapter.cleanup(first);
64
+ return { passed: true, checks: RuntimeAdapterConformanceChecks };
65
+ }
66
+ function assert(condition, code) {
67
+ if (!condition)
68
+ throw new Error(`RUNTIME_ADAPTER_CONFORMANCE:${code}`);
69
+ }
70
+ function fingerprint(value) {
71
+ return JSON.stringify(value);
72
+ }
73
+ //# sourceMappingURL=conformance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conformance.js","sourceRoot":"","sources":["../src/conformance.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,8BAA8B,EAC9B,kBAAkB,EAClB,4BAA4B,EAC5B,8BAA8B,EAC9B,4BAA4B,GAK7B,MAAM,cAAc,CAAA;AAErB,MAAM,CAAC,MAAM,+BAA+B,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3D,YAAY;IACZ,cAAc;IACd,k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GAAG,4BAA4B,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;IACpF,MAAM,UAAU,GAAG,4BAA4B,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAA;IAC3F,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,WAAW,CAAC,UAAU,CAAC,EAAE,yBAAyB,CAAC,CAAA;IAElF,MAAM,SAAS,GAAG,4BAA4B,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAA;IACjF,MAAM,CACJ,SAAS,CAAC,KAAK,KAAK,WAAW,IAAI,SAAS,CAAC,MAAM,EAAE,OAAO,KAAK,WAAW,EAC5E,gBAAgB,CACjB,CAAA;IAED,MAAM,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAClC,MAAM,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAClC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,+BAA+B,EAAE,CAAA;AAClE,CAAC;AAED,SAAS,MAAM,CAAC,SAAkB,EAAE,IAAY;IAC9C,IAAI,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,IAAI,EAAE,CAAC,CAAA;AACxE,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { type ExternalSessionDiscoveryReadModel, type RuntimeConnectionDiscoveryReadModel } from '@control-plane/contracts';
2
+ import { type RuntimeCapabilityName } from './capabilities.js';
3
+ import { type RuntimeConnection } from './models.js';
4
+ import { type ExternalSession, type ExternalSessionAssessment } from './sessions.js';
5
+ export interface RuntimeConnectionDiscoveryProjectionInput {
6
+ readonly connection: RuntimeConnection;
7
+ readonly family: string;
8
+ readonly node?: unknown;
9
+ readonly nodeHealth: 'online' | 'offline' | 'unknown' | 'revoked' | 'not_applicable';
10
+ readonly evaluatedAt: string;
11
+ readonly localProjectGrant: {
12
+ readonly required: boolean;
13
+ readonly state: 'not_required' | 'granted' | 'missing' | 'revoked';
14
+ };
15
+ readonly entitlement: {
16
+ readonly state: 'allowed' | 'denied' | 'unknown';
17
+ readonly class?: string;
18
+ };
19
+ readonly requiredCapabilities?: readonly RuntimeCapabilityName[];
20
+ }
21
+ export declare function projectRuntimeConnectionDiscovery(inputValue: RuntimeConnectionDiscoveryProjectionInput): RuntimeConnectionDiscoveryReadModel;
22
+ export declare function projectExternalSessionDiscovery(inputValue: {
23
+ readonly session: ExternalSession;
24
+ readonly assessment: ExternalSessionAssessment;
25
+ }): ExternalSessionDiscoveryReadModel;
26
+ //# sourceMappingURL=discovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,iCAAiC,EACtC,KAAK,mCAAmC,EACzC,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAA+B,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAE3F,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAA;AACpB,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC/B,MAAM,eAAe,CAAA;AAEtB,MAAM,WAAW,yCAAyC;IACxD,QAAQ,CAAC,UAAU,EAAE,iBAAiB,CAAA;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,UAAU,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,gBAAgB,CAAA;IACpF,QAAQ,CAAC,WAAW,EAA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