@opengeni/worker-bundle 0.12.1 → 0.12.5

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/index.js CHANGED
@@ -5891,6 +5891,9 @@ import {
5891
5891
  } from "@opengeni/contracts";
5892
5892
  import { createHash as createHash4, randomUUID } from "crypto";
5893
5893
  var PROVIDER_BACKPRESSURE_DELAY_MS = 6e4;
5894
+ function credentialSubjectIdForTurnInitiator(initiator) {
5895
+ return initiator.kind === "subject" ? initiator.subjectId : void 0;
5896
+ }
5894
5897
  function turnExecutionPolicyBillingIdentity(policy) {
5895
5898
  return {
5896
5899
  externallyBilled: policy.billing.metering === "external",
@@ -7388,7 +7391,7 @@ function createRunAgentTurnActivity(services) {
7388
7391
  producerSeq
7389
7392
  });
7390
7393
  if (immediate) {
7391
- await Bun.sleep(0);
7394
+ await new Promise((resolve) => setTimeout(resolve, 0));
7392
7395
  }
7393
7396
  return appended;
7394
7397
  };
@@ -8997,6 +9000,7 @@ function createRunAgentTurnActivity(services) {
8997
9000
  }
8998
9001
  return result;
8999
9002
  };
9003
+ const credentialSubjectId = credentialSubjectIdForTurnInitiator(turn.initiator);
9000
9004
  preparedTools = await waitForTurnOperation(
9001
9005
  withCodex(
9002
9006
  () => runtime.prepareTools(runSettings, turnTools, {
@@ -9011,6 +9015,7 @@ function createRunAgentTurnActivity(services) {
9011
9015
  executionGeneration,
9012
9016
  subjectId: "worker:first-party-mcp",
9013
9017
  subjectLabel: "OpenGeni worker",
9018
+ ...credentialSubjectId ? { credentialSubjectId } : {},
9014
9019
  resolveCredential,
9015
9020
  onAuthNeeded: async (payload) => {
9016
9021
  await publish([{ type: "tool.auth_needed", payload }], true);
@@ -9131,6 +9136,7 @@ function createRunAgentTurnActivity(services) {
9131
9136
  await maybeStartOnTurnRecording(resolvedSandbox, activeSandboxBackend);
9132
9137
  },
9133
9138
  ...packRuntime.skills.length > 0 ? { packSkills: packRuntime.skills } : {},
9139
+ ...session.skills.length > 0 ? { sessionSkills: session.skills } : {},
9134
9140
  ...skillLibraryRuntime.skillLibrarySkills.length > 0 ? {
9135
9141
  skillLibrarySkills: skillLibraryRuntime.skillLibrarySkills,
9136
9142
  skillLibrarySelections: skillLibraryRuntime.skillLibrarySelections