managed-deepagents 0.9.0-dev.1 → 0.9.0-dev.3

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 (154) hide show
  1. package/README.md +81 -36
  2. package/dist/agent-entry.d.ts +6 -0
  3. package/dist/agent-entry.d.ts.map +1 -0
  4. package/dist/agent-entry.js +2 -0
  5. package/dist/agent-entry.js.map +1 -0
  6. package/dist/channels/binding.d.ts +5 -0
  7. package/dist/channels/binding.d.ts.map +1 -1
  8. package/dist/channels/binding.js +4 -1
  9. package/dist/channels/binding.js.map +1 -1
  10. package/dist/channels/messaging-registry.d.ts +2 -0
  11. package/dist/channels/messaging-registry.d.ts.map +1 -1
  12. package/dist/channels/messaging-registry.js +10 -0
  13. package/dist/channels/messaging-registry.js.map +1 -1
  14. package/dist/channels/reactions.d.ts +32 -0
  15. package/dist/channels/reactions.d.ts.map +1 -0
  16. package/dist/channels/reactions.js +53 -0
  17. package/dist/channels/reactions.js.map +1 -0
  18. package/dist/channels/response-format.d.ts +1 -0
  19. package/dist/channels/response-format.d.ts.map +1 -1
  20. package/dist/channels/response-format.js +30 -4
  21. package/dist/channels/response-format.js.map +1 -1
  22. package/dist/channels/slack/files-middleware.d.ts +4 -4
  23. package/dist/channels/slack/files-middleware.d.ts.map +1 -1
  24. package/dist/channels/slack/files-middleware.js +11 -9
  25. package/dist/channels/slack/files-middleware.js.map +1 -1
  26. package/dist/channels/slack/files.d.ts +3 -2
  27. package/dist/channels/slack/files.d.ts.map +1 -1
  28. package/dist/channels/slack/files.js +35 -15
  29. package/dist/channels/slack/files.js.map +1 -1
  30. package/dist/channels/slack/index.d.ts +8 -0
  31. package/dist/channels/slack/index.d.ts.map +1 -1
  32. package/dist/channels/slack/index.js +10 -0
  33. package/dist/channels/slack/index.js.map +1 -1
  34. package/dist/channels/trigger/http.d.ts +3 -0
  35. package/dist/channels/trigger/http.d.ts.map +1 -1
  36. package/dist/channels/trigger/http.js +84 -37
  37. package/dist/channels/trigger/http.js.map +1 -1
  38. package/dist/channels/trigger/types.d.ts +21 -2
  39. package/dist/channels/trigger/types.d.ts.map +1 -1
  40. package/dist/channels/trigger/types.js.map +1 -1
  41. package/dist/connection-authorization.d.ts +7 -0
  42. package/dist/connection-authorization.d.ts.map +1 -1
  43. package/dist/connection-authorization.js +1 -1
  44. package/dist/connection-authorization.js.map +1 -1
  45. package/dist/connectors/mcp/index.d.ts +12 -12
  46. package/dist/connectors/mcp/index.d.ts.map +1 -1
  47. package/dist/connectors/mcp/index.js +85 -125
  48. package/dist/connectors/mcp/index.js.map +1 -1
  49. package/dist/connectors/mcp/langsmith-url.js +2 -2
  50. package/dist/connectors/mcp/langsmith-url.js.map +1 -1
  51. package/dist/connectors/mcp/schema.d.ts +4 -13
  52. package/dist/connectors/mcp/schema.d.ts.map +1 -1
  53. package/dist/connectors/mcp/schema.js +57 -96
  54. package/dist/connectors/mcp/schema.js.map +1 -1
  55. package/dist/connectors/mcp/types.d.ts +17 -51
  56. package/dist/connectors/mcp/types.d.ts.map +1 -1
  57. package/dist/credential-gate.d.ts.map +1 -1
  58. package/dist/credential-gate.js +2 -4
  59. package/dist/credential-gate.js.map +1 -1
  60. package/dist/define-deep-agent.d.ts +7 -5
  61. package/dist/define-deep-agent.d.ts.map +1 -1
  62. package/dist/define-deep-agent.js +13 -17
  63. package/dist/define-deep-agent.js.map +1 -1
  64. package/dist/index.d.ts +5 -3
  65. package/dist/index.d.ts.map +1 -1
  66. package/dist/index.js.map +1 -1
  67. package/dist/managed-composition.d.ts +21 -0
  68. package/dist/managed-composition.d.ts.map +1 -0
  69. package/dist/managed-composition.js +244 -0
  70. package/dist/managed-composition.js.map +1 -0
  71. package/dist/memory/define-memory.d.ts.map +1 -1
  72. package/dist/memory/define-memory.js +4 -5
  73. package/dist/memory/define-memory.js.map +1 -1
  74. package/dist/memory/types.d.ts +18 -3
  75. package/dist/memory/types.d.ts.map +1 -1
  76. package/dist/runtime/agent-entry.d.ts +6 -0
  77. package/dist/runtime/agent-entry.d.ts.map +1 -0
  78. package/dist/runtime/agent-entry.js +38 -0
  79. package/dist/runtime/agent-entry.js.map +1 -0
  80. package/dist/runtime/auth.d.ts +2 -0
  81. package/dist/runtime/auth.d.ts.map +1 -1
  82. package/dist/runtime/auth.js.map +1 -1
  83. package/dist/runtime/backend.d.ts +1 -0
  84. package/dist/runtime/backend.d.ts.map +1 -1
  85. package/dist/runtime/backend.js +9 -6
  86. package/dist/runtime/backend.js.map +1 -1
  87. package/dist/runtime/eval-filesystem.d.ts +4 -2
  88. package/dist/runtime/eval-filesystem.d.ts.map +1 -1
  89. package/dist/runtime/eval-filesystem.js +134 -8
  90. package/dist/runtime/eval-filesystem.js.map +1 -1
  91. package/dist/runtime/identity-runtime.d.ts +6 -8
  92. package/dist/runtime/identity-runtime.d.ts.map +1 -1
  93. package/dist/runtime/identity-runtime.js +12 -8
  94. package/dist/runtime/identity-runtime.js.map +1 -1
  95. package/dist/runtime/index.d.ts +4 -221
  96. package/dist/runtime/index.d.ts.map +1 -1
  97. package/dist/runtime/index.js +163 -47
  98. package/dist/runtime/index.js.map +1 -1
  99. package/dist/runtime/managed-tools.d.ts +7 -9
  100. package/dist/runtime/managed-tools.d.ts.map +1 -1
  101. package/dist/runtime/managed-tools.js +1 -11
  102. package/dist/runtime/managed-tools.js.map +1 -1
  103. package/dist/runtime/memory/index.d.ts +1 -1
  104. package/dist/runtime/memory/index.d.ts.map +1 -1
  105. package/dist/runtime/memory/index.js +1 -1
  106. package/dist/runtime/memory/index.js.map +1 -1
  107. package/dist/runtime/memory/mounts.d.ts +3 -2
  108. package/dist/runtime/memory/mounts.d.ts.map +1 -1
  109. package/dist/runtime/memory/mounts.js +11 -15
  110. package/dist/runtime/memory/mounts.js.map +1 -1
  111. package/dist/runtime/memory/paths.d.ts +1 -0
  112. package/dist/runtime/memory/paths.d.ts.map +1 -1
  113. package/dist/runtime/memory/paths.js +10 -0
  114. package/dist/runtime/memory/paths.js.map +1 -1
  115. package/dist/runtime/memory/policy.d.ts +1 -1
  116. package/dist/runtime/memory/policy.d.ts.map +1 -1
  117. package/dist/runtime/memory/policy.js +6 -2
  118. package/dist/runtime/memory/policy.js.map +1 -1
  119. package/dist/runtime/run-input.d.ts +35 -31
  120. package/dist/runtime/run-input.d.ts.map +1 -1
  121. package/dist/runtime/run-input.js +64 -8
  122. package/dist/runtime/run-input.js.map +1 -1
  123. package/dist/runtime/sandbox-manager.d.ts +14 -2
  124. package/dist/runtime/sandbox-manager.d.ts.map +1 -1
  125. package/dist/runtime/sandbox-manager.js +90 -12
  126. package/dist/runtime/sandbox-manager.js.map +1 -1
  127. package/dist/runtime/schedule-auth.d.ts +2 -0
  128. package/dist/runtime/schedule-auth.d.ts.map +1 -1
  129. package/dist/runtime/schedule-auth.js +3 -0
  130. package/dist/runtime/schedule-auth.js.map +1 -1
  131. package/dist/runtime/selected-skills-backend.d.ts +22 -0
  132. package/dist/runtime/selected-skills-backend.d.ts.map +1 -0
  133. package/dist/runtime/selected-skills-backend.js +238 -0
  134. package/dist/runtime/selected-skills-backend.js.map +1 -0
  135. package/dist/runtime/selected-skills.d.ts +13 -0
  136. package/dist/runtime/selected-skills.d.ts.map +1 -0
  137. package/dist/runtime/selected-skills.js +257 -0
  138. package/dist/runtime/selected-skills.js.map +1 -0
  139. package/dist/runtime/static-entry.d.ts +4 -0
  140. package/dist/runtime/static-entry.d.ts.map +1 -0
  141. package/dist/runtime/static-entry.js +16 -0
  142. package/dist/runtime/static-entry.js.map +1 -0
  143. package/dist/runtime/types.d.ts +6 -8
  144. package/dist/runtime/types.d.ts.map +1 -1
  145. package/dist/runtime-schedules.d.ts.map +1 -1
  146. package/dist/runtime-schedules.js +12 -1
  147. package/dist/runtime-schedules.js.map +1 -1
  148. package/dist/sandbox.d.ts +2 -1
  149. package/dist/sandbox.d.ts.map +1 -1
  150. package/dist/sandbox.js.map +1 -1
  151. package/dist/types.d.ts +39 -16
  152. package/dist/types.d.ts.map +1 -1
  153. package/dist/types.js.map +1 -1
  154. package/package.json +10 -10
