@granular-software/sdk 0.4.50 → 0.4.52

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.
@@ -224,9 +224,28 @@ interface OpenEnvironmentOptions {
224
224
  * the newest tag target instead of reusing the outdated one.
225
225
  */
226
226
  createFreshIfOutdated?: boolean;
227
+ /**
228
+ * Create a fresh environment on the current tag target. Reusing this key is
229
+ * safe: it returns the environment created by the original operation.
230
+ */
231
+ resetKey?: string;
232
+ /** Canonical active-environment slot. Defaults to `default`. */
233
+ slot?: string;
227
234
  /** Backwards-compatible user object returned from `recordUser()`. */
228
235
  user?: User;
229
236
  }
237
+ /**
238
+ * One-time administrative migration of a known existing environment into
239
+ * Granular's active-environment map. The environment id must be obtained from
240
+ * a reviewed baseline; this API intentionally has no name-based lookup.
241
+ */
242
+ interface AdoptEnvironmentOptions {
243
+ sandboxId: string;
244
+ tag: string;
245
+ userId: string;
246
+ environmentId: string;
247
+ slot?: string;
248
+ }
230
249
  /**
231
250
  * Deprecated compatibility alias for the legacy `connect()` entry point.
232
251
  *
@@ -256,6 +275,13 @@ interface ConnectOptions extends OpenEnvironmentOptions {
256
275
  interface CreateSessionOptions {
257
276
  /** Optional stable client ID. Defaults to `client_${Date.now()}`. */
258
277
  clientId?: string;
278
+ /**
279
+ * Optional application-owned history scope for this conversation.
280
+ *
281
+ * Use the same value when listing sessions or reading the materialized user
282
+ * environment state so unrelated product surfaces never share history.
283
+ */
284
+ sessionScope?: string;
259
285
  /**
260
286
  * Optional session heap seed. Each item uses application record identity:
261
287
  * class name plus the record id from the customer's own system. Granular
@@ -285,6 +311,23 @@ interface ConversationSessionInfo {
285
311
  jobCount?: number;
286
312
  toolCallCount?: number;
287
313
  }
314
+ type ConversationSessionListStatus = ConversationSessionInfo["status"] | "all";
315
+ /**
316
+ * Bounded filters for indexed conversation history.
317
+ *
318
+ * At least one ownership filter (`environmentId`, `sandboxId`, or
319
+ * `subjectId`) is required by the SDK. Results are newest-first and default to
320
+ * 100 rows; use `offset` to request the next page.
321
+ */
322
+ interface ConversationSessionListOptions {
323
+ environmentId?: string;
324
+ sandboxId?: string;
325
+ subjectId?: string;
326
+ sessionScope?: string | null;
327
+ status?: ConversationSessionListStatus;
328
+ limit?: number;
329
+ offset?: number;
330
+ }
288
331
  type SpendLineItemType = "llm_tokens" | "granular_session_time" | string;
289
332
  type QuotaScopeType = "tenant" | "sandbox" | "permission_profile" | "subject";
290
333
  type QuotaPeriod = "hour" | "day" | "week" | "month";
@@ -893,6 +936,10 @@ interface Job {
893
936
  }
