@opengeni/worker-bundle 0.12.2 → 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 +6 -0
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
- package/src/activities/agent-turn.ts +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeni/worker-bundle",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.5",
|
|
4
4
|
"description": "OpenGeni worker entry and reusable embedded lifecycle, shipped with a release-coherent pre-bundled Temporal workflow artifact.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -41,16 +41,16 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@opengeni/agent-proto": "^0.3.0",
|
|
43
43
|
"@opengeni/codex": "^0.2.7",
|
|
44
|
-
"@opengeni/config": "^0.7.
|
|
45
|
-
"@opengeni/contracts": "^0.
|
|
46
|
-
"@opengeni/core": "^0.12.
|
|
47
|
-
"@opengeni/db": "^0.13.
|
|
48
|
-
"@opengeni/documents": "^0.2.
|
|
49
|
-
"@opengeni/events": "^0.3.
|
|
50
|
-
"@opengeni/github": "^0.3.
|
|
44
|
+
"@opengeni/config": "^0.7.10",
|
|
45
|
+
"@opengeni/contracts": "^0.21.0",
|
|
46
|
+
"@opengeni/core": "^0.12.5",
|
|
47
|
+
"@opengeni/db": "^0.13.4",
|
|
48
|
+
"@opengeni/documents": "^0.2.41",
|
|
49
|
+
"@opengeni/events": "^0.3.32",
|
|
50
|
+
"@opengeni/github": "^0.3.22",
|
|
51
51
|
"@opengeni/observability": "^0.3.0",
|
|
52
|
-
"@opengeni/runtime": "^0.
|
|
53
|
-
"@opengeni/storage": "^0.2.
|
|
52
|
+
"@opengeni/runtime": "^0.14.0",
|
|
53
|
+
"@opengeni/storage": "^0.2.34",
|
|
54
54
|
"@temporalio/activity": "^1.17.0",
|
|
55
55
|
"@temporalio/client": "^1.17.0",
|
|
56
56
|
"@temporalio/worker": "^1.17.0",
|
|
@@ -305,6 +305,7 @@ import {
|
|
|
305
305
|
type SessionStatus,
|
|
306
306
|
type SessionTurn,
|
|
307
307
|
type TurnExecutionPolicyV1,
|
|
308
|
+
type TurnInitiator,
|
|
308
309
|
} from "@opengeni/contracts";
|
|
309
310
|
import { createHash, randomUUID } from "node:crypto";
|
|
310
311
|
|
|
@@ -314,6 +315,13 @@ import { createHash, randomUUID } from "node:crypto";
|
|
|
314
315
|
// budget against the same window.
|
|
315
316
|
export const PROVIDER_BACKPRESSURE_DELAY_MS = 60_000;
|
|
316
317
|
|
|
318
|
+
/** Personal connection authority follows the immutable human turn initiator, never the worker. */
|
|
319
|
+
export function credentialSubjectIdForTurnInitiator(
|
|
320
|
+
initiator: Pick<TurnInitiator, "kind" | "subjectId">,
|
|
321
|
+
): string | undefined {
|
|
322
|
+
return initiator.kind === "subject" ? initiator.subjectId : undefined;
|
|
323
|
+
}
|
|
324
|
+
|
|
317
325
|
export function turnExecutionPolicyBillingIdentity(policy: TurnExecutionPolicyV1): {
|
|
318
326
|
externallyBilled: boolean;
|
|
319
327
|
codexSubscription: boolean;
|
|
@@ -4970,6 +4978,7 @@ export function createRunAgentTurnActivity(services: () => Promise<ActivityServi
|
|
|
4970
4978
|
}
|
|
4971
4979
|
return result;
|
|
4972
4980
|
};
|
|
4981
|
+
const credentialSubjectId = credentialSubjectIdForTurnInitiator(turn.initiator);
|
|
4973
4982
|
preparedTools = await waitForTurnOperation(
|
|
4974
4983
|
withCodex(() =>
|
|
4975
4984
|
runtime.prepareTools(runSettings, turnTools, {
|
|
@@ -4984,6 +4993,7 @@ export function createRunAgentTurnActivity(services: () => Promise<ActivityServi
|
|
|
4984
4993
|
executionGeneration,
|
|
4985
4994
|
subjectId: "worker:first-party-mcp",
|
|
4986
4995
|
subjectLabel: "OpenGeni worker",
|
|
4996
|
+
...(credentialSubjectId ? { credentialSubjectId } : {}),
|
|
4987
4997
|
resolveCredential,
|
|
4988
4998
|
onAuthNeeded: async (payload) => {
|
|
4989
4999
|
await publish!([{ type: "tool.auth_needed", payload }], true);
|
|
@@ -5149,6 +5159,7 @@ export function createRunAgentTurnActivity(services: () => Promise<ActivityServi
|
|
|
5149
5159
|
await maybeStartOnTurnRecording(resolvedSandbox, activeSandboxBackend);
|
|
5150
5160
|
},
|
|
5151
5161
|
...(packRuntime.skills.length > 0 ? { packSkills: packRuntime.skills } : {}),
|
|
5162
|
+
...(session.skills.length > 0 ? { sessionSkills: session.skills } : {}),
|
|
5152
5163
|
...(skillLibraryRuntime.skillLibrarySkills.length > 0
|
|
5153
5164
|
? {
|
|
5154
5165
|
skillLibrarySkills: skillLibraryRuntime.skillLibrarySkills,
|