@@ -1,6 +1,7 @@
1
- import type { DeepAgentDefinition } from "../types.js";
1
+ import type { AgentEntry } from "../agent-entry.js";
2
2
  import type { ManagedAgentOptions, ManagedRunConfig, ManagedServerRuntime } from "./types.js";
3
3
  export type { ManagedAgentOptions, ManagedRunConfig, ManagedServerRuntime, } from "./types.js";
4
+ export { assertStaticAgentDefinition } from "./static-entry.js";
4
5
  export { createEvalTrialFilesystemBackend } from "./eval-filesystem.js";
5
6
  export { buildManagedAuth } from "./auth.js";
6
7
  export { buildManagedHttpApp } from "./identity-http.js";
@@ -26,116 +27,7 @@ export declare const MANAGED_DEEP_AGENT_INSTRUCTIONS: string;
26
27
  * scratch fallback, and managed memory/skills. It is consumed only by the
27
28
  * generated entry module; agent authors never call it.
28
29
  */
29
- export declare function compileManagedAgent(definition: DeepAgentDefinition, config?: ManagedRunConfig, options?: ManagedAgentOptions, runtime?: ManagedServerRuntime): Promise<import("langchain").ReactAgent<import("deepagents").DeepAgentTypeConfig<import("langchain").ResponseFormatUndefined, undefined, import("@langchain/core/utils/types").InteropZodObject, readonly [import("langchain").AgentMiddleware<import("@langchain/langgraph").StateSchema<{
30
- files: import("@langchain/langgraph").ReducedValue<{
31
- [x: string]: import("deepagents").FileData;
32
- } | undefined, {
33
- [x: string]: import("deepagents").FileData | null;
34
- } | undefined>;
35
- }>, undefined, unknown, (import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
36
- path: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
37
- }, import("zod/v4/core").$strip>, {
38
- path: string;
39
- }, {
40
- path?: string | undefined;
41
- }, string | import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>, unknown, "ls"> | import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
42
- pattern: import("zod").ZodString;
43
- path: import("zod").ZodOptional<import("zod").ZodString>;
44
- }, import("zod/v4/core").$strip>, {
45
- pattern: string;
46
- path?: string | undefined;
47
- }, {
48
- pattern: string;
49
- path?: string | undefined;
50
- }, string | import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>, unknown, "glob"> | import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
51
- pattern: import("zod").ZodString;
52
- path: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
53
- glob: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>>;
54
- max_count: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>>>;
55
- output_mode: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodEnum<{
56
- content: "content";
57
- count: "count";
58
- files_with_matches: "files_with_matches";
59
- }>>>;
60
- }, import("zod/v4/core").$strip>, {
61
- pattern: string;
62
- path: string;
63
- glob: string | null;
64
- max_count: number | null;
65
- output_mode: "content" | "count" | "files_with_matches";
66
- }, {
67
- pattern: string;
68
- path?: string | undefined;
69
- glob?: string | null | undefined;
70
- max_count?: unknown;
71
- output_mode?: "content" | "count" | "files_with_matches" | undefined;
72
- }, string | import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>, unknown, "grep"> | import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
73
- command: import("zod").ZodString;
74
- }, import("zod/v4/core").$strip>, {
75
- command: string;
76
- }, {
77
- command: string;
78
- }, string, unknown, "execute"> | import("langchain").DynamicStructuredTool<import("zod").ZodPreprocess<import("zod").ZodObject<{
79
- file_path: import("zod").ZodString;
80
- offset: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>>;
81
- limit: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>>;
82
- }, import("zod/v4/core").$strip>, unknown>, {
83
- file_path: string;
84
- offset: number;
85
- limit: number;
86
- }, unknown, {
87
- type: string;
88
- text: string;
89
- }[] | {
90
- type: string;
91
- mimeType: string;
92
- data: string;
93
- }[] | import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>, unknown, "read_file"> | import("langchain").DynamicStructuredTool<import("zod").ZodPreprocess<import("zod").ZodObject<{
94
- file_path: import("zod").ZodString;
95
- content: import("zod").ZodString;
96
- }, import("zod/v4/core").$strip>, unknown>, {
97
- file_path: string;
98
- content: string;
99
- }, unknown, string | import("@langchain/langgraph").Command<unknown, {
100
- files: Record<string, import("deepagents").FileData>;
101
- messages: import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>[];
102
- }, string> | import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>, unknown, "write_file"> | import("langchain").DynamicStructuredTool<import("zod").ZodPreprocess<import("zod").ZodObject<{
103
- file_path: import("zod").ZodString;
104
- old_string: import("zod").ZodString;
105
- new_string: import("zod").ZodString;
106
- replace_all: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
107
- }, import("zod/v4/core").$strip>, unknown>, {
108
- file_path: string;
109
- old_string: string;
110
- new_string: string;
111
- replace_all: boolean;
112
- }, unknown, string | import("@langchain/langgraph").Command<unknown, {
113
- files: Record<string, import("deepagents").FileData>;
114
- messages: import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>[];
115
- }, string> | import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>, unknown, "edit_file"> | import("langchain").DynamicStructuredTool<import("zod").ZodPreprocess<import("zod").ZodObject<{
116
- file_path: import("zod").ZodString;
117
- }, import("zod/v4/core").$strip>, unknown>, {
118
- file_path: string;
119
- }, unknown, import("@langchain/langgraph").Command<unknown, {
120
- files: Record<string, null>;
121
- messages: import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>[];
122
- }, string> | import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>, unknown, "delete">)[], readonly []>, import("langchain").AgentMiddleware<undefined, undefined, unknown, readonly [import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
123
- description: import("zod").ZodString;
124
- subagent_type: import("zod").ZodString;
125
- }, import("zod/v4/core").$strip>, {
126
- description: string;
127
- subagent_type: string;
128
- }, {
129
- description: string;
130
- subagent_type: string;
131
- }, string | import("@langchain/langgraph").Command<unknown, Record<string, unknown>, string>, unknown, "task">], readonly []>, import("langchain").AgentMiddleware<import("zod").ZodObject<{
132
- _summarizationSessionId: import("zod").ZodOptional<import("zod").ZodString>;
133
- _summarizationEvent: import("zod").ZodOptional<import("zod").ZodObject<{
134
- cutoffIndex: import("zod").ZodNumber;
135
- summaryMessage: import("zod").ZodCustom<import("langchain").HumanMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>, import("langchain").HumanMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>>;
136
- filePath: import("zod").ZodNullable<import("zod").ZodString>;
137
- }, import("zod/v4/core").$strip>>;
138
- }, import("zod/v4/core").$strip>, undefined, unknown, readonly (import("@langchain/core/tools").ServerTool | import("@langchain/core/tools").ClientTool)[], readonly []>, import("langchain").AgentMiddleware<undefined, undefined, unknown, readonly (import("@langchain/core/tools").ServerTool | import("@langchain/core/tools").ClientTool)[], readonly []>], readonly [], readonly [], readonly []>>>;
30
+ export declare function compileManagedAgent(entry: AgentEntry, config?: ManagedRunConfig, options?: ManagedAgentOptions, runtime?: ManagedServerRuntime): Promise<any>;
139
31
  export interface ManagedEvalOptions extends Omit<ManagedAgentOptions, "contextRepo" | "sandbox" | "memory"> {
140
32
  modelOverride?: string;
141
33
  }
