@hue-run/sdk 0.19.1 → 0.20.1

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 (50) hide show
  1. package/CLI.md +27 -10
  2. package/ENVIRONMENTS.md +5 -2
  3. package/EVALUATIONS.md +6 -1
  4. package/README.md +2 -2
  5. package/WORLDS.md +133 -0
  6. package/dist/cli/eval.d.ts +4 -0
  7. package/dist/cli/eval.js +434 -186
  8. package/dist/cli/listen.js +1 -1
  9. package/dist/environment/client.d.ts +2 -95
  10. package/dist/environment/client.js +2 -283
  11. package/dist/environment/tools.d.ts +2 -35
  12. package/dist/environment/tools.js +2 -30
  13. package/dist/environment/types.d.ts +2 -623
  14. package/dist/environment/types.js +2 -1
  15. package/dist/environment/world.d.ts +2 -65
  16. package/dist/environment/world.js +2 -171
  17. package/dist/environment.d.ts +7 -7
  18. package/dist/environment.js +3 -3
  19. package/dist/evals/attempt.d.ts +1 -1
  20. package/dist/evals/client.d.ts +3 -2
  21. package/dist/evals/client.js +2 -1
  22. package/dist/evals/environment-target.d.ts +3 -3
  23. package/dist/evals/environment-target.js +3 -3
  24. package/dist/evals/failure.js +1 -1
  25. package/dist/evals/local-worker.d.ts +8 -3
  26. package/dist/evals/local-worker.js +10 -2
  27. package/dist/evals/simulation.d.ts +6 -3
  28. package/dist/evals/simulation.js +2 -1
  29. package/dist/evals/types.d.ts +2 -2
  30. package/dist/version.d.ts +1 -1
  31. package/dist/version.js +1 -1
  32. package/dist/world/client.d.ts +161 -0
  33. package/dist/world/client.js +387 -0
  34. package/dist/world/definitions.d.ts +47 -0
  35. package/dist/world/definitions.js +1 -0
  36. package/dist/world/model-types.d.ts +123 -0
  37. package/dist/world/model-types.js +1 -0
  38. package/dist/world/models.d.ts +42 -0
  39. package/dist/world/models.js +56 -0
  40. package/dist/world/readiness.d.ts +18 -0
  41. package/dist/world/readiness.js +69 -0
  42. package/dist/world/tools.d.ts +35 -0
  43. package/dist/world/tools.js +30 -0
  44. package/dist/world/types.d.ts +625 -0
  45. package/dist/world/types.js +1 -0
  46. package/dist/world/world.d.ts +65 -0
  47. package/dist/world/world.js +175 -0
  48. package/dist/world.d.ts +13 -0
  49. package/dist/world.js +5 -0
  50. package/package.json +8 -2
