@byok-sdk/client 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -0
- package/dist/agent-memory/index.d.ts +96 -0
- package/dist/agent-memory/index.js +762 -0
- package/dist/agent-memory/index.js.map +1 -0
- package/dist/bin/byok-agent.js +44 -3
- package/dist/bin/byok-agent.js.map +1 -1
- package/dist/index.js +43 -2
- package/dist/index.js.map +1 -1
- package/package.json +9 -5
package/dist/index.js
CHANGED
|
@@ -13292,8 +13292,49 @@ var TaskRunner = class {
|
|
|
13292
13292
|
if (this.tasks.get(active.taskId) !== active || active.beingTornDown) return;
|
|
13293
13293
|
if (active.messageRequirement !== void 0 && active.messageAccepted !== true) {
|
|
13294
13294
|
active.pendingMessageCompletion = { finalOutput, ...outcome.document === void 0 ? {} : { document: outcome.document } };
|
|
13295
|
-
const
|
|
13296
|
-
|
|
13295
|
+
const outbox = active.messageOutbox;
|
|
13296
|
+
const record = outbox?.get(active.taskId);
|
|
13297
|
+
if (record !== void 0) {
|
|
13298
|
+
this.sendAgentMessageRecord(outbox, record);
|
|
13299
|
+
return;
|
|
13300
|
+
}
|
|
13301
|
+
const body = finalOutput.trim();
|
|
13302
|
+
if (outbox === void 0 || active.agentRef === void 0) {
|
|
13303
|
+
active.pendingMessageCompletion = void 0;
|
|
13304
|
+
await this.fail(active.taskId, "required Agent message lane is unavailable for this task", false);
|
|
13305
|
+
return;
|
|
13306
|
+
}
|
|
13307
|
+
if (body === "") {
|
|
13308
|
+
active.pendingMessageCompletion = void 0;
|
|
13309
|
+
await this.fail(active.taskId, "runtime produced no reply text for the required Agent message", false);
|
|
13310
|
+
return;
|
|
13311
|
+
}
|
|
13312
|
+
try {
|
|
13313
|
+
await outbox.appendDraft({
|
|
13314
|
+
taskId: active.taskId,
|
|
13315
|
+
tenantId: this.deps.tenantId,
|
|
13316
|
+
agentRef: active.agentRef,
|
|
13317
|
+
requirement: active.messageRequirement,
|
|
13318
|
+
contentType: active.messageRequirement.contentType,
|
|
13319
|
+
body,
|
|
13320
|
+
maxPendingEvents: 64,
|
|
13321
|
+
maxPendingBytes: 4 * 1024 * 1024
|
|
13322
|
+
});
|
|
13323
|
+
if (this.tasks.get(active.taskId) !== active || active.beingTornDown) return;
|
|
13324
|
+
const activated = await outbox.activate(active.taskId, active.session.sessionRef);
|
|
13325
|
+
if (this.tasks.get(active.taskId) !== active || active.beingTornDown) return;
|
|
13326
|
+
if (activated === void 0) throw new Error("Agent message draft disappeared before activation");
|
|
13327
|
+
this.sendAgentMessageRecord(outbox, activated);
|
|
13328
|
+
} catch (err) {
|
|
13329
|
+
if (this.tasks.get(active.taskId) !== active || active.beingTornDown) return;
|
|
13330
|
+
const raced = outbox.get(active.taskId);
|
|
13331
|
+
if (raced !== void 0 && raced.sessionRef !== void 0) {
|
|
13332
|
+
this.sendAgentMessageRecord(outbox, raced);
|
|
13333
|
+
return;
|
|
13334
|
+
}
|
|
13335
|
+
active.pendingMessageCompletion = void 0;
|
|
13336
|
+
await this.fail(active.taskId, `failed to deliver the required Agent message: ${errorMessage4(err)}`, false);
|
|
13337
|
+
}
|
|
13297
13338
|
return;
|
|
13298
13339
|
}
|
|
13299
13340
|
await this.publishSuccessfulCompletion(active, finalOutput, outcome.document);
|