@@ -156,114 +48,5 @@ export interface ManagedEvalOptions extends Omit<ManagedAgentOptions, "contextRe
156
48
  * The model override is applied to a copied definition so normal dev/deploy
157
49
  * behavior remains unchanged.
158
50
  */
159
- export declare function compileManagedAgentForEval(definition: DeepAgentDefinition, config?: ManagedRunConfig, options?: ManagedEvalOptions): Promise<import("langchain").ReactAgent<import("deepagents").DeepAgentTypeConfig<import("langchain").ResponseFormatUndefined, undefined, import("@langchain/core/utils/types").InteropZodObject, readonly [import("langchain").AgentMiddleware<import("@langchain/langgraph").StateSchema<{
160
- files: import("@langchain/langgraph").ReducedValue<{
161
- [x: string]: import("deepagents").FileData;
162
- } | undefined, {
163
- [x: string]: import("deepagents").FileData | null;
164
- } | undefined>;
165
- }>, undefined, unknown, (import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
166
- path: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
167
- }, import("zod/v4/core").$strip>, {
168
- path: string;
169
- }, {
170
- path?: string | undefined;
171
- }, string | import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>, unknown, "ls"> | import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
172
- pattern: import("zod").ZodString;
173
- path: import("zod").ZodOptional<import("zod").ZodString>;
174
- }, import("zod/v4/core").$strip>, {
175
- pattern: string;
176
- path?: string | undefined;
177
- }, {
178
- pattern: string;
179
- path?: string | undefined;
180
- }, string | import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>, unknown, "glob"> | import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
181
- pattern: import("zod").ZodString;
182
- path: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
183
- glob: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>>;
184
- max_count: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>>>;
185
- output_mode: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodEnum<{
186
- content: "content";
187
- count: "count";
188
- files_with_matches: "files_with_matches";
189
- }>>>;
190
- }, import("zod/v4/core").$strip>, {
191
- pattern: string;
192
- path: string;
193
- glob: string | null;
194
- max_count: number | null;
195
- output_mode: "content" | "count" | "files_with_matches";
196
- }, {
197
- pattern: string;
198
- path?: string | undefined;
199
- glob?: string | null | undefined;
200
- max_count?: unknown;
201
- output_mode?: "content" | "count" | "files_with_matches" | undefined;
202
- }, string | import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>, unknown, "grep"> | import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
203
- command: import("zod").ZodString;
204
- }, import("zod/v4/core").$strip>, {
205
- command: string;
206
- }, {
207
- command: string;
208
- }, string, unknown, "execute"> | import("langchain").DynamicStructuredTool<import("zod").ZodPreprocess<import("zod").ZodObject<{
209
- file_path: import("zod").ZodString;
210
- offset: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>>;
211
- limit: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>>;
212
- }, import("zod/v4/core").$strip>, unknown>, {
213
- file_path: string;
214
- offset: number;
215
- limit: number;
216
- }, unknown, {
217
- type: string;
218
- text: string;
219
- }[] | {
220
- type: string;
221
- mimeType: string;
222
- data: string;
223
- }[] | import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>, unknown, "read_file"> | import("langchain").DynamicStructuredTool<import("zod").ZodPreprocess<import("zod").ZodObject<{
224
- file_path: import("zod").ZodString;
225
- content: import("zod").ZodString;
226
- }, import("zod/v4/core").$strip>, unknown>, {
227
- file_path: string;
228
- content: string;
229
- }, unknown, string | import("@langchain/langgraph").Command<unknown, {
230
- files: Record<string, import("deepagents").FileData>;
231
- messages: import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>[];
232
- }, string> | import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>, unknown, "write_file"> | import("langchain").DynamicStructuredTool<import("zod").ZodPreprocess<import("zod").ZodObject<{
233
- file_path: import("zod").ZodString;
234
- old_string: import("zod").ZodString;
235
- new_string: import("zod").ZodString;
236
- replace_all: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
237
- }, import("zod/v4/core").$strip>, unknown>, {
238
- file_path: string;
239
- old_string: string;
240
- new_string: string;
241
- replace_all: boolean;
242
- }, unknown, string | import("@langchain/langgraph").Command<unknown, {
243
- files: Record<string, import("deepagents").FileData>;
244
- messages: import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>[];
245
- }, string> | import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>, unknown, "edit_file"> | import("langchain").DynamicStructuredTool<import("zod").ZodPreprocess<import("zod").ZodObject<{
246
- file_path: import("zod").ZodString;
247
- }, import("zod/v4/core").$strip>, unknown>, {
248
- file_path: string;
249
- }, unknown, import("@langchain/langgraph").Command<unknown, {
250
- files: Record<string, null>;
251
- messages: import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>[];
252
- }, string> | import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>, unknown, "delete">)[], readonly []>, import("langchain").AgentMiddleware<undefined, undefined, unknown, readonly [import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
253
- description: import("zod").ZodString;
254
- subagent_type: import("zod").ZodString;
255
- }, import("zod/v4/core").$strip>, {
256
- description: string;
257
- subagent_type: string;
258
- }, {
259
- description: string;
260
- subagent_type: string;
261
- }, string | import("@langchain/langgraph").Command<unknown, Record<string, unknown>, string>, unknown, "task">], readonly []>, import("langchain").AgentMiddleware<import("zod").ZodObject<{
262
- _summarizationSessionId: import("zod").ZodOptional<import("zod").ZodString>;
263
- _summarizationEvent: import("zod").ZodOptional<import("zod").ZodObject<{
264
- cutoffIndex: import("zod").ZodNumber;
265
- summaryMessage: import("zod").ZodCustom<import("langchain").HumanMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>, import("langchain").HumanMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>>;
266
- filePath: import("zod").ZodNullable<import("zod").ZodString>;
267
- }, import("zod/v4/core").$strip>>;
268
- }, import("zod/v4/core").$strip>, undefined, unknown, readonly (import("@langchain/core/tools").ServerTool | import("@langchain/core/tools").ClientTool)[], readonly []>, import("langchain").AgentMiddleware<undefined, undefined, unknown, readonly (import("@langchain/core/tools").ServerTool | import("@langchain/core/tools").ClientTool)[], readonly []>], readonly [], readonly [], readonly []>>>;
51
+ export declare function compileManagedAgentForEval(entry: AgentEntry, config?: ManagedRunConfig, options?: ManagedEvalOptions): Promise<any>;
269
52
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAyCvD,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,YAAY,CAAC;AAIpB,YAAY,EACV,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAIzD,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,EACX,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,SAAS,EACT,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,EACjB,yBAAyB,EACzB,aAAa,EACb,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,WAAW,GACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,aAAa,EACb,eAAe,EACf,SAAS,EACT,wBAAwB,GACzB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,OAAO,EACP,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAG9C,eAAO,MAAM,+BAA+B,QAGnB,CAAC;AAE1B;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,mBAAmB,EAC/B,MAAM,CAAC,EAAE,gBAAgB,EACzB,OAAO,CAAC,EAAE,mBAAmB,EAC7B,OAAO,CAAC,EAAE,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2YAkB/B;AAuUD,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAC9C,mBAAmB,EACnB,aAAa,GAAG,SAAS,GAAG,QAAQ,CACrC;IACC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,0BAA0B,CAC9C,UAAU,EAAE,mBAAmB,EAC/B,MAAM,CAAC,EAAE,gBAAgB,EACzB,OAAO,CAAC,EAAE,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2YAuB7B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAsDpD,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,YAAY,CAAC;AAUpB,YAAY,EACV,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAIzD,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,EACX,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,SAAS,EACT,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,EACjB,yBAAyB,EACzB,aAAa,EACb,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,WAAW,GACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,aAAa,EACb,eAAe,EACf,SAAS,EACT,wBAAwB,GACzB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,OAAO,EACP,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAG9C,eAAO,MAAM,+BAA+B,QAGnB,CAAC;AAO1B;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,UAAU,EACjB,MAAM,CAAC,EAAE,gBAAgB,EACzB,OAAO,CAAC,EAAE,mBAAmB,EAC7B,OAAO,CAAC,EAAE,oBAAoB,gBA4C/B;AA8cD,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAC9C,mBAAmB,EACnB,aAAa,GAAG,SAAS,GAAG,QAAQ,CACrC;IACC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,0BAA0B,CAC9C,KAAK,EAAE,UAAU,EACjB,MAAM,CAAC,EAAE,gBAAgB,EACzB,OAAO,CAAC,EAAE,kBAAkB,gBAsC7B"}
@@ -1,6 +1,9 @@
1
1
  import { createSlackFileTransferMiddleware } from "../channels/slack/files-middleware.js";
