@granular-software/sdk 0.4.35 → 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/agent-evals.js +35 -7
- package/dist/agent-evals.js.map +1 -1
- package/dist/agent-evals.mjs +35 -7
- package/dist/agent-evals.mjs.map +1 -1
- package/dist/cli/index.js +35 -7
- package/dist/index.js +35 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -21818,13 +21818,27 @@ var Granular = class _Granular {
|
|
|
21818
21818
|
registerEnvironmentImporter(ontologyNameOrId, handler) {
|
|
21819
21819
|
this.ontologyImporters.set(ontologyNameOrId, handler);
|
|
21820
21820
|
if (ontologyNameOrId.startsWith("sbx_")) {
|
|
21821
|
-
this.sandboxImporters.set(ontologyNameOrId,
|
|
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
|
+
}
|
|
21822
21834
|
}
|
|
21823
21835
|
}
|
|
21824
21836
|
clearEnvironmentImporter(ontologyNameOrId) {
|
|
21825
21837
|
this.ontologyImporters.delete(ontologyNameOrId);
|
|
21826
|
-
|
|
21827
|
-
|
|
21838
|
+
for (const [sandboxId, importer] of this.sandboxImporters.entries()) {
|
|
21839
|
+
if (importer.sourceOntology === ontologyNameOrId) {
|
|
21840
|
+
this.sandboxImporters.delete(sandboxId);
|
|
21841
|
+
}
|
|
21828
21842
|
}
|
|
21829
21843
|
}
|
|
21830
21844
|
/**
|
|
@@ -22185,11 +22199,25 @@ var Granular = class _Granular {
|
|
|
22185
22199
|
return this.connectSession({ sessionId, clientId: options?.clientId });
|
|
22186
22200
|
}
|
|
22187
22201
|
resolveEnvironmentImporter(requestedOntology, sandboxId) {
|
|
22188
|
-
const
|
|
22189
|
-
if (
|
|
22190
|
-
this.
|
|
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);
|
|
22191
22211
|
}
|
|
22192
|
-
|
|
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;
|
|
22193
22221
|
}
|
|
22194
22222
|
async maybeRunEnvironmentImporter(resolved, environment) {
|
|
22195
22223
|
if (!resolved.setupTriggerReason) {
|
package/dist/index.js
CHANGED
|
@@ -13886,13 +13886,27 @@ var Granular = class _Granular {
|
|
|
13886
13886
|
registerEnvironmentImporter(ontologyNameOrId, handler) {
|
|
13887
13887
|
this.ontologyImporters.set(ontologyNameOrId, handler);
|
|
13888
13888
|
if (ontologyNameOrId.startsWith("sbx_")) {
|
|
13889
|
-
this.sandboxImporters.set(ontologyNameOrId,
|
|
13889
|
+
this.sandboxImporters.set(ontologyNameOrId, {
|
|
13890
|
+
handler,
|
|
13891
|
+
sourceOntology: ontologyNameOrId
|
|
13892
|
+
});
|
|
13893
|
+
return;
|
|
13894
|
+
}
|
|
13895
|
+
for (const [sandboxId, importer] of this.sandboxImporters.entries()) {
|
|
13896
|
+
if (importer.sourceOntology === ontologyNameOrId) {
|
|
13897
|
+
this.sandboxImporters.set(sandboxId, {
|
|
13898
|
+
handler,
|
|
13899
|
+
sourceOntology: ontologyNameOrId
|
|
13900
|
+
});
|
|
13901
|
+
}
|
|
13890
13902
|
}
|
|
13891
13903
|
}
|
|
13892
13904
|
clearEnvironmentImporter(ontologyNameOrId) {
|
|
13893
13905
|
this.ontologyImporters.delete(ontologyNameOrId);
|
|
13894
|
-
|
|
13895
|
-
|
|
13906
|
+
for (const [sandboxId, importer] of this.sandboxImporters.entries()) {
|
|
13907
|
+
if (importer.sourceOntology === ontologyNameOrId) {
|
|
13908
|
+
this.sandboxImporters.delete(sandboxId);
|
|
13909
|
+
}
|
|
13896
13910
|
}
|
|
13897
13911
|
}
|
|
13898
13912
|
/**
|
|
@@ -14253,11 +14267,25 @@ var Granular = class _Granular {
|
|
|
14253
14267
|
return this.connectSession({ sessionId, clientId: options?.clientId });
|
|
14254
14268
|
}
|
|
14255
14269
|
resolveEnvironmentImporter(requestedOntology, sandboxId) {
|
|
14256
|
-
const
|
|
14257
|
-
if (
|
|
14258
|
-
this.
|
|
14270
|
+
const sandboxImporter = this.sandboxImporters.get(sandboxId);
|
|
14271
|
+
if (sandboxImporter) {
|
|
14272
|
+
const sourceImporter = this.ontologyImporters.get(
|
|
14273
|
+
sandboxImporter.sourceOntology
|
|
14274
|
+
);
|
|
14275
|
+
if (sourceImporter === sandboxImporter.handler) {
|
|
14276
|
+
return sandboxImporter.handler;
|
|
14277
|
+
}
|
|
14278
|
+
this.sandboxImporters.delete(sandboxId);
|
|
14259
14279
|
}
|
|
14260
|
-
|
|
14280
|
+
const ontologyImporter = this.ontologyImporters.get(requestedOntology);
|
|
14281
|
+
if (!ontologyImporter) {
|
|
14282
|
+
return void 0;
|
|
14283
|
+
}
|
|
14284
|
+
this.sandboxImporters.set(sandboxId, {
|
|
14285
|
+
handler: ontologyImporter,
|
|
14286
|
+
sourceOntology: requestedOntology
|
|
14287
|
+
});
|
|
14288
|
+
return ontologyImporter;
|
|
14261
14289
|
}
|
|
14262
14290
|
async maybeRunEnvironmentImporter(resolved, environment) {
|
|
14263
14291
|
if (!resolved.setupTriggerReason) {
|