@adea-ai/runtime-sdk 1.17.0 → 1.17.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 (77) hide show
  1. package/dist/adapter.d.ts +29 -1
  2. package/dist/adapter.js +32 -1
  3. package/dist/agent-plugins.d.ts +0 -1
  4. package/dist/agent-plugins.js +0 -1
  5. package/dist/capabilities.d.ts +0 -1
  6. package/dist/capabilities.js +0 -1
  7. package/dist/channel-ownership.d.ts +0 -1
  8. package/dist/channel-ownership.js +0 -1
  9. package/dist/compatibility.d.ts +0 -1
  10. package/dist/compatibility.js +0 -1
  11. package/dist/conformance.d.ts +0 -1
  12. package/dist/conformance.js +0 -1
  13. package/dist/discovery.d.ts +0 -1
  14. package/dist/discovery.js +0 -1
  15. package/dist/eligibility.d.ts +0 -1
  16. package/dist/eligibility.js +0 -1
  17. package/dist/fixtures.d.ts +0 -1
  18. package/dist/fixtures.js +0 -1
  19. package/dist/health.d.ts +0 -1
  20. package/dist/health.js +0 -1
  21. package/dist/index.d.ts +0 -1
  22. package/dist/index.js +0 -1
  23. package/dist/inventory.d.ts +0 -1
  24. package/dist/inventory.js +0 -1
  25. package/dist/mock.d.ts +0 -1
  26. package/dist/mock.js +0 -1
  27. package/dist/models.d.ts +0 -1
  28. package/dist/models.js +0 -1
  29. package/dist/pi-durable-lead.d.ts +150 -1305
  30. package/dist/pi-durable-lead.js +68 -10
  31. package/dist/registry.d.ts +0 -1
  32. package/dist/registry.js +0 -1
  33. package/dist/routing.d.ts +0 -1
  34. package/dist/routing.js +0 -1
  35. package/dist/sessions.d.ts +0 -1
  36. package/dist/sessions.js +0 -1
  37. package/dist/transport.d.ts +0 -1
  38. package/dist/transport.js +0 -1
  39. package/package.json +3 -3
  40. package/dist/adapter.d.ts.map +0 -1
  41. package/dist/adapter.js.map +0 -1
  42. package/dist/agent-plugins.d.ts.map +0 -1
  43. package/dist/agent-plugins.js.map +0 -1
  44. package/dist/capabilities.d.ts.map +0 -1
  45. package/dist/capabilities.js.map +0 -1
  46. package/dist/channel-ownership.d.ts.map +0 -1
  47. package/dist/channel-ownership.js.map +0 -1
  48. package/dist/compatibility.d.ts.map +0 -1
  49. package/dist/compatibility.js.map +0 -1
  50. package/dist/conformance.d.ts.map +0 -1
  51. package/dist/conformance.js.map +0 -1
  52. package/dist/discovery.d.ts.map +0 -1
  53. package/dist/discovery.js.map +0 -1
  54. package/dist/eligibility.d.ts.map +0 -1
  55. package/dist/eligibility.js.map +0 -1
  56. package/dist/fixtures.d.ts.map +0 -1
  57. package/dist/fixtures.js.map +0 -1
  58. package/dist/health.d.ts.map +0 -1
  59. package/dist/health.js.map +0 -1
  60. package/dist/index.d.ts.map +0 -1
  61. package/dist/index.js.map +0 -1
  62. package/dist/inventory.d.ts.map +0 -1
  63. package/dist/inventory.js.map +0 -1
  64. package/dist/mock.d.ts.map +0 -1
  65. package/dist/mock.js.map +0 -1
  66. package/dist/models.d.ts.map +0 -1
  67. package/dist/models.js.map +0 -1
  68. package/dist/pi-durable-lead.d.ts.map +0 -1
  69. package/dist/pi-durable-lead.js.map +0 -1
  70. package/dist/registry.d.ts.map +0 -1
  71. package/dist/registry.js.map +0 -1
  72. package/dist/routing.d.ts.map +0 -1
  73. package/dist/routing.js.map +0 -1
  74. package/dist/sessions.d.ts.map +0 -1
  75. package/dist/sessions.js.map +0 -1
  76. package/dist/transport.d.ts.map +0 -1
  77. package/dist/transport.js.map +0 -1
package/dist/adapter.d.ts CHANGED
@@ -293,6 +293,28 @@ export declare const RuntimeExecutionStateSchema: z.ZodEnum<{
293
293
  timed_out: "timed_out";
294
294
  unknown: "unknown";
295
295
  }>;
296
+ /**
297
+ * The runtime's own observed generation identity for the execution's current
298
+ * turn.
299
+ *
300
+ * Observed by construction: the runtime reports the generation it authorized
301
+ * for this attempt, never a generation a caller claimed. A control that names
302
+ * a generation the runtime did not observe is not bound to it, so this shape
303
+ * is an identity, not a counter the caller can advance.
304
+ *
305
+ * The identity is self-verifying: the inference key is the turn's key extended
306
+ * by the inference id, exactly as the runtime retained it. A key that names a
307
+ * different turn or inference is refused here rather than accepted as an
308
+ * observation of something else.
309
+ */
310
+ export declare const RuntimeObservedGenerationSchema: z.ZodObject<{
311
+ schemaVersion: z.ZodLiteral<"runtime-observed-generation/v1">;
312
+ attemptId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@adea-ai/contracts").OpaqueIdentifier<"attempt ID">, string>>;
313
+ turnKey: z.ZodString;
314
+ inferenceId: z.ZodString;
315
+ inferenceKey: z.ZodString;
316
+ }, z.core.$strict>;
317
+ export type RuntimeObservedGeneration = z.output<typeof RuntimeObservedGenerationSchema>;
296
318
  export declare const RuntimeExecutionStatusSchema: z.ZodObject<{
297
319
  handle: z.ZodObject<{
298
320
  handleId: z.ZodString;
@@ -312,6 +334,13 @@ export declare const RuntimeExecutionStatusSchema: z.ZodObject<{
312
334
  unknown: "unknown";
313
335
  }>;
314
336
  observedAt: z.ZodISODateTime;
337
+ observedGeneration: z.ZodOptional<z.ZodObject<{
338
+ schemaVersion: z.ZodLiteral<"runtime-observed-generation/v1">;
339
+ attemptId: z.ZodPipe<z.ZodString, z.ZodTransform<import("@adea-ai/contracts").OpaqueIdentifier<"attempt ID">, string>>;
340
+ turnKey: z.ZodString;
341
+ inferenceId: z.ZodString;
342
+ inferenceKey: z.ZodString;
343
+ }, z.core.$strict>>;
315
344
  result: z.ZodOptional<z.ZodObject<{
316
345
  outcome: z.ZodLiteral<"completed">;
317
346
  output: z.ZodOptional<z.ZodJSONSchema>;
@@ -641,4 +670,3 @@ export declare class RuntimeAdapterError extends Error {
641
670
  toJSON(): RuntimeError;
642
671
  }
643
672
  export declare function inspectRuntimeCapabilities(capabilities: RuntimeAdapterInspection['capabilities'], requirements: readonly CapabilityRequirement[]): CapabilityEvaluation;
644
- //# sourceMappingURL=adapter.d.ts.map
package/dist/adapter.js CHANGED
@@ -183,11 +183,43 @@ export const RuntimeExecutionStateSchema = z.enum([
183
183
  'timed_out',
184
184
  'unknown',
185
185
  ]);
186
+ /**
187
+ * The runtime's own observed generation identity for the execution's current
188
+ * turn.
189
+ *
190
+ * Observed by construction: the runtime reports the generation it authorized
191
+ * for this attempt, never a generation a caller claimed. A control that names
192
+ * a generation the runtime did not observe is not bound to it, so this shape
193
+ * is an identity, not a counter the caller can advance.
194
+ *
195
+ * The identity is self-verifying: the inference key is the turn's key extended
196
+ * by the inference id, exactly as the runtime retained it. A key that names a
197
+ * different turn or inference is refused here rather than accepted as an
198
+ * observation of something else.
199
+ */
200
+ export const RuntimeObservedGenerationSchema = z
201
+ .object({
202
+ schemaVersion: z.literal('runtime-observed-generation/v1'),
203
+ attemptId: IdentifierSchemas.attemptId,
204
+ turnKey: z.string().min(1).max(4096),
205
+ inferenceId: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$/),
206
+ inferenceKey: z.string().min(1).max(8192),
207
+ })
208
+ .strict()
209
+ .superRefine((generation, context) => {
210
+ if (generation.inferenceKey !== `${generation.turnKey}:${generation.inferenceId}`)
211
+ context.addIssue({ code: 'custom', path: ['inferenceKey'], message: 'invalid inference key' });
212
+ });
186
213
  export const RuntimeExecutionStatusSchema = z
187
214
  .object({
188
215
  handle: RuntimeExecutionHandleSchema,
189
216
  state: RuntimeExecutionStateSchema,
190
217
  observedAt: TimestampSchema,
218
+ // The generation the runtime observed for this attempt, when it has one.
219
+ // Additive in contract 3.1: a consumer that advertised an earlier version
220
+ // parses with the pre-3.1 strict status shape, so a producer publishes it
221
+ // only to a consumer whose negotiated version includes it.
222
+ observedGeneration: RuntimeObservedGenerationSchema.optional(),
191
223
  result: RuntimeExecutionResultSchema.optional(),
192
224
  // Observed usage survives unsuccessful termination without fabricating a result.
193
225
  terminalUsage: RuntimeUsageSchema.optional(),
@@ -408,4 +440,3 @@ export class RuntimeAdapterError extends Error {
408
440
  export function inspectRuntimeCapabilities(capabilities, requirements) {
409
441
  return evaluateCapabilities(capabilities, CapabilityRequirementSetSchema.parse(requirements));
410
442
  }
411
- //# sourceMappingURL=adapter.js.map
@@ -59,4 +59,3 @@ export declare function createHarnessProfile(input: Readonly<{
59
59
  agentPlugins: AgentPluginsCapabilityReport;
60
60
  components: ComponentCapabilityReport;
61
61
  }>): HarnessProfile;
62
- //# sourceMappingURL=agent-plugins.d.ts.map
@@ -41,4 +41,3 @@ export function harnessProfileFromInspection(input) {
41
41
  export function createHarnessProfile(input) {
42
42
  return HarnessProfileSchema.parse({ profileVersion: 1, ...input });
43
43
  }
44
- //# sourceMappingURL=agent-plugins.js.map
@@ -133,4 +133,3 @@ export interface CapabilityEvaluation {
133
133
  export declare function evaluateCapabilities(capabilitiesInput: readonly RuntimeCapability[], requirementsInput: readonly CapabilityRequirement[]): CapabilityEvaluation;
134
134
  export declare function runtimeCapabilitiesEqual(left: readonly RuntimeCapability[], right: readonly RuntimeCapability[]): boolean;
135
135
  export declare function capabilityFingerprint(capabilities: readonly RuntimeCapability[]): string;
136
- //# sourceMappingURL=capabilities.d.ts.map
@@ -85,4 +85,3 @@ export function capabilityFingerprint(capabilities) {
85
85
  .map((capability) => RuntimeCapabilitySchema.parse(capability))
86
86
  .toSorted((left, right) => compareCodePointOrder(left.name, right.name)));
87
87
  }
88
- //# sourceMappingURL=capabilities.js.map
@@ -49,4 +49,3 @@ export interface RuntimeChannelOwnershipRepository {
49
49
  heartbeat(record: RuntimeChannelOwnership, credentialFence?: RuntimeChannelOwnershipCredentialFence): Promise<boolean>;
50
50
  release(record: RuntimeChannelOwnership): Promise<boolean>;
51
51
  }
52
- //# sourceMappingURL=channel-ownership.d.ts.map
@@ -23,4 +23,3 @@ export const RuntimeChannelSequenceRequestSchema = z
23
23
  minimum: z.number().int().min(1).max(2147483647),
24
24
  })
25
25
  .strict();
26
- //# sourceMappingURL=channel-ownership.js.map
@@ -181,4 +181,3 @@ export interface RuntimeCompatibilityCertificationInput {
181
181
  readonly connection: unknown;
182
182
  }
183
183
  export declare function applyRuntimeCompatibilityCertification(input: RuntimeCompatibilityCertificationInput): RuntimeConnection;
184
- //# sourceMappingURL=compatibility.d.ts.map
@@ -240,4 +240,3 @@ function certificationIdentity(certification) {
240
240
  platform: certification.testedPlatform,
241
241
  });
242
242
  }
243
- //# sourceMappingURL=compatibility.js.map
@@ -11,4 +11,3 @@ export interface RuntimeAdapterConformanceReport {
11
11
  readonly checks: typeof RuntimeAdapterConformanceChecks;
12
12
  }
13
13
  export declare function runRuntimeAdapterConformance(input: RuntimeAdapterConformanceInput): Promise<RuntimeAdapterConformanceReport>;
14
- //# sourceMappingURL=conformance.d.ts.map
@@ -70,4 +70,3 @@ function assert(condition, code) {
70
70
  function fingerprint(value) {
71
71
  return JSON.stringify(value);
72
72
  }
73
- //# sourceMappingURL=conformance.js.map
@@ -23,4 +23,3 @@ export declare function projectExternalSessionDiscovery(inputValue: {
23
23
  readonly session: ExternalSession;
24
24
  readonly assessment: ExternalSessionAssessment;
25
25
  }): ExternalSessionDiscoveryReadModel;
26
- //# sourceMappingURL=discovery.d.ts.map
package/dist/discovery.js CHANGED
@@ -251,4 +251,3 @@ function normalizeCode(value) {
251
251
  .slice(0, 128);
252
252
  return /^[A-Z]/.test(normalized) ? normalized : `RUNTIME_${normalized || 'LIMITATION'}`;
253
253
  }
254
- //# sourceMappingURL=discovery.js.map
@@ -335,4 +335,3 @@ export declare const RuntimeEligibilityDecisionSchema: z.ZodObject<{
335
335
  export type RuntimeEligibilityInput = z.output<typeof RuntimeEligibilityInputSchema>;
336
336
  export type RuntimeEligibilityDecision = z.output<typeof RuntimeEligibilityDecisionSchema>;
337
337
  export declare function evaluateRuntimeEligibility(inputValue: unknown): RuntimeEligibilityDecision;
338
- //# sourceMappingURL=eligibility.d.ts.map
@@ -308,4 +308,3 @@ function digestEligibilityInput(input) {
308
308
  };
309
309
  return `sha256:${createHash('sha256').update(JSON.stringify(normalized)).digest('hex')}`;
310
310
  }
311
- //# sourceMappingURL=eligibility.js.map
@@ -87,4 +87,3 @@ export declare const RuntimeFixtures: Readonly<{
87
87
  };
88
88
  };
89
89
  }>;
90
- //# sourceMappingURL=fixtures.d.ts.map
package/dist/fixtures.js CHANGED
@@ -45,4 +45,3 @@ function runtime(runtimeDefinitionId, family, capabilities) {
45
45
  function capability(name, support = 'supported', limitations) {
46
46
  return { name, support, ...(limitations === undefined ? {} : { limitations: [...limitations] }) };
47
47
  }
48
- //# sourceMappingURL=fixtures.js.map
package/dist/health.d.ts CHANGED
@@ -181,4 +181,3 @@ export declare class RuntimeHealthIngestionService {
181
181
  refresh(input: unknown): Promise<RuntimeHealthIngestionResult>;
182
182
  }
183
183
  export declare function runtimeAvailabilityIsExecutable(state: RuntimeAvailabilityState): boolean;
184
- //# sourceMappingURL=health.d.ts.map
package/dist/health.js CHANGED
@@ -480,4 +480,3 @@ function ignored(reason, connection, assessment) {
480
480
  function fail(code) {
481
481
  throw new RuntimeHealthIngestionError(code);
482
482
  }
483
- //# sourceMappingURL=health.js.map
package/dist/index.d.ts CHANGED
@@ -17,4 +17,3 @@ export * from './routing.js';
17
17
  export * from './sessions.js';
18
18
  export * from './transport.js';
19
19
  export declare const packageName = "runtime-sdk";
20
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -17,4 +17,3 @@ export * from './routing.js';
17
17
  export * from './sessions.js';
18
18
  export * from './transport.js';
19
19
  export const packageName = 'runtime-sdk';
20
- //# sourceMappingURL=index.js.map
@@ -28,4 +28,3 @@ export declare class InMemoryRuntimeInventoryCheckpointRepository implements Run
28
28
  get(runtimeNodeRefId: string): Promise<RuntimeInventoryCheckpoint | undefined>;
29
29
  compareAndSet(expectedRevision: number | undefined, checkpointInput: RuntimeInventoryCheckpoint): Promise<boolean>;
30
30
  }
31
- //# sourceMappingURL=inventory.d.ts.map
package/dist/inventory.js CHANGED
@@ -48,4 +48,3 @@ export class InMemoryRuntimeInventoryCheckpointRepository {
48
48
  return true;
49
49
  }
50
50
  }
51
- //# sourceMappingURL=inventory.js.map
package/dist/mock.d.ts CHANGED
@@ -21,4 +21,3 @@ export declare class MockRuntimeAdapter implements RuntimeAdapter {
21
21
  cleanup(handleInput: RuntimeExecutionHandle): Promise<void>;
22
22
  complete(handleInput: RuntimeExecutionHandle, resultInput: Omit<RuntimeExecutionResult, 'outcome'>): RuntimeExecutionStatus;
23
23
  }
24
- //# sourceMappingURL=mock.d.ts.map
package/dist/mock.js CHANGED
@@ -258,4 +258,3 @@ function stable(value) {
258
258
  function clone(value) {
259
259
  return structuredClone(value);
260
260
  }
261
- //# sourceMappingURL=mock.js.map
package/dist/models.d.ts CHANGED
@@ -284,4 +284,3 @@ export declare function assessRuntimeCompatibility(definitionInput: unknown, exp
284
284
  readonly capabilities: readonly CapabilityRequirement[];
285
285
  }): RuntimeCompatibilityResult;
286
286
  export declare function runtimeDefinitionsEqual(left: unknown, right: unknown): boolean;
287
- //# sourceMappingURL=models.d.ts.map
package/dist/models.js CHANGED
@@ -239,4 +239,3 @@ function normalizeDefinition(input) {
239
239
  function major(version) {
240
240
  return Number.parseInt(version.split('.')[0] ?? '', 10);
241
241
  }
242
- //# sourceMappingURL=models.js.map