@@ -1,623 +1,2 @@
1
- import type { JsonValue, McpServerInfo } from "../types.js";
2
- export type { JsonValue } from "../types.js";
3
- /** Human-readable identity used when creating an environment. */
4
- export interface EnvironmentIdentity {
5
- /** Display name. */
6
- name: string;
7
- /** Project-unique URL-safe slug. */
8
- slug: string;
9
- /** Optional description of the simulated world. */
10
- description?: string;
11
- }
12
- /** Environment registry entry without version bodies. */
13
- export interface EnvironmentSummary extends Required<EnvironmentIdentity> {
14
- /** Environment identity. */
15
- id: string;
16
- /** Archive timestamp, or `null` while active. */
17
- archivedAt: string | null;
18
- }
19
- /** Immutable environment-version identity. */
20
- export interface EnvironmentVersionSummary {
21
- /** Environment-version identity. */
22
- id: string;
23
- /** Monotonic version number within the environment. */
24
- version: number;
25
- /** Canonical digest of the stored, defaulted definition. */
26
- contentDigest: string;
27
- /** Creation timestamp. */
28
- createdAt: string;
29
- }
30
- /** Environment registry entry with all immutable versions. */
31
- export interface Environment extends EnvironmentSummary {
32
- /** Versions available for explicit pinning. */
33
- versions: EnvironmentVersionSummary[];
34
- }
35
- /** One page of environment registry entries. */
36
- export interface EnvironmentPage {
37
- /** Entries on this page. */
38
- items: EnvironmentSummary[];
39
- /** Cursor for the next page, or `null` at the end. */
40
- nextCursor: string | null;
41
- }
42
- /** Cursor pagination for environment registry methods. */
43
- export interface EnvironmentPageOptions {
44
- /** Cursor returned by the previous page. */
45
- after?: string;
46
- /** Page size, 1–100. */
47
- limit?: number;
48
- }
49
- /** Versioned deterministic semantic implemented by Hue's environment kernel. */
50
- export type SemanticEntry = "hue.collection.get@1" | "hue.collection.list@1" | "hue.collection.search@1" | "hue.collection.create@1" | "hue.collection.update@1" | "hue.gmail.search_messages@1" | "hue.gmail.get_message@1" | "hue.gmail.get_thread@1" | "hue.gmail.create_draft@1" | "hue.gmail.update_draft@1" | "hue.slack.search@1" | "hue.slack.read_channel@1" | "hue.slack.read_thread@1" | "hue.slack.draft@1" | "hue.slack.destination@1";
51
- /** One parameter in an authored environment action. */
52
- export interface EnvironmentActionParameter {
53
- /** Agent-visible parameter name. */
54
- name: string;
55
- /** Supported flat parameter type. */
56
- type: "string" | "number" | "boolean" | "string[]";
57
- /** Whether the argument is required; defaults to `true`. */
58
- required?: boolean;
59
- /** Agent-visible parameter description. */
60
- description?: string;
61
- /** Allowed string values, when constrained. */
62
- enum?: string[];
63
- }
64
- /** Configuration interpreted by a versioned environment semantic. */
65
- export interface EnvironmentSemanticConfig {
66
- /** Primary state collection. */
67
- collection: string;
68
- /** Draft collection used by provider-shaped mail semantics. */
69
- draftsCollection?: string;
70
- /** Synthetic Slack actor identity. */
71
- slackActorId?: string;
72
- /** Synthetic Slack workspace identity. */
73
- slackWorkspaceId?: string;
74
- /** Synthetic mailbox address. */
75
- mailboxAddress?: string;
76
- /** Parameter that supplies an entity identity. */
77
- idParam?: string;
78
- /** Parameter that supplies a search query. */
79
- queryParam?: string;
80
- /** Entity fields projected into observations. */
81
- fields?: string[];
82
- /** Field-to-parameter equality filter. */
83
- filter?: {
84
- /** Stored entity field. */
85
- field: string;
86
- /** Action parameter compared with the field. */
87
- param: string;
88
- };
89
- /** Maximum records returned by a read semantic. */
90
- limit?: number;
91
- /** Literal fields written by a mutation semantic. */
92
- set?: Record<string, JsonValue>;
93
- /** Parameter names copied into written fields. */
94
- setFromParams?: string[];
95
- /** Prefix for deterministically generated entity identities. */
96
- idPrefix?: string;
97
- /** Preconditions evaluated before a mutation. */
98
- guards?: Array<{
99
- /** Stored field to inspect. */
100
- field: string;
101
- /** Required field value. */
102
- equals: string | number | boolean | null;
103
- /** Stable observation error when the guard fails. */
104
- error: string;
105
- }>;
106
- /** Stable observation error for a missing entity. */
107
- notFoundError?: string;
108
- }
109
- /** Agent-visible action mapped to one deterministic kernel semantic. */
110
- export interface EnvironmentActionDeclaration {
111
- /** Unique action name. */
112
- name: string;
113
- /** Agent-visible action description. */
114
- description?: string;
115
- /** Flat action parameters. */
116
- params?: EnvironmentActionParameter[];
117
- /** Versioned semantic and its configuration. */
118
- semantics: {
119
- /** Kernel semantic implementation. */
120
- entry: SemanticEntry;
121
- /** Semantic configuration. */
122
- config: EnvironmentSemanticConfig;
123
- };
124
- /** Observation projection; identity is the only V1 projection. */
125
- observation?: {
126
- /** Return the semantic's observation unchanged. */
127
- projection: "identity";
128
- };
129
- }
130
- /** Complete V1 authored-world document stored as an immutable version. */
131
- export interface EnvironmentDefinition {
132
- /** Definition schema discriminator. */
133
- schemaVersion: 1;
134
- /** Optional human-readable world description. */
135
- description?: string;
136
- /** Deterministic virtual-clock configuration. */
137
- determinism?: {
138
- /** Virtual-clock settings. */
139
- clock?: {
140
- /** Initial virtual nanoseconds as a decimal string. */
141
- startNs?: string;
142
- /** Nanoseconds advanced after each recorded step. */
143
- stepAdvanceNs?: string;
144
- };
145
- };
146
- /** Initial normalized collection/entity state. */
147
- state: {
148
- /** Collections keyed by collection, entity and field names. */
149
- collections: Record<string, Record<string, Record<string, JsonValue>>>;
150
- };
151
- /** Closed catalog exposed by this world. */
152
- actions: EnvironmentActionDeclaration[];
153
- /** How this definition was produced. */
154
- provenance?: {
155
- /** Authored directly by a developer. */
156
- kind: "handwritten";
157
- } | {
158
- /** Generated from synthetic source material. */
159
- kind: "synthetic";
160
- /** Optional generation note. */
161
- note?: string;
162
- } | {
163
- /** Derived from one immutable trace revision. */
164
- kind: "derived_from_trace";
165
- /** Source trace identity. */
166
- traceId: string;
167
- /** Source trace revision. */
168
- revision: number;
169
- };
170
- /** Caller-owned immutable metadata. */
171
- metadata?: Record<string, JsonValue>;
172
- }
173
- /** The extendable legacy name remains V1. Publication and runs select their
174
- * explicit version; provider context is validated by the authoritative server. */
175
- export type EnvironmentDefinitionV1 = EnvironmentDefinition;
176
- /** Gmail mailbox carrier holding messages and drafts in the simplified shape Hue's
177
- * `hue.gmail.*` actions read. */
178
- export interface GmailMailboxConfigurationV1 {
179
- /** Gmail mailbox configuration discriminator. */
180
- kind: "gmail_mailbox/v1";
181
- /** Collection containing synthetic messages. */
182
- messagesCollection: string;
183
- /** Collection containing synthetic drafts. */
184
- draftsCollection: string;
185
- /** Synthetic mailbox address. */
186
- mailboxAddress: string;
187
- }
188
- /** Gmail mailbox carrier served by Hue's simulation gateway: messages, drafts and labels in the
189
- * entity shapes the Gmail mirrors serve, with threads derived from each message's `threadId`. A
190
- * definition whose provider instances all use it may publish with no actions. */
191
- export interface GmailMailboxConfigurationV2 {
192
- /** Gmail mailbox configuration discriminator. */
193
- kind: "gmail_mailbox/v2";
194
- /** Collection containing synthetic messages. */
195
- messagesCollection: string;
196
- /** Collection containing synthetic drafts, each naming a `DRAFT`-labelled message. */
197
- draftsCollection: string;
198
- /** Collection containing synthetic labels. */
199
- labelsCollection: string;
200
- /** Synthetic mailbox address; Hue accepts only `owner@example.test`, in any letter case. */
201
- mailboxAddress: string;
202
- }
203
- /** Either Gmail mailbox carrier, discriminated by `kind`; Hue validates both at publication. */
204
- export type GmailMailboxConfiguration = GmailMailboxConfigurationV1 | GmailMailboxConfigurationV2;
205
- /** One synthetic Gmail principal and its world-state collection bindings. */
206
- export interface GmailProviderInstance {
207
- /** Stable instance key referenced by attempt provider selection. */
208
- providerInstanceKey: string;
209
- /** Provider discriminator for the V2 Gmail slice. */
210
- providerId: "google.gmail";
211
- /** Synthetic principal UUID, canonicalized to lowercase by Hue. */
212
- syntheticPrincipalId: string;
213
- /** Versioned mapping from Gmail concepts to authored-world collections. */
214
- configuration: GmailMailboxConfiguration;
215
- }
216
- /** V2 authored world with immutable provider-instance bindings. */
217
- export interface EnvironmentDefinitionV2 extends Omit<EnvironmentDefinition, "schemaVersion"> {
218
- /** Definition schema discriminator. */
219
- schemaVersion: 2;
220
- /** Provider instances available to a strict attempt profile. */
221
- providerInstances: GmailProviderInstance[];
222
- }
223
- /** Definition accepted by immutable environment publication. */
224
- export type PublishableEnvironmentDefinition = EnvironmentDefinitionV1 | EnvironmentDefinitionV2;
225
- /** Full immutable environment version and its generated action catalog. */
226
- export interface EnvironmentVersion extends EnvironmentVersionSummary {
227
- /** Owning environment identity. */
228
- environmentId: string;
229
- /** Stored, defaulted authored definition. */
230
- definition: PublishableEnvironmentDefinition;
231
- /** Generated agent-visible actions. */
232
- actions: ActionDefinition[];
233
- }
234
- /** JSON Schema subset generated for one action's input. */
235
- export interface ActionSchema {
236
- /** Actions always accept an object. */
237
- type: "object";
238
- /** Parameter schemas keyed by parameter name. */
239
- properties: Record<string, {
240
- /** Scalar JSON Schema type. */
241
- type: "string" | "number" | "boolean";
242
- /** Agent-visible parameter description. */
243
- description?: string;
244
- /** Allowed string values, when constrained. */
245
- enum?: string[];
246
- } | {
247
- /** Array JSON Schema type. */
248
- type: "array";
249
- /** Bounded string item schema. */
250
- items: {
251
- /** Array items are strings. */
252
- type: "string";
253
- /** Maximum item length. */
254
- maxLength: number;
255
- };
256
- /** Maximum array length. */
257
- maxItems: number;
258
- /** Agent-visible parameter description. */
259
- description?: string;
260
- }>;
261
- /** Required parameter names. */
262
- required: string[];
263
- /** Unknown action arguments are rejected. */
264
- additionalProperties: false;
265
- }
266
- /** One generated framework-neutral action. */
267
- export interface ActionDefinition {
268
- /** Unique action name. */
269
- name: string;
270
- /** Agent-visible description. */
271
- description?: string;
272
- /** Generated input contract. */
273
- inputSchema: ActionSchema;
274
- /**
275
- * MCP `initialize` identity and Hue provider/surface when this action is served by one MCP
276
- * surface. Bound environment tools record it on the tool span as `mcp.server.name`,
277
- * `mcp.server.version`, `hue.mcp.provider` and `hue.mcp.surface`.
278
- */
279
- mcp?: McpServerInfo;
280
- }
281
- /** Recorded answer returned by the simulated world. */
282
- export interface Observation {
283
- /** Whether the world accepted or refused the action. */
284
- status: "ok" | "error";
285
- /** Additional bounded observation fields. */
286
- [key: string]: JsonValue;
287
- }
288
- /** One normalized world-state effect caused by an action. */
289
- export interface Effect {
290
- /** Mutation category. */
291
- kind: "created" | "updated" | "deleted";
292
- /** Affected collection. */
293
- collection: string;
294
- /** Affected entity identity. */
295
- entityId: string;
296
- /** Changed field names. */
297
- fields: string[];
298
- }
299
- /** Lifecycle of a world the simulation gateway serves. */
300
- export type WorldLifecycle = "pending" | "live" | "completing" | "sealed";
301
- /** Advisory flags on a world's status read. */
302
- export type WorldFlag = "no_calls" | "fingerprint_differs";
303
- /** One pinned provider surface of one provider instance, as the mirror URL an official client
304
- * is pointed at. `alias` stays null until the provider's alias hosts are served. */
305
- export interface WorldSurface {
306
- /** Provider identity, such as `google.gmail`. */
307
- provider: string;
308
- /** Surface identity, such as `google.gmail/mcp` or `google.gmail/rest`. */
309
- surface: string;
310
- /** The provider instance of the environment version this surface belongs to. */
311
- providerInstanceKey: string;
312
- /** Mirror URL in the path form. */
313
- url: string;
314
- /** Alias-host URL, or null while unavailable. */
315
- alias: string | null;
316
- }
317
- /** The headers an MCP client sends the mirror. */
318
- export interface WorldMcpHeaders {
319
- /** `Bearer <world token>`. */
320
- Authorization: string;
321
- }
322
- /** One MCP server entry of the common `mcpServers` configuration shape. */
323
- export interface WorldMcpServer {
324
- /** Transport; the mirrors serve Streamable HTTP. */
325
- type: "http";
326
- /** Mirror URL of the MCP surface. */
327
- url: string;
328
- /** The world token as a bearer. */
329
- headers: WorldMcpHeaders;
330
- }
331
- /** The `{ url, token, expiresAt }` shape the retired `hue_sim_` capability had. */
332
- export interface LegacyMcpCapability {
333
- /** MCP endpoint: the world's first MCP mirror. */
334
- url: string;
335
- /** The world token. */
336
- token: string;
337
- /** The world deadline as an ISO timestamp. */
338
- expiresAt: string;
339
- }
340
- /** The common `mcpServers` shape, one server per MCP surface of each provider instance. */
341
- export interface WorldMcpConfig {
342
- /** Servers keyed by provider instance (suffixed by surface when an instance has several). */
343
- mcpServers: Record<string, WorldMcpServer>;
344
- }
345
- /**
346
- * What the World API hands an agent for one world: the world token in the provider's own
347
- * credential slot, the mirror URLs, the environment carriers and the MCP configuration.
348
- * Minted per response and never stored by Hue; keep it out of logs and checkpoints.
349
- */
350
- export interface WorldHandoff {
351
- /** World identity (the environment-run ID). */
352
- id: string;
353
- /** The `hue_world_…` credential; lives exactly as long as the world. */
354
- token: string;
355
- /** World deadline; the token outlives it by the 5 s completion grace. */
356
- expiresAt: string;
357
- /** Current lifecycle. */
358
- lifecycle: WorldLifecycle;
359
- /** Grace deadline while completing, else null. */
360
- completingUntil: string | null;
361
- /** The caller's trace context, echoed for the agent; null when none was supplied. */
362
- traceparent: string | null;
363
- /** `hue-world=<id>`, the OpenTelemetry baggage carrier value. */
364
- baggage: string;
365
- /** Mirror surfaces of every provider instance the environment version binds. */
366
- surfaces: WorldSurface[];
367
- /** The world's clock at creation (RFC 3339): the date an agent computes its dates from in
368
- * place of the wall clock, a trace-built world's recorded start. Also `env.HUE_WORLD_NOW`;
369
- * null for a Hue that names neither. */
370
- now: string | null;
371
- /** `HUE_WORLD_ID`, `HUE_WORLD_TOKEN`, `HUE_WORLD_NOW`, `BAGGAGE`, `TRACEPARENT` and one
372
- * `HUE_SIM_<SURFACE ID>_URL` per surface. */
373
- env: Record<string, string>;
374
- /** The `mcpServers` configuration for the MCP surfaces. */
375
- mcpConfig: WorldMcpConfig;
376
- }
377
- /** Newly created isolated world and its action catalog. */
378
- export interface EnvironmentRun {
379
- /** Environment-run identity. */
380
- id: string;
381
- /** Immutable environment version used by the run. */
382
- environmentVersionId: string;
383
- /** Current virtual nanoseconds as a decimal string. */
384
- clockNs: string;
385
- /** The world's clock at creation as an RFC 3339 timestamp (`clockNs` as a date): a
386
- * trace-built world's recorded start. Absent from a Hue that predates it. */
387
- now?: string;
388
- /** Digest of current world state. */
389
- stateDigest: string;
390
- /** Maximum recorded actions. */
391
- maxSteps: number;
392
- /** Lease expiry timestamp. */
393
- expiresAt: string;
394
- /** Closed generated action catalog. */
395
- actions: ActionDefinition[];
396
- /** World identity; present for a world the simulation gateway serves. */
397
- worldId?: string;
398
- /** World token; present for a world the simulation gateway serves. */
399
- token?: string;
400
- /** Lifecycle; present for a world the simulation gateway serves. */
401
- lifecycle?: WorldLifecycle;
402
- /** Grace deadline while completing. */
403
- completingUntil?: string | null;
404
- /** Baggage carrier value. */
405
- baggage?: string;
406
- /** The stored caller trace context, or null. */
407
- traceparent?: string | null;
408
- /** Mirror surfaces. */
409
- surfaces?: WorldSurface[];
410
- /** Environment carriers. */
411
- env?: Record<string, string>;
412
- /** MCP configuration. */
413
- mcpConfig?: WorldMcpConfig;
414
- /** Reserved for connection keys; null today. */
415
- connection?: null;
416
- }
417
- /** Result of invoking one environment action. */
418
- export interface ActionResult {
419
- /** Environment-run identity. */
420
- runId: string;
421
- /** Zero-based journal ordinal. */
422
- stepOrdinal: number;
423
- /** World observation returned to the agent. */
424
- observation: Observation;
425
- /** Normalized state effects. */
426
- effects: Effect[];
427
- /** Digest after the action. */
428
- stateDigest: string;
429
- /** Virtual nanoseconds after the action. */
430
- clockNs: string;
431
- /** Whether Hue replayed a previously recorded invocation. */
432
- replayed: boolean;
433
- /** Remaining step budget. */
434
- stepsRemaining: number;
435
- }
436
- /** Durable first-fault report for known missing provider behavior. */
437
- export interface CoverageGapInput {
438
- /** Stable idempotency key for retrying a lost acknowledgement. */
439
- idempotencyKey: string;
440
- /** Provider boundary that received the valid request. */
441
- provider: string;
442
- /** Provider operation that is not modeled. */
443
- operation: string;
444
- /** Stable coverage-gap code. */
445
- code: string;
446
- /** First-fault arguments are bounded to 16,000 JSON bytes. */
447
- args: Record<string, JsonValue>;
448
- /** Nonsecret explanation of the unsupported behavior. */
449
- description: string;
450
- }
451
- /** Stored coverage gap with reporting provenance. */
452
- export interface CoverageGap extends Omit<CoverageGapInput, "idempotencyKey"> {
453
- /** Server timestamp of the first report. */
454
- reportedAt: string;
455
- /** Authenticated actor that reported the gap. */
456
- reportedBy: {
457
- /** Actor credential class. */
458
- kind: "project_key" | "user";
459
- /** Actor identity. */
460
- id: string;
461
- };
462
- }
463
- /** Missing fields from older servers mean not_assessed, never verified parity. */
464
- export interface EnvironmentCoverage {
465
- /** Whether a known simulator gap invalidates agent evaluation. */
466
- validity?: "not_assessed" | "environment_incomplete";
467
- /** First durable gap, or `null` when no gap was reported. */
468
- coverageGap?: CoverageGap | null;
469
- }
470
- /** Confirmation that a coverage gap was durably recorded. */
471
- export interface CoverageGapResult {
472
- /** Affected environment-run identity. */
473
- runId: string;
474
- /** Incomplete is the only successful reporting result. */
475
- validity: "environment_incomplete";
476
- /** Preserved first coverage gap. */
477
- coverageGap: CoverageGap;
478
- }
479
- /** Authoritative current or sealed state of an environment run. */
480
- export interface RunState extends EnvironmentCoverage {
481
- /** Environment-run identity. */
482
- id: string;
483
- /** Immutable environment version used by the run. */
484
- environmentVersionId: string;
485
- /** Linked target execution, or `null` for a standalone run. */
486
- executionId: string | null;
487
- /** Deterministic run seed. */
488
- seed: string;
489
- /** Run lifecycle state. */
490
- status: "open" | "completed" | "abandoned" | "expired";
491
- /** Number of recorded steps. */
492
- stepCount: number;
493
- /** Maximum recorded actions. */
494
- maxSteps: number;
495
- /** Current virtual nanoseconds as a decimal string. */
496
- clockNs: string;
497
- /** Lease expiry timestamp. */
498
- expiresAt: string;
499
- /** Creation timestamp. */
500
- createdAt: string;
501
- /** Seal timestamp, or `null` while open. */
502
- sealedAt: string | null;
503
- /** Digest of current or final state. */
504
- stateDigest: string;
505
- /** Final state, available after sealing. */
506
- finalState?: JsonValue;
507
- /** World identity; present for a world the simulation gateway serves. */
508
- worldId?: string;
509
- /** Lifecycle; present for a world the simulation gateway serves. */
510
- lifecycle?: WorldLifecycle;
511
- /** Grace deadline while completing. */
512
- completingUntil?: string | null;
513
- /** The trace the linked execution declared, or null. */
514
- traceExternalId?: string | null;
515
- /** Mirror surfaces. */
516
- surfaces?: WorldSurface[];
517
- /** Advisory flags. A status read never returns the token. */
518
- flags?: WorldFlag[];
519
- /** Reserved for connection keys; null today. */
520
- connection?: null;
521
- }
522
- /** One immutable journal entry. */
523
- export interface Step {
524
- /** Step identity. */
525
- id: string;
526
- /** Zero-based journal ordinal. */
527
- ordinal: number;
528
- /** Caller invocation identity used for replay protection. */
529
- invocationId: string;
530
- /** Invoked action name. */
531
- action: string;
532
- /** Validated action arguments. */
533
- args: Record<string, JsonValue>;
534
- /** World observation returned to the agent. */
535
- observation: Observation;
536
- /** Normalized state effects. */
537
- effects: Effect[];
538
- /** Whether state changed. */
539
- mutated: boolean;
540
- /** Virtual nanoseconds after the action. */
541
- clockNs: string;
542
- /** State digest after the action. */
543
- stateDigest: string;
544
- }
545
- /** One ordinal page of environment journal steps. */
546
- export interface StepPage {
547
- /** Steps on this page. */
548
- items: Step[];
549
- /** Next step ordinal, or `null` at the end. */
550
- nextCursor: number | null;
551
- }
552
- /** Confirmation that an environment run was sealed. */
553
- export interface SealedRun {
554
- /** Environment-run identity. */
555
- id: string;
556
- /** Requested terminal state. */
557
- status: "completed" | "abandoned";
558
- /** Final number of journal steps. */
559
- stepCount: number;
560
- /** Final state digest. */
561
- stateDigest: string;
562
- /** Seal timestamp; null while a gateway world is `completing` (its seal follows the grace). */
563
- sealedAt: string | null;
564
- /** Lifecycle after finish, for a world the simulation gateway serves. */
565
- lifecycle?: "completing" | "sealed";
566
- /** Grace deadline while completing. */
567
- completingUntil?: string | null;
568
- }
569
- /** One section of a sealed world's evidence, or everything. */
570
- export type WorldEvidenceSection = "all" | "start" | "end" | "diff" | "ledger";
571
- /** Options for reading a sealed world's evaluator-only evidence. */
572
- export interface WorldEvidenceOptions {
573
- /** One section, or everything (default). */
574
- section?: WorldEvidenceSection;
575
- /** Include ledger request and response bodies (default true). */
576
- bodies?: boolean;
577
- }
578
- /** The evaluator-only evidence of a sealed world: start and end state, the diff, the call ledger,
579
- * coverage and the fingerprint. Hue's shape is the authority; this client does not narrow it. */
580
- export type WorldEvidence = Record<string, JsonValue>;
581
- /** Options for creating one fresh isolated world. */
582
- export interface CreateRunInput {
583
- /** Stable idempotency key for recovering creation acknowledgement. */
584
- idempotencyKey: string;
585
- /** Immutable environment version to instantiate. */
586
- environmentVersionId: string;
587
- /** Target execution linked to this world. */
588
- executionId?: string;
589
- /** Optional deterministic seed. */
590
- seed?: string;
591
- /** Optional action ceiling, 1–500. */
592
- maxSteps?: number;
593
- /** Optional lease in seconds. */
594
- ttlSeconds?: number;
595
- /** The case span's W3C context (`00-<trace id>-<span id>-<flags>`); its trace ID must equal
596
- * the trace the execution declared at start. The world span is parented on it. */
597
- traceparent?: string;
598
- /** The agent revision under test, 1 to 256 characters; part of the world's fingerprint. */
599
- agentRevision?: string;
600
- }
601
- /** Request to invoke one action. */
602
- export interface ActionInput {
603
- /** Stable logical invocation identity. */
604
- invocationId: string;
605
- /** Action name from the run's catalog. */
606
- action: string;
607
- /** Action arguments; omitted means an empty object. */
608
- args?: Record<string, JsonValue>;
609
- }
610
- /** Request to seal an environment run. */
611
- export interface FinishRunInput {
612
- /** Stable idempotency key for recovering seal acknowledgement. */
613
- idempotencyKey: string;
614
- /** Completed for accepted outcomes; abandoned for failures/cancellation. */
615
- status: "completed" | "abandoned";
616
- }
617
- /** Ordinal pagination for an environment journal. */
618
- export interface StepPageOptions {
619
- /** Last seen ordinal; `-1` starts at the first step. */
620
- after?: number;
621
- /** Page size, 1–100. */
622
- limit?: number;
623
- }
1
+ /** Compatibility entry point. Use the world module. */
2
+ export * from "../world/types.js";
@@ -1 +1,2 @@
1
- export {};
1
+ /** Compatibility entry point. Use the world module. */
2
+ export * from "../world/types.js";