2
2
  import { ContextHubBackend, FilesystemBackend, createDeepAgent, } from "deepagents";
3
+ import { snapshotMemorySelection, snapshotMcpSelection, snapshotSandboxSelection, } from "../managed-composition.js";
3
4
  import { LazyManagedSandboxBackend } from "./backend.js";
5
+ import { sandboxSelectionFingerprint } from "./sandbox-manager.js";
6
+ import { resolveAgentDefinition } from "./agent-entry.js";
4
7
  import { loadConnectorTools } from "./connector.js";
5
8
  import { createScheduleDeliveryMiddleware } from "../channels/schedule-delivery.js";
6
9
  import { createChannelResponseFormatMiddleware } from "../channels/response-format.js";
@@ -11,14 +14,17 @@ import { wrapMiddlewareWithManagedRuntime, } from "./managed-middleware.js";
11
14
  import { wrapToolsWithManagedRuntime, } from "./managed-tools.js";
12
15
  import { createMemoryInstructionsMiddleware, hasAgentMemoryLayer, userMemoryLayer, } from "../memory/index.js";
13
16
  import { resolveAgentMemoryAccess, resolveUserMemoryAccess, } from "./memory/policy.js";
14
- import { resolveChannelProvider } from "../channels/binding.js";
17
+ import { resolveChannelProvider, resolveRuntimeChannel, } from "../channels/binding.js";
15
18
  import { detectRunIdentity } from "../telemetry/metadata.js";