894
937
  interface Prompt {
895
938
  id: string;
939
+ /** Job that owns this prompt, when it was opened by a running job. */
940
+ jobId?: string;
941
+ /** Harness turn that owns this prompt. */
942
+ turnId?: string;
896
943
  type: "confirm" | "choice" | "input";
897
944
  title: string;
898
945
  message: string;
@@ -913,6 +960,33 @@ interface ConversationMessageShowRefs {
913
960
  fileIds?: string[];
914
961
  sessionArtifactIds?: string[];
915
962
  actionSuggestions?: ConversationActionSuggestion[];
963
+ tables?: ConversationTableProjection[];
964
+ }
965
+ type ConversationTableCell = string | number | boolean | null | {
966
+ kind: "relative_time" | "date";
967
+ value: string | number;
968
+ };
969
+ interface ConversationTableColumn {
970
+ id: string;
971
+ label: string;
972
+ }
973
+ interface ConversationTableRowReference {
974
+ entryPath?: string;
975
+ className?: string;
976
+ id?: string;
977
+ label?: string;
978
+ }
979
+ interface ConversationTableRow {
980
+ id: string;
981
+ reference?: ConversationTableRowReference;
982
+ cells: ConversationTableCell[];
983
+ }
984
+ interface ConversationTableProjection {
985
+ id: string;
986
+ label?: string;
987
+ source?: string;
988
+ columns: ConversationTableColumn[];
989
+ rows: ConversationTableRow[];
916
990
  }
917
991
  interface ConversationActionSuggestion {
918
992
  suggestionId?: string;
@@ -922,13 +996,35 @@ interface ConversationActionSuggestion {
922
996
  target?: Record<string, unknown> | null;
923
997
  metadata?: Record<string, unknown>;
924
998
  }
999
+ /** A normalized action embedded in an ordered assistant message stream. */
1000
+ interface ConversationMessageAction {
1001
+ kind: "frontend" | "backend" | "system";
1002
+ label: string;
1003
+ status?: "done" | "queued" | "failed";
1004
+ }
1005
+ /**
1006
+ * A durable assistant message segment in the order it reached the client.
1007
+ *
1008
+ * `content` and `actions` remain the canonical compatibility fields on the
1009
+ * message. Parts only preserve their interleaving for capable clients.
1010
+ */
1011
+ type ConversationMessagePart = {
1012
+ type: "text";
1013
+ text: string;
1014
+ } | {
1015
+ type: "action";
1016
+ action: ConversationMessageAction;
1017
+ };
925
1018
  interface ConversationMessageInput {
1019
+ /** Optional caller-owned id used to correlate optimistic and durable turns. */
1020
+ id?: string;
926
1021
  role: "user" | "assistant";
927
1022
  content?: string;
928
1023
  show?: ConversationMessageShowRefs;
929
1024
  reasoningLines?: string[];
930
1025
  reasoningDurationMs?: number;
931
1026
  actions?: Array<Record<string, unknown>>;
1027
+ parts?: ConversationMessagePart[];
932
1028
  target?: Record<string, unknown>;
933
1029
  jobId?: string;
934
1030
  promptId?: string;
@@ -949,6 +1045,7 @@ interface SessionConversationMessage {
949
1045
  reasoningLines?: string[];
950
1046
  reasoningDurationMs?: number;
951
1047
  actions?: Array<Record<string, unknown>>;
1048
+ parts?: ConversationMessagePart[];
952
1049
  target?: Record<string, unknown>;
953
1050
  jobId?: string;
954
1051
  promptId?: string;
@@ -998,6 +1095,25 @@ interface SessionFileRecord {
998
1095
  }
999
1096
  type SessionArtifactStatus = "draft" | "ready" | "needs_edit" | "blocked" | "running" | "awaiting_human" | "completed" | "partially_completed" | "failed" | "canceled" | "stale";
1000
1097
  type SessionArtifactKind = "effect" | "batch" | "state_path";
1098
+ /**
1099
+ * Declarative impact metadata consumed by deterministic clients before an
1100
+ * artifact can execute. Missing metadata must be treated conservatively.
1101
+ */
1102
+ interface SessionArtifactAutonomyPolicy {
1103
+ sideEffect?: "read" | "readonly" | "read_only" | "ui" | "write" | "delete" | "destructive" | "irreversible";
1104
+ scope?: "internal" | "bulk" | "external" | "financial" | "permission";
1105
+ risk?: "low" | "medium" | "high";
1106
+ targetCount?: number;
1107
+ reversible?: boolean;
1108
+ destructive?: boolean;
1109
+ external?: boolean;
1110
+ financial?: boolean;
1111
+ permissionChange?: boolean;
1112
+ reverse?: string | Record<string, unknown>;
1113
+ undo?: string | Record<string, unknown>;
1114
+ rollback?: string | Record<string, unknown>;
1115
+ [key: string]: unknown;
1116
+ }
1001
1117
  interface SessionArtifactRecord {
1002
1118
  artifactId: string;
1003
1119
  sessionId?: string | null;
@@ -1023,8 +1139,10 @@ interface SessionArtifactRecord {
1023
1139
  } | null;
1024
1140
  relationships?: Record<string, string | string[] | null>;
1025
1141
  validation?: Record<string, unknown> | null;
1026
- policy?: Record<string, unknown> | null;
1027
- metadata?: Record<string, unknown>;
1142
+ policy?: SessionArtifactAutonomyPolicy | null;
1143
+ metadata?: Record<string, unknown> & {
1144
+ autonomy?: SessionArtifactAutonomyPolicy;
1145
+ };
1028
1146
  parentArtifactId?: string | null;
1029
1147
  subArtifactIds?: string[];
1030
1148
  createdAt: number;
@@ -1274,6 +1392,8 @@ interface SessionTranscriptEntry {
1274
1392
  jobResultPreview?: string;
1275
1393
  error?: string;
1276
1394
  show?: ConversationMessageShowRefs;
1395
+ actions?: ConversationMessageAction[];
1396
+ parts?: ConversationMessagePart[];
1277
1397
  historyContent?: string;
1278
1398
  source: "conversation" | "job_code" | "job_result" | "job_prompt" | "job_agent_message";
1279
1399
  }
@@ -1344,6 +1464,8 @@ interface SessionDocumentResult {
1344
1464
  interface SessionCollectionListOptions {
1345
1465
  limit?: number;
1346
1466
  cursor?: string | null;
1467
+ /** Return only the newest page, in chronological order. */
1468
+ latest?: boolean | null;
1347
1469
  }
1348
1470
  interface SessionJobListOptions extends SessionCollectionListOptions {
1349
1471
  status?: string | null;
@@ -1393,6 +1515,8 @@ interface UserEnvironmentState {
1393
1515
  tenantId?: string;
1394
1516
  sessionScope?: string | null;
1395
1517
  updatedAt: number;
1518
+ /** Monotonic materialized-index revision used for conditional refreshes. */
1519
+ revision?: number;
1396
1520
  stateSource?: "user_environment_snapshot" | "live_session_aggregate";
1397
1521
  stale?: boolean;
1398
1522
  snapshotUpdatedAt?: number | null;
@@ -1434,6 +1558,7 @@ interface WSClientOptions {
1434
1558
  url: string;
1435
1559
  sessionId: string;
1436
1560
  token: string;
1561
+ initialDocumentSnapshot?: Record<string, unknown> | Uint8Array | null;
1437
1562
  tokenProvider?: AccessTokenProvider;
1438
1563
  WebSocketCtor?: any;
1439
1564
  maxReconnectAttempts?: number;
@@ -1662,6 +1787,8 @@ type RecordImportWriteMode = "adaptive" | "batched" | "per_record" | "parallel_5
1662
1787
  interface RecordImportOptions {
1663
1788
  batchSize?: number;
1664
1789
  setupRunId?: string;
1790
+ /** Stable key for retrying one logical durable import exactly once. */
1791
+ operationKey?: string;
1665
1792
  writeMode?: RecordImportWriteMode;
1666
1793
  }
1667
1794
  type RecordImportStatus = "queued" | "processing" | "completed" | "failed" | "canceled";
@@ -1701,6 +1828,7 @@ interface RecordImport {
1701
1828
  sandboxId: string;
1702
1829
  subjectId: string;
1703
1830
  setupRunId?: string | null;
1831
+ operationKey?: string | null;
1704
1832
  status: RecordImportStatus;
1705
1833
  batchSize: number;
1706
1834
  errorMessage: string | null;
@@ -1717,7 +1845,7 @@ interface EnvironmentRecordImportSummary extends RecordImportStats {
1717
1845
  activeImports: number;
1718
1846
  updatedAt: number;
1719
1847
  }
1720
- type EnvironmentSetupTriggerReason = "new_environment" | "fresh_after_version_update";
1848
+ type EnvironmentSetupTriggerReason = "new_environment" | "fresh_after_version_update" | "explicit_reset";
1721
1849
  interface RunEnvironmentImporterOptions {
1722
1850
  /**
1723
1851
  * Ontology name/id used to resolve the registered importer. Defaults to the
@@ -1728,6 +1856,8 @@ interface RunEnvironmentImporterOptions {
1728
1856
  * Reason recorded on the setup run. Defaults to `new_environment`.
1729
1857
  */
1730
1858
  reason?: EnvironmentSetupTriggerReason;
1859
+ /** Stable caller operation key. Use for explicit reset retries. */
1860
+ operationKey?: string;
1731
1861
  }
1732
1862
  type EnvironmentSetupLifecycleStatus = "running" | "completed" | "failed";
1733
1863
  interface EnvironmentSetupSummary extends RecordImportStats {
@@ -1736,6 +1866,7 @@ interface EnvironmentSetupSummary extends RecordImportStats {
1736
1866
  sandboxId: string;
1737
1867
  subjectId: string;
1738
1868
  triggerReason: EnvironmentSetupTriggerReason;
1869
+ operationKey?: string | null;
1739
1870
  lifecycleStatus: EnvironmentSetupLifecycleStatus;
1740
1871
  stage: string | null;
1741
1872
  totalObjectsToImport: number;
@@ -1746,6 +1877,14 @@ interface EnvironmentSetupSummary extends RecordImportStats {
1746
1877
  hookCompletedAt: number | null;
1747
1878
  finishedAt: number | null;
1748
1879
  updatedAt: number;
1880
+ /** `false` when an idempotent setup operation already exists. */
1881
+ created?: boolean;
1882
+ }
1883
+ /** Result of claiming the importer portion of a durable setup run. */
1884
+ interface EnvironmentSetupImporterClaim {
1885
+ action: "run" | "submitted" | "busy" | "terminal";
1886
+ summary: EnvironmentSetupSummary;
1887
+ retryAfterMs?: number;
1749
1888
  }
1750
1889
  interface EnvironmentImporterImportOptions {
1751
1890
  batchSize?: number;
@@ -1755,6 +1894,8 @@ interface EnvironmentImporter {
1755
1894
  environmentId: string;
1756
1895
  sandboxId: string;
1757
1896
  subjectId: string;
1897
+ /** Application identity originally supplied as `openEnvironment({ userId })`. */
1898
+ externalUserId: string;
1758
1899
  reason: EnvironmentSetupTriggerReason;
1759
1900
  incrementTotalObjectsToImportCount: (n: number) => Promise<void>;
1760
1901
  setStage: (stage: string | null) => Promise<void>;
@@ -2082,13 +2223,23 @@ interface OpenAIModelPricing {
2082
2223
  currency: "USD";
2083
2224
  inputUsdPerMillion: number;
2084
2225
  cachedInputUsdPerMillion: number;
2226
+ cacheWriteUsdPerMillion?: number | null;
2085
2227
  outputUsdPerMillion: number;
2228
+ contextTier?: "short" | "long";
2229
+ longContextThresholdTokens?: number | null;
2230
+ longContextPricing?: {
2231
+ inputUsdPerMillion: number;
2232
+ cachedInputUsdPerMillion: number;
2233
+ cacheWriteUsdPerMillion?: number | null;
2234
+ outputUsdPerMillion: number;
2235
+ };
2086
2236
  sourceUrl: string;
2087
2237
  effectiveDate: string;
2088
2238
  }
2089
2239
  interface NormalizedOpenAIUsage {
2090
2240
  inputTokens: number;
2091
2241
  cachedInputTokens: number;
2242
+ cacheWriteTokens: number;
2092
2243
  uncachedInputTokens: number;
2093
2244
  outputTokens: number;
2094
2245
  reasoningTokens: number;
@@ -2099,6 +2250,7 @@ interface OpenAITokenSpend {
2099
2250
  model: string;
2100
2251
  inputTokens: number;
2101
2252
  cachedInputTokens: number;
2253
+ cacheWriteTokens: number;
2102
2254
  uncachedInputTokens: number;
2103
2255
  outputTokens: number;
2104
2256
  reasoningTokens: number;
@@ -2107,13 +2259,17 @@ interface OpenAITokenSpend {
2107
2259
  currency: "USD";
2108
2260
  inputPricePerMillionMicros: number;
2109
2261
  cachedInputPricePerMillionMicros: number;
2262
+ cacheWritePricePerMillionMicros: number | null;
2263
+ cacheWriteCostMicros: number;
2110
2264
  outputPricePerMillionMicros: number;
2265
+ pricingContextTier: "short" | "long";
2266
+ longContextThresholdTokens: number | null;
2111
2267
  pricingSource: string;
2112
2268
  pricingEffectiveAt: string;
2113
2269
  usage: NormalizedOpenAIUsage;
2114
2270
  }
2115
2271
  declare const OPENAI_MODEL_PRICING_USD_PER_MILLION: Record<string, OpenAIModelPricing>;
2116
- declare function getOpenAIModelPricing(model: string): OpenAIModelPricing | null;
2272
+ declare function getOpenAIModelPricing(model: string, inputTokens?: number): OpenAIModelPricing | null;
2117
2273
  declare function normalizeOpenAIUsage(rawUsage: unknown): NormalizedOpenAIUsage;
2118
2274
  declare function calculateOpenAITokenSpend(model: string, rawUsage: unknown): OpenAITokenSpend | null;
2119
2275
 
@@ -2151,4 +2307,4 @@ declare function toGranularHttpBase(apiUrl: string): string;
2151
2307
  declare function buildOpenAISpendEventId(usage: Pick<OpenAIUsageSpendEvent, "requestId">, context?: GranularSpendContext): string | undefined;
2152
2308
  declare function recordOpenAIUsageSpend(options: RecordOpenAIUsageSpendOptions): Promise<RecordOpenAIUsageSpendResult>;
2153
2309
 
2154
- export { type GranularQuotaProgress as $, type AccessTokenProvider as A, type RecordUserOptions as B, type ConditionIR as C, type DomainState as D, type EndpointMode as E, type Subject as F, type GranularSpendContext as G, type OpenEnvironmentOptions as H, type InstanceToolHandler as I, type ConnectOptions as J, type CreateSessionOptions as K, type ConversationSessionInfo as L, type ManifestEffectMetamodelSpec as M, type NormalizedOpenAIUsage as N, type OpenAIModelPricing as O, type Prompt as P, type SpendLineItemType as Q, type ResolvedEffectBehaviors as R, type SessionHeapEntry as S, type ToolWithHandler as T, type User as U, type QuotaScopeType as V, type QuotaPeriod as W, type QuotaStatus as X, type SpendSummary as Y, type QuotaLineItemFilter as Z, type GranularQuotaPolicy as _, type EffectHandlerContext as a, type SessionArtifactExecutionResult as a$, type Sandbox as a0, type CreateSandboxData as a1, type SandboxListResponse as a2, type PermissionRules as a3, type PermissionProfile as a4, type CreatePermissionProfileData as a5, type PermissionProfileListResponse as a6, type Assignment as a7, type AssignmentListResponse as a8, type BuildPolicy as a9, type EffectsChangedEvent as aA, type EffectHandler as aB, type InstanceEffectHandler as aC, type JobStatus as aD, type JobFeedbackSentiment as aE, type JobFeedbackToolCall as aF, type JobFeedbackMetadata as aG, type JobFeedbackInput as aH, type JobFeedbackRecord as aI, type EnvironmentFeedbackRecord as aJ, type JobSubmitResult as aK, type Job as aL, type ConversationMessageShowRefs as aM, type ConversationActionSuggestion as aN, type ConversationMessageInput as aO, type ConversationAppendResult as aP, type SessionConversationMessage as aQ, type SessionTimelineEvent as aR, type SessionFileSource as aS, type SessionFileKind as aT, type SessionFileStatus as aU, type SessionFileRecord as aV, type SessionArtifactStatus as aW, type SessionArtifactKind as aX, type SessionArtifactRecord as aY, type SessionArtifactListOptions as aZ, type SessionArtifactValidationResult as a_, type VersionTracking as aa, type VersionTag as ab, type EnvironmentData as ac, type CreateEnvironmentData as ad, type EnvironmentListResponse as ae, type Manifest as af, type ManifestListResponse as ag, type BuildStatus as ah, type Build as ai, type Version as aj, type BuildListResponse as ak, type SemanticVersionDiffEntry as al, type SemanticVersionDiff as am, type ResolvedEffectPostCondition as an, type ResolvedEffectDryRun as ao, type ResolvedEffectReverse as ap, type ResolvedEffectApprovalRequired as aq, type EffectInvocationMode as ar, type EffectInvocationMetadata as as, type EffectSchema as at, type EffectWithHandler as au, type PublishEffectsResult as av, type EffectVersionSelector as aw, type ToolInfo as ax, type EffectInfo as ay, type ToolsChangedEvent as az, type SessionHeapList as b, type RecordImport as b$, type SessionArtifactExecutionOptions as b0, type SessionArtifactApprovalOptions as b1, type ArtifactApprovalTaskStatus as b2, type ArtifactApprovalTask as b3, type ArtifactApprovalTaskListOptions as b4, type ArtifactApprovalDecisionInput as b5, type ArtifactApprovalDecisionResult as b6, type ManualActionStatus as b7, type ManualActionSource as b8, type ManualActionTarget as b9, type WSReconnectErrorInfo as bA, type WSClientOptions as bB, type RPCRequest as bC, type RPCResponse as bD, type SyncMessage as bE, type RPCRequestFromServer as bF, type ToolInvokeParams as bG, type ToolResultParams as bH, type ModelRef as bI, type RelationshipInfo as bJ, type DefineRelationshipOptions as bK, type RecordObjectOptions as bL, type RecordObjectStateValue as bM, type EnvironmentStateTarget as bN, type EnvironmentStateObservationInput as bO, type EnvironmentStateUpdateInput as bP, type EnvironmentStateMachineProxy as bQ, type EnvironmentStateProxy as bR, type RecordObjectResult as bS, type RecordObjectsChunkInfo as bT, type RecordObjectsOptions as bU, type RecordImportWriteMode as bV, type RecordImportOptions as bW, type RecordImportStatus as bX, type RecordImportItemStatus as bY, type RecordImportStats as bZ, type RecordImportItem as b_, type ManualActionRelatedRecord as ba, type RecordManualActionInput as bb, type ManualActionOccurrence as bc, type ManualActionRecordResult as bd, type ManualActionListOptions as be, type ManualActionSuggestion as bf, type ManualActionSuggestionOptions as bg, type SessionFileUploadOptions as bh, type SessionJobRecord as bi, type SessionHeapFieldType as bj, type SessionHeapFieldValue as bk, type SessionHeapVariable as bl, type RecordSearchResult as bm, type RecordSearchOptions as bn, type RecordMentionInput as bo, type SessionDocumentResult as bp, type SessionCollectionListOptions as bq, type SessionJobListOptions as br, type SessionCollectionListResult as bs, type UserEnvironmentPrompt as bt, type UserEnvironmentMessagePreview as bu, type UserEnvironmentSessionState as bv, type UserEnvironmentState as bw, type UserEnvironmentStateOptions as bx, type MarkUserEnvironmentReadOptions as by, type WSDisconnectInfo as bz, type SessionHeapSnapshot as c, type EnvironmentRecordImportSummary as c0, type EnvironmentSetupTriggerReason as c1, type RunEnvironmentImporterOptions as c2, type EnvironmentSetupLifecycleStatus as c3, type EnvironmentSetupSummary as c4, type EnvironmentImporterImportOptions as c5, type EnvironmentImporter as c6, type ManifestPropertySpec as c7, type ManifestValidationOperator as c8, type ManifestEnumRuleSpec as c9, type GraphQLResult as cA, type APIError as cB, type DeleteResponse as cC, type StreamEvent as cD, type StreamSubscription as cE, type StreamStats as cF, type ManifestFilterBySpec as ca, type ManifestValidationRuleSpec as cb, type ManifestStateMachineStateSpec as cc, type ManifestStateTransitionInputBinding as cd, type ManifestStateTransitionActionSpec as ce, type ManifestStateTransitionAssigneeSpec as cf, type ManifestStateTransitionRelatedStateRequirementSpec as cg, type ManifestStateTransitionRequirementsSpec as ch, type ManifestStateTransitionPermissionSpec as ci, type ManifestStateTransitionExpectedOutcomeSpec as cj, type ManifestStateMachineTransitionSpec as ck, type ManifestStateMachineSpec as cl, type ManifestPostConditionSpec as cm, type ManifestDryRunSpec as cn, type ManifestReverseSpec as co, type ManifestApprovalRequiredSpec as cp, type ManifestCreatesSpec as cq, type ManifestRelationshipDef as cr, type ManifestEffectSchema as cs, type ManifestEffectDeclaration as ct, type ManifestEventTypeDef as cu, type ManifestEventStreamDef as cv, type ManifestOperation as cw, type ManifestImport as cx, type ManifestVolume as cy, type ManifestContent as cz, type SessionTranscriptEntry as d, type ToolSchema as e, type PublishToolsResult as f, type ToolHandler as g, type OpenAITokenSpend as h, OPENAI_MODEL_PRICING_USD_PER_MILLION as i, getOpenAIModelPricing as j, calculateOpenAITokenSpend as k, type OpenAIUsageSpendEvent as l, type RecordOpenAIUsageSpendOptions as m, normalizeOpenAIUsage as n, type RecordOpenAIUsageSpendResult as o, buildOpenAISpendEventId as p, type PolicySource as q, recordOpenAIUsageSpend as r, type PolicyPredicateSource as s, toGranularHttpBase as t, type PolicyOperator as u, type PolicyOrigin as v, type PolicyRuleIR as w, type MatchedPolicy as x, type GranularOptions as y, type GranularAuth as z };
2310
+ export { type SpendSummary as $, type AccessTokenProvider as A, type RecordUserOptions as B, type ConditionIR as C, type DomainState as D, type EndpointMode as E, type Subject as F, type GranularSpendContext as G, type OpenEnvironmentOptions as H, type InstanceToolHandler as I, type AdoptEnvironmentOptions as J, type ConnectOptions as K, type CreateSessionOptions as L, type ManifestEffectMetamodelSpec as M, type NormalizedOpenAIUsage as N, type OpenAIModelPricing as O, type Prompt as P, type ConversationSessionInfo as Q, type ResolvedEffectBehaviors as R, type SessionHeapEntry as S, type ToolWithHandler as T, type User as U, type ConversationSessionListStatus as V, type ConversationSessionListOptions as W, type SpendLineItemType as X, type QuotaScopeType as Y, type QuotaPeriod as Z, type QuotaStatus as _, type EffectHandlerContext as a, type SessionTimelineEvent as a$, type QuotaLineItemFilter as a0, type GranularQuotaPolicy as a1, type GranularQuotaProgress as a2, type Sandbox as a3, type CreateSandboxData as a4, type SandboxListResponse as a5, type PermissionRules as a6, type PermissionProfile as a7, type CreatePermissionProfileData as a8, type PermissionProfileListResponse as a9, type ToolInfo as aA, type EffectInfo as aB, type ToolsChangedEvent as aC, type EffectsChangedEvent as aD, type EffectHandler as aE, type InstanceEffectHandler as aF, type JobStatus as aG, type JobFeedbackSentiment as aH, type JobFeedbackToolCall as aI, type JobFeedbackMetadata as aJ, type JobFeedbackInput as aK, type JobFeedbackRecord as aL, type EnvironmentFeedbackRecord as aM, type JobSubmitResult as aN, type Job as aO, type ConversationMessageShowRefs as aP, type ConversationTableCell as aQ, type ConversationTableColumn as aR, type ConversationTableRowReference as aS, type ConversationTableRow as aT, type ConversationTableProjection as aU, type ConversationActionSuggestion as aV, type ConversationMessageAction as aW, type ConversationMessagePart as aX, type ConversationMessageInput as aY, type ConversationAppendResult as aZ, type SessionConversationMessage as a_, type Assignment as aa, type AssignmentListResponse as ab, type BuildPolicy as ac, type VersionTracking as ad, type VersionTag as ae, type EnvironmentData as af, type CreateEnvironmentData as ag, type EnvironmentListResponse as ah, type Manifest as ai, type ManifestListResponse as aj, type BuildStatus as ak, type Build as al, type Version as am, type BuildListResponse as an, type SemanticVersionDiffEntry as ao, type SemanticVersionDiff as ap, type ResolvedEffectPostCondition as aq, type ResolvedEffectDryRun as ar, type ResolvedEffectReverse as as, type ResolvedEffectApprovalRequired as at, type EffectInvocationMode as au, type EffectInvocationMetadata as av, type EffectSchema as aw, type EffectWithHandler as ax, type PublishEffectsResult as ay, type EffectVersionSelector as az, type SessionHeapList as b, type EnvironmentStateMachineProxy as b$, type SessionFileSource as b0, type SessionFileKind as b1, type SessionFileStatus as b2, type SessionFileRecord as b3, type SessionArtifactStatus as b4, type SessionArtifactKind as b5, type SessionArtifactAutonomyPolicy as b6, type SessionArtifactRecord as b7, type SessionArtifactListOptions as b8, type SessionArtifactValidationResult as b9, type SessionDocumentResult as bA, type SessionCollectionListOptions as bB, type SessionJobListOptions as bC, type SessionCollectionListResult as bD, type UserEnvironmentPrompt as bE, type UserEnvironmentMessagePreview as bF, type UserEnvironmentSessionState as bG, type UserEnvironmentState as bH, type UserEnvironmentStateOptions as bI, type MarkUserEnvironmentReadOptions as bJ, type WSDisconnectInfo as bK, type WSReconnectErrorInfo as bL, type WSClientOptions as bM, type RPCRequest as bN, type RPCResponse as bO, type SyncMessage as bP, type RPCRequestFromServer as bQ, type ToolInvokeParams as bR, type ToolResultParams as bS, type ModelRef as bT, type RelationshipInfo as bU, type DefineRelationshipOptions as bV, type RecordObjectOptions as bW, type RecordObjectStateValue as bX, type EnvironmentStateTarget as bY, type EnvironmentStateObservationInput as bZ, type EnvironmentStateUpdateInput as b_, type SessionArtifactExecutionResult as ba, type SessionArtifactExecutionOptions as bb, type SessionArtifactApprovalOptions as bc, type ArtifactApprovalTaskStatus as bd, type ArtifactApprovalTask as be, type ArtifactApprovalTaskListOptions as bf, type ArtifactApprovalDecisionInput as bg, type ArtifactApprovalDecisionResult as bh, type ManualActionStatus as bi, type ManualActionSource as bj, type ManualActionTarget as bk, type ManualActionRelatedRecord as bl, type RecordManualActionInput as bm, type ManualActionOccurrence as bn, type ManualActionRecordResult as bo, type ManualActionListOptions as bp, type ManualActionSuggestion as bq, type ManualActionSuggestionOptions as br, type SessionFileUploadOptions as bs, type SessionJobRecord as bt, type SessionHeapFieldType as bu, type SessionHeapFieldValue as bv, type SessionHeapVariable as bw, type RecordSearchResult as bx, type RecordSearchOptions as by, type RecordMentionInput as bz, type SessionHeapSnapshot as c, type EnvironmentStateProxy as c0, type RecordObjectResult as c1, type RecordObjectsChunkInfo as c2, type RecordObjectsOptions as c3, type RecordImportWriteMode as c4, type RecordImportOptions as c5, type RecordImportStatus as c6, type RecordImportItemStatus as c7, type RecordImportStats as c8, type RecordImportItem as c9, type ManifestReverseSpec as cA, type ManifestApprovalRequiredSpec as cB, type ManifestCreatesSpec as cC, type ManifestRelationshipDef as cD, type ManifestEffectSchema as cE, type ManifestEffectDeclaration as cF, type ManifestEventTypeDef as cG, type ManifestEventStreamDef as cH, type ManifestOperation as cI, type ManifestImport as cJ, type ManifestVolume as cK, type ManifestContent as cL, type GraphQLResult as cM, type APIError as cN, type DeleteResponse as cO, type StreamEvent as cP, type StreamSubscription as cQ, type StreamStats as cR, type RecordImport as ca, type EnvironmentRecordImportSummary as cb, type EnvironmentSetupTriggerReason as cc, type RunEnvironmentImporterOptions as cd, type EnvironmentSetupLifecycleStatus as ce, type EnvironmentSetupSummary as cf, type EnvironmentSetupImporterClaim as cg, type EnvironmentImporterImportOptions as ch, type EnvironmentImporter as ci, type ManifestPropertySpec as cj, type ManifestValidationOperator as ck, type ManifestEnumRuleSpec as cl, type ManifestFilterBySpec as cm, type ManifestValidationRuleSpec as cn, type ManifestStateMachineStateSpec as co, type ManifestStateTransitionInputBinding as cp, type ManifestStateTransitionActionSpec as cq, type ManifestStateTransitionAssigneeSpec as cr, type ManifestStateTransitionRelatedStateRequirementSpec as cs, type ManifestStateTransitionRequirementsSpec as ct, type ManifestStateTransitionPermissionSpec as cu, type ManifestStateTransitionExpectedOutcomeSpec as cv, type ManifestStateMachineTransitionSpec as cw, type ManifestStateMachineSpec as cx, type ManifestPostConditionSpec as cy, type ManifestDryRunSpec as cz, type SessionTranscriptEntry as d, type ToolSchema as e, type PublishToolsResult as f, type ToolHandler as g, type OpenAITokenSpend as h, OPENAI_MODEL_PRICING_USD_PER_MILLION as i, getOpenAIModelPricing as j, calculateOpenAITokenSpend as k, type OpenAIUsageSpendEvent as l, type RecordOpenAIUsageSpendOptions as m, normalizeOpenAIUsage as n, type RecordOpenAIUsageSpendResult as o, buildOpenAISpendEventId as p, type PolicySource as q, recordOpenAIUsageSpend as r, type PolicyPredicateSource as s, toGranularHttpBase as t, type PolicyOperator as u, type PolicyOrigin as v, type PolicyRuleIR as w, type MatchedPolicy as x, type GranularOptions as y, type GranularAuth as z };