@granular-software/sdk 0.4.34 → 0.4.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -20304,6 +20304,38 @@ function normalizeUser(user) {
20304
20304
  permissions: Array.isArray(user.permissions) ? user.permissions : []
20305
20305
  };
20306
20306
  }
20307
+ function normalizeEnvironmentSetupSummary(setup) {
20308
+ if (!setup) {
20309
+ return null;
20310
+ }
20311
+ const queuedRecords = Number(setup.queuedRecords || 0);
20312
+ const processingRecords = Number(setup.processingRecords || 0);
20313
+ return {
20314
+ ...setup,
20315
+ setupRunId: String(setup.setupRunId || ""),
20316
+ environmentId: String(setup.environmentId || ""),
20317
+ sandboxId: String(setup.sandboxId || ""),
20318
+ subjectId: String(setup.subjectId || ""),
20319
+ triggerReason: setup.triggerReason === "fresh_after_version_update" ? "fresh_after_version_update" : "new_environment",
20320
+ lifecycleStatus: setup.lifecycleStatus === "completed" || setup.lifecycleStatus === "failed" ? setup.lifecycleStatus : "running",
20321
+ stage: typeof setup.stage === "string" ? setup.stage : null,
20322
+ totalObjectsToImport: Number(setup.totalObjectsToImport || 0),
20323
+ totalImports: Number(setup.totalImports || 0),
20324
+ activeImports: Number(setup.activeImports || 0),
20325
+ totalRecords: Number(setup.totalRecords || 0),
20326
+ queuedRecords,
20327
+ processingRecords,
20328
+ completedRecords: Number(setup.completedRecords || 0),
20329
+ failedRecords: Number(setup.failedRecords || 0),
20330
+ canceledRecords: Number(setup.canceledRecords || 0),
20331
+ awaitingRecords: Number(setup.awaitingRecords || 0) || queuedRecords + processingRecords,
20332
+ errorMessage: typeof setup.errorMessage === "string" ? setup.errorMessage : null,
20333
+ startedAt: Number(setup.startedAt || Date.now()),
20334
+ hookCompletedAt: setup.hookCompletedAt == null ? null : Number(setup.hookCompletedAt),
20335
+ finishedAt: setup.finishedAt == null ? null : Number(setup.finishedAt),
20336
+ updatedAt: Number(setup.updatedAt || Date.now())
20337
+ };
20338
+ }
20307
20339
  function normalizeEnvironmentData(environment) {
20308
20340
  const buildPolicy = environment.buildPolicy || environment.tracking || (environment.tagId ? { mode: "tag", tagId: environment.tagId } : {
20309
20341
  mode: "pinned",
@@ -20317,7 +20349,8 @@ function normalizeEnvironmentData(environment) {
20317
20349
  envName: environmentName,
20318
20350
  environment: environmentName,
20319
20351
  buildPolicy,
20320
- tracking: environment.tracking || buildPolicy
20352
+ tracking: environment.tracking || buildPolicy,
20353
+ setup: normalizeEnvironmentSetupSummary(environment.setup)
20321
20354
  };
20322
20355
  }
20323
20356
  var Environment = class {
@@ -20375,6 +20408,10 @@ var Environment = class {
20375
20408
  get updateState() {
20376
20409
  return this.envData.updateState;
20377
20410
  }
20411
+ /** The latest setup/import run summary for this environment, when available. */
20412
+ get setup() {
20413
+ return this.envData.setup || null;
20414
+ }
20378
20415
  /** Convenience flag for whether this environment trails the current tag target */
20379
20416
  get isOutdated() {
20380
20417
  return this.envData.updateState === "update_available";
@@ -20395,6 +20432,9 @@ var Environment = class {
20395
20432
  get runtimeBaseUrl() {
20396
20433
  return this.getRuntimeBaseUrl();
20397
20434
  }
20435
+ syncEnvironmentData(envData) {
20436
+ this.envData = normalizeEnvironmentData(envData);
20437
+ }
20398
20438
  get sessions() {
20399
20439
  return {
20400
20440
  list: async (options) => this.listSessions(options?.status || "active"),
@@ -21340,7 +21380,8 @@ var Environment = class {
21340
21380
  method: "POST",
21341
21381
  body: JSON.stringify({
21342
21382
  records,
21343
- batchSize: options.batchSize
21383
+ batchSize: options.batchSize,
21384
+ setupRunId: options.setupRunId
21344
21385
  })
21345
21386
  }
21346
21387
  );
@@ -21488,18 +21529,12 @@ var EnvironmentSession = class extends Session {
21488
21529
  }
21489
21530
  get messages() {
21490
21531
  return {
21491
- list: (options = {}) => this.sessionDataRequest(
21492
- "/messages",
21493
- options
21494
- )
21532
+ list: (options = {}) => this.sessionDataRequest("/messages", options)
21495
21533
  };
21496
21534
  }
21497
21535
  get timeline() {
21498
21536
  return {
21499
- list: (options = {}) => this.sessionDataRequest(
21500
- "/timeline",
21501
- options
21502
- )
21537
+ list: (options = {}) => this.sessionDataRequest("/timeline", options)
21503
21538
  };
21504
21539
  }
21505
21540
  get jobs() {
@@ -21516,10 +21551,7 @@ var EnvironmentSession = class extends Session {
21516
21551
  get heap() {
21517
21552
  return {
21518
21553
  entries: {
21519
- list: (options = {}) => this.sessionDataRequest(
21520
- "/heap/entries",
21521
- options
21522
- ),
21554
+ list: (options = {}) => this.sessionDataRequest("/heap/entries", options),
21523
21555
  get: (path6) => this.sessionDataRequest(
21524
21556
  `/heap/entries/${encodeURIComponent(path6)}`
21525
21557
  )
@@ -21563,10 +21595,7 @@ var EnvironmentSession = class extends Session {
21563
21595
  const heap = normalizeHeapSnapshot({
21564
21596
  entriesByPath: Object.fromEntries(
21565
21597
  entries.map((entry) => {
21566
- return entry?.path ? [
21567
- entry.path,
21568
- entry
21569
- ] : null;
21598
+ return entry?.path ? [entry.path, entry] : null;
21570
21599
  }).filter(
21571
21600
  (entry) => Boolean(entry)
21572
21601
  )
@@ -21732,6 +21761,15 @@ var OntologyHandle = class {
21732
21761
  disconnect: async () => this.granular.disconnectEffects(this.ontologyNameOrId)
21733
21762
  };
21734
21763
  }
21764
+ get importer() {
21765
+ return {
21766
+ onEnvironmentCreate: (handler) => this.granular.registerEnvironmentImporter(
21767
+ this.ontologyNameOrId,
21768
+ handler
21769
+ ),
21770
+ clear: () => this.granular.clearEnvironmentImporter(this.ontologyNameOrId)
21771
+ };
21772
+ }
21735
21773
  };
21736
21774
  var Granular = class _Granular {
21737
21775
  apiKey;
@@ -21748,6 +21786,10 @@ var Granular = class _Granular {
21748
21786
  sandboxEffectHosts = /* @__PURE__ */ new Map();
21749
21787
  /** In-flight host connection promises to avoid duplicate concurrent connects */
21750
21788
  sandboxEffectHostPromises = /* @__PURE__ */ new Map();
21789
+ /** Ontology-bound environment importer hooks keyed by the caller's ontology identifier. */
21790
+ ontologyImporters = /* @__PURE__ */ new Map();
21791
+ /** Resolved importer hooks keyed by sandboxId for fast lookups during openEnvironment(). */
21792
+ sandboxImporters = /* @__PURE__ */ new Map();
21751
21793
  /**
21752
21794
  * Create a new Granular client
21753
21795
  * @param options - Client configuration
@@ -21773,6 +21815,32 @@ var Granular = class _Granular {
21773
21815
  ontology(ontologyNameOrId) {
21774
21816
  return new OntologyHandle(this, ontologyNameOrId);
21775
21817
  }
21818
+ registerEnvironmentImporter(ontologyNameOrId, handler) {
21819
+ this.ontologyImporters.set(ontologyNameOrId, handler);
21820
+ if (ontologyNameOrId.startsWith("sbx_")) {
21821
+ this.sandboxImporters.set(ontologyNameOrId, {
21822
+ handler,
21823
+ sourceOntology: ontologyNameOrId
21824
+ });
21825
+ return;
21826
+ }
21827
+ for (const [sandboxId, importer] of this.sandboxImporters.entries()) {
21828
+ if (importer.sourceOntology === ontologyNameOrId) {
21829
+ this.sandboxImporters.set(sandboxId, {
21830
+ handler,
21831
+ sourceOntology: ontologyNameOrId
21832
+ });
21833
+ }
21834
+ }
21835
+ }
21836
+ clearEnvironmentImporter(ontologyNameOrId) {
21837
+ this.ontologyImporters.delete(ontologyNameOrId);
21838
+ for (const [sandboxId, importer] of this.sandboxImporters.entries()) {
21839
+ if (importer.sourceOntology === ontologyNameOrId) {
21840
+ this.sandboxImporters.delete(sandboxId);
21841
+ }
21842
+ }
21843
+ }
21776
21844
  /**
21777
21845
  * Records/upserts a user and prepares them for sandbox connections
21778
21846
  *
@@ -21889,11 +21957,13 @@ var Granular = class _Granular {
21889
21957
  * ```
21890
21958
  */
21891
21959
  async openEnvironment(options) {
21892
- const envData = await this.resolveOpenEnvironmentData(
21960
+ const resolved = await this.resolveOpenEnvironmentData(
21893
21961
  options,
21894
21962
  "openEnvironment"
21895
21963
  );
21896
- return this.bindEnvironmentHandle(envData);
21964
+ const environment = this.bindEnvironmentHandle(resolved.environment);
21965
+ await this.maybeRunEnvironmentImporter(resolved, environment);
21966
+ return environment;
21897
21967
  }
21898
21968
  /**
21899
21969
  * Deprecated compatibility alias for `openEnvironment()`.
@@ -21980,7 +22050,12 @@ var Granular = class _Granular {
21980
22050
  )
21981
22051
  );
21982
22052
  if (currentMatches.length > 0) {
21983
- return currentMatches[0];
22053
+ return {
22054
+ environment: currentMatches[0],
22055
+ requestedOntology: ontology,
22056
+ sandboxId: sandbox.sandboxId,
22057
+ subjectId: user.granularId
22058
+ };
21984
22059
  }
21985
22060
  const outdatedMatches = this.sortEnvironmentsByRecency(
21986
22061
  userEnvironments.filter(
@@ -21988,14 +22063,25 @@ var Granular = class _Granular {
21988
22063
  )
21989
22064
  );
21990
22065
  if (outdatedMatches.length > 0 && options.createFreshIfOutdated !== true) {
21991
- return outdatedMatches[0];
22066
+ return {
22067
+ environment: outdatedMatches[0],
22068
+ requestedOntology: ontology,
22069
+ sandboxId: sandbox.sandboxId,
22070
+ subjectId: user.granularId
22071
+ };
21992
22072
  }
21993
- return this.environments.create(sandbox.sandboxId, {
22073
+ return {
22074
+ environment: await this.environments.create(sandbox.sandboxId, {
22075
+ subjectId: user.granularId,
22076
+ environment: this.buildManagedEnvironmentName(tagName, targetVersionId),
22077
+ tagId: tag2.tagId,
22078
+ permissionProfileId: null
22079
+ }),
22080
+ requestedOntology: ontology,
22081
+ sandboxId: sandbox.sandboxId,
21994
22082
  subjectId: user.granularId,
21995
- environment: this.buildManagedEnvironmentName(tagName, targetVersionId),
21996
- tagId: tag2.tagId,
21997
- permissionProfileId: null
21998
- });
22083
+ setupTriggerReason: outdatedMatches.length > 0 ? "fresh_after_version_update" : "new_environment"
22084
+ };
21999
22085
  }
22000
22086
  /**
22001
22087
  * List active (open) sessions for an environment — each session is one agent conversation thread.
@@ -22112,6 +22198,94 @@ var Granular = class _Granular {
22112
22198
  });
22113
22199
  return this.connectSession({ sessionId, clientId: options?.clientId });
22114
22200
  }
22201
+ resolveEnvironmentImporter(requestedOntology, sandboxId) {
22202
+ const sandboxImporter = this.sandboxImporters.get(sandboxId);
22203
+ if (sandboxImporter) {
22204
+ const sourceImporter = this.ontologyImporters.get(
22205
+ sandboxImporter.sourceOntology
22206
+ );
22207
+ if (sourceImporter === sandboxImporter.handler) {
22208
+ return sandboxImporter.handler;
22209
+ }
22210
+ this.sandboxImporters.delete(sandboxId);
22211
+ }
22212
+ const ontologyImporter = this.ontologyImporters.get(requestedOntology);
22213
+ if (!ontologyImporter) {
22214
+ return void 0;
22215
+ }
22216
+ this.sandboxImporters.set(sandboxId, {
22217
+ handler: ontologyImporter,
22218
+ sourceOntology: requestedOntology
22219
+ });
22220
+ return ontologyImporter;
22221
+ }
22222
+ async maybeRunEnvironmentImporter(resolved, environment) {
22223
+ if (!resolved.setupTriggerReason) {
22224
+ return;
22225
+ }
22226
+ const importer = this.resolveEnvironmentImporter(
22227
+ resolved.requestedOntology,
22228
+ resolved.sandboxId
22229
+ );
22230
+ if (!importer) {
22231
+ return;
22232
+ }
22233
+ const setupRun = await this.request(
22234
+ `/control/environments/${environment.environmentId}/setup-runs`,
22235
+ {
22236
+ method: "POST",
22237
+ body: JSON.stringify({
22238
+ triggerReason: resolved.setupTriggerReason
22239
+ })
22240
+ }
22241
+ );
22242
+ const setupRunId = setupRun.setupRunId;
22243
+ const updateSetupRun = async (patch) => {
22244
+ await this.request(
22245
+ `/control/environment-setup-runs/${setupRunId}`,
22246
+ {
22247
+ method: "PATCH",
22248
+ body: JSON.stringify(patch)
22249
+ }
22250
+ );
22251
+ };
22252
+ const importerContext = {
22253
+ environmentId: environment.environmentId,
22254
+ sandboxId: environment.sandboxId,
22255
+ subjectId: environment.subjectId,
22256
+ reason: resolved.setupTriggerReason,
22257
+ incrementTotalObjectsToImportCount: async (n) => {
22258
+ const safeIncrement = Math.max(0, Math.trunc(n));
22259
+ if (safeIncrement <= 0) {
22260
+ return;
22261
+ }
22262
+ await updateSetupRun({
22263
+ incrementTotalObjectsToImportCount: safeIncrement
22264
+ });
22265
+ },
22266
+ setStage: async (stage) => {
22267
+ await updateSetupRun({ stage });
22268
+ },
22269
+ importRecords: async (records, options) => environment.enqueueRecordImport(records, {
22270
+ batchSize: options?.batchSize,
22271
+ setupRunId
22272
+ })
22273
+ };
22274
+ try {
22275
+ await importer(importerContext);
22276
+ await updateSetupRun({ markHookCompleted: true });
22277
+ const refreshedEnvironment = await this.environments.get(
22278
+ environment.environmentId
22279
+ );
22280
+ environment.syncEnvironmentData(refreshedEnvironment);
22281
+ } catch (error2) {
22282
+ await updateSetupRun({
22283
+ status: "failed",
22284
+ errorMessage: error2 instanceof Error ? error2.message : String(error2)
22285
+ }).catch(() => void 0);
22286
+ throw error2;
22287
+ }
22288
+ }
22115
22289
  bindEnvironmentHandle(envData) {
22116
22290
  const graphqlEndpoint = `${this.httpUrl}/orchestrator/graphql`;
22117
22291
  return new Environment(this, envData, this.apiKey, graphqlEndpoint);
@@ -313,6 +313,7 @@ interface EnvironmentData {
313
313
  tag?: VersionTag | null;
314
314
  tracking?: BuildPolicy;
315
315
  buildPolicy: BuildPolicy;
316
+ setup?: EnvironmentSetupSummary | null;
316
317
  updateState?: "up_to_date" | "update_available" | "upgrading" | "failed";
317
318
  createdAt: number;
318
319
  updatedAt: number;
@@ -1105,6 +1106,7 @@ interface RecordImport {
1105
1106
  environmentId: string;
1106
1107
  sandboxId: string;
1107
1108
  subjectId: string;
1109
+ setupRunId?: string | null;
1108
1110
  status: RecordImportStatus;
1109
1111
  batchSize: number;
1110
1112
  errorMessage: string | null;
@@ -1121,6 +1123,37 @@ interface EnvironmentRecordImportSummary extends RecordImportStats {
1121
1123
  activeImports: number;
1122
1124
  updatedAt: number;
1123
1125
  }
1126
+ type EnvironmentSetupTriggerReason = "new_environment" | "fresh_after_version_update";
1127
+ type EnvironmentSetupLifecycleStatus = "running" | "completed" | "failed";
1128
+ interface EnvironmentSetupSummary extends RecordImportStats {
1129
+ setupRunId: string;
1130
+ environmentId: string;
1131
+ sandboxId: string;
1132
+ subjectId: string;
1133
+ triggerReason: EnvironmentSetupTriggerReason;
1134
+ lifecycleStatus: EnvironmentSetupLifecycleStatus;
1135
+ stage: string | null;
1136
+ totalObjectsToImport: number;
1137
+ totalImports: number;
1138
+ activeImports: number;
1139
+ errorMessage: string | null;
1140
+ startedAt: number;
1141
+ hookCompletedAt: number | null;
1142
+ finishedAt: number | null;
1143
+ updatedAt: number;
1144
+ }
1145
+ interface EnvironmentImporterImportOptions {
1146
+ batchSize?: number;
1147
+ }
1148
+ interface EnvironmentImporter {
1149
+ environmentId: string;
1150
+ sandboxId: string;
1151
+ subjectId: string;
1152
+ reason: EnvironmentSetupTriggerReason;
1153
+ incrementTotalObjectsToImportCount: (n: number) => Promise<void>;
1154
+ setStage: (stage: string | null) => Promise<void>;
1155
+ importRecords: (records: RecordObjectOptions[], options?: EnvironmentImporterImportOptions) => Promise<RecordImport>;
1156
+ }
1124
1157
  /**
1125
1158
  * Property specification in a manifest operation
1126
1159
  */
@@ -1577,6 +1610,7 @@ declare class Session {
1577
1610
  private checkForToolChanges;
1578
1611
  }
1579
1612
 
1613
+ type EnvironmentImporterHandler = (importer: EnvironmentImporter) => Promise<void> | void;
1580
1614
  /**
1581
1615
  * Environment is the sessionless handle for one resolved ontology environment.
1582
1616
  *
@@ -1612,6 +1646,8 @@ declare class Environment {
1612
1646
  get buildPolicy(): BuildPolicy;
1613
1647
  /** The current update state relative to the followed tag */
1614
1648
  get updateState(): EnvironmentData["updateState"];
1649
+ /** The latest setup/import run summary for this environment, when available. */
1650
+ get setup(): EnvironmentSetupSummary | null;
1615
1651
  /** Convenience flag for whether this environment trails the current tag target */
1616
1652
  get isOutdated(): boolean;
1617
1653
  /** The followed tag name when this environment is tag-tracked */
@@ -1622,6 +1658,7 @@ declare class Environment {
1622
1658
  get authToken(): string;
1623
1659
  /** Base runtime URL derived from the GraphQL endpoint */
1624
1660
  get runtimeBaseUrl(): string;
1661
+ syncEnvironmentData(envData: EnvironmentData): void;
1625
1662
  get sessions(): {
1626
1663
  list: (options?: {
1627
1664
  status?: "active" | "closed" | "all";
@@ -1926,6 +1963,7 @@ declare class Environment {
1926
1963
  */
1927
1964
  enqueueRecordImport(records: RecordObjectOptions[], options?: {
1928
1965
  batchSize?: number;
1966
+ setupRunId?: string;
1929
1967
  }): Promise<RecordImport>;
1930
1968
  /**
1931
1969
  * List queued or completed record imports for this environment.
@@ -2081,6 +2119,10 @@ declare class OntologyHandle {
2081
2119
  clear: () => Promise<void>;
2082
2120
  disconnect: () => Promise<void>;
2083
2121
  };
2122
+ get importer(): {
2123
+ onEnvironmentCreate: (handler: EnvironmentImporterHandler) => void;
2124
+ clear: () => void;
2125
+ };
2084
2126
  }
2085
2127
  declare class Granular {
2086
2128
  private apiKey;
@@ -2097,6 +2139,10 @@ declare class Granular {
2097
2139
  private sandboxEffectHosts;
2098
2140
  /** In-flight host connection promises to avoid duplicate concurrent connects */
2099
2141
  private sandboxEffectHostPromises;
2142
+ /** Ontology-bound environment importer hooks keyed by the caller's ontology identifier. */
2143
+ private ontologyImporters;
2144
+ /** Resolved importer hooks keyed by sandboxId for fast lookups during openEnvironment(). */
2145
+ private sandboxImporters;
2100
2146
  /**
2101
2147
  * Create a new Granular client
2102
2148
  * @param options - Client configuration
@@ -2106,6 +2152,8 @@ declare class Granular {
2106
2152
  * Return an ontology-scoped handle for effects and other ontology-level APIs.
2107
2153
  */
2108
2154
  ontology(ontologyNameOrId: string): OntologyHandle;
2155
+ registerEnvironmentImporter(ontologyNameOrId: string, handler: EnvironmentImporterHandler): void;
2156
+ clearEnvironmentImporter(ontologyNameOrId: string): void;
2109
2157
  /**
2110
2158
  * Records/upserts a user and prepares them for sandbox connections
2111
2159
  *
@@ -2204,6 +2252,8 @@ declare class Granular {
2204
2252
  reopenSession(sessionId: string, options?: {
2205
2253
  clientId?: string;
2206
2254
  }): Promise<EnvironmentSession>;
2255
+ private resolveEnvironmentImporter;
2256
+ private maybeRunEnvironmentImporter;
2207
2257
  private bindEnvironmentHandle;
2208
2258
  private bindWebSocketEnvironmentSession;
2209
2259
  private activateEnvironment;
@@ -2349,4 +2399,4 @@ declare class Granular {
2349
2399
  private request;
2350
2400
  }
2351
2401
 
2352
- export { type SemanticVersionDiff as $, type AccessTokenProvider as A, type BuildPolicy as B, type ConnectOptions as C, type DomainState as D, type EndpointMode as E, type VersionTag as F, Granular as G, type EnvironmentData as H, type InstanceToolHandler as I, type CreateEnvironmentData as J, type EnvironmentListResponse as K, type Manifest as L, type ManifestEffectMetamodelSpec as M, type ManifestListResponse as N, OntologyHandle as O, type Prompt as P, type BuildStatus as Q, type ResolvedEffectBehaviors as R, type SessionHeapEntry as S, type ToolWithHandler as T, type User as U, type VersionTracking as V, WSClient as W, type Build as X, type Version as Y, type BuildListResponse as Z, type SemanticVersionDiffEntry as _, type EffectHandlerContext as a, type ManifestFilterBySpec as a$, type ResolvedEffectPostCondition as a0, type ResolvedEffectDryRun as a1, type ResolvedEffectReverse as a2, type ResolvedEffectApprovalRequired as a3, type EffectInvocationMode as a4, type EffectInvocationMetadata as a5, type EffectSchema as a6, type EffectWithHandler as a7, type PublishEffectsResult as a8, type EffectVersionSelector as a9, type SessionJobListOptions as aA, type SessionCollectionListResult as aB, type WSDisconnectInfo as aC, type WSReconnectErrorInfo as aD, type WSClientOptions as aE, type RPCRequest as aF, type RPCResponse as aG, type SyncMessage as aH, type RPCRequestFromServer as aI, type ToolInvokeParams as aJ, type ToolResultParams as aK, type ModelRef as aL, type RelationshipInfo as aM, type DefineRelationshipOptions as aN, type RecordObjectOptions as aO, type RecordObjectResult as aP, type RecordObjectsChunkInfo as aQ, type RecordObjectsOptions as aR, type RecordImportStatus as aS, type RecordImportItemStatus as aT, type RecordImportStats as aU, type RecordImportItem as aV, type RecordImport as aW, type EnvironmentRecordImportSummary as aX, type ManifestPropertySpec as aY, type ManifestValidationOperator as aZ, type ManifestEnumRuleSpec as a_, 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 ConversationMessageInput as aq, type ConversationAppendResult as ar, type SessionConversationMessage as as, type SessionTimelineEvent as at, type SessionJobRecord as au, type SessionHeapFieldType as av, type SessionHeapFieldValue as aw, type SessionHeapVariable as ax, type SessionDocumentResult as ay, type SessionCollectionListOptions as az, type SessionHeapList as b, type ManifestValidationRuleSpec as b0, type ManifestStateMachineStateSpec as b1, type ManifestStateMachineTransitionSpec as b2, type ManifestStateMachineSpec as b3, type ManifestPostConditionSpec as b4, type ManifestDryRunSpec as b5, type ManifestReverseSpec as b6, type ManifestApprovalRequiredSpec as b7, type ManifestRelationshipDef as b8, type ManifestEffectSchema as b9, type ManifestEffectDeclaration as ba, type ManifestEventTypeDef as bb, type ManifestEventStreamDef as bc, type ManifestOperation as bd, type ManifestImport as be, type ManifestVolume as bf, type ManifestContent as bg, type GraphQLResult as bh, type APIError as bi, type DeleteResponse as bj, type StreamEvent as bk, type StreamSubscription as bl, type StreamStats as bm, type SessionHeapSnapshot as c, type SessionTranscriptEntry as d, Environment as e, EnvironmentSession as f, Session as g, type ToolSchema as h, type PublishToolsResult as i, type ToolHandler as j, type GranularOptions as k, type GranularAuth as l, type RecordUserOptions as m, type Subject as n, type OpenEnvironmentOptions as o, type CreateSessionOptions as p, type ConversationSessionInfo as q, type Sandbox as r, type CreateSandboxData as s, type SandboxListResponse as t, type PermissionRules as u, type PermissionProfile as v, type CreatePermissionProfileData as w, type PermissionProfileListResponse as x, type Assignment as y, type AssignmentListResponse as z };
2402
+ export { type SemanticVersionDiff as $, type AccessTokenProvider as A, type BuildPolicy as B, type ConnectOptions as C, type DomainState as D, type EndpointMode as E, type VersionTag as F, Granular as G, type EnvironmentData as H, type InstanceToolHandler as I, type CreateEnvironmentData as J, type EnvironmentListResponse as K, type Manifest as L, type ManifestEffectMetamodelSpec as M, type ManifestListResponse as N, OntologyHandle as O, type Prompt as P, type BuildStatus as Q, type ResolvedEffectBehaviors as R, type SessionHeapEntry as S, type ToolWithHandler as T, type User as U, type VersionTracking as V, WSClient as W, type Build as X, type Version as Y, type BuildListResponse as Z, type SemanticVersionDiffEntry as _, type EffectHandlerContext as a, type EnvironmentImporterImportOptions as a$, type ResolvedEffectPostCondition as a0, type ResolvedEffectDryRun as a1, type ResolvedEffectReverse as a2, type ResolvedEffectApprovalRequired as a3, type EffectInvocationMode as a4, type EffectInvocationMetadata as a5, type EffectSchema as a6, type EffectWithHandler as a7, type PublishEffectsResult as a8, type EffectVersionSelector as a9, type SessionJobListOptions as aA, type SessionCollectionListResult as aB, type WSDisconnectInfo as aC, type WSReconnectErrorInfo as aD, type WSClientOptions as aE, type RPCRequest as aF, type RPCResponse as aG, type SyncMessage as aH, type RPCRequestFromServer as aI, type ToolInvokeParams as aJ, type ToolResultParams as aK, type ModelRef as aL, type RelationshipInfo as aM, type DefineRelationshipOptions as aN, type RecordObjectOptions as aO, type RecordObjectResult as aP, type RecordObjectsChunkInfo as aQ, type RecordObjectsOptions as aR, type RecordImportStatus as aS, type RecordImportItemStatus as aT, type RecordImportStats as aU, type RecordImportItem as aV, type RecordImport as aW, type EnvironmentRecordImportSummary as aX, type EnvironmentSetupTriggerReason as aY, type EnvironmentSetupLifecycleStatus as aZ, type EnvironmentSetupSummary as a_, 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 ConversationMessageInput as aq, type ConversationAppendResult as ar, type SessionConversationMessage as as, type SessionTimelineEvent as at, type SessionJobRecord as au, type SessionHeapFieldType as av, type SessionHeapFieldValue as aw, type SessionHeapVariable as ax, type SessionDocumentResult as ay, type SessionCollectionListOptions as az, type SessionHeapList as b, type EnvironmentImporter as b0, type ManifestPropertySpec as b1, type ManifestValidationOperator as b2, type ManifestEnumRuleSpec as b3, type ManifestFilterBySpec as b4, type ManifestValidationRuleSpec as b5, type ManifestStateMachineStateSpec as b6, type ManifestStateMachineTransitionSpec as b7, type ManifestStateMachineSpec as b8, type ManifestPostConditionSpec as b9, type ManifestDryRunSpec as ba, type ManifestReverseSpec as bb, type ManifestApprovalRequiredSpec as bc, type ManifestRelationshipDef as bd, type ManifestEffectSchema as be, type ManifestEffectDeclaration as bf, type ManifestEventTypeDef as bg, type ManifestEventStreamDef as bh, type ManifestOperation as bi, type ManifestImport as bj, type ManifestVolume as bk, type ManifestContent as bl, type GraphQLResult as bm, type APIError as bn, type DeleteResponse as bo, type StreamEvent as bp, type StreamSubscription as bq, type StreamStats as br, type SessionHeapSnapshot as c, type SessionTranscriptEntry as d, Environment as e, EnvironmentSession as f, Session as g, type ToolSchema as h, type PublishToolsResult as i, type ToolHandler as j, type GranularOptions as k, type GranularAuth as l, type RecordUserOptions as m, type Subject as n, type OpenEnvironmentOptions as o, type CreateSessionOptions as p, type ConversationSessionInfo as q, type Sandbox as r, type CreateSandboxData as s, type SandboxListResponse as t, type PermissionRules as u, type PermissionProfile as v, type CreatePermissionProfileData as w, type PermissionProfileListResponse as x, type Assignment as y, type AssignmentListResponse as z };
@@ -313,6 +313,7 @@ interface EnvironmentData {
313
313
  tag?: VersionTag | null;
314
314
  tracking?: BuildPolicy;
315
315
  buildPolicy: BuildPolicy;
316
+ setup?: EnvironmentSetupSummary | null;
316
317
  updateState?: "up_to_date" | "update_available" | "upgrading" | "failed";
317
318
  createdAt: number;
318
319
  updatedAt: number;
@@ -1105,6 +1106,7 @@ interface RecordImport {
1105
1106
  environmentId: string;
1106
1107
  sandboxId: string;
1107
1108
  subjectId: string;
1109
+ setupRunId?: string | null;
1108
1110
  status: RecordImportStatus;
1109
1111
  batchSize: number;
1110
1112
  errorMessage: string | null;
@@ -1121,6 +1123,37 @@ interface EnvironmentRecordImportSummary extends RecordImportStats {
1121
1123
  activeImports: number;
1122
1124
  updatedAt: number;
1123
1125
  }
1126
+ type EnvironmentSetupTriggerReason = "new_environment" | "fresh_after_version_update";
1127
+ type EnvironmentSetupLifecycleStatus = "running" | "completed" | "failed";
1128
+ interface EnvironmentSetupSummary extends RecordImportStats {
1129
+ setupRunId: string;
1130
+ environmentId: string;
1131
+ sandboxId: string;
1132
+ subjectId: string;
1133
+ triggerReason: EnvironmentSetupTriggerReason;
1134
+ lifecycleStatus: EnvironmentSetupLifecycleStatus;
1135
+ stage: string | null;
1136
+ totalObjectsToImport: number;
1137
+ totalImports: number;
1138
+ activeImports: number;
1139
+ errorMessage: string | null;
1140
+ startedAt: number;
1141
+ hookCompletedAt: number | null;
1142
+ finishedAt: number | null;
1143
+ updatedAt: number;
1144
+ }
1145
+ interface EnvironmentImporterImportOptions {
1146
+ batchSize?: number;
1147
+ }
1148
+ interface EnvironmentImporter {
1149
+ environmentId: string;
1150
+ sandboxId: string;
1151
+ subjectId: string;
1152
+ reason: EnvironmentSetupTriggerReason;
1153
+ incrementTotalObjectsToImportCount: (n: number) => Promise<void>;
1154
+ setStage: (stage: string | null) => Promise<void>;
1155
+ importRecords: (records: RecordObjectOptions[], options?: EnvironmentImporterImportOptions) => Promise<RecordImport>;
1156
+ }
1124
1157
  /**
1125
1158
  * Property specification in a manifest operation
1126
1159
  */
@@ -1577,6 +1610,7 @@ declare class Session {
1577
1610
  private checkForToolChanges;
1578
1611
  }
1579
1612
 
1613
+ type EnvironmentImporterHandler = (importer: EnvironmentImporter) => Promise<void> | void;
1580
1614
  /**
1581
1615
  * Environment is the sessionless handle for one resolved ontology environment.
1582
1616
  *
@@ -1612,6 +1646,8 @@ declare class Environment {
1612
1646
  get buildPolicy(): BuildPolicy;
1613
1647
  /** The current update state relative to the followed tag */
1614
1648
  get updateState(): EnvironmentData["updateState"];
1649
+ /** The latest setup/import run summary for this environment, when available. */
1650
+ get setup(): EnvironmentSetupSummary | null;
1615
1651
  /** Convenience flag for whether this environment trails the current tag target */
1616
1652
  get isOutdated(): boolean;
1617
1653
  /** The followed tag name when this environment is tag-tracked */
@@ -1622,6 +1658,7 @@ declare class Environment {
1622
1658
  get authToken(): string;
1623
1659
  /** Base runtime URL derived from the GraphQL endpoint */
1624
1660
  get runtimeBaseUrl(): string;
1661
+ syncEnvironmentData(envData: EnvironmentData): void;
1625
1662
  get sessions(): {
1626
1663
  list: (options?: {
1627
1664
  status?: "active" | "closed" | "all";
@@ -1926,6 +1963,7 @@ declare class Environment {
1926
1963
  */
1927
1964
  enqueueRecordImport(records: RecordObjectOptions[], options?: {
1928
1965
  batchSize?: number;
1966
+ setupRunId?: string;
1929
1967
  }): Promise<RecordImport>;
1930
1968
  /**
1931
1969
  * List queued or completed record imports for this environment.
@@ -2081,6 +2119,10 @@ declare class OntologyHandle {
2081
2119
  clear: () => Promise<void>;
2082
2120
  disconnect: () => Promise<void>;
2083
2121
  };
2122
+ get importer(): {
2123
+ onEnvironmentCreate: (handler: EnvironmentImporterHandler) => void;
2124
+ clear: () => void;
2125
+ };
2084
2126
  }
2085
2127
  declare class Granular {
2086
2128
  private apiKey;
@@ -2097,6 +2139,10 @@ declare class Granular {
2097
2139
  private sandboxEffectHosts;
2098
2140
  /** In-flight host connection promises to avoid duplicate concurrent connects */
2099
2141
  private sandboxEffectHostPromises;
2142
+ /** Ontology-bound environment importer hooks keyed by the caller's ontology identifier. */
2143
+ private ontologyImporters;
2144
+ /** Resolved importer hooks keyed by sandboxId for fast lookups during openEnvironment(). */
2145
+ private sandboxImporters;
2100
2146
  /**
2101
2147
  * Create a new Granular client
2102
2148
  * @param options - Client configuration
@@ -2106,6 +2152,8 @@ declare class Granular {
2106
2152
  * Return an ontology-scoped handle for effects and other ontology-level APIs.
2107
2153
  */
2108
2154
  ontology(ontologyNameOrId: string): OntologyHandle;
2155
+ registerEnvironmentImporter(ontologyNameOrId: string, handler: EnvironmentImporterHandler): void;
2156
+ clearEnvironmentImporter(ontologyNameOrId: string): void;
2109
2157
  /**
2110
2158
  * Records/upserts a user and prepares them for sandbox connections
2111
2159
  *
@@ -2204,6 +2252,8 @@ declare class Granular {
2204
2252
  reopenSession(sessionId: string, options?: {
2205
2253
  clientId?: string;
2206
2254
  }): Promise<EnvironmentSession>;
2255
+ private resolveEnvironmentImporter;
2256
+ private maybeRunEnvironmentImporter;
2207
2257
  private bindEnvironmentHandle;
2208
2258
  private bindWebSocketEnvironmentSession;
2209
2259
  private activateEnvironment;
@@ -2349,4 +2399,4 @@ declare class Granular {
2349
2399
  private request;
2350
2400
  }
2351
2401
 
2352
- export { type SemanticVersionDiff as $, type AccessTokenProvider as A, type BuildPolicy as B, type ConnectOptions as C, type DomainState as D, type EndpointMode as E, type VersionTag as F, Granular as G, type EnvironmentData as H, type InstanceToolHandler as I, type CreateEnvironmentData as J, type EnvironmentListResponse as K, type Manifest as L, type ManifestEffectMetamodelSpec as M, type ManifestListResponse as N, OntologyHandle as O, type Prompt as P, type BuildStatus as Q, type ResolvedEffectBehaviors as R, type SessionHeapEntry as S, type ToolWithHandler as T, type User as U, type VersionTracking as V, WSClient as W, type Build as X, type Version as Y, type BuildListResponse as Z, type SemanticVersionDiffEntry as _, type EffectHandlerContext as a, type ManifestFilterBySpec as a$, type ResolvedEffectPostCondition as a0, type ResolvedEffectDryRun as a1, type ResolvedEffectReverse as a2, type ResolvedEffectApprovalRequired as a3, type EffectInvocationMode as a4, type EffectInvocationMetadata as a5, type EffectSchema as a6, type EffectWithHandler as a7, type PublishEffectsResult as a8, type EffectVersionSelector as a9, type SessionJobListOptions as aA, type SessionCollectionListResult as aB, type WSDisconnectInfo as aC, type WSReconnectErrorInfo as aD, type WSClientOptions as aE, type RPCRequest as aF, type RPCResponse as aG, type SyncMessage as aH, type RPCRequestFromServer as aI, type ToolInvokeParams as aJ, type ToolResultParams as aK, type ModelRef as aL, type RelationshipInfo as aM, type DefineRelationshipOptions as aN, type RecordObjectOptions as aO, type RecordObjectResult as aP, type RecordObjectsChunkInfo as aQ, type RecordObjectsOptions as aR, type RecordImportStatus as aS, type RecordImportItemStatus as aT, type RecordImportStats as aU, type RecordImportItem as aV, type RecordImport as aW, type EnvironmentRecordImportSummary as aX, type ManifestPropertySpec as aY, type ManifestValidationOperator as aZ, type ManifestEnumRuleSpec as a_, 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 ConversationMessageInput as aq, type ConversationAppendResult as ar, type SessionConversationMessage as as, type SessionTimelineEvent as at, type SessionJobRecord as au, type SessionHeapFieldType as av, type SessionHeapFieldValue as aw, type SessionHeapVariable as ax, type SessionDocumentResult as ay, type SessionCollectionListOptions as az, type SessionHeapList as b, type ManifestValidationRuleSpec as b0, type ManifestStateMachineStateSpec as b1, type ManifestStateMachineTransitionSpec as b2, type ManifestStateMachineSpec as b3, type ManifestPostConditionSpec as b4, type ManifestDryRunSpec as b5, type ManifestReverseSpec as b6, type ManifestApprovalRequiredSpec as b7, type ManifestRelationshipDef as b8, type ManifestEffectSchema as b9, type ManifestEffectDeclaration as ba, type ManifestEventTypeDef as bb, type ManifestEventStreamDef as bc, type ManifestOperation as bd, type ManifestImport as be, type ManifestVolume as bf, type ManifestContent as bg, type GraphQLResult as bh, type APIError as bi, type DeleteResponse as bj, type StreamEvent as bk, type StreamSubscription as bl, type StreamStats as bm, type SessionHeapSnapshot as c, type SessionTranscriptEntry as d, Environment as e, EnvironmentSession as f, Session as g, type ToolSchema as h, type PublishToolsResult as i, type ToolHandler as j, type GranularOptions as k, type GranularAuth as l, type RecordUserOptions as m, type Subject as n, type OpenEnvironmentOptions as o, type CreateSessionOptions as p, type ConversationSessionInfo as q, type Sandbox as r, type CreateSandboxData as s, type SandboxListResponse as t, type PermissionRules as u, type PermissionProfile as v, type CreatePermissionProfileData as w, type PermissionProfileListResponse as x, type Assignment as y, type AssignmentListResponse as z };
2402
+ export { type SemanticVersionDiff as $, type AccessTokenProvider as A, type BuildPolicy as B, type ConnectOptions as C, type DomainState as D, type EndpointMode as E, type VersionTag as F, Granular as G, type EnvironmentData as H, type InstanceToolHandler as I, type CreateEnvironmentData as J, type EnvironmentListResponse as K, type Manifest as L, type ManifestEffectMetamodelSpec as M, type ManifestListResponse as N, OntologyHandle as O, type Prompt as P, type BuildStatus as Q, type ResolvedEffectBehaviors as R, type SessionHeapEntry as S, type ToolWithHandler as T, type User as U, type VersionTracking as V, WSClient as W, type Build as X, type Version as Y, type BuildListResponse as Z, type SemanticVersionDiffEntry as _, type EffectHandlerContext as a, type EnvironmentImporterImportOptions as a$, type ResolvedEffectPostCondition as a0, type ResolvedEffectDryRun as a1, type ResolvedEffectReverse as a2, type ResolvedEffectApprovalRequired as a3, type EffectInvocationMode as a4, type EffectInvocationMetadata as a5, type EffectSchema as a6, type EffectWithHandler as a7, type PublishEffectsResult as a8, type EffectVersionSelector as a9, type SessionJobListOptions as aA, type SessionCollectionListResult as aB, type WSDisconnectInfo as aC, type WSReconnectErrorInfo as aD, type WSClientOptions as aE, type RPCRequest as aF, type RPCResponse as aG, type SyncMessage as aH, type RPCRequestFromServer as aI, type ToolInvokeParams as aJ, type ToolResultParams as aK, type ModelRef as aL, type RelationshipInfo as aM, type DefineRelationshipOptions as aN, type RecordObjectOptions as aO, type RecordObjectResult as aP, type RecordObjectsChunkInfo as aQ, type RecordObjectsOptions as aR, type RecordImportStatus as aS, type RecordImportItemStatus as aT, type RecordImportStats as aU, type RecordImportItem as aV, type RecordImport as aW, type EnvironmentRecordImportSummary as aX, type EnvironmentSetupTriggerReason as aY, type EnvironmentSetupLifecycleStatus as aZ, type EnvironmentSetupSummary as a_, 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 ConversationMessageInput as aq, type ConversationAppendResult as ar, type SessionConversationMessage as as, type SessionTimelineEvent as at, type SessionJobRecord as au, type SessionHeapFieldType as av, type SessionHeapFieldValue as aw, type SessionHeapVariable as ax, type SessionDocumentResult as ay, type SessionCollectionListOptions as az, type SessionHeapList as b, type EnvironmentImporter as b0, type ManifestPropertySpec as b1, type ManifestValidationOperator as b2, type ManifestEnumRuleSpec as b3, type ManifestFilterBySpec as b4, type ManifestValidationRuleSpec as b5, type ManifestStateMachineStateSpec as b6, type ManifestStateMachineTransitionSpec as b7, type ManifestStateMachineSpec as b8, type ManifestPostConditionSpec as b9, type ManifestDryRunSpec as ba, type ManifestReverseSpec as bb, type ManifestApprovalRequiredSpec as bc, type ManifestRelationshipDef as bd, type ManifestEffectSchema as be, type ManifestEffectDeclaration as bf, type ManifestEventTypeDef as bg, type ManifestEventStreamDef as bh, type ManifestOperation as bi, type ManifestImport as bj, type ManifestVolume as bk, type ManifestContent as bl, type GraphQLResult as bm, type APIError as bn, type DeleteResponse as bo, type StreamEvent as bp, type StreamSubscription as bq, type StreamStats as br, type SessionHeapSnapshot as c, type SessionTranscriptEntry as d, Environment as e, EnvironmentSession as f, Session as g, type ToolSchema as h, type PublishToolsResult as i, type ToolHandler as j, type GranularOptions as k, type GranularAuth as l, type RecordUserOptions as m, type Subject as n, type OpenEnvironmentOptions as o, type CreateSessionOptions as p, type ConversationSessionInfo as q, type Sandbox as r, type CreateSandboxData as s, type SandboxListResponse as t, type PermissionRules as u, type PermissionProfile as v, type CreatePermissionProfileData as w, type PermissionProfileListResponse as x, type Assignment as y, type AssignmentListResponse as z };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { E as EndpointMode, T as ToolWithHandler, a as EffectHandlerContext, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, S as SessionHeapEntry, b as SessionHeapList, c as SessionHeapSnapshot, P as Prompt, d as SessionTranscriptEntry } from './client-iw76FL_8.mjs';
2
- export { bi as APIError, A as AccessTokenProvider, y as Assignment, z as AssignmentListResponse, X as Build, Z as BuildListResponse, B as BuildPolicy, Q as BuildStatus, C as ConnectOptions, ar as ConversationAppendResult, aq as ConversationMessageInput, ap as ConversationMessageShowRefs, q as ConversationSessionInfo, J as CreateEnvironmentData, w as CreatePermissionProfileData, s as CreateSandboxData, p as CreateSessionOptions, aN as DefineRelationshipOptions, bj as DeleteResponse, D as DomainState, ae as EffectHandler, ab as EffectInfo, a5 as EffectInvocationMetadata, a4 as EffectInvocationMode, a6 as EffectSchema, a9 as EffectVersionSelector, a7 as EffectWithHandler, ad as EffectsChangedEvent, e as Environment, H as EnvironmentData, am as EnvironmentFeedbackRecord, K as EnvironmentListResponse, aX as EnvironmentRecordImportSummary, f as EnvironmentSession, G as Granular, l as GranularAuth, k as GranularOptions, bh as GraphQLResult, af as InstanceEffectHandler, I as InstanceToolHandler, ao as Job, ak as JobFeedbackInput, aj as JobFeedbackMetadata, al as JobFeedbackRecord, ah as JobFeedbackSentiment, ai as JobFeedbackToolCall, ag as JobStatus, an as JobSubmitResult, L as Manifest, b7 as ManifestApprovalRequiredSpec, bg as ManifestContent, b5 as ManifestDryRunSpec, ba as ManifestEffectDeclaration, b9 as ManifestEffectSchema, a_ as ManifestEnumRuleSpec, bc as ManifestEventStreamDef, bb as ManifestEventTypeDef, a$ as ManifestFilterBySpec, be as ManifestImport, N as ManifestListResponse, bd as ManifestOperation, b4 as ManifestPostConditionSpec, aY as ManifestPropertySpec, b8 as ManifestRelationshipDef, b6 as ManifestReverseSpec, b3 as ManifestStateMachineSpec, b1 as ManifestStateMachineStateSpec, b2 as ManifestStateMachineTransitionSpec, aZ as ManifestValidationOperator, b0 as ManifestValidationRuleSpec, bf as ManifestVolume, aL as ModelRef, O as OntologyHandle, o as OpenEnvironmentOptions, v as PermissionProfile, x as PermissionProfileListResponse, u as PermissionRules, a8 as PublishEffectsResult, i as PublishToolsResult, aF as RPCRequest, aI as RPCRequestFromServer, aG as RPCResponse, aW as RecordImport, aV as RecordImportItem, aT as RecordImportItemStatus, aU as RecordImportStats, aS as RecordImportStatus, aO as RecordObjectOptions, aP as RecordObjectResult, aQ as RecordObjectsChunkInfo, aR as RecordObjectsOptions, m as RecordUserOptions, aM as RelationshipInfo, a3 as ResolvedEffectApprovalRequired, a1 as ResolvedEffectDryRun, a0 as ResolvedEffectPostCondition, a2 as ResolvedEffectReverse, r as Sandbox, t as SandboxListResponse, $ as SemanticVersionDiff, _ as SemanticVersionDiffEntry, g as Session, az as SessionCollectionListOptions, aB as SessionCollectionListResult, as as SessionConversationMessage, ay as SessionDocumentResult, av as SessionHeapFieldType, aw as SessionHeapFieldValue, ax as SessionHeapVariable, aA as SessionJobListOptions, au as SessionJobRecord, at as SessionTimelineEvent, bk as StreamEvent, bm as StreamStats, bl as StreamSubscription, n as Subject, aH as SyncMessage, j as ToolHandler, aa as ToolInfo, aJ as ToolInvokeParams, aK as ToolResultParams, h as ToolSchema, ac as ToolsChangedEvent, U as User, Y as Version, F as VersionTag, V as VersionTracking, W as WSClient, aE as WSClientOptions, aC as WSDisconnectInfo, aD as WSReconnectErrorInfo } from './client-iw76FL_8.mjs';
1
+ import { E as EndpointMode, T as ToolWithHandler, a as EffectHandlerContext, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, S as SessionHeapEntry, b as SessionHeapList, c as SessionHeapSnapshot, P as Prompt, d as SessionTranscriptEntry } from './client-Cq8onk2D.mjs';
2
+ export { bn as APIError, A as AccessTokenProvider, y as Assignment, z as AssignmentListResponse, X as Build, Z as BuildListResponse, B as BuildPolicy, Q as BuildStatus, C as ConnectOptions, ar as ConversationAppendResult, aq as ConversationMessageInput, ap as ConversationMessageShowRefs, q as ConversationSessionInfo, J as CreateEnvironmentData, w as CreatePermissionProfileData, s as CreateSandboxData, p as CreateSessionOptions, aN as DefineRelationshipOptions, bo as DeleteResponse, D as DomainState, ae as EffectHandler, ab as EffectInfo, a5 as EffectInvocationMetadata, a4 as EffectInvocationMode, a6 as EffectSchema, a9 as EffectVersionSelector, a7 as EffectWithHandler, ad as EffectsChangedEvent, e as Environment, H as EnvironmentData, am as EnvironmentFeedbackRecord, b0 as EnvironmentImporter, a$ as EnvironmentImporterImportOptions, K as EnvironmentListResponse, aX as EnvironmentRecordImportSummary, f as EnvironmentSession, aZ as EnvironmentSetupLifecycleStatus, a_ as EnvironmentSetupSummary, aY as EnvironmentSetupTriggerReason, G as Granular, l as GranularAuth, k as GranularOptions, bm as GraphQLResult, af as InstanceEffectHandler, I as InstanceToolHandler, ao as Job, ak as JobFeedbackInput, aj as JobFeedbackMetadata, al as JobFeedbackRecord, ah as JobFeedbackSentiment, ai as JobFeedbackToolCall, ag as JobStatus, an as JobSubmitResult, L as Manifest, bc as ManifestApprovalRequiredSpec, bl as ManifestContent, ba as ManifestDryRunSpec, bf as ManifestEffectDeclaration, be as ManifestEffectSchema, b3 as ManifestEnumRuleSpec, bh as ManifestEventStreamDef, bg as ManifestEventTypeDef, b4 as ManifestFilterBySpec, bj as ManifestImport, N as ManifestListResponse, bi as ManifestOperation, b9 as ManifestPostConditionSpec, b1 as ManifestPropertySpec, bd as ManifestRelationshipDef, bb as ManifestReverseSpec, b8 as ManifestStateMachineSpec, b6 as ManifestStateMachineStateSpec, b7 as ManifestStateMachineTransitionSpec, b2 as ManifestValidationOperator, b5 as ManifestValidationRuleSpec, bk as ManifestVolume, aL as ModelRef, O as OntologyHandle, o as OpenEnvironmentOptions, v as PermissionProfile, x as PermissionProfileListResponse, u as PermissionRules, a8 as PublishEffectsResult, i as PublishToolsResult, aF as RPCRequest, aI as RPCRequestFromServer, aG as RPCResponse, aW as RecordImport, aV as RecordImportItem, aT as RecordImportItemStatus, aU as RecordImportStats, aS as RecordImportStatus, aO as RecordObjectOptions, aP as RecordObjectResult, aQ as RecordObjectsChunkInfo, aR as RecordObjectsOptions, m as RecordUserOptions, aM as RelationshipInfo, a3 as ResolvedEffectApprovalRequired, a1 as ResolvedEffectDryRun, a0 as ResolvedEffectPostCondition, a2 as ResolvedEffectReverse, r as Sandbox, t as SandboxListResponse, $ as SemanticVersionDiff, _ as SemanticVersionDiffEntry, g as Session, az as SessionCollectionListOptions, aB as SessionCollectionListResult, as as SessionConversationMessage, ay as SessionDocumentResult, av as SessionHeapFieldType, aw as SessionHeapFieldValue, ax as SessionHeapVariable, aA as SessionJobListOptions, au as SessionJobRecord, at as SessionTimelineEvent, bp as StreamEvent, br as StreamStats, bq as StreamSubscription, n as Subject, aH as SyncMessage, j as ToolHandler, aa as ToolInfo, aJ as ToolInvokeParams, aK as ToolResultParams, h as ToolSchema, ac as ToolsChangedEvent, U as User, Y as Version, F as VersionTag, V as VersionTracking, W as WSClient, aE as WSClientOptions, aC as WSDisconnectInfo, aD as WSReconnectErrorInfo } from './client-Cq8onk2D.mjs';
3
3
  export { BuildGranularAgentSystemPromptInput, GeneratedJobCodeIssue, GranularAgentExecutionCheckpoint, GranularAgentHeapSummaryOptions, GranularAgentReferentFocus, GranularAgentSessionContext, GranularAgentToolInfo, GranularAgentWorkflowFocus, HarnessContinuationDecision, HarnessControllerBudgets, HarnessProjectionOptions, HarnessPromptLike, HarnessVerifierSnapshot, HarnessVerifierSnapshotInput, buildContinuationInstruction, buildGranularAgentCheckpointBlock, buildGranularAgentDomainBlock, buildGranularAgentHeapBlock, buildGranularAgentLoopBlock, buildGranularAgentReferentBlock, buildGranularAgentSessionBlock, buildGranularAgentSystemPrompt, buildGranularAgentToolBlock, buildGranularAgentWorkflowBlock, createHarnessVerifierSnapshot, evaluateContinuation, getCurrentClosureId, getExclusivePromptTarget, hasOpenPrompt, projectConversationReferentFocus, projectConversationReferentSummary, projectHeapSummary, projectLoopSummary, projectWorkflowFocus, projectWorkflowSummary, reviewGeneratedJobCode } from './agent-harness.mjs';
4
4
  import '@automerge/automerge';
5
5
  import '@automerge/automerge/slim';