@tangle-network/agent-interface 5.1.0 → 5.2.1
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/README.md +16 -0
- package/dist/agent-candidate-artifact-schema.d.ts +4 -0
- package/dist/agent-candidate-artifact-schema.js +2 -0
- package/dist/agent-candidate-profile-schema.d.ts +4 -0
- package/dist/agent-candidate-promotion-schema.d.ts +24 -0
- package/dist/agent-candidate-schema.d.ts +4 -0
- package/dist/agent-execution-preparation-receipt.d.ts +2 -0
- package/dist/agent-profile-materialization.d.ts +1 -1
- package/dist/agent-profile-materialization.js +6 -0
- package/dist/agent-profile.d.ts +9 -0
- package/dist/agent-profile.js +24 -2
- package/dist/environment-interactive-control.d.ts +10 -0
- package/dist/environment-interactive-start.d.ts +4 -0
- package/dist/environment-runtime.d.ts +12 -0
- package/dist/portable-context-transfer.d.ts +4 -0
- package/dist/profile-diff.d.ts +1 -0
- package/dist/profile-diff.js +16 -0
- package/dist/profile-knowledge.d.ts +10 -0
- package/dist/profile-knowledge.js +22 -0
- package/dist/profile-schema.d.ts +11 -0
- package/dist/profile-schema.js +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -399,3 +399,19 @@ Rollback creates a new guarded revision; historical pins remain immutable.
|
|
|
399
399
|
`qualification: 'fixture'` or `'native-binary'` honestly. A fixture is not proof
|
|
400
400
|
of an external CLI binary or deployed volume. Complete native-binary and
|
|
401
401
|
deployment qualification before advertising those stronger guarantees.
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
### Pinned knowledge sources
|
|
405
|
+
|
|
406
|
+
`AgentProfile.resources.knowledge` carries up to `MAX_PROFILE_KNOWLEDGE_SOURCES`
|
|
407
|
+
immutable `{ sourceId, generation }` Hub references. A generation is an exact
|
|
408
|
+
`kg_` SHA-256 identity, never a mutable `latest` alias. A source may appear only
|
|
409
|
+
once. These references participate in snapshots, candidate identity, profile
|
|
410
|
+
merges/diffs and the `knowledge` materialization axis. An overlay can explicitly
|
|
411
|
+
repin a source; a diff can remove it by source ID.
|
|
412
|
+
|
|
413
|
+
References contain neither corpus content nor authorization. The execution host
|
|
414
|
+
must validate source ownership and active generation bindings for its own runtime
|
|
415
|
+
before admitting a knowledge tool. A profile copied to another owner does not
|
|
416
|
+
confer access. Hosts unable to resolve the saved pins must fail closed rather than
|
|
417
|
+
inline JSON into instructions, substitute a newer generation or silently omit them.
|
|
@@ -375,6 +375,10 @@ export declare const agentCandidateFileMountSchema: z.ZodObject<{
|
|
|
375
375
|
executable: z.ZodOptional<z.ZodBoolean>;
|
|
376
376
|
}, z.core.$strict>;
|
|
377
377
|
export declare const agentCandidateResourcesSchema: z.ZodObject<{
|
|
378
|
+
knowledge: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
379
|
+
sourceId: z.ZodString;
|
|
380
|
+
generation: z.ZodString;
|
|
381
|
+
}, z.core.$strict>>>;
|
|
378
382
|
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
379
383
|
path: z.ZodString;
|
|
380
384
|
resource: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { agentProfileKnowledgeRefsSchema } from "./profile-knowledge.js";
|
|
2
3
|
import { agentCandidateGitHubRepositorySchema, gitObjectSchema, isSafeRelativePath, isWellFormedUnicode, looksLikeCredential, sha256DigestSchema, } from "./agent-candidate-schema-common.js";
|
|
3
4
|
import { agentImprovementSourceSchema } from "./agent-improvement-source.js";
|
|
4
5
|
const base64Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
@@ -234,6 +235,7 @@ export const agentCandidateFileMountSchema = z
|
|
|
234
235
|
.strict();
|
|
235
236
|
export const agentCandidateResourcesSchema = z
|
|
236
237
|
.object({
|
|
238
|
+
knowledge: agentProfileKnowledgeRefsSchema.optional(),
|
|
237
239
|
files: z.array(agentCandidateFileMountSchema).optional(),
|
|
238
240
|
tools: z.array(agentCandidateResourceRefSchema).optional(),
|
|
239
241
|
skills: z.array(agentCandidateResourceRefSchema).optional(),
|
|
@@ -76,6 +76,10 @@ export declare const agentCandidateProfileSchema: z.ZodObject<{
|
|
|
76
76
|
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
77
77
|
}, z.core.$strict>>>;
|
|
78
78
|
resources: z.ZodOptional<z.ZodObject<{
|
|
79
|
+
knowledge: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
80
|
+
sourceId: z.ZodString;
|
|
81
|
+
generation: z.ZodString;
|
|
82
|
+
}, z.core.$strict>>>;
|
|
79
83
|
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
80
84
|
path: z.ZodString;
|
|
81
85
|
resource: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -67,6 +67,10 @@ export declare const agentCandidateExperimentSchema: z.ZodObject<{
|
|
|
67
67
|
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
68
68
|
}, z.core.$strict>>>;
|
|
69
69
|
resources: z.ZodOptional<z.ZodObject<{
|
|
70
|
+
knowledge: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
71
|
+
sourceId: z.ZodString;
|
|
72
|
+
generation: z.ZodString;
|
|
73
|
+
}, z.core.$strict>>>;
|
|
70
74
|
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
71
75
|
path: z.ZodString;
|
|
72
76
|
resource: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -932,6 +936,10 @@ export declare const agentCandidateExperimentSchema: z.ZodObject<{
|
|
|
932
936
|
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
933
937
|
}, z.core.$strict>>>;
|
|
934
938
|
resources: z.ZodOptional<z.ZodObject<{
|
|
939
|
+
knowledge: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
940
|
+
sourceId: z.ZodString;
|
|
941
|
+
generation: z.ZodString;
|
|
942
|
+
}, z.core.$strict>>>;
|
|
935
943
|
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
936
944
|
path: z.ZodString;
|
|
937
945
|
resource: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -3897,6 +3905,10 @@ export declare const agentImprovementMeasuredComparisonSchema: z.ZodObject<{
|
|
|
3897
3905
|
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
3898
3906
|
}, z.core.$strict>>>;
|
|
3899
3907
|
resources: z.ZodOptional<z.ZodObject<{
|
|
3908
|
+
knowledge: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3909
|
+
sourceId: z.ZodString;
|
|
3910
|
+
generation: z.ZodString;
|
|
3911
|
+
}, z.core.$strict>>>;
|
|
3900
3912
|
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3901
3913
|
path: z.ZodString;
|
|
3902
3914
|
resource: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -4762,6 +4774,10 @@ export declare const agentImprovementMeasuredComparisonSchema: z.ZodObject<{
|
|
|
4762
4774
|
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
4763
4775
|
}, z.core.$strict>>>;
|
|
4764
4776
|
resources: z.ZodOptional<z.ZodObject<{
|
|
4777
|
+
knowledge: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
4778
|
+
sourceId: z.ZodString;
|
|
4779
|
+
generation: z.ZodString;
|
|
4780
|
+
}, z.core.$strict>>>;
|
|
4765
4781
|
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
4766
4782
|
path: z.ZodString;
|
|
4767
4783
|
resource: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -9301,6 +9317,10 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
|
|
|
9301
9317
|
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
9302
9318
|
}, z.core.$strict>>>;
|
|
9303
9319
|
resources: z.ZodOptional<z.ZodObject<{
|
|
9320
|
+
knowledge: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
9321
|
+
sourceId: z.ZodString;
|
|
9322
|
+
generation: z.ZodString;
|
|
9323
|
+
}, z.core.$strict>>>;
|
|
9304
9324
|
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
9305
9325
|
path: z.ZodString;
|
|
9306
9326
|
resource: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -10166,6 +10186,10 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
|
|
|
10166
10186
|
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
10167
10187
|
}, z.core.$strict>>>;
|
|
10168
10188
|
resources: z.ZodOptional<z.ZodObject<{
|
|
10189
|
+
knowledge: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
10190
|
+
sourceId: z.ZodString;
|
|
10191
|
+
generation: z.ZodString;
|
|
10192
|
+
}, z.core.$strict>>>;
|
|
10169
10193
|
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
10170
10194
|
path: z.ZodString;
|
|
10171
10195
|
resource: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -71,6 +71,10 @@ export declare const agentCandidateBundleSchema: z.ZodObject<{
|
|
|
71
71
|
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
72
72
|
}, z.core.$strict>>>;
|
|
73
73
|
resources: z.ZodOptional<z.ZodObject<{
|
|
74
|
+
knowledge: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
75
|
+
sourceId: z.ZodString;
|
|
76
|
+
generation: z.ZodString;
|
|
77
|
+
}, z.core.$strict>>>;
|
|
74
78
|
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
75
79
|
path: z.ZodString;
|
|
76
80
|
resource: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -108,6 +108,7 @@ export declare const agentExecutionPreparationAxisResultSchema: z.ZodObject<{
|
|
|
108
108
|
harness: "harness";
|
|
109
109
|
hooks: "hooks";
|
|
110
110
|
instructions: "instructions";
|
|
111
|
+
knowledge: "knowledge";
|
|
111
112
|
mcp: "mcp";
|
|
112
113
|
metadata: "metadata";
|
|
113
114
|
modelDefault: "modelDefault";
|
|
@@ -260,6 +261,7 @@ export declare const agentExecutionPreparationReceiptSchema: z.ZodObject<{
|
|
|
260
261
|
harness: "harness";
|
|
261
262
|
hooks: "hooks";
|
|
262
263
|
instructions: "instructions";
|
|
264
|
+
knowledge: "knowledge";
|
|
263
265
|
mcp: "mcp";
|
|
264
266
|
metadata: "metadata";
|
|
265
267
|
modelDefault: "modelDefault";
|
|
@@ -9,7 +9,7 @@ import type { AgentProfile } from "./agent-profile.js";
|
|
|
9
9
|
* can only add text must report the requested replacement as unsatisfied rather
|
|
10
10
|
* than acknowledge it.
|
|
11
11
|
*/
|
|
12
|
-
export declare const AGENT_PROFILE_MATERIALIZATION_AXES: readonly ["name", "description", "version", "tags", "systemPrompt", "appendSystemPrompt", "instructions", "modelDefault", "modelSmall", "modelProvider", "modelReasoningEffort", "modelMaxVisibleOutputTokens", "modelMaxReasoningTokens", "modelMaxTotalOutputTokens", "modelMetadata", "harness", "seats", "permissions", "tools", "mcp", "connections", "subagents", "files", "resourceTools", "skills", "resourceAgents", "commands", "resourceInstructions", "resourceFailOnError", "hooks", "modes", "confidential", "metadata", "extensions"];
|
|
12
|
+
export declare const AGENT_PROFILE_MATERIALIZATION_AXES: readonly ["name", "description", "version", "tags", "systemPrompt", "appendSystemPrompt", "instructions", "modelDefault", "modelSmall", "modelProvider", "modelReasoningEffort", "modelMaxVisibleOutputTokens", "modelMaxReasoningTokens", "modelMaxTotalOutputTokens", "modelMetadata", "harness", "seats", "permissions", "tools", "mcp", "connections", "subagents", "files", "resourceTools", "skills", "resourceAgents", "commands", "knowledge", "resourceInstructions", "resourceFailOnError", "hooks", "modes", "confidential", "metadata", "extensions"];
|
|
13
13
|
/** One exact leaf of the public AgentProfile contract. */
|
|
14
14
|
export type AgentProfileMaterializationAxis = (typeof AGENT_PROFILE_MATERIALIZATION_AXES)[number];
|
|
15
15
|
/** Compatibility name used by runtimes that distinguish canonical axes. */
|
|
@@ -36,6 +36,7 @@ export const AGENT_PROFILE_MATERIALIZATION_AXES = [
|
|
|
36
36
|
"skills",
|
|
37
37
|
"resourceAgents",
|
|
38
38
|
"commands",
|
|
39
|
+
"knowledge",
|
|
39
40
|
"resourceInstructions",
|
|
40
41
|
"resourceFailOnError",
|
|
41
42
|
"hooks",
|
|
@@ -146,6 +147,11 @@ const AXIS_DESCRIPTORS = [
|
|
|
146
147
|
rootPath: "/resources/commands",
|
|
147
148
|
value: (profile) => profile.resources?.commands,
|
|
148
149
|
},
|
|
150
|
+
{
|
|
151
|
+
axis: "knowledge",
|
|
152
|
+
rootPath: "/resources/knowledge",
|
|
153
|
+
value: (profile) => profile.resources?.knowledge,
|
|
154
|
+
},
|
|
149
155
|
{
|
|
150
156
|
axis: "resourceInstructions",
|
|
151
157
|
rootPath: "/resources/instructions",
|
package/dist/agent-profile.d.ts
CHANGED
|
@@ -59,7 +59,16 @@ export interface AgentProfileFileMount {
|
|
|
59
59
|
/**
|
|
60
60
|
* Provider-neutral resource bundle.
|
|
61
61
|
*/
|
|
62
|
+
export declare const MAX_PROFILE_KNOWLEDGE_SOURCES = 16;
|
|
63
|
+
/** Immutable Hub source generation. This is public identity, never retrieval authority. */
|
|
64
|
+
export interface AgentProfileKnowledgeRef {
|
|
65
|
+
sourceId: string;
|
|
66
|
+
generation: string;
|
|
67
|
+
}
|
|
62
68
|
export interface AgentProfileResources {
|
|
69
|
+
/** Owner-authorized source generations resolved by the execution host before admission.
|
|
70
|
+
* Source content and credentials must never be inlined into a profile or prompt. */
|
|
71
|
+
knowledge?: AgentProfileKnowledgeRef[];
|
|
63
72
|
/**
|
|
64
73
|
* Generic files to materialize into the agent workspace before execution.
|
|
65
74
|
*/
|
package/dist/agent-profile.js
CHANGED
|
@@ -31,6 +31,10 @@ export function defineGitHubResource(path, options = {}) {
|
|
|
31
31
|
...(options.name === undefined ? {} : { name: options.name }),
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Provider-neutral resource bundle.
|
|
36
|
+
*/
|
|
37
|
+
export const MAX_PROFILE_KNOWLEDGE_SOURCES = 16;
|
|
34
38
|
/**
|
|
35
39
|
* Portable reasoning/thinking effort. Backends map it to their native control at materialization:
|
|
36
40
|
* codex `model_reasoning_effort`, kimi `--thinking`/`--no-thinking`, claude thinking budget.
|
|
@@ -92,8 +96,15 @@ function assignDefined(...sources) {
|
|
|
92
96
|
if (source === undefined)
|
|
93
97
|
continue;
|
|
94
98
|
for (const [key, value] of Object.entries(source)) {
|
|
95
|
-
if (value !== undefined)
|
|
96
|
-
|
|
99
|
+
if (value !== undefined) {
|
|
100
|
+
// Define own data properties like object spread, including __proto__.
|
|
101
|
+
Object.defineProperty(merged, key, {
|
|
102
|
+
value,
|
|
103
|
+
enumerable: true,
|
|
104
|
+
configurable: true,
|
|
105
|
+
writable: true,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
97
108
|
}
|
|
98
109
|
}
|
|
99
110
|
return merged;
|
|
@@ -126,6 +137,16 @@ function mergeOptionalArrays(base, overlay) {
|
|
|
126
137
|
return undefined;
|
|
127
138
|
return [...(base ?? []), ...(overlay ?? [])];
|
|
128
139
|
}
|
|
140
|
+
/** A source has one effective immutable generation; an overlay explicitly repins it. */
|
|
141
|
+
function mergeKnowledgeRefs(base, overlay) {
|
|
142
|
+
if (!base && !overlay)
|
|
143
|
+
return undefined;
|
|
144
|
+
const refs = new Map();
|
|
145
|
+
for (const ref of [...(base ?? []), ...(overlay ?? [])]) {
|
|
146
|
+
refs.set(ref.sourceId, { ...ref });
|
|
147
|
+
}
|
|
148
|
+
return [...refs.values()];
|
|
149
|
+
}
|
|
129
150
|
/**
|
|
130
151
|
* Merge two public AgentProfile values.
|
|
131
152
|
*
|
|
@@ -151,6 +172,7 @@ export function mergeAgentProfiles(base, overlay) {
|
|
|
151
172
|
: undefined;
|
|
152
173
|
const mergedResources = base?.resources || overlay?.resources
|
|
153
174
|
? assignDefined(base?.resources, overlay?.resources, {
|
|
175
|
+
knowledge: mergeKnowledgeRefs(base?.resources?.knowledge, overlay?.resources?.knowledge),
|
|
154
176
|
files: mergeOptionalArrays(base?.resources?.files, overlay?.resources?.files),
|
|
155
177
|
tools: mergeOptionalArrays(base?.resources?.tools, overlay?.resources?.tools),
|
|
156
178
|
skills: mergeOptionalArrays(base?.resources?.skills, overlay?.resources?.skills),
|
|
@@ -102,6 +102,7 @@ export declare const AgentInteractiveSessionRefSchema: z.ZodObject<{
|
|
|
102
102
|
harness: "harness";
|
|
103
103
|
hooks: "hooks";
|
|
104
104
|
instructions: "instructions";
|
|
105
|
+
knowledge: "knowledge";
|
|
105
106
|
mcp: "mcp";
|
|
106
107
|
metadata: "metadata";
|
|
107
108
|
modelDefault: "modelDefault";
|
|
@@ -278,6 +279,7 @@ export declare const AgentInteractiveSessionControlClaimRequestSchema: z.ZodObje
|
|
|
278
279
|
harness: "harness";
|
|
279
280
|
hooks: "hooks";
|
|
280
281
|
instructions: "instructions";
|
|
282
|
+
knowledge: "knowledge";
|
|
281
283
|
mcp: "mcp";
|
|
282
284
|
metadata: "metadata";
|
|
283
285
|
modelDefault: "modelDefault";
|
|
@@ -447,6 +449,7 @@ export declare const AgentInteractiveSessionControlClaimAcknowledgementSchema: z
|
|
|
447
449
|
harness: "harness";
|
|
448
450
|
hooks: "hooks";
|
|
449
451
|
instructions: "instructions";
|
|
452
|
+
knowledge: "knowledge";
|
|
450
453
|
mcp: "mcp";
|
|
451
454
|
metadata: "metadata";
|
|
452
455
|
modelDefault: "modelDefault";
|
|
@@ -637,6 +640,7 @@ export declare const AgentInteractiveSessionStatusSchema: z.ZodDiscriminatedUnio
|
|
|
637
640
|
harness: "harness";
|
|
638
641
|
hooks: "hooks";
|
|
639
642
|
instructions: "instructions";
|
|
643
|
+
knowledge: "knowledge";
|
|
640
644
|
mcp: "mcp";
|
|
641
645
|
metadata: "metadata";
|
|
642
646
|
modelDefault: "modelDefault";
|
|
@@ -786,6 +790,7 @@ export declare const AgentInteractiveSessionStatusSchema: z.ZodDiscriminatedUnio
|
|
|
786
790
|
harness: "harness";
|
|
787
791
|
hooks: "hooks";
|
|
788
792
|
instructions: "instructions";
|
|
793
|
+
knowledge: "knowledge";
|
|
789
794
|
mcp: "mcp";
|
|
790
795
|
metadata: "metadata";
|
|
791
796
|
modelDefault: "modelDefault";
|
|
@@ -943,6 +948,7 @@ export declare const AgentInteractiveSessionStatusSchema: z.ZodDiscriminatedUnio
|
|
|
943
948
|
harness: "harness";
|
|
944
949
|
hooks: "hooks";
|
|
945
950
|
instructions: "instructions";
|
|
951
|
+
knowledge: "knowledge";
|
|
946
952
|
mcp: "mcp";
|
|
947
953
|
metadata: "metadata";
|
|
948
954
|
modelDefault: "modelDefault";
|
|
@@ -1105,6 +1111,7 @@ export declare const AgentInteractiveSessionStopCommandSchema: z.ZodObject<{
|
|
|
1105
1111
|
harness: "harness";
|
|
1106
1112
|
hooks: "hooks";
|
|
1107
1113
|
instructions: "instructions";
|
|
1114
|
+
knowledge: "knowledge";
|
|
1108
1115
|
mcp: "mcp";
|
|
1109
1116
|
metadata: "metadata";
|
|
1110
1117
|
modelDefault: "modelDefault";
|
|
@@ -1276,6 +1283,7 @@ export declare const AgentInteractiveSessionStopAcknowledgementSchema: z.ZodObje
|
|
|
1276
1283
|
harness: "harness";
|
|
1277
1284
|
hooks: "hooks";
|
|
1278
1285
|
instructions: "instructions";
|
|
1286
|
+
knowledge: "knowledge";
|
|
1279
1287
|
mcp: "mcp";
|
|
1280
1288
|
metadata: "metadata";
|
|
1281
1289
|
modelDefault: "modelDefault";
|
|
@@ -1463,6 +1471,7 @@ export declare const AgentInteractiveSessionPromptCommandSchema: z.ZodObject<{
|
|
|
1463
1471
|
harness: "harness";
|
|
1464
1472
|
hooks: "hooks";
|
|
1465
1473
|
instructions: "instructions";
|
|
1474
|
+
knowledge: "knowledge";
|
|
1466
1475
|
mcp: "mcp";
|
|
1467
1476
|
metadata: "metadata";
|
|
1468
1477
|
modelDefault: "modelDefault";
|
|
@@ -1633,6 +1642,7 @@ export declare const AgentInteractiveSessionPromptAcknowledgementSchema: z.ZodOb
|
|
|
1633
1642
|
harness: "harness";
|
|
1634
1643
|
hooks: "hooks";
|
|
1635
1644
|
instructions: "instructions";
|
|
1645
|
+
knowledge: "knowledge";
|
|
1636
1646
|
mcp: "mcp";
|
|
1637
1647
|
metadata: "metadata";
|
|
1638
1648
|
modelDefault: "modelDefault";
|
|
@@ -126,6 +126,10 @@ export declare const AgentInteractiveSessionStartSchema: z.ZodObject<{
|
|
|
126
126
|
metadata?: Record<string, unknown> | undefined;
|
|
127
127
|
}>, unknown>>>;
|
|
128
128
|
resources: z.ZodOptional<z.ZodObject<{
|
|
129
|
+
knowledge: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
130
|
+
sourceId: z.ZodString;
|
|
131
|
+
generation: z.ZodString;
|
|
132
|
+
}, z.core.$strict>>>;
|
|
129
133
|
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
130
134
|
path: z.ZodString;
|
|
131
135
|
resource: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -149,6 +149,10 @@ export declare const AgentTurnInputSchema: z.ZodObject<{
|
|
|
149
149
|
metadata?: Record<string, unknown> | undefined;
|
|
150
150
|
}>, unknown>>>;
|
|
151
151
|
resources: z.ZodOptional<z.ZodObject<{
|
|
152
|
+
knowledge: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
153
|
+
sourceId: z.ZodString;
|
|
154
|
+
generation: z.ZodString;
|
|
155
|
+
}, z.core.$strict>>>;
|
|
152
156
|
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
153
157
|
path: z.ZodString;
|
|
154
158
|
resource: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -516,6 +520,10 @@ export declare const AgentTurnInputSchema: z.ZodObject<{
|
|
|
516
520
|
metadata?: Record<string, unknown> | undefined;
|
|
517
521
|
}>, unknown>>>;
|
|
518
522
|
resources: z.ZodOptional<z.ZodObject<{
|
|
523
|
+
knowledge: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
524
|
+
sourceId: z.ZodString;
|
|
525
|
+
generation: z.ZodString;
|
|
526
|
+
}, z.core.$strict>>>;
|
|
519
527
|
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
520
528
|
path: z.ZodString;
|
|
521
529
|
resource: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -1928,6 +1936,10 @@ export declare const AgentEnvironmentGetOptionsSchema: z.ZodObject<{
|
|
|
1928
1936
|
metadata?: Record<string, unknown> | undefined;
|
|
1929
1937
|
}>, unknown>>>;
|
|
1930
1938
|
resources: z.ZodOptional<z.ZodObject<{
|
|
1939
|
+
knowledge: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1940
|
+
sourceId: z.ZodString;
|
|
1941
|
+
generation: z.ZodString;
|
|
1942
|
+
}, z.core.$strict>>>;
|
|
1931
1943
|
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1932
1944
|
path: z.ZodString;
|
|
1933
1945
|
resource: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -236,6 +236,10 @@ export declare const ContextTransferRequestSchema: z.ZodObject<{
|
|
|
236
236
|
metadata?: Record<string, unknown> | undefined;
|
|
237
237
|
}>, unknown>>>;
|
|
238
238
|
resources: z.ZodOptional<z.ZodObject<{
|
|
239
|
+
knowledge: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
240
|
+
sourceId: z.ZodString;
|
|
241
|
+
generation: z.ZodString;
|
|
242
|
+
}, z.core.$strict>>>;
|
|
239
243
|
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
240
244
|
path: z.ZodString;
|
|
241
245
|
resource: z.ZodUnion<readonly [z.ZodObject<{
|
package/dist/profile-diff.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export interface AgentProfilePromptRemoval {
|
|
|
8
8
|
instructions?: AgentProfileRemoveList;
|
|
9
9
|
}
|
|
10
10
|
export interface AgentProfileResourceRemoval {
|
|
11
|
+
knowledge?: AgentProfileRemoveList;
|
|
11
12
|
files?: AgentProfileRemoveList;
|
|
12
13
|
tools?: AgentProfileRemoveList;
|
|
13
14
|
skills?: AgentProfileRemoveList;
|
package/dist/profile-diff.js
CHANGED
|
@@ -30,6 +30,7 @@ const agentProfilePromptDiffPropertyAxes = [
|
|
|
30
30
|
const _agentProfilePromptDiffPropertyAxesAreExhaustive = true;
|
|
31
31
|
void _agentProfilePromptDiffPropertyAxesAreExhaustive;
|
|
32
32
|
const agentProfileResourceDiffPropertyAxes = [
|
|
33
|
+
"knowledge",
|
|
33
34
|
"files",
|
|
34
35
|
"tools",
|
|
35
36
|
"skills",
|
|
@@ -118,6 +119,14 @@ function replaceChangedProfileResources(baseline, candidate, remove, set) {
|
|
|
118
119
|
}
|
|
119
120
|
return;
|
|
120
121
|
}
|
|
122
|
+
// Resource removals prune empty sibling arrays. Restore only the candidate's
|
|
123
|
+
// explicit empties, without copying unchanged nonempty or external resources.
|
|
124
|
+
for (const axis of agentProfileResourceDiffPropertyAxes) {
|
|
125
|
+
const value = candidate?.[axis];
|
|
126
|
+
if (Array.isArray(value) && value.length === 0) {
|
|
127
|
+
Object.assign(resourceSet, { [axis]: [] });
|
|
128
|
+
}
|
|
129
|
+
}
|
|
121
130
|
remove.resources = resourceRemove;
|
|
122
131
|
const canonicalCandidate = canonicalProfileValue(candidate);
|
|
123
132
|
if (Object.keys(resourceSet).length > 0 ||
|
|
@@ -178,6 +187,12 @@ function removeResources(resources, removal) {
|
|
|
178
187
|
if (removal === true)
|
|
179
188
|
return undefined;
|
|
180
189
|
const next = { ...resources };
|
|
190
|
+
if (removal.knowledge === true)
|
|
191
|
+
delete next.knowledge;
|
|
192
|
+
else if (removal.knowledge !== undefined) {
|
|
193
|
+
const removeSet = new Set(removal.knowledge);
|
|
194
|
+
setOrDelete(next, "knowledge", next.knowledge?.filter((ref) => !removeSet.has(ref.sourceId)));
|
|
195
|
+
}
|
|
181
196
|
if (removal.files !== undefined) {
|
|
182
197
|
if (removal.files === true) {
|
|
183
198
|
delete next.files;
|
|
@@ -199,6 +214,7 @@ function removeResources(resources, removal) {
|
|
|
199
214
|
if (removal.failOnError)
|
|
200
215
|
delete next.failOnError;
|
|
201
216
|
for (const key of [
|
|
217
|
+
"knowledge",
|
|
202
218
|
"files",
|
|
203
219
|
"tools",
|
|
204
220
|
"skills",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Immutable Hub generation identities, never aliases such as latest or a caller's scope. */
|
|
3
|
+
export declare const agentProfileKnowledgeRefSchema: z.ZodObject<{
|
|
4
|
+
sourceId: z.ZodString;
|
|
5
|
+
generation: z.ZodString;
|
|
6
|
+
}, z.core.$strict>;
|
|
7
|
+
export declare const agentProfileKnowledgeRefsSchema: z.ZodArray<z.ZodObject<{
|
|
8
|
+
sourceId: z.ZodString;
|
|
9
|
+
generation: z.ZodString;
|
|
10
|
+
}, z.core.$strict>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { MAX_PROFILE_KNOWLEDGE_SOURCES, } from "./agent-profile.js";
|
|
3
|
+
/** Immutable Hub generation identities, never aliases such as latest or a caller's scope. */
|
|
4
|
+
export const agentProfileKnowledgeRefSchema = z.strictObject({
|
|
5
|
+
sourceId: z.string().regex(/^[A-Za-z0-9_-]{1,128}$/),
|
|
6
|
+
generation: z.string().regex(/^kg_[a-f0-9]{64}$/),
|
|
7
|
+
});
|
|
8
|
+
export const agentProfileKnowledgeRefsSchema = z
|
|
9
|
+
.array(agentProfileKnowledgeRefSchema)
|
|
10
|
+
.max(MAX_PROFILE_KNOWLEDGE_SOURCES)
|
|
11
|
+
.superRefine((refs, context) => {
|
|
12
|
+
const seen = new Set();
|
|
13
|
+
refs.forEach((ref, index) => {
|
|
14
|
+
if (seen.has(ref.sourceId))
|
|
15
|
+
context.addIssue({
|
|
16
|
+
code: "custom",
|
|
17
|
+
path: [index, "sourceId"],
|
|
18
|
+
message: "A profile must pin exactly one generation per knowledge source",
|
|
19
|
+
});
|
|
20
|
+
seen.add(ref.sourceId);
|
|
21
|
+
});
|
|
22
|
+
});
|
package/dist/profile-schema.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
export { agentProfileKnowledgeRefSchema, agentProfileKnowledgeRefsSchema, } from "./profile-knowledge.js";
|
|
2
3
|
import { type AgentProfile, type AgentProfileMetadata, type AgentTrainingTask, type AgentProfileMcpServer } from "./agent-profile.js";
|
|
3
4
|
import type { AgentProfileDiff } from "./profile-diff.js";
|
|
4
5
|
import { type SandboxSizePreset } from "./sandbox-size.js";
|
|
@@ -39,6 +40,10 @@ export declare const agentProfileFileMountSchema: z.ZodObject<{
|
|
|
39
40
|
executable: z.ZodOptional<z.ZodBoolean>;
|
|
40
41
|
}, z.core.$strict>;
|
|
41
42
|
export declare const agentProfileResourcesSchema: z.ZodObject<{
|
|
43
|
+
knowledge: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
44
|
+
sourceId: z.ZodString;
|
|
45
|
+
generation: z.ZodString;
|
|
46
|
+
}, z.core.$strict>>>;
|
|
42
47
|
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
43
48
|
path: z.ZodString;
|
|
44
49
|
resource: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -319,6 +324,7 @@ export declare const agentProfilePromptRemovalSchema: z.ZodObject<{
|
|
|
319
324
|
instructions: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodArray<z.ZodString>]>>;
|
|
320
325
|
}, z.core.$strict>;
|
|
321
326
|
export declare const agentProfileResourceRemovalSchema: z.ZodObject<{
|
|
327
|
+
knowledge: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodArray<z.ZodString>]>>;
|
|
322
328
|
files: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodArray<z.ZodString>]>>;
|
|
323
329
|
tools: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodArray<z.ZodString>]>>;
|
|
324
330
|
skills: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodArray<z.ZodString>]>>;
|
|
@@ -344,6 +350,7 @@ export declare const agentProfileDiffRemovalSchema: z.ZodObject<{
|
|
|
344
350
|
connections: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodArray<z.ZodString>]>>;
|
|
345
351
|
subagents: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodArray<z.ZodString>]>>;
|
|
346
352
|
resources: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
|
|
353
|
+
knowledge: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodArray<z.ZodString>]>>;
|
|
347
354
|
files: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodArray<z.ZodString>]>>;
|
|
348
355
|
tools: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodArray<z.ZodString>]>>;
|
|
349
356
|
skills: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodArray<z.ZodString>]>>;
|
|
@@ -575,6 +582,10 @@ export declare const agentProfileSchema: z.ZodObject<{
|
|
|
575
582
|
metadata?: Record<string, unknown> | undefined;
|
|
576
583
|
}>, unknown>>>;
|
|
577
584
|
resources: z.ZodOptional<z.ZodObject<{
|
|
585
|
+
knowledge: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
586
|
+
sourceId: z.ZodString;
|
|
587
|
+
generation: z.ZodString;
|
|
588
|
+
}, z.core.$strict>>>;
|
|
578
589
|
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
579
590
|
path: z.ZodString;
|
|
580
591
|
resource: z.ZodUnion<readonly [z.ZodObject<{
|
package/dist/profile-schema.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { agentProfileKnowledgeRefsSchema } from "./profile-knowledge.js";
|
|
3
|
+
export { agentProfileKnowledgeRefSchema, agentProfileKnowledgeRefsSchema, } from "./profile-knowledge.js";
|
|
2
4
|
import { REASONING_EFFORTS, TRAINED_MODEL_PREFIX, trainedModelIdForArtifact, } from "./agent-profile.js";
|
|
3
5
|
import { canonicalCandidateDigest, sha256DigestSchema, environmentNameSchema, headerNameSchema, isSafeExecutable, isSafeRelativePath, isWellFormedUnicode, looksLikeCredential, } from "./agent-candidate-schema-common.js";
|
|
4
6
|
import { harnessTypeSchema } from "./harness.js";
|
|
@@ -82,6 +84,7 @@ export const agentProfileFileMountSchema = z.strictObject({
|
|
|
82
84
|
executable: z.boolean().optional(),
|
|
83
85
|
});
|
|
84
86
|
export const agentProfileResourcesSchema = z.strictObject({
|
|
87
|
+
knowledge: agentProfileKnowledgeRefsSchema.optional(),
|
|
85
88
|
files: z.array(agentProfileFileMountSchema).optional(),
|
|
86
89
|
tools: z.array(agentProfileResourceRefSchema).optional(),
|
|
87
90
|
skills: z.array(agentProfileResourceRefSchema).optional(),
|
|
@@ -306,6 +309,7 @@ export const agentProfilePromptRemovalSchema = z.strictObject({
|
|
|
306
309
|
instructions: removeListSchema.optional(),
|
|
307
310
|
});
|
|
308
311
|
export const agentProfileResourceRemovalSchema = z.strictObject({
|
|
312
|
+
knowledge: removeListSchema.optional(),
|
|
309
313
|
files: removeListSchema.optional(),
|
|
310
314
|
tools: removeListSchema.optional(),
|
|
311
315
|
skills: removeListSchema.optional(),
|