16
19
  import { RunTelemetryListener } from "../telemetry/run-listener.js";
17
20
  import { startRun } from "../telemetry/run.js";
18
- import { asText, downloadContextFile, managedContextBackend, managedContextPermissions, UserMemoryBackend, } from "./memory/index.js";
21
+ import { asText, downloadContextFile, managedContextBackend, managedContextPermissions, managedSelectedSkillsBackend, UserMemoryBackend, } from "./memory/index.js";
22
+ import { resolveSelectedSkills } from "./selected-skills.js";
19
23
  import { createEvalTrialFilesystemBackend } from "./eval-filesystem.js";
20
- import { selectContextSchema, isRunExecution } from "./run-input.js";
24
+ import { adaptChannelExecution, executionContext, isChannelExecution, isRunExecution, } from "./run-input.js";
25
+ import { managedChannelContextSchema } from "../run-context.js";
21
26
  import { registerChannelMessaging } from "../channels/messaging-registry.js";
27
+ export { assertStaticAgentDefinition } from "./static-entry.js";
22
28
  export { createEvalTrialFilesystemBackend } from "./eval-filesystem.js";
23
29
  export { buildManagedAuth } from "./auth.js";
24
30
  export { buildManagedHttpApp } from "./identity-http.js";
@@ -47,34 +53,113 @@ export const MANAGED_DEEP_AGENT_INSTRUCTIONS = "<managed_deep_agent>\n" +
47
53
  * scratch fallback, and managed memory/skills. It is consumed only by the
48
54
  * generated entry module; agent authors never call it.
49
55
  */
50
- export async function compileManagedAgent(definition, config, options, runtime) {
51
- registerChannelMessaging(options?.channels ?? []);
56
+ export async function compileManagedAgent(entry, config, options, runtime) {
52
57
  const isRun = runtime
53
58
  ? runtime.executionRuntime !== null
54
59
  : isRunExecution(config);
55
60
  const runConfig = runtime?.executionRuntime
56
61
  ? { ...config, context: runtime.executionRuntime.context }
57
62
  : config;
58
- const contextSchema = isRun
59
- ? selectContextSchema(runConfig, definition.config.contextSchema)
60
- : definition.config.contextSchema;
61
- return compileManagedAgentGraph({ ...definition, config: { ...definition.config, contextSchema } }, runConfig, options, isRun);
63
+ registerChannelMessaging(options?.channels ?? []);
64
+ const nativeRuntime = runtime ?? internalServerRuntime(config?.context, isRun);
65
+ const { binding } = isRun
66
+ ? executionContext(runConfig)
67
+ : { binding: undefined };
68
+ const extras = {
69
+ channel: binding
70
+ ? resolveRuntimeChannel({ channel: binding }, runConfig?.configurable)
71
+ : undefined,
72
+ backend: undefined,
73
+ };
74
+ const factoryRuntime = nativeRuntime.executionRuntime
75
+ ? {
76
+ ...nativeRuntime,
77
+ ...extras,
78
+ executionRuntime: {
79
+ ...nativeRuntime.executionRuntime,
80
+ context: isRun && isChannelExecution(runConfig)
81
+ ? undefined
82
+ : nativeRuntime.executionRuntime.context,
83
+ },
84
+ }
85
+ : { ...nativeRuntime, ...extras };
86
+ const factoryEntry = typeof entry === "function";
87
+ const skipFactoryInspectionTools = factoryEntry && !isRun;
88
+ const definition = await resolveAgentDefinition(entry, factoryRuntime);
89
+ return compileResolvedManagedAgent(definition, runConfig, options, isRun, skipFactoryInspectionTools, factoryEntry);
90
+ }
91
+ /** Internal/eval calls do not have an Agent Server runtime. */
92
+ function internalServerRuntime(context, isRun) {
93
+ return isRun
94
+ ? {
95
+ accessContext: "threads.create_run",
96
+ executionRuntime: {
97
+ context: (context ?? {}),
98
+ },
99
+ }
100
+ : { accessContext: "assistants.read", executionRuntime: null };
101
+ }
102
+ async function compileResolvedManagedAgent(definition, config, options, isRun, skipFactoryInspectionTools, factoryEntry = false) {
103
+ const connectors = selectRunConnectors(definition.config, options?.connectors);
104
+ const sandbox = options?.trialRootDir
105
+ ? undefined
106
+ : selectRunSandbox(definition.config, options?.sandbox);
107
+ const sandboxFingerprint = factoryEntry && sandbox && Object.hasOwn(definition.config, "sandbox")
108
+ ? sandboxSelectionFingerprint(sandbox)
109
+ : undefined;
110
+ const runOptions = Object.hasOwn(definition.config, "mcp") ||
111
+ Object.hasOwn(definition.config, "sandbox")
112
+ ? {
113
+ ...options,
114
+ connectors,
115
+ sandbox,
116
+ sandboxSelectionFingerprint: sandboxFingerprint,
117
+ }
118
+ : options;
119
+ registerChannelMessaging(options?.channels ?? []);
120
+ return adaptChannelExecution(await compileManagedAgentGraph(definition, config, runOptions, isRun, skipFactoryInspectionTools));
121
+ }
122
+ /** Replace or disable the discovered sandbox for this run. */
123
+ function selectRunSandbox(config, discovered) {
124
+ if (!Object.hasOwn(config, "sandbox") || config.sandbox === undefined) {
125
+ return discovered;
126
+ }
127
+ return snapshotSandboxSelection(config.sandbox) ?? undefined;
62
128
  }
63
- async function compileManagedAgentGraph(definition, config, options, isRun = false) {
64
- const { contextRoot, contextRepo, systemPrompt, hasSkills = false, sandbox, connectors,
129
+ /** Replace discovered MCP definitions while preserving every other connector. */
130
+ function selectRunConnectors(config, discovered) {
131
+ if (!Object.hasOwn(config, "mcp") || config.mcp === undefined) {
132
+ return discovered;
133
+ }
134
+ const selected = config.mcp === null ? [] : snapshotMcpSelection(config.mcp);
135
+ return [
136
+ ...(discovered ?? []).filter((connector) => connector.kind !== "mcp_servers"),
137
+ ...selected,
138
+ ];
139
+ }
140
+ async function compileManagedAgentGraph(definition, config, options, isRun = false, skipFactoryInspectionTools = false) {
141
+ const { contextRoot, contextRepo, systemPrompt, hasSkills = false, sandbox, sandboxSelectionFingerprint, connectors,
65
142
  // Resolution + thread/store scoping run in the generated custom-auth handler
66
143
  // (`buildManagedAuth`). When identity is declared, the seam also surfaces
67
144
  // `runtime.serverInfo.principal` to authored + connector tools (below).
68
145
  identity,
69
- // The root `memory.{ts,py}` declaration. Absent → no durable memory: the
70
- // layers a run mounts come from here and nowhere else.
71
- memory, trialRootDir, reportTelemetry = true, } = options ?? {};
146
+ // The autodiscovered root memory declaration. An explicit dynamic
147
+ // selection below replaces it for this run.
148
+ memory: discoveredMemory, trialRootDir, reportTelemetry = true, } = options ?? {};
72
149
  const startedMonotonicMs = performance.now();
73
- const { metadata, ...agentConfig } = definition.config;
150
+ const { metadata, instructions: authoredInstructions, memory: authoredMemory, skills: skillSelection, ...agentConfig } = definition.config;
151
+ delete agentConfig.mcp;
152
+ delete agentConfig.sandbox;
153
+ const memorySelectedByDynamicResolver = Object.hasOwn(definition.config, "memory") && authoredMemory !== undefined;
154
+ const memory = memorySelectedByDynamicResolver
155
+ ? authoredMemory === null
156
+ ? undefined
157
+ : snapshotMemorySelection(authoredMemory)
158
+ : discoveredMemory;
74
159
  /** Layers mounted for this run, also used to state their objective policy. */
75
160
  let mountedMemory = [];
76
161
  /** Layers the project declared, whether or not this run was allowed them. */
77
- let requestedMemory = [];
162
+ const declaredMemory = memory?.config.scope ?? [];
78
163
  let userDeniedReason = null;
79
164
  let loadAgentMemory;
80
165
  let loadUserMemory;
@@ -85,15 +170,16 @@ async function compileManagedAgentGraph(definition, config, options, isRun = fal
85
170
  * backend resolution below.
86
171
  *
87
172
  * Each connector's `tools` hook contributes tools appended to the authored
88
- * tools. The author never imports the MCP client or calls `getTools()` — MDA
89
- * owns the connector lifecycle.
173
+ * tools. The author never imports the MCP client or calls `listTools()` —
174
+ * MDA owns the connector lifecycle.
90
175
  */
91
- const connectorToolsPromise = connectors && connectors.length > 0
176
+ const connectorToolsPromise = !skipFactoryInspectionTools && connectors && connectors.length > 0
92
177
  ? loadConnectorTools(connectors)
93
178
  : undefined;
94
179
  const sandboxBackend = sandbox
95
180
  ? LazyManagedSandboxBackend.create({
96
181
  sandbox,
182
+ sandboxSelectionFingerprint,
97
183
  runConfig: config,
98
184
  connectors,
99
185
  identity,
@@ -102,27 +188,36 @@ async function compileManagedAgentGraph(definition, config, options, isRun = fal
102
188
  const backendFactory = sandboxBackend
103
189
  ? (runtime) => sandboxBackend.bindRuntime(runtime)
104
190
  : undefined;
105
- const contextBackend = await resolveContextBackend(contextRepo, contextRoot);
191
+ const contextBackend = skipFactoryInspectionTools
192
+ ? undefined
193
+ : await resolveContextBackend(contextRepo, contextRoot);
194
+ const selectedSkills = skillSelection === undefined || skipFactoryInspectionTools
195
+ ? undefined
196
+ : await resolveSelectedSkills(skillSelection ?? [], {
197
+ ...(trialRootDir
198
+ ? { localRoot: trialRootDir }
199
+ : contextBackend
200
+ ? { contextBackend: contextBackend.backend }
201
+ : {}),
202
+ });
106
203
  if (contextBackend) {
107
- const hubPrompt = await readInstructions(contextBackend.backend);
108
- if (hubPrompt !== undefined) {
109
- params.systemPrompt = hubPrompt;
110
- }
111
204
  // Memory is opt-in: only the root `memory` declaration enables a layer, so a
112
205
  // project that declares nothing mounts nothing regardless of identity.
113
- const declaredLayers = memory?.config.scope ?? [];
114
- requestedMemory = declaredLayers;
115
- const agentLayer = declaredLayers.find((layer) => layer.type === "agent");
116
- const userLayer = userMemoryLayer(declaredLayers);
117
- const allowAgent = await resolveAgentMemoryAccess(agentLayer, config, agentConfig.contextSchema, isRun);
206
+ const agentLayer = declaredMemory.find((layer) => layer.type === "agent");
207
+ const userLayer = userMemoryLayer(declaredMemory);
208
+ const allowAgent = await resolveAgentMemoryAccess(agentLayer, config, isChannelExecution(config)
209
+ ? managedChannelContextSchema
210
+ : agentConfig.contextSchema, isRun);
118
211
  const userAccess = !userLayer
119
212
  ? { deniedReason: null }
120
213
  : isRun
121
- ? await resolveUserMemoryAccess(userLayer, config, agentConfig.contextSchema)
214
+ ? await resolveUserMemoryAccess(userLayer, config, isChannelExecution(config)
215
+ ? managedChannelContextSchema
216
+ : agentConfig.contextSchema, memorySelectedByDynamicResolver)
122
217
  : { deniedReason: "no_context" };
123
218
  const allowedUserId = userAccess.userId;
124
219
  userDeniedReason = userAccess.deniedReason;
125
- const memoryLayers = declaredLayers.filter((layer) => layer.type === "agent" ? allowAgent : allowedUserId !== undefined);
220
+ const memoryLayers = declaredMemory.filter((layer) => layer.type === "agent" ? allowAgent : allowedUserId !== undefined);
126
221
  mountedMemory = memoryLayers;
127
222
  const userMemoryBackend = allowedUserId !== undefined
128
223
  ? new UserMemoryBackend({
@@ -137,7 +232,7 @@ async function compileManagedAgentGraph(definition, config, options, isRun = fal
137
232
  if (userMemoryBackend) {
138
233
  loadUserMemory = () => downloadContextFile(userMemoryBackend, "/AGENTS.md");
139
234
  }
140
- params.backend = managedContextBackend(contextBackend.backend, sandboxBackend, hasAgentMemoryLayer(memoryLayers), userMemoryBackend);
235
+ params.backend = managedContextBackend(contextBackend.backend, sandboxBackend, hasAgentMemoryLayer(memoryLayers), userMemoryBackend, selectedSkills?.backend);
141
236
  // Sandbox + FilesystemPermission cannot coexist at execute() time: deepagents
142
237
  // adapts CompositeBackend and drops routePrefixes, so any permission rule
143
238
  // disables shell. Rely on read-only Context Hub mounts instead.
@@ -149,28 +244,43 @@ async function compileManagedAgentGraph(definition, config, options, isRun = fal
149
244
  }
150
245
  }
151
246
  else {
152
- // Eval entries embed instructions directly; local/deploy prefer Context Hub.
153
- if (systemPrompt !== undefined) {
154
- params.systemPrompt = systemPrompt;
155
- }
156
247
  if (sandboxBackend) {
157
248
  params.backend = sandboxBackend;
158
249
  }
159
250
  else if (trialRootDir) {
160
251
  // Harbor trial disk root — not via definition.config (authoring forbids backend).
161
- params.backend = createEvalTrialFilesystemBackend(trialRootDir);
252
+ params.backend = createEvalTrialFilesystemBackend(trialRootDir, {
253
+ hideSkills: selectedSkills !== undefined,
254
+ });
255
+ }
256
+ if (selectedSkills) {
257
+ params.backend = managedSelectedSkillsBackend(params.backend, selectedSkills.backend);
258
+ params.permissions = sandboxBackend
259
+ ? []
260
+ : managedContextPermissions(params.permissions);
162
261
  }
163
262
  }
164
- // Include platform context even when the project has no instructions.md.
165
- const instructions = params.systemPrompt;
166
- params.systemPrompt = instructions
167
- ? `${MANAGED_DEEP_AGENT_INSTRUCTIONS}\n\n${instructions}`
263
+ // Explicit dynamic instructions replace the authored file, including `""`.
264
+ // Omission retains the discovered prompt, with eval's embedded prompt as a
265
+ // fallback. The platform boundary is always first and cannot be replaced.
266
+ let selectedInstructions = authoredInstructions;
267
+ if (selectedInstructions === undefined && contextBackend) {
268
+ selectedInstructions = await readInstructions(contextBackend.backend);
269
+ }
270
+ if (selectedInstructions === undefined) {
271
+ selectedInstructions = systemPrompt;
272
+ }
273
+ params.systemPrompt = selectedInstructions
274
+ ? `${MANAGED_DEEP_AGENT_INSTRUCTIONS}\n\n${selectedInstructions}`
168
275
  : MANAGED_DEEP_AGENT_INSTRUCTIONS;
169
276
  // Mounted the same way in every mode, but resolved against different roots:
170
277
  // local/deploy route `/skills/` to the Context Hub mock or repo, while an eval
171
278
  // trial reads the project's own `skills/` tree, which the Harbor adapter copies
172
279
  // into the trial workspace the backend is rooted at.
173
- if (hasSkills) {
280
+ const effectiveHasSkills = skipFactoryInspectionTools && skillSelection !== undefined
281
+ ? (skillSelection?.length ?? 0) > 0
282
+ : (selectedSkills?.hasSkills ?? hasSkills);
283
+ if (effectiveHasSkills) {
174
284
  params.skills = [MANAGED_SKILLS_PATH];
175
285
  }
176
286
  // Add the managed fields to authored tools. Only authored tools receive
@@ -203,6 +313,7 @@ async function compileManagedAgentGraph(definition, config, options, isRun = fal
203
313
  if (mountedMemory.length > 0) {
204
314
  params.memory = mountedMemory.map((layer) => `/memories/${layer.type}/AGENTS.md`);
205
315
  }
316
+ // Inspection needs the credential gate, but must not load credentials.
206
317
  const credentialGate = createCredentialGateMiddleware([
207
318
  ...mcpCredentialConsumers(connectors),
208
319
  ...sandboxCredentialConsumers(sandbox),
@@ -236,7 +347,7 @@ async function compileManagedAgentGraph(definition, config, options, isRun = fal
236
347
  channel: detectRunChannel(config),
237
348
  sandboxDeclared: sandbox !== undefined,
238
349
  identityDeclared: identity !== undefined,
239
- skillsDeclared: hasSkills,
350
+ skillsDeclared: effectiveHasSkills,
240
351
  backendKind: sandboxBackend
241
352
  ? "sandbox"
242
353
  : trialRootDir
@@ -248,7 +359,7 @@ async function compileManagedAgentGraph(definition, config, options, isRun = fal
248
359
  ? "local"
249
360
  : "none",
250
361
  memory: {
251
- layers_declared: requestedMemory.map((layer) => layer.type),
362
+ layers_declared: declaredMemory.map((layer) => layer.type),
252
363
  layers_mounted: mountedMemory.map((layer) => layer.type),
253
364
  user_denied_reason: userDeniedReason,
254
365
  },
@@ -320,7 +431,12 @@ function wrapDeclarativeSubagents(subagents, backendFactory) {
320
431
  * The model override is applied to a copied definition so normal dev/deploy
321
432
  * behavior remains unchanged.
322
433
  */
323
- export async function compileManagedAgentForEval(definition, config, options) {
434
+ export async function compileManagedAgentForEval(entry, config, options) {
435
+ // Harbor calls this helper only to execute a scored trial. Missing context
436
+ // means the run has empty authored context; it is not graph inspection.
437
+ const isRun = true;
438
+ const skipFactoryInspectionTools = false;
439
+ const definition = await resolveAgentDefinition(entry, internalServerRuntime(config?.context, true));
324
440
  const { modelOverride, ...managedOptions } = options ?? {};
325
441
  const configuredModel = configurableModel(config);
326
442
  const evalDefinition = {
@@ -332,7 +448,7 @@ export async function compileManagedAgentForEval(definition, config, options) {
332
448
  : {}),
333
449
  },
334
450
  };
335
- return compileManagedAgent(evalDefinition, config, {
451
+ return compileResolvedManagedAgent(evalDefinition, config, {
336
452
  ...managedOptions,
337
453
  // Eval trials never mount durable memory. The generated eval entry does not
338
454
  // pass a declaration and the option is omitted from `ManagedEvalOptions`;
@@ -341,7 +457,7 @@ export async function compileManagedAgentForEval(definition, config, options) {
341
457
  // Prefer runner-provided cwd; default matches the adapter's `/app` staging.
342
458
  trialRootDir: evalAppDir(config),
343
459
  reportTelemetry: false,
344
- });
460
+ }, isRun, skipFactoryInspectionTools, typeof entry === "function");
345
461
  }
346
462
  function configurableModel(config) {
347
463
  const value = config?.configurable?.model;