@opengeni/config 1.2.0-canary.0 → 1.2.0-canary.2
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.d.ts +32 -10
- package/dist/index.js +12 -76
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +13 -89
package/dist/index.d.ts
CHANGED
|
@@ -45,6 +45,13 @@ export declare const AGENT_INSTRUCTIONS_CORE_PLACEHOLDER = "{{core}}";
|
|
|
45
45
|
export declare const DEFAULT_AGENT_INSTRUCTIONS: string;
|
|
46
46
|
export declare const McpServerConnectionRefSchema: z.ZodObject<{
|
|
47
47
|
connectionId: z.ZodOptional<z.ZodString>;
|
|
48
|
+
authoritySource: z.ZodOptional<z.ZodLiteral<"host">>;
|
|
49
|
+
hostBinding: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
50
|
+
bindingId: z.ZodString;
|
|
51
|
+
generation: z.ZodNumber;
|
|
52
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
53
|
+
selection: z.ZodLiteral<"accepted_turn">;
|
|
54
|
+
}, z.core.$strict>]>>;
|
|
48
55
|
provider: z.ZodOptional<z.ZodString>;
|
|
49
56
|
providerDomain: z.ZodString;
|
|
50
57
|
kind: z.ZodOptional<z.ZodEnum<{
|
|
@@ -59,11 +66,6 @@ export declare const McpServerConnectionRefSchema: z.ZodObject<{
|
|
|
59
66
|
id: z.ZodString;
|
|
60
67
|
kind: z.ZodLiteral<"repository">;
|
|
61
68
|
}, z.core.$strict>>>;
|
|
62
|
-
authoritySource: z.ZodOptional<z.ZodLiteral<"host">>;
|
|
63
|
-
hostBinding: z.ZodOptional<z.ZodObject<{
|
|
64
|
-
bindingId: z.ZodString;
|
|
65
|
-
generation: z.ZodNumber;
|
|
66
|
-
}, z.core.$strict>>;
|
|
67
69
|
subjectScope: z.ZodOptional<z.ZodEnum<{
|
|
68
70
|
subject: "subject";
|
|
69
71
|
workspace: "workspace";
|
|
@@ -214,11 +216,20 @@ declare const SettingsSchema: z.ZodObject<{
|
|
|
214
216
|
goal_resume: "goal_resume";
|
|
215
217
|
goal_set: "goal_set";
|
|
216
218
|
goal_update: "goal_update";
|
|
219
|
+
instruction_policy_get: "instruction_policy_get";
|
|
217
220
|
instruction_policy_propose: "instruction_policy_propose";
|
|
221
|
+
instruction_policy_save: "instruction_policy_save";
|
|
218
222
|
interaction_discover: "interaction_discover";
|
|
219
223
|
interaction_request_human: "interaction_request_human";
|
|
224
|
+
knowledge_archive: "knowledge_archive";
|
|
225
|
+
knowledge_browse: "knowledge_browse";
|
|
220
226
|
knowledge_correct: "knowledge_correct";
|
|
227
|
+
knowledge_get: "knowledge_get";
|
|
221
228
|
knowledge_propose: "knowledge_propose";
|
|
229
|
+
knowledge_retain_file: "knowledge_retain_file";
|
|
230
|
+
knowledge_retain_message: "knowledge_retain_message";
|
|
231
|
+
knowledge_save: "knowledge_save";
|
|
232
|
+
knowledge_search: "knowledge_search";
|
|
222
233
|
memory_correct: "memory_correct";
|
|
223
234
|
memory_save: "memory_save";
|
|
224
235
|
memory_search: "memory_search";
|
|
@@ -373,11 +384,20 @@ declare const SettingsSchema: z.ZodObject<{
|
|
|
373
384
|
goal_resume: "goal_resume";
|
|
374
385
|
goal_set: "goal_set";
|
|
375
386
|
goal_update: "goal_update";
|
|
387
|
+
instruction_policy_get: "instruction_policy_get";
|
|
376
388
|
instruction_policy_propose: "instruction_policy_propose";
|
|
389
|
+
instruction_policy_save: "instruction_policy_save";
|
|
377
390
|
interaction_discover: "interaction_discover";
|
|
378
391
|
interaction_request_human: "interaction_request_human";
|
|
392
|
+
knowledge_archive: "knowledge_archive";
|
|
393
|
+
knowledge_browse: "knowledge_browse";
|
|
379
394
|
knowledge_correct: "knowledge_correct";
|
|
395
|
+
knowledge_get: "knowledge_get";
|
|
380
396
|
knowledge_propose: "knowledge_propose";
|
|
397
|
+
knowledge_retain_file: "knowledge_retain_file";
|
|
398
|
+
knowledge_retain_message: "knowledge_retain_message";
|
|
399
|
+
knowledge_save: "knowledge_save";
|
|
400
|
+
knowledge_search: "knowledge_search";
|
|
381
401
|
memory_correct: "memory_correct";
|
|
382
402
|
memory_save: "memory_save";
|
|
383
403
|
memory_search: "memory_search";
|
|
@@ -861,6 +881,13 @@ declare const SettingsSchema: z.ZodObject<{
|
|
|
861
881
|
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
862
882
|
connectionRef: z.ZodOptional<z.ZodObject<{
|
|
863
883
|
connectionId: z.ZodOptional<z.ZodString>;
|
|
884
|
+
authoritySource: z.ZodOptional<z.ZodLiteral<"host">>;
|
|
885
|
+
hostBinding: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
886
|
+
bindingId: z.ZodString;
|
|
887
|
+
generation: z.ZodNumber;
|
|
888
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
889
|
+
selection: z.ZodLiteral<"accepted_turn">;
|
|
890
|
+
}, z.core.$strict>]>>;
|
|
864
891
|
provider: z.ZodOptional<z.ZodString>;
|
|
865
892
|
providerDomain: z.ZodString;
|
|
866
893
|
kind: z.ZodOptional<z.ZodEnum<{
|
|
@@ -875,11 +902,6 @@ declare const SettingsSchema: z.ZodObject<{
|
|
|
875
902
|
id: z.ZodString;
|
|
876
903
|
kind: z.ZodLiteral<"repository">;
|
|
877
904
|
}, z.core.$strict>>>;
|
|
878
|
-
authoritySource: z.ZodOptional<z.ZodLiteral<"host">>;
|
|
879
|
-
hostBinding: z.ZodOptional<z.ZodObject<{
|
|
880
|
-
bindingId: z.ZodString;
|
|
881
|
-
generation: z.ZodNumber;
|
|
882
|
-
}, z.core.$strict>>;
|
|
883
905
|
subjectScope: z.ZodOptional<z.ZodEnum<{
|
|
884
906
|
subject: "subject";
|
|
885
907
|
workspace: "workspace";
|
package/dist/index.js
CHANGED
|
@@ -3,11 +3,13 @@ import {
|
|
|
3
3
|
BillingMode,
|
|
4
4
|
CAPABILITY_DESCRIPTORS,
|
|
5
5
|
DEFAULT_FIRST_PARTY_MCP_TOOLS,
|
|
6
|
+
currentAgentLearningToolSelection,
|
|
6
7
|
Entitlements,
|
|
7
8
|
EntitlementsMode,
|
|
8
9
|
KnowledgeSourceSyncLimits,
|
|
9
10
|
LatencyMode,
|
|
10
11
|
MAX_NESTED_AGENT_DEPTH,
|
|
12
|
+
McpServerConnectionRef as PublicMcpServerConnectionRef,
|
|
11
13
|
ProductAccessMode,
|
|
12
14
|
ReasoningEffort,
|
|
13
15
|
FIRST_PARTY_MCP_TOOL_NAMES,
|
|
@@ -154,66 +156,7 @@ var DEFAULT_AGENT_INSTRUCTIONS = [
|
|
|
154
156
|
"Return concise, factual summaries with files changed, commands run, and remaining blockers.",
|
|
155
157
|
AGENT_INSTRUCTIONS_CORE_PLACEHOLDER
|
|
156
158
|
].join(" ");
|
|
157
|
-
var McpServerConnectionRefSchema =
|
|
158
|
-
// Standalone ids are UUIDs; embedded hosts may use any stable opaque id.
|
|
159
|
-
connectionId: z.string().min(1).optional(),
|
|
160
|
-
provider: z.string().min(1).max(128).optional(),
|
|
161
|
-
providerDomain: z.string().min(1),
|
|
162
|
-
kind: z.enum(["oauth2", "api_key", "app_install", "delegated"]).optional(),
|
|
163
|
-
scopes: z.array(z.string().min(1)).optional(),
|
|
164
|
-
resource: z.string().min(1).optional(),
|
|
165
|
-
selectedResources: z.array(
|
|
166
|
-
z.object({
|
|
167
|
-
id: z.string().min(1).max(512),
|
|
168
|
-
kind: z.literal("repository")
|
|
169
|
-
}).strict()
|
|
170
|
-
).min(1).max(256).superRefine((resources, context) => {
|
|
171
|
-
const seen = /* @__PURE__ */ new Set();
|
|
172
|
-
for (const [index, resource] of resources.entries()) {
|
|
173
|
-
const key = `${resource.kind}\0${resource.id}`;
|
|
174
|
-
if (seen.has(key)) {
|
|
175
|
-
context.addIssue({
|
|
176
|
-
code: "custom",
|
|
177
|
-
message: "selectedResources must not contain duplicates",
|
|
178
|
-
path: [index]
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
seen.add(key);
|
|
182
|
-
}
|
|
183
|
-
}).optional(),
|
|
184
|
-
authoritySource: z.literal("host").optional(),
|
|
185
|
-
hostBinding: z.object({ bindingId: z.string().uuid(), generation: z.number().int().positive().safe() }).strict().optional(),
|
|
186
|
-
subjectScope: z.enum(["workspace", "subject"]).optional()
|
|
187
|
-
}).strict().superRefine((reference, context) => {
|
|
188
|
-
if (reference.authoritySource === "host" && !reference.connectionId) {
|
|
189
|
-
context.addIssue({
|
|
190
|
-
code: "custom",
|
|
191
|
-
message: "host authority requires connectionId",
|
|
192
|
-
path: ["connectionId"]
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
if (reference.hostBinding && reference.authoritySource !== "host")
|
|
196
|
-
context.addIssue({
|
|
197
|
-
code: "custom",
|
|
198
|
-
path: ["hostBinding"],
|
|
199
|
-
message: "Durable binding requires host authority"
|
|
200
|
-
});
|
|
201
|
-
if (!reference.selectedResources) return;
|
|
202
|
-
if (!reference.connectionId) {
|
|
203
|
-
context.addIssue({
|
|
204
|
-
code: "custom",
|
|
205
|
-
message: "selectedResources requires connectionId",
|
|
206
|
-
path: ["connectionId"]
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
if (!reference.provider) {
|
|
210
|
-
context.addIssue({
|
|
211
|
-
code: "custom",
|
|
212
|
-
message: "selectedResources requires provider",
|
|
213
|
-
path: ["provider"]
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
});
|
|
159
|
+
var McpServerConnectionRefSchema = PublicMcpServerConnectionRef;
|
|
217
160
|
var McpOperationRecoverySchema = z.record(
|
|
218
161
|
z.string().min(1).max(512).regex(/^\S+$/u),
|
|
219
162
|
z.object({ observerTool: z.string().min(1).max(512).regex(/^\S+$/u) }).strict()
|
|
@@ -2619,9 +2562,13 @@ function resolveFirstPartyDelegationSecret(settings) {
|
|
|
2619
2562
|
return settings.productAccessMode === "local" && (settings.environment === "local" || settings.environment === "test") ? LOCAL_FIRST_PARTY_DELEGATION_SECRET : void 0;
|
|
2620
2563
|
}
|
|
2621
2564
|
function resolveFirstPartyMcpToolPolicy(settings) {
|
|
2622
|
-
const allowed =
|
|
2565
|
+
const allowed = currentAgentLearningToolSelection(
|
|
2566
|
+
settings.allowedFirstPartyMcpTools ?? [...FIRST_PARTY_MCP_TOOL_NAMES]
|
|
2567
|
+
);
|
|
2623
2568
|
const allowedSet = new Set(allowed);
|
|
2624
|
-
const defaults =
|
|
2569
|
+
const defaults = currentAgentLearningToolSelection(
|
|
2570
|
+
settings.defaultFirstPartyMcpTools ?? [...DEFAULT_FIRST_PARTY_MCP_TOOLS]
|
|
2571
|
+
);
|
|
2625
2572
|
return {
|
|
2626
2573
|
default: defaults.filter((tool) => allowedSet.has(tool)),
|
|
2627
2574
|
allowed: [...allowed]
|
|
@@ -2630,7 +2577,7 @@ function resolveFirstPartyMcpToolPolicy(settings) {
|
|
|
2630
2577
|
function allowedFirstPartyMcpToolsForSession(settings, selected) {
|
|
2631
2578
|
const policy = resolveFirstPartyMcpToolPolicy(settings);
|
|
2632
2579
|
const allowed = new Set(policy.allowed);
|
|
2633
|
-
const tools = new Set(selected ?? policy.default);
|
|
2580
|
+
const tools = new Set(currentAgentLearningToolSelection(selected ?? policy.default));
|
|
2634
2581
|
if (tools.has("goal_pause")) tools.add("goal_resume");
|
|
2635
2582
|
return [...tools].filter((tool) => allowed.has(tool));
|
|
2636
2583
|
}
|
|
@@ -4584,20 +4531,9 @@ function ensureBuiltInMcpServers(settings) {
|
|
|
4584
4531
|
...hasDocs ? [] : [
|
|
4585
4532
|
{
|
|
4586
4533
|
id: "docs",
|
|
4587
|
-
name: "
|
|
4534
|
+
name: "Knowledge",
|
|
4588
4535
|
url: firstPartyDocsMcpUrl,
|
|
4589
|
-
allowedTools: [
|
|
4590
|
-
"search_documents",
|
|
4591
|
-
"fetch_document_chunk",
|
|
4592
|
-
"list_document_bases",
|
|
4593
|
-
"list_indexed_documents",
|
|
4594
|
-
"knowledge_search",
|
|
4595
|
-
"knowledge_get",
|
|
4596
|
-
"knowledge_browse",
|
|
4597
|
-
"knowledge_fetch",
|
|
4598
|
-
"memory_search",
|
|
4599
|
-
"memory_propose"
|
|
4600
|
-
],
|
|
4536
|
+
allowedTools: ["knowledge_search", "knowledge_get", "knowledge_browse"],
|
|
4601
4537
|
cacheToolsList: false
|
|
4602
4538
|
}
|
|
4603
4539
|
],
|