@granular-software/sdk 0.4.51 → 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.
- package/dist/agent-evals.d.mts +2 -2
- package/dist/agent-evals.d.ts +2 -2
- package/dist/agent-evals.js +236 -31
- package/dist/agent-evals.js.map +1 -1
- package/dist/agent-evals.mjs +236 -31
- package/dist/agent-evals.mjs.map +1 -1
- package/dist/cli/index.js +267 -50
- package/dist/{client-djorlOpn.d.mts → client-B2OyGOHE.d.mts} +18 -3
- package/dist/{client-NSH-tpNU.d.ts → client-BMfjRJTs.d.ts} +18 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +236 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +236 -31
- package/dist/index.mjs.map +1 -1
- package/dist/{spend-BA-jZwZ0.d.mts → spend-DpRRCrAr.d.mts} +37 -2
- package/dist/{spend-BA-jZwZ0.d.ts → spend-DpRRCrAr.d.ts} +37 -2
- package/dist/spend.d.mts +1 -1
- package/dist/spend.d.ts +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -7898,14 +7898,14 @@ var ApiClient = class {
|
|
|
7898
7898
|
async getVersion(versionId) {
|
|
7899
7899
|
return this.request(`/control/versions/${versionId}`);
|
|
7900
7900
|
}
|
|
7901
|
-
async triggerBuild(sandboxId, manifestId) {
|
|
7901
|
+
async triggerBuild(sandboxId, manifestId, releaseKey) {
|
|
7902
7902
|
return this.request(`/control/sandboxes/${sandboxId}/builds`, {
|
|
7903
7903
|
method: "POST",
|
|
7904
|
-
body: JSON.stringify({ manifestId })
|
|
7904
|
+
body: JSON.stringify({ manifestId, releaseKey })
|
|
7905
7905
|
});
|
|
7906
7906
|
}
|
|
7907
|
-
async createVersion(sandboxId, manifestId) {
|
|
7908
|
-
return this.triggerBuild(sandboxId, manifestId);
|
|
7907
|
+
async createVersion(sandboxId, manifestId, releaseKey) {
|
|
7908
|
+
return this.triggerBuild(sandboxId, manifestId, releaseKey);
|
|
7909
7909
|
}
|
|
7910
7910
|
async listTags(sandboxId) {
|
|
7911
7911
|
const result = await this.request(
|
|
@@ -18947,7 +18947,7 @@ async function deployCommand(options = {}) {
|
|
|
18947
18947
|
]);
|
|
18948
18948
|
const devTag = tags.find((tag2) => tag2.name === "dev");
|
|
18949
18949
|
const prodTag = tags.find((tag2) => tag2.name === "prod");
|
|
18950
|
-
const existingVersion = versions.find(
|
|
18950
|
+
const existingVersion = options.releaseKey ? null : versions.find(
|
|
18951
18951
|
(version2) => version2.manifestDigest === uploadedManifest.digest
|
|
18952
18952
|
) || null;
|
|
18953
18953
|
const existingVersionId = existingVersion?.buildId || null;
|
|
@@ -18965,19 +18965,27 @@ async function deployCommand(options = {}) {
|
|
|
18965
18965
|
} else {
|
|
18966
18966
|
const version2 = await api.createVersion(
|
|
18967
18967
|
config.sandboxId,
|
|
18968
|
-
uploadedManifest.manifestId
|
|
18969
|
-
|
|
18970
|
-
const startTime = Date.now();
|
|
18971
|
-
building.text = ` Running build for version... ${brand.muted(version2.buildId)}`;
|
|
18972
|
-
completed = await api.waitForVersionBuild(version2.buildId, (status) => {
|
|
18973
|
-
const elapsed = Math.round((Date.now() - startTime) / 1e3);
|
|
18974
|
-
building.text = ` Running build for version... ${brand.muted(`${status} (${elapsed}s)`)}`;
|
|
18975
|
-
});
|
|
18976
|
-
totalTime = Math.round((Date.now() - startTime) / 1e3);
|
|
18977
|
-
deployedToDev = true;
|
|
18978
|
-
building.succeed(
|
|
18979
|
-
` Dev now points to ${brand.secondary(completed.buildId)} (${totalTime}s)`
|
|
18968
|
+
uploadedManifest.manifestId,
|
|
18969
|
+
options.releaseKey
|
|
18980
18970
|
);
|
|
18971
|
+
if (version2.createdNewVersion === false && version2.status === "completed") {
|
|
18972
|
+
completed = version2;
|
|
18973
|
+
building.succeed(
|
|
18974
|
+
` Reused ${brand.secondary(version2.buildId)}; the release key is unchanged.`
|
|
18975
|
+
);
|
|
18976
|
+
} else {
|
|
18977
|
+
const startTime = Date.now();
|
|
18978
|
+
building.text = ` Running build for version... ${brand.muted(version2.buildId)}`;
|
|
18979
|
+
completed = await api.waitForVersionBuild(version2.buildId, (status) => {
|
|
18980
|
+
const elapsed = Math.round((Date.now() - startTime) / 1e3);
|
|
18981
|
+
building.text = ` Running build for version... ${brand.muted(`${status} (${elapsed}s)`)}`;
|
|
18982
|
+
});
|
|
18983
|
+
totalTime = Math.round((Date.now() - startTime) / 1e3);
|
|
18984
|
+
deployedToDev = true;
|
|
18985
|
+
building.succeed(
|
|
18986
|
+
` Dev now points to ${brand.secondary(completed.buildId)} (${totalTime}s)`
|
|
18987
|
+
);
|
|
18988
|
+
}
|
|
18981
18989
|
}
|
|
18982
18990
|
if (!completed) {
|
|
18983
18991
|
throw new Error("Could not resolve the current ontology version.");
|
|
@@ -19008,6 +19016,7 @@ async function deployCommand(options = {}) {
|
|
|
19008
19016
|
Release: options.prod ? deployedToDev ? "dev and prod now point to this version" : "prod promoted to the version already on dev" : "dev updated to this version",
|
|
19009
19017
|
"Agent doc": "GRANULAR_SANDBOX.md"
|
|
19010
19018
|
});
|
|
19019
|
+
console.log(`GRANULAR_RELEASE_CHANGED=${deployedToDev ? "true" : "false"}`);
|
|
19011
19020
|
console.log();
|
|
19012
19021
|
if (options.prod) {
|
|
19013
19022
|
info(
|
|
@@ -23201,7 +23210,8 @@ function normalizeEnvironmentSetupSummary(setup) {
|
|
|
23201
23210
|
environmentId: String(setup.environmentId || ""),
|
|
23202
23211
|
sandboxId: String(setup.sandboxId || ""),
|
|
23203
23212
|
subjectId: String(setup.subjectId || ""),
|
|
23204
|
-
triggerReason: setup.triggerReason === "fresh_after_version_update" ? "fresh_after_version_update" : "new_environment",
|
|
23213
|
+
triggerReason: setup.triggerReason === "fresh_after_version_update" ? "fresh_after_version_update" : setup.triggerReason === "explicit_reset" ? "explicit_reset" : "new_environment",
|
|
23214
|
+
operationKey: typeof setup.operationKey === "string" ? setup.operationKey : null,
|
|
23205
23215
|
lifecycleStatus: setup.lifecycleStatus === "completed" || setup.lifecycleStatus === "failed" ? setup.lifecycleStatus : "running",
|
|
23206
23216
|
stage: typeof setup.stage === "string" ? setup.stage : null,
|
|
23207
23217
|
totalObjectsToImport: Number(setup.totalObjectsToImport || 0),
|
|
@@ -24483,6 +24493,7 @@ var Environment = class _Environment {
|
|
|
24483
24493
|
records: recordsToImport,
|
|
24484
24494
|
batchSize: options.batchSize,
|
|
24485
24495
|
setupRunId: options.setupRunId,
|
|
24496
|
+
operationKey: options.operationKey,
|
|
24486
24497
|
writeMode: options.writeMode
|
|
24487
24498
|
})
|
|
24488
24499
|
}
|
|
@@ -25287,6 +25298,107 @@ var Granular = class _Granular {
|
|
|
25287
25298
|
await this.maybeRunEnvironmentImporter(resolved, environment);
|
|
25288
25299
|
return environment;
|
|
25289
25300
|
}
|
|
25301
|
+
/**
|
|
25302
|
+
* Read the active environment selected by Granular for an already-recorded
|
|
25303
|
+
* external user. This is intentionally read-only: browser/login code must
|
|
25304
|
+
* not create subjects or environments as a side effect.
|
|
25305
|
+
*/
|
|
25306
|
+
async getActiveEnvironmentForUser(options) {
|
|
25307
|
+
const sandboxId = options.sandboxId.trim();
|
|
25308
|
+
const tagName = options.tag.trim();
|
|
25309
|
+
const userId = options.userId.trim();
|
|
25310
|
+
if (!sandboxId || !tagName || !userId) {
|
|
25311
|
+
throw new Error(
|
|
25312
|
+
"getActiveEnvironmentForUser() requires sandboxId, tag, and userId."
|
|
25313
|
+
);
|
|
25314
|
+
}
|
|
25315
|
+
const subjects = await this.request(
|
|
25316
|
+
`/control/subjects?identityId=${encodeURIComponent(userId)}`
|
|
25317
|
+
);
|
|
25318
|
+
const subject = (subjects.items || []).find(
|
|
25319
|
+
(item) => item.identityId === userId || item.userId === userId
|
|
25320
|
+
);
|
|
25321
|
+
if (!subject?.subjectId && !subject?.granularId) {
|
|
25322
|
+
return null;
|
|
25323
|
+
}
|
|
25324
|
+
const subjectId = subject.subjectId || subject.granularId;
|
|
25325
|
+
const tags = await this.request(
|
|
25326
|
+
`/control/sandboxes/${encodeURIComponent(sandboxId)}/tags`
|
|
25327
|
+
);
|
|
25328
|
+
const tag2 = (tags.items || []).find(
|
|
25329
|
+
(item) => item?.name === tagName
|
|
25330
|
+
);
|
|
25331
|
+
if (!tag2) return null;
|
|
25332
|
+
const query = new URLSearchParams({
|
|
25333
|
+
tagId: tag2.tagId,
|
|
25334
|
+
slot: options.slot?.trim() || "default"
|
|
25335
|
+
});
|
|
25336
|
+
try {
|
|
25337
|
+
const payload = await this.request(
|
|
25338
|
+
`/control/sandboxes/${encodeURIComponent(sandboxId)}/subjects/${encodeURIComponent(subjectId)}/active-environment?${query.toString()}`
|
|
25339
|
+
);
|
|
25340
|
+
return payload.environment ? this.bindEnvironmentHandle(
|
|
25341
|
+
normalizeEnvironmentData(payload.environment)
|
|
25342
|
+
) : null;
|
|
25343
|
+
} catch (error2) {
|
|
25344
|
+
const message = error2 instanceof Error ? error2.message : String(error2);
|
|
25345
|
+
if (message.includes("404") || message.includes("not found")) {
|
|
25346
|
+
return null;
|
|
25347
|
+
}
|
|
25348
|
+
throw error2;
|
|
25349
|
+
}
|
|
25350
|
+
}
|
|
25351
|
+
/**
|
|
25352
|
+
* Register one reviewed, pre-existing environment as the active workspace
|
|
25353
|
+
* for an external user. This is for a controlled migration only: it does
|
|
25354
|
+
* not create an environment and it does not run an importer.
|
|
25355
|
+
*/
|
|
25356
|
+
async adoptEnvironmentForUser(options) {
|
|
25357
|
+
const sandboxId = options.sandboxId.trim();
|
|
25358
|
+
const tagName = options.tag.trim();
|
|
25359
|
+
const userId = options.userId.trim();
|
|
25360
|
+
const environmentId = options.environmentId.trim();
|
|
25361
|
+
if (!sandboxId || !tagName || !userId || !environmentId) {
|
|
25362
|
+
throw new Error(
|
|
25363
|
+
"adoptEnvironmentForUser() requires sandboxId, tag, userId, and environmentId."
|
|
25364
|
+
);
|
|
25365
|
+
}
|
|
25366
|
+
const subjects = await this.request(
|
|
25367
|
+
`/control/subjects?identityId=${encodeURIComponent(userId)}`
|
|
25368
|
+
);
|
|
25369
|
+
const subject = (subjects.items || []).find(
|
|
25370
|
+
(item) => item.identityId === userId || item.userId === userId
|
|
25371
|
+
);
|
|
25372
|
+
if (!subject?.subjectId && !subject?.granularId) {
|
|
25373
|
+
throw new Error(`No Granular subject exists for user ${userId}.`);
|
|
25374
|
+
}
|
|
25375
|
+
const tags = await this.request(`/control/sandboxes/${encodeURIComponent(sandboxId)}/tags`);
|
|
25376
|
+
const tag2 = (tags.items || []).find(
|
|
25377
|
+
(item) => item?.name === tagName
|
|
25378
|
+
);
|
|
25379
|
+
if (!tag2) {
|
|
25380
|
+
throw new Error(`Tag ${tagName} was not found in sandbox ${sandboxId}.`);
|
|
25381
|
+
}
|
|
25382
|
+
const payload = await this.request(
|
|
25383
|
+
"/control/environment-activations/adopt",
|
|
25384
|
+
{
|
|
25385
|
+
method: "POST",
|
|
25386
|
+
body: JSON.stringify({
|
|
25387
|
+
environmentId,
|
|
25388
|
+
subjectId: subject.subjectId || subject.granularId,
|
|
25389
|
+
tagId: tag2.tagId,
|
|
25390
|
+
slot: options.slot?.trim() || "default",
|
|
25391
|
+
confirmExistingData: true
|
|
25392
|
+
})
|
|
25393
|
+
}
|
|
25394
|
+
);
|
|
25395
|
+
if (!payload.environment) {
|
|
25396
|
+
throw new Error("Granular did not return the adopted environment.");
|
|
25397
|
+
}
|
|
25398
|
+
return this.bindEnvironmentHandle(
|
|
25399
|
+
normalizeEnvironmentData(payload.environment)
|
|
25400
|
+
);
|
|
25401
|
+
}
|
|
25290
25402
|
/**
|
|
25291
25403
|
* Deprecated compatibility alias for `openEnvironment()`.
|
|
25292
25404
|
*
|
|
@@ -25318,7 +25430,9 @@ var Granular = class _Granular {
|
|
|
25318
25430
|
requestedOntology,
|
|
25319
25431
|
sandboxId: environmentData.sandboxId,
|
|
25320
25432
|
subjectId: environmentData.subjectId,
|
|
25321
|
-
|
|
25433
|
+
externalUserId: environmentData.subjectId,
|
|
25434
|
+
setupTriggerReason: options.reason || "new_environment",
|
|
25435
|
+
setupOperationKey: options.operationKey
|
|
25322
25436
|
},
|
|
25323
25437
|
environment
|
|
25324
25438
|
);
|
|
@@ -25330,20 +25444,17 @@ var Granular = class _Granular {
|
|
|
25330
25444
|
}
|
|
25331
25445
|
return tag2;
|
|
25332
25446
|
}
|
|
25333
|
-
buildManagedEnvironmentName(tag2, versionId) {
|
|
25334
|
-
|
|
25447
|
+
buildManagedEnvironmentName(tag2, versionId, resetKey) {
|
|
25448
|
+
if (!resetKey) {
|
|
25449
|
+
return `__sdk__${tag2}__${versionId}__tracked`;
|
|
25450
|
+
}
|
|
25451
|
+
const safeResetKey = resetKey.replace(/[^a-zA-Z0-9_-]/g, "_").slice(0, 80);
|
|
25452
|
+
return `__sdk__${tag2}__${versionId}__reset__${safeResetKey}`;
|
|
25335
25453
|
}
|
|
25336
25454
|
isManagedEnvironmentName(environment, tagName) {
|
|
25337
25455
|
const name = environment.environment || environment.envName || "";
|
|
25338
25456
|
return name.startsWith(`__sdk__${tagName}__`);
|
|
25339
25457
|
}
|
|
25340
|
-
isPinnedToVersion(environment, versionId) {
|
|
25341
|
-
return environment.buildPolicy.mode === "pinned" && (environment.versionId === versionId || environment.buildPolicy.versionId === versionId || environment.buildPolicy.buildId === versionId);
|
|
25342
|
-
}
|
|
25343
|
-
matchesTagTrackedEnvironment(environment, tagName, tagId) {
|
|
25344
|
-
const environmentTagName = environment.tag?.name || environment.buildPolicy.tagName || null;
|
|
25345
|
-
return environment.tagId === tagId || environmentTagName === tagName || environment.environment === tagName || environment.envName === tagName || environment.environment === this.buildManagedEnvironmentName(tagName, environment.versionId) || environment.envName === this.buildManagedEnvironmentName(tagName, environment.versionId);
|
|
25346
|
-
}
|
|
25347
25458
|
sortEnvironmentsByRecency(environments) {
|
|
25348
25459
|
return [...environments].sort(
|
|
25349
25460
|
(left, right) => right.updatedAt - left.updatedAt
|
|
@@ -25393,48 +25504,119 @@ var Granular = class _Granular {
|
|
|
25393
25504
|
`Tag "${tagName}" does not currently point to a build/version.`
|
|
25394
25505
|
);
|
|
25395
25506
|
}
|
|
25507
|
+
const slot = options.slot?.trim() || "default";
|
|
25508
|
+
const resetKey = options.resetKey?.trim() || void 0;
|
|
25509
|
+
const resolveActive = async (operationKey) => {
|
|
25510
|
+
const query = new URLSearchParams({ tagId: tag2.tagId, slot });
|
|
25511
|
+
if (operationKey) query.set("operationKey", operationKey);
|
|
25512
|
+
try {
|
|
25513
|
+
const payload = await this.request(
|
|
25514
|
+
`/control/sandboxes/${encodeURIComponent(sandbox.sandboxId)}/subjects/${encodeURIComponent(user.granularId)}/active-environment?${query.toString()}`
|
|
25515
|
+
);
|
|
25516
|
+
return payload.environment ? normalizeEnvironmentData(payload.environment) : null;
|
|
25517
|
+
} catch (error2) {
|
|
25518
|
+
const message = error2 instanceof Error ? error2.message : String(error2);
|
|
25519
|
+
if (message.includes("404") || message.includes("not found")) {
|
|
25520
|
+
return null;
|
|
25521
|
+
}
|
|
25522
|
+
throw error2;
|
|
25523
|
+
}
|
|
25524
|
+
};
|
|
25525
|
+
const activate = async (environment2) => {
|
|
25526
|
+
const payload = await this.request(
|
|
25527
|
+
"/control/environment-activations",
|
|
25528
|
+
{
|
|
25529
|
+
method: "POST",
|
|
25530
|
+
body: JSON.stringify({
|
|
25531
|
+
environmentId: environment2.environmentId,
|
|
25532
|
+
tagId: tag2.tagId,
|
|
25533
|
+
slot,
|
|
25534
|
+
operationKey: resetKey,
|
|
25535
|
+
operation: resetKey ? "explicit_reset" : void 0
|
|
25536
|
+
})
|
|
25537
|
+
}
|
|
25538
|
+
);
|
|
25539
|
+
return normalizeEnvironmentData(payload.environment);
|
|
25540
|
+
};
|
|
25541
|
+
if (resetKey) {
|
|
25542
|
+
const resetEnvironment = await resolveActive(resetKey);
|
|
25543
|
+
if (resetEnvironment) {
|
|
25544
|
+
return {
|
|
25545
|
+
environment: resetEnvironment,
|
|
25546
|
+
requestedOntology: ontology,
|
|
25547
|
+
sandboxId: sandbox.sandboxId,
|
|
25548
|
+
subjectId: user.granularId,
|
|
25549
|
+
externalUserId: user.userId,
|
|
25550
|
+
// Retrying an explicit reset must also resume its durable setup run.
|
|
25551
|
+
// Otherwise a Container crash after queue submission would leave a
|
|
25552
|
+
// valid environment permanently marked as "running".
|
|
25553
|
+
setupTriggerReason: "explicit_reset",
|
|
25554
|
+
setupOperationKey: resetKey
|
|
25555
|
+
};
|
|
25556
|
+
}
|
|
25557
|
+
} else {
|
|
25558
|
+
const active = await resolveActive();
|
|
25559
|
+
if (active && (active.versionId === targetVersionId || options.createFreshIfOutdated !== true)) {
|
|
25560
|
+
return {
|
|
25561
|
+
environment: active,
|
|
25562
|
+
requestedOntology: ontology,
|
|
25563
|
+
sandboxId: sandbox.sandboxId,
|
|
25564
|
+
subjectId: user.granularId,
|
|
25565
|
+
externalUserId: user.userId
|
|
25566
|
+
};
|
|
25567
|
+
}
|
|
25568
|
+
}
|
|
25396
25569
|
const allEnvironments = await this.environments.list(sandbox.sandboxId);
|
|
25397
25570
|
const userEnvironments = allEnvironments.filter(
|
|
25398
|
-
(
|
|
25571
|
+
(environment2) => environment2.subjectId === user.granularId
|
|
25399
25572
|
);
|
|
25400
25573
|
const currentMatches = this.sortEnvironmentsByRecency(
|
|
25401
25574
|
userEnvironments.filter(
|
|
25402
|
-
(
|
|
25575
|
+
(environment2) => environment2.tagId === tag2.tagId && environment2.versionId === targetVersionId
|
|
25403
25576
|
)
|
|
25404
25577
|
);
|
|
25405
|
-
if (currentMatches.length > 0) {
|
|
25578
|
+
if (!resetKey && currentMatches.length > 0) {
|
|
25579
|
+
const environment2 = await activate(currentMatches[0]);
|
|
25406
25580
|
return {
|
|
25407
|
-
environment:
|
|
25581
|
+
environment: environment2,
|
|
25408
25582
|
requestedOntology: ontology,
|
|
25409
25583
|
sandboxId: sandbox.sandboxId,
|
|
25410
|
-
subjectId: user.granularId
|
|
25584
|
+
subjectId: user.granularId,
|
|
25585
|
+
externalUserId: user.userId
|
|
25411
25586
|
};
|
|
25412
25587
|
}
|
|
25413
25588
|
const outdatedMatches = this.sortEnvironmentsByRecency(
|
|
25414
|
-
userEnvironments.filter(
|
|
25415
|
-
(environment) => this.matchesTagTrackedEnvironment(environment, tagName, tag2.tagId)
|
|
25416
|
-
)
|
|
25589
|
+
userEnvironments.filter((environment2) => environment2.tagId === tag2.tagId)
|
|
25417
25590
|
);
|
|
25418
25591
|
if (outdatedMatches.length > 0 && options.createFreshIfOutdated !== true) {
|
|
25592
|
+
const environment2 = await activate(outdatedMatches[0]);
|
|
25419
25593
|
return {
|
|
25420
|
-
environment:
|
|
25594
|
+
environment: environment2,
|
|
25421
25595
|
requestedOntology: ontology,
|
|
25422
25596
|
sandboxId: sandbox.sandboxId,
|
|
25423
|
-
subjectId: user.granularId
|
|
25597
|
+
subjectId: user.granularId,
|
|
25598
|
+
externalUserId: user.userId
|
|
25424
25599
|
};
|
|
25425
25600
|
}
|
|
25601
|
+
const created = await this.environments.create(sandbox.sandboxId, {
|
|
25602
|
+
subjectId: user.granularId,
|
|
25603
|
+
environment: this.buildManagedEnvironmentName(
|
|
25604
|
+
tagName,
|
|
25605
|
+
targetVersionId,
|
|
25606
|
+
resetKey
|
|
25607
|
+
),
|
|
25608
|
+
tagId: tag2.tagId,
|
|
25609
|
+
permissionProfileId: null
|
|
25610
|
+
});
|
|
25611
|
+
const environment = await activate(created);
|
|
25426
25612
|
return {
|
|
25427
|
-
environment
|
|
25428
|
-
subjectId: user.granularId,
|
|
25429
|
-
environment: this.buildManagedEnvironmentName(tagName, targetVersionId),
|
|
25430
|
-
tagId: tag2.tagId,
|
|
25431
|
-
versionId: targetVersionId,
|
|
25432
|
-
permissionProfileId: null
|
|
25433
|
-
}),
|
|
25613
|
+
environment,
|
|
25434
25614
|
requestedOntology: ontology,
|
|
25435
25615
|
sandboxId: sandbox.sandboxId,
|
|
25436
25616
|
subjectId: user.granularId,
|
|
25437
|
-
|
|
25617
|
+
externalUserId: user.userId,
|
|
25618
|
+
setupTriggerReason: resetKey ? "explicit_reset" : outdatedMatches.length > 0 ? "fresh_after_version_update" : "new_environment",
|
|
25619
|
+
setupOperationKey: resetKey
|
|
25438
25620
|
};
|
|
25439
25621
|
}
|
|
25440
25622
|
/**
|
|
@@ -25713,11 +25895,24 @@ var Granular = class _Granular {
|
|
|
25713
25895
|
{
|
|
25714
25896
|
method: "POST",
|
|
25715
25897
|
body: JSON.stringify({
|
|
25716
|
-
triggerReason: resolved.setupTriggerReason
|
|
25898
|
+
triggerReason: resolved.setupTriggerReason,
|
|
25899
|
+
operationKey: resolved.setupOperationKey
|
|
25717
25900
|
})
|
|
25718
25901
|
}
|
|
25719
25902
|
);
|
|
25720
25903
|
const setupRunId = setupRun.setupRunId;
|
|
25904
|
+
let claim = null;
|
|
25905
|
+
for (let attempt = 0; attempt < 3; attempt += 1) {
|
|
25906
|
+
claim = await this.request(
|
|
25907
|
+
`/control/environment-setup-runs/${setupRunId}/importer-claim`,
|
|
25908
|
+
{ method: "POST", body: JSON.stringify({}) }
|
|
25909
|
+
);
|
|
25910
|
+
if (claim.action !== "busy") break;
|
|
25911
|
+
await sleep(Math.min(3e4, Math.max(250, claim.retryAfterMs || 1e3)));
|
|
25912
|
+
}
|
|
25913
|
+
if (!claim) {
|
|
25914
|
+
throw new Error(`Unable to claim environment setup run ${setupRunId}.`);
|
|
25915
|
+
}
|
|
25721
25916
|
const updateSetupRun = async (patch) => {
|
|
25722
25917
|
await this.request(
|
|
25723
25918
|
`/control/environment-setup-runs/${setupRunId}`,
|
|
@@ -25727,10 +25922,26 @@ var Granular = class _Granular {
|
|
|
25727
25922
|
}
|
|
25728
25923
|
);
|
|
25729
25924
|
};
|
|
25925
|
+
if (claim.action === "submitted") {
|
|
25926
|
+
const completedSetupRun = await this.request(
|
|
25927
|
+
`/control/environment-setup-runs/${setupRunId}`,
|
|
25928
|
+
{ method: "PATCH", body: JSON.stringify({ markHookCompleted: true }) }
|
|
25929
|
+
);
|
|
25930
|
+
const refreshedEnvironment = await this.environments.get(
|
|
25931
|
+
environment.environmentId
|
|
25932
|
+
);
|
|
25933
|
+
environment.syncEnvironmentData(refreshedEnvironment);
|
|
25934
|
+
return completedSetupRun;
|
|
25935
|
+
}
|
|
25936
|
+
if (claim.action === "busy" || claim.action === "terminal") {
|
|
25937
|
+
return claim.summary;
|
|
25938
|
+
}
|
|
25939
|
+
let importSequence = 0;
|
|
25730
25940
|
const importerContext = {
|
|
25731
25941
|
environmentId: environment.environmentId,
|
|
25732
25942
|
sandboxId: environment.sandboxId,
|
|
25733
25943
|
subjectId: environment.subjectId,
|
|
25944
|
+
externalUserId: resolved.externalUserId,
|
|
25734
25945
|
reason: resolved.setupTriggerReason,
|
|
25735
25946
|
incrementTotalObjectsToImportCount: async (n) => {
|
|
25736
25947
|
const safeIncrement = Math.max(0, Math.trunc(n));
|
|
@@ -25747,7 +25958,10 @@ var Granular = class _Granular {
|
|
|
25747
25958
|
importRecords: async (records, options) => environment.enqueueRecordImport(records, {
|
|
25748
25959
|
batchSize: options?.batchSize,
|
|
25749
25960
|
writeMode: options?.writeMode,
|
|
25750
|
-
setupRunId
|
|
25961
|
+
setupRunId,
|
|
25962
|
+
// Sequence is deterministic for a retry of one importer hook. It
|
|
25963
|
+
// prevents a Container restart from creating a second queue import.
|
|
25964
|
+
operationKey: `${setupRunId}:import:${importSequence++}`
|
|
25751
25965
|
})
|
|
25752
25966
|
};
|
|
25753
25967
|
try {
|
|
@@ -27964,9 +28178,12 @@ program2.command("build").description(
|
|
|
27964
28178
|
});
|
|
27965
28179
|
program2.command("deploy").description(
|
|
27966
28180
|
"Push the current revision to dev; use --prod to move prod there too"
|
|
27967
|
-
).option("--prod", "Also point prod to the current version").
|
|
28181
|
+
).option("--prod", "Also point prod to the current version").option(
|
|
28182
|
+
"--release-key <key>",
|
|
28183
|
+
"Version data/importer changes with this immutable release key"
|
|
28184
|
+
).action(async (opts) => {
|
|
27968
28185
|
try {
|
|
27969
|
-
await deployCommand({ prod: opts.prod });
|
|
28186
|
+
await deployCommand({ prod: opts.prod, releaseKey: opts.releaseKey });
|
|
27970
28187
|
} catch (err) {
|
|
27971
28188
|
error(err.message);
|
|
27972
28189
|
process.exit(1);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bM as WSClientOptions, a2 as GranularQuotaProgress, T as ToolWithHandler, f as PublishToolsResult, aO as Job, g as ToolHandler, I as InstanceToolHandler, aY as ConversationMessageInput, aZ as ConversationAppendResult, aB as EffectInfo, P as Prompt, aA as ToolInfo, aD as EffectsChangedEvent, aC as ToolsChangedEvent, D as DomainState, y as GranularOptions, ci as EnvironmentImporter, B as RecordUserOptions, U as User, H as OpenEnvironmentOptions, af as EnvironmentData, ac as BuildPolicy, cf as EnvironmentSetupSummary, W as ConversationSessionListOptions, Q as ConversationSessionInfo, L as CreateSessionOptions, bW as RecordObjectOptions, c1 as RecordObjectResult, c3 as RecordObjectsOptions, ca as RecordImport, c6 as RecordImportStatus, cb as EnvironmentRecordImportSummary, aM as EnvironmentFeedbackRecord, c as SessionHeapSnapshot, bA as SessionDocumentResult, bB as SessionCollectionListOptions, bD as SessionCollectionListResult, a_ as SessionConversationMessage, a$ as SessionTimelineEvent, bC as SessionJobListOptions, bt as SessionJobRecord, b8 as SessionArtifactListOptions, b7 as SessionArtifactRecord, b9 as SessionArtifactValidationResult, bb as SessionArtifactExecutionOptions, ba as SessionArtifactExecutionResult, bc as SessionArtifactApprovalOptions, bm as RecordManualActionInput, bo as ManualActionRecordResult, bp as ManualActionListOptions, bn as ManualActionOccurrence, br as ManualActionSuggestionOptions, bq as ManualActionSuggestion, bf as ArtifactApprovalTaskListOptions, be as ArtifactApprovalTask, bg as ArtifactApprovalDecisionInput, bh as ArtifactApprovalDecisionResult, b3 as SessionFileRecord, bs as SessionFileUploadOptions, S as SessionHeapEntry, b as SessionHeapList, bw as SessionHeapVariable, d as SessionTranscriptEntry, cM as GraphQLResult, by as RecordSearchOptions, bx as RecordSearchResult, bz as RecordMentionInput, bV as DefineRelationshipOptions, bU as RelationshipInfo, bT as ModelRef, cL as ManifestContent, b_ as EnvironmentStateUpdateInput, bY as EnvironmentStateTarget, c0 as EnvironmentStateProxy, c5 as RecordImportOptions, bI as UserEnvironmentStateOptions, bH as UserEnvironmentState, bJ as MarkUserEnvironmentReadOptions, J as AdoptEnvironmentOptions, K as ConnectOptions, cd as RunEnvironmentImporterOptions, l as OpenAIUsageSpendEvent, G as GranularSpendContext, o as RecordOpenAIUsageSpendResult, a5 as SandboxListResponse, a3 as Sandbox, a4 as CreateSandboxData, cO as DeleteResponse, a7 as PermissionProfile, a8 as CreatePermissionProfileData, ag as CreateEnvironmentData, cP as StreamEvent, cQ as StreamSubscription, cR as StreamStats, F as Subject, ab as AssignmentListResponse } from './spend-DpRRCrAr.mjs';
|
|
2
2
|
import * as Automerge from '@automerge/automerge';
|
|
3
3
|
import { Doc } from '@automerge/automerge/slim';
|
|
4
4
|
|
|
@@ -952,6 +952,23 @@ declare class Granular {
|
|
|
952
952
|
* ```
|
|
953
953
|
*/
|
|
954
954
|
openEnvironment(options: OpenEnvironmentOptions): Promise<Environment>;
|
|
955
|
+
/**
|
|
956
|
+
* Read the active environment selected by Granular for an already-recorded
|
|
957
|
+
* external user. This is intentionally read-only: browser/login code must
|
|
958
|
+
* not create subjects or environments as a side effect.
|
|
959
|
+
*/
|
|
960
|
+
getActiveEnvironmentForUser(options: {
|
|
961
|
+
sandboxId: string;
|
|
962
|
+
tag: string;
|
|
963
|
+
userId: string;
|
|
964
|
+
slot?: string;
|
|
965
|
+
}): Promise<Environment | null>;
|
|
966
|
+
/**
|
|
967
|
+
* Register one reviewed, pre-existing environment as the active workspace
|
|
968
|
+
* for an external user. This is for a controlled migration only: it does
|
|
969
|
+
* not create an environment and it does not run an importer.
|
|
970
|
+
*/
|
|
971
|
+
adoptEnvironmentForUser(options: AdoptEnvironmentOptions): Promise<Environment>;
|
|
955
972
|
/**
|
|
956
973
|
* Deprecated compatibility alias for `openEnvironment()`.
|
|
957
974
|
*
|
|
@@ -971,8 +988,6 @@ declare class Granular {
|
|
|
971
988
|
private resolveRequestedTag;
|
|
972
989
|
private buildManagedEnvironmentName;
|
|
973
990
|
private isManagedEnvironmentName;
|
|
974
|
-
private isPinnedToVersion;
|
|
975
|
-
private matchesTagTrackedEnvironment;
|
|
976
991
|
private sortEnvironmentsByRecency;
|
|
977
992
|
private resolveOpenEnvironmentData;
|
|
978
993
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bM as WSClientOptions, a2 as GranularQuotaProgress, T as ToolWithHandler, f as PublishToolsResult, aO as Job, g as ToolHandler, I as InstanceToolHandler, aY as ConversationMessageInput, aZ as ConversationAppendResult, aB as EffectInfo, P as Prompt, aA as ToolInfo, aD as EffectsChangedEvent, aC as ToolsChangedEvent, D as DomainState, y as GranularOptions, ci as EnvironmentImporter, B as RecordUserOptions, U as User, H as OpenEnvironmentOptions, af as EnvironmentData, ac as BuildPolicy, cf as EnvironmentSetupSummary, W as ConversationSessionListOptions, Q as ConversationSessionInfo, L as CreateSessionOptions, bW as RecordObjectOptions, c1 as RecordObjectResult, c3 as RecordObjectsOptions, ca as RecordImport, c6 as RecordImportStatus, cb as EnvironmentRecordImportSummary, aM as EnvironmentFeedbackRecord, c as SessionHeapSnapshot, bA as SessionDocumentResult, bB as SessionCollectionListOptions, bD as SessionCollectionListResult, a_ as SessionConversationMessage, a$ as SessionTimelineEvent, bC as SessionJobListOptions, bt as SessionJobRecord, b8 as SessionArtifactListOptions, b7 as SessionArtifactRecord, b9 as SessionArtifactValidationResult, bb as SessionArtifactExecutionOptions, ba as SessionArtifactExecutionResult, bc as SessionArtifactApprovalOptions, bm as RecordManualActionInput, bo as ManualActionRecordResult, bp as ManualActionListOptions, bn as ManualActionOccurrence, br as ManualActionSuggestionOptions, bq as ManualActionSuggestion, bf as ArtifactApprovalTaskListOptions, be as ArtifactApprovalTask, bg as ArtifactApprovalDecisionInput, bh as ArtifactApprovalDecisionResult, b3 as SessionFileRecord, bs as SessionFileUploadOptions, S as SessionHeapEntry, b as SessionHeapList, bw as SessionHeapVariable, d as SessionTranscriptEntry, cM as GraphQLResult, by as RecordSearchOptions, bx as RecordSearchResult, bz as RecordMentionInput, bV as DefineRelationshipOptions, bU as RelationshipInfo, bT as ModelRef, cL as ManifestContent, b_ as EnvironmentStateUpdateInput, bY as EnvironmentStateTarget, c0 as EnvironmentStateProxy, c5 as RecordImportOptions, bI as UserEnvironmentStateOptions, bH as UserEnvironmentState, bJ as MarkUserEnvironmentReadOptions, J as AdoptEnvironmentOptions, K as ConnectOptions, cd as RunEnvironmentImporterOptions, l as OpenAIUsageSpendEvent, G as GranularSpendContext, o as RecordOpenAIUsageSpendResult, a5 as SandboxListResponse, a3 as Sandbox, a4 as CreateSandboxData, cO as DeleteResponse, a7 as PermissionProfile, a8 as CreatePermissionProfileData, ag as CreateEnvironmentData, cP as StreamEvent, cQ as StreamSubscription, cR as StreamStats, F as Subject, ab as AssignmentListResponse } from './spend-DpRRCrAr.js';
|
|
2
2
|
import * as Automerge from '@automerge/automerge';
|
|
3
3
|
import { Doc } from '@automerge/automerge/slim';
|
|
4
4
|
|
|
@@ -952,6 +952,23 @@ declare class Granular {
|
|
|
952
952
|
* ```
|
|
953
953
|
*/
|
|
954
954
|
openEnvironment(options: OpenEnvironmentOptions): Promise<Environment>;
|
|
955
|
+
/**
|
|
956
|
+
* Read the active environment selected by Granular for an already-recorded
|
|
957
|
+
* external user. This is intentionally read-only: browser/login code must
|
|
958
|
+
* not create subjects or environments as a side effect.
|
|
959
|
+
*/
|
|
960
|
+
getActiveEnvironmentForUser(options: {
|
|
961
|
+
sandboxId: string;
|
|
962
|
+
tag: string;
|
|
963
|
+
userId: string;
|
|
964
|
+
slot?: string;
|
|
965
|
+
}): Promise<Environment | null>;
|
|
966
|
+
/**
|
|
967
|
+
* Register one reviewed, pre-existing environment as the active workspace
|
|
968
|
+
* for an external user. This is for a controlled migration only: it does
|
|
969
|
+
* not create an environment and it does not run an importer.
|
|
970
|
+
*/
|
|
971
|
+
adoptEnvironmentForUser(options: AdoptEnvironmentOptions): Promise<Environment>;
|
|
955
972
|
/**
|
|
956
973
|
* Deprecated compatibility alias for `openEnvironment()`.
|
|
957
974
|
*
|
|
@@ -971,8 +988,6 @@ declare class Granular {
|
|
|
971
988
|
private resolveRequestedTag;
|
|
972
989
|
private buildManagedEnvironmentName;
|
|
973
990
|
private isManagedEnvironmentName;
|
|
974
|
-
private isPinnedToVersion;
|
|
975
|
-
private matchesTagTrackedEnvironment;
|
|
976
991
|
private sortEnvironmentsByRecency;
|
|
977
992
|
private resolveOpenEnvironmentData;
|
|
978
993
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { E as Environment, a as EnvironmentSession, G as Granular, O as OntologyHandle, S as Session, W as WSClient } from './client-
|
|
2
|
-
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 './spend-
|
|
3
|
-
export {
|
|
1
|
+
export { E as Environment, a as EnvironmentSession, G as Granular, O as OntologyHandle, S as Session, W as WSClient } from './client-B2OyGOHE.mjs';
|
|
2
|
+
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 './spend-DpRRCrAr.mjs';
|
|
3
|
+
export { cN as APIError, A as AccessTokenProvider, J as AdoptEnvironmentOptions, bg as ArtifactApprovalDecisionInput, bh as ArtifactApprovalDecisionResult, be as ArtifactApprovalTask, bf as ArtifactApprovalTaskListOptions, bd as ArtifactApprovalTaskStatus, aa as Assignment, ab as AssignmentListResponse, al as Build, an as BuildListResponse, ac as BuildPolicy, ak as BuildStatus, C as ConditionIR, K as ConnectOptions, aV as ConversationActionSuggestion, aZ as ConversationAppendResult, aW as ConversationMessageAction, aY as ConversationMessageInput, aX as ConversationMessagePart, aP as ConversationMessageShowRefs, Q as ConversationSessionInfo, W as ConversationSessionListOptions, V as ConversationSessionListStatus, aQ as ConversationTableCell, aR as ConversationTableColumn, aU as ConversationTableProjection, aT as ConversationTableRow, aS as ConversationTableRowReference, ag as CreateEnvironmentData, a8 as CreatePermissionProfileData, a4 as CreateSandboxData, L as CreateSessionOptions, bV as DefineRelationshipOptions, cO as DeleteResponse, D as DomainState, aE as EffectHandler, aB as EffectInfo, av as EffectInvocationMetadata, au as EffectInvocationMode, aw as EffectSchema, az as EffectVersionSelector, ax as EffectWithHandler, aD as EffectsChangedEvent, af as EnvironmentData, aM as EnvironmentFeedbackRecord, ci as EnvironmentImporter, ch as EnvironmentImporterImportOptions, ah as EnvironmentListResponse, cb as EnvironmentRecordImportSummary, cg as EnvironmentSetupImporterClaim, ce as EnvironmentSetupLifecycleStatus, cf as EnvironmentSetupSummary, cc as EnvironmentSetupTriggerReason, b$ as EnvironmentStateMachineProxy, bZ as EnvironmentStateObservationInput, c0 as EnvironmentStateProxy, bY as EnvironmentStateTarget, b_ as EnvironmentStateUpdateInput, z as GranularAuth, y as GranularOptions, a1 as GranularQuotaPolicy, a2 as GranularQuotaProgress, G as GranularSpendContext, cM 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, ai as Manifest, cB as ManifestApprovalRequiredSpec, cL as ManifestContent, cC as ManifestCreatesSpec, cz as ManifestDryRunSpec, cF as ManifestEffectDeclaration, cE as ManifestEffectSchema, cl as ManifestEnumRuleSpec, cH as ManifestEventStreamDef, cG as ManifestEventTypeDef, cm as ManifestFilterBySpec, cJ as ManifestImport, aj as ManifestListResponse, cI as ManifestOperation, cy as ManifestPostConditionSpec, cj as ManifestPropertySpec, cD as ManifestRelationshipDef, cA as ManifestReverseSpec, cx as ManifestStateMachineSpec, co as ManifestStateMachineStateSpec, cw as ManifestStateMachineTransitionSpec, cq as ManifestStateTransitionActionSpec, cr as ManifestStateTransitionAssigneeSpec, cv as ManifestStateTransitionExpectedOutcomeSpec, cp as ManifestStateTransitionInputBinding, cu as ManifestStateTransitionPermissionSpec, cs as ManifestStateTransitionRelatedStateRequirementSpec, ct as ManifestStateTransitionRequirementsSpec, ck as ManifestValidationOperator, cn as ManifestValidationRuleSpec, cK as ManifestVolume, bp as ManualActionListOptions, bn as ManualActionOccurrence, bo as ManualActionRecordResult, bl as ManualActionRelatedRecord, bj as ManualActionSource, bi as ManualActionStatus, bq as ManualActionSuggestion, br as ManualActionSuggestionOptions, bk as ManualActionTarget, bJ as MarkUserEnvironmentReadOptions, x as MatchedPolicy, bT as ModelRef, N as NormalizedOpenAIUsage, i as OPENAI_MODEL_PRICING_USD_PER_MILLION, O as OpenAIModelPricing, h as OpenAITokenSpend, l as OpenAIUsageSpendEvent, H as OpenEnvironmentOptions, a7 as PermissionProfile, a9 as PermissionProfileListResponse, a6 as PermissionRules, u as PolicyOperator, v as PolicyOrigin, s as PolicyPredicateSource, w as PolicyRuleIR, q as PolicySource, ay as PublishEffectsResult, f as PublishToolsResult, a0 as QuotaLineItemFilter, Z as QuotaPeriod, Y as QuotaScopeType, _ as QuotaStatus, bN as RPCRequest, bQ as RPCRequestFromServer, bO as RPCResponse, ca as RecordImport, c9 as RecordImportItem, c7 as RecordImportItemStatus, c5 as RecordImportOptions, c8 as RecordImportStats, c6 as RecordImportStatus, c4 as RecordImportWriteMode, bm as RecordManualActionInput, bz as RecordMentionInput, bW as RecordObjectOptions, c1 as RecordObjectResult, bX as RecordObjectStateValue, c2 as RecordObjectsChunkInfo, c3 as RecordObjectsOptions, m as RecordOpenAIUsageSpendOptions, o as RecordOpenAIUsageSpendResult, by as RecordSearchOptions, bx as RecordSearchResult, B as RecordUserOptions, bU as RelationshipInfo, at as ResolvedEffectApprovalRequired, ar as ResolvedEffectDryRun, aq as ResolvedEffectPostCondition, as as ResolvedEffectReverse, cd as RunEnvironmentImporterOptions, a3 as Sandbox, a5 as SandboxListResponse, ap as SemanticVersionDiff, ao as SemanticVersionDiffEntry, bc as SessionArtifactApprovalOptions, b6 as SessionArtifactAutonomyPolicy, bb as SessionArtifactExecutionOptions, ba as SessionArtifactExecutionResult, b5 as SessionArtifactKind, b8 as SessionArtifactListOptions, b7 as SessionArtifactRecord, b4 as SessionArtifactStatus, b9 as SessionArtifactValidationResult, bB as SessionCollectionListOptions, bD as SessionCollectionListResult, a_ as SessionConversationMessage, bA as SessionDocumentResult, b1 as SessionFileKind, b3 as SessionFileRecord, b0 as SessionFileSource, b2 as SessionFileStatus, bs as SessionFileUploadOptions, bu as SessionHeapFieldType, bv as SessionHeapFieldValue, bw as SessionHeapVariable, bC as SessionJobListOptions, bt as SessionJobRecord, a$ as SessionTimelineEvent, X as SpendLineItemType, $ as SpendSummary, cP as StreamEvent, cR as StreamStats, cQ as StreamSubscription, F as Subject, bP as SyncMessage, g as ToolHandler, aA as ToolInfo, bR as ToolInvokeParams, bS as ToolResultParams, e as ToolSchema, aC as ToolsChangedEvent, U as User, bF as UserEnvironmentMessagePreview, bE as UserEnvironmentPrompt, bG as UserEnvironmentSessionState, bH as UserEnvironmentState, bI as UserEnvironmentStateOptions, am as Version, ae as VersionTag, ad as VersionTracking, bM as WSClientOptions, bK as WSDisconnectInfo, bL as WSReconnectErrorInfo, p as buildOpenAISpendEventId, k as calculateOpenAITokenSpend, j as getOpenAIModelPricing, n as normalizeOpenAIUsage, r as recordOpenAIUsageSpend, t as toGranularHttpBase } from './spend-DpRRCrAr.mjs';
|
|
4
4
|
export { BuildGranularAgentSystemPromptInput, GeneratedJobCodeIssue, GranularAgentExecutionCheckpoint, GranularAgentHeapSummaryOptions, GranularAgentManualActionMemorySuggestion, GranularAgentPromptCapabilities, GranularAgentReferentFocus, GranularAgentSessionContext, GranularAgentToolInfo, GranularAgentWorkflowFocus, GranularReasoningTraceChunkResult, GranularReasoningTraceOptions, HarnessContinuationDecision, HarnessControllerBudgets, HarnessProjectionOptions, HarnessPromptLike, HarnessRenderedContinuation, HarnessRenderedPrompt, HarnessTemplate, HarnessTemplateManifest, HarnessTemplateSelectionOptions, HarnessTemplateStatus, HarnessVerifierSnapshot, HarnessVerifierSnapshotInput, ReviewGeneratedJobCodeOptions, buildContinuationInstruction, buildContinuationInstructionFromTemplate, buildGranularAgentCheckpointBlock, buildGranularAgentDomainBlock, buildGranularAgentFileBlock, buildGranularAgentHeapBlock, buildGranularAgentLoopBlock, buildGranularAgentManualActionBlock, buildGranularAgentManualActionMemorySummary, buildGranularAgentReferentBlock, buildGranularAgentRuntimeImportsBlock, buildGranularAgentSessionBlock, buildGranularAgentSystemPrompt, buildGranularAgentSystemPromptFromTemplate, buildGranularAgentToolBlock, buildGranularAgentWorkflowBlock, consumeGranularReasoningOnlyChunk, consumeGranularReasoningTraceChunk, createHarnessVerifierSnapshot, evaluateContinuation, getCurrentClosureId, getDefaultHarnessTemplateId, getExclusivePromptTarget, hasOpenPrompt, hashHarnessTemplateValue, listHarnessTemplates, projectConversationReferentFocus, projectConversationReferentSummary, projectHeapSummary, projectLoopSummary, projectSessionFileSummary, projectWorkflowFocus, projectWorkflowSummary, renderContinuationInstructionFromTemplate, renderGranularAgentSystemPromptFromTemplate, resolveHarnessTemplate, reviewGeneratedJobCode, stripGranularReasoningTrace, validateHarnessTemplateManifest } from './agent-harness.mjs';
|
|
5
5
|
import '@automerge/automerge';
|
|
6
6
|
import '@automerge/automerge/slim';
|