@opengeni/worker-bundle 6.6.1-canary.41657852324001 → 6.7.0

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.
Files changed (26) hide show
  1. package/dist/activities/agent-turn/prompt-tool-availability.d.ts +12 -1
  2. package/dist/activities/agent-turn/tool-environment.d.ts +3 -1
  3. package/dist/{activities-control-YEDEFXTR.js → activities-control-LJVIL5FP.js} +4 -4
  4. package/dist/{activities-turn-YT2OLABL.js → activities-turn-GTZPMF6T.js} +34 -7
  5. package/dist/activities-turn-GTZPMF6T.js.map +1 -0
  6. package/dist/artifact-materializer-entry.js +0 -0
  7. package/dist/artifact-outbox-entry.js +0 -0
  8. package/dist/{chunk-6AMYPT2B.js → chunk-C5RYXGXF.js} +2 -2
  9. package/dist/{chunk-IXEKKMJD.js → chunk-Q4KXCK36.js} +2 -2
  10. package/dist/{chunk-LQ352XGC.js → chunk-W2IHRF7L.js} +8 -1
  11. package/dist/chunk-W2IHRF7L.js.map +1 -0
  12. package/dist/index.js +3 -3
  13. package/dist/{sandbox-lease-GIEUWXRI.js → sandbox-lease-ILEZ6RVI.js} +3 -3
  14. package/dist/workflow-bundle.js +1 -1
  15. package/package.json +29 -30
  16. package/src/activities/agent-turn/prompt-tool-availability.ts +50 -2
  17. package/src/activities/agent-turn/run.ts +1 -0
  18. package/src/activities/agent-turn/skill-selection.ts +2 -1
  19. package/src/activities/agent-turn/tool-environment.ts +6 -0
  20. package/src/observability-metrics.ts +7 -0
  21. package/dist/activities-turn-YT2OLABL.js.map +0 -1
  22. package/dist/chunk-LQ352XGC.js.map +0 -1
  23. /package/dist/{activities-control-YEDEFXTR.js.map → activities-control-LJVIL5FP.js.map} +0 -0
  24. /package/dist/{chunk-6AMYPT2B.js.map → chunk-C5RYXGXF.js.map} +0 -0
  25. /package/dist/{chunk-IXEKKMJD.js.map → chunk-Q4KXCK36.js.map} +0 -0
  26. /package/dist/{sandbox-lease-GIEUWXRI.js.map → sandbox-lease-ILEZ6RVI.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { type AgentPromptToolAvailability } from "@opengeni/runtime";
2
- import type { FirstPartyMcpToolName, Permission, ResolvedAgentConfig } from "@opengeni/contracts";
2
+ import type { AgentLearningDefaults, FirstPartyMcpToolName, Permission, ResolvedAgentConfig } from "@opengeni/contracts";
3
3
  /**
4
4
  * The frozen clause-availability view for one attempt's modular instructions.
5
5
  * Derived from the same accepted first-party selection and permission ceiling
@@ -7,6 +7,12 @@ import type { FirstPartyMcpToolName, Permission, ResolvedAgentConfig } from "@op
7
7
  * so it can only describe tools the executable catalog already excludes. It is
8
8
  * a rendering input, never authority.
9
9
  *
10
+ * The turn's frozen learning modes are a rendering input too: with a category
11
+ * Off, its authoring clauses are omitted as if those tools were absent. The
12
+ * tools themselves stay in the catalog and still answer with the refusal, so
13
+ * nothing executable changes. Learning settings change rarely, so the prefix
14
+ * stays stable between turns.
15
+ *
10
16
  * Sessions without an agent configuration keep the legacy composition, which
11
17
  * does not read availability; they receive undefined so nothing changes.
12
18
  */
@@ -14,4 +20,9 @@ export declare function promptToolAvailabilityForTurn(input: {
14
20
  agentConfig: ResolvedAgentConfig | null | undefined;
15
21
  selectedFirstPartyMcpTools: readonly FirstPartyMcpToolName[];
16
22
  firstPartyPermissions: readonly Permission[] | null | undefined;
23
+ /** Frozen on the session; an exhausted depth hides `session_create`. */
24
+ nestedAgentDepth?: number | undefined;
25
+ effectiveMaxNestedAgentDepth?: number | undefined;
26
+ /** The accepted turn's effective learning modes; omitted keeps every clause. */
27
+ learning?: AgentLearningDefaults | undefined;
17
28
  }): AgentPromptToolAvailability | undefined;
@@ -4,7 +4,7 @@ import { withFirstPartyTools } from "../goals.js";
4
4
  import type { TurnActivityServices as ActivityServices, RunAgentTurnInput } from "../types.js";
5
5
  import { ToolResultSpill } from "./tool-result-spill.js";
6
6
  import { createTurnMediaArtifacts } from "./media-artifacts.js";
7
- import { type ResourceRef, type Permission } from "@opengeni/contracts";
7
+ import { type AgentLearningDefaults, type ResourceRef, type Permission } from "@opengeni/contracts";
8
8
  import type { ClaimTurnOk } from "./claim.js";
9
9
  import type { GovernanceModelOk } from "./governance-model.js";
10
10
  import type { SandboxTurnRuntime } from "./sandbox-runtime.js";
@@ -85,6 +85,8 @@ export type PrepareTurnToolRuntimeDeps = {
85
85
  /** Present when this turn resolves host-managed run credentials. */
86
86
  runCredentialRenewals?: RenewalState | undefined;
87
87
  runMcpCredentials?: RunMcpCredentials;
88
+ /** The accepted turn's frozen effective learning modes (instructions rendering only). */
89
+ learningModes?: AgentLearningDefaults | undefined;
88
90
  };
89
91
  export declare function prepareTurnToolPolicy(deps: PrepareTurnToolPolicyDeps): Promise<{
90
92
  turnResources: ({
@@ -20,7 +20,7 @@ import {
20
20
  withFirstPartyTools,
21
21
  workflowIdForSession,
22
22
  writeSessionUsageReceipts
23
- } from "./chunk-IXEKKMJD.js";
23
+ } from "./chunk-Q4KXCK36.js";
24
24
  import "./chunk-5E7CLEQM.js";
25
25
  import {
26
26
  createSiteAuthMaintenanceActivities
@@ -28,13 +28,13 @@ import {
28
28
  import {
29
29
  createBrowserDeadlineCheckpointActivities,
30
30
  createSandboxLeaseActivities
31
- } from "./chunk-6AMYPT2B.js";
31
+ } from "./chunk-C5RYXGXF.js";
32
32
  import "./chunk-XTG32O4Q.js";
33
33
  import "./chunk-BKPKTXFV.js";
34
34
  import {
35
35
  recordTurnsQueuedGauge,
36
36
  recordWorkerDeathRecoveryMetrics
37
- } from "./chunk-LQ352XGC.js";
37
+ } from "./chunk-W2IHRF7L.js";
38
38
  import {
39
39
  deliverFailedChildTurnToParent,
40
40
  notifyParentOfChildIdle,
@@ -8961,4 +8961,4 @@ export {
8961
8961
  createControlActivities,
8962
8962
  createControlActivitiesFromServices
8963
8963
  };
8964
- //# sourceMappingURL=activities-control-YEDEFXTR.js.map
8964
+ //# sourceMappingURL=activities-control-LJVIL5FP.js.map
@@ -120,7 +120,7 @@ import {
120
120
  wakeSubscriptionCoreWaitersAndDeliver,
121
121
  withFirstPartyTools,
122
122
  withModelRoutePresentation
123
- } from "./chunk-IXEKKMJD.js";
123
+ } from "./chunk-Q4KXCK36.js";
124
124
  import "./chunk-5E7CLEQM.js";
125
125
  import {
126
126
  agentBackgroundCommandDeps,
@@ -173,7 +173,7 @@ import {
173
173
  runtimeMetricsHooksForObservability,
174
174
  sandboxAutomaticRecoveryOutcome,
175
175
  turnLifecycleMetricsFor
176
- } from "./chunk-LQ352XGC.js";
176
+ } from "./chunk-W2IHRF7L.js";
177
177
  import {
178
178
  deliverChildRequiresActionToParent,
179
179
  deliverFailedChildTurnToParent
@@ -38092,12 +38092,34 @@ import {
38092
38092
  import {
38093
38093
  deriveAgentPromptToolAvailability
38094
38094
  } from "@opengeni/runtime";
38095
+ var KNOWLEDGE_AUTHORING_TOOLS = [
38096
+ "knowledge_save",
38097
+ "knowledge_prepare_save",
38098
+ "knowledge_retain_message",
38099
+ "knowledge_retain_file",
38100
+ "knowledge_archive",
38101
+ "task_note_promote_knowledge"
38102
+ ];
38103
+ var INSTRUCTION_AUTHORING_TOOLS = [
38104
+ "instruction_policy_save"
38105
+ ];
38095
38106
  function promptToolAvailabilityForTurn(input) {
38096
38107
  if (!input.agentConfig) return void 0;
38097
- return deriveAgentPromptToolAvailability({
38108
+ const availability = deriveAgentPromptToolAvailability({
38098
38109
  selectedFirstPartyTools: input.selectedFirstPartyMcpTools,
38099
- firstPartyPermissions: input.firstPartyPermissions
38110
+ firstPartyPermissions: input.firstPartyPermissions,
38111
+ nestedAgentDepth: input.nestedAgentDepth,
38112
+ effectiveMaxNestedAgentDepth: input.effectiveMaxNestedAgentDepth
38100
38113
  });
38114
+ const refused = [
38115
+ ...input.learning?.knowledge === "off" ? KNOWLEDGE_AUTHORING_TOOLS : [],
38116
+ ...input.learning?.instructions === "off" ? INSTRUCTION_AUTHORING_TOOLS : []
38117
+ ];
38118
+ if (refused.length === 0) return availability;
38119
+ return {
38120
+ ...availability,
38121
+ unavailable: [.../* @__PURE__ */ new Set([...availability.unavailable, ...refused])].sort()
38122
+ };
38101
38123
  }
38102
38124
 
38103
38125
  // src/activities/agent-turn/tool-environment.ts
@@ -40566,7 +40588,8 @@ function configuredBundledSkillNames(context) {
40566
40588
  { name: "visualize", include: () => true },
40567
40589
  { name: "document-parsing", include: () => true },
40568
40590
  { name: "skill-management", include: () => true },
40569
- { name: "projects", include: () => true },
40591
+ // The Skill only explains the project tools; without them it is noise.
40592
+ { name: "projects", include: () => tools.has("project_list") },
40570
40593
  { name: "schedules", include: () => tools.has("scheduled_tasks_create") },
40571
40594
  {
40572
40595
  name: "event-triggers",
@@ -40879,7 +40902,10 @@ async function prepareTurnToolRuntime(deps) {
40879
40902
  const promptToolAvailability = promptToolAvailabilityForTurn({
40880
40903
  agentConfig: session.agent,
40881
40904
  selectedFirstPartyMcpTools,
40882
- firstPartyPermissions: effectiveFirstPartyPermissions
40905
+ firstPartyPermissions: effectiveFirstPartyPermissions,
40906
+ nestedAgentDepth: session.nestedAgentDepth,
40907
+ effectiveMaxNestedAgentDepth: session.effectiveMaxNestedAgentDepth,
40908
+ learning: deps.learningModes
40883
40909
  });
40884
40910
  const needsTitle = shouldRequestMissingSessionTitle({
40885
40911
  agentConfig: session.agent,
@@ -45011,6 +45037,7 @@ These are publication receipts for the human's earlier answer. Do not call the r
45011
45037
  });
45012
45038
  const toolRuntime = await prepareTurnToolRuntime({
45013
45039
  independentSessionTitles: !!startSessionTitleWorkflow,
45040
+ learningModes: learning.effective,
45014
45041
  vaultAccess,
45015
45042
  runCredentialRenewals: runCredentialResolver ? renewals : void 0,
45016
45043
  runMcpCredentials,
@@ -46729,4 +46756,4 @@ export {
46729
46756
  createTurnActivities,
46730
46757
  createTurnActivitiesFromServices
46731
46758
  };
46732
- //# sourceMappingURL=activities-turn-YT2OLABL.js.map
46759
+ //# sourceMappingURL=activities-turn-GTZPMF6T.js.map