@tangle-network/agent-interface 0.45.0 → 0.46.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.
- package/README.md +1 -1
- package/dist/agent-candidate-profile-schema.d.ts +2 -2
- package/dist/agent-candidate-promotion-schema.d.ts +22 -22
- package/dist/agent-candidate-schema-common.js +1 -1
- package/dist/agent-candidate-schema.d.ts +2 -2
- package/dist/agent-execution-preparation.d.ts +26 -26
- package/dist/agent-profile.d.ts +10 -3
- package/dist/agent-profile.js +45 -22
- package/dist/backend-message.d.ts +14 -0
- package/dist/backend-message.js +1 -0
- package/dist/contract-limits.d.ts +26 -0
- package/dist/contract-limits.js +175 -0
- package/dist/environment-exact-process.d.ts +161 -0
- package/dist/environment-exact-process.js +1 -0
- package/dist/environment-profile-capabilities.d.ts +26 -0
- package/dist/environment-profile-capabilities.js +34 -0
- package/dist/environment-provider.d.ts +3 -730
- package/dist/environment-provider.js +3 -245
- package/dist/environment-requests.d.ts +70 -0
- package/dist/environment-requests.js +1 -0
- package/dist/environment-runtime.d.ts +834 -0
- package/dist/environment-runtime.js +228 -0
- package/dist/execution-types.d.ts +47 -0
- package/dist/execution-types.js +1 -0
- package/dist/host-services.d.ts +91 -0
- package/dist/host-services.js +1 -0
- package/dist/index.d.ts +10 -617
- package/dist/index.js +10 -125
- package/dist/interaction-answer-validation.d.ts +13 -0
- package/dist/interaction-answer-validation.js +149 -0
- package/dist/interaction-data.d.ts +22 -0
- package/dist/interaction-data.js +46 -0
- package/dist/interaction-envelope.d.ts +258 -0
- package/dist/interaction-envelope.js +245 -0
- package/dist/interaction-fields.d.ts +130 -0
- package/dist/interaction-fields.js +227 -0
- package/dist/interaction-permissions.d.ts +28 -0
- package/dist/interaction-permissions.js +57 -0
- package/dist/interaction-resolution-validation.d.ts +9 -0
- package/dist/interaction-resolution-validation.js +50 -0
- package/dist/interaction-response-validation.d.ts +17 -0
- package/dist/interaction-response-validation.js +102 -0
- package/dist/interaction.d.ts +6 -397
- package/dist/interaction.js +6 -603
- package/dist/mcp.d.ts +38 -0
- package/dist/mcp.js +1 -0
- package/dist/parts.d.ts +104 -0
- package/dist/parts.js +55 -0
- package/dist/portable-context-base.d.ts +82 -0
- package/dist/portable-context-base.js +63 -0
- package/dist/portable-context-continuation.d.ts +168 -0
- package/dist/portable-context-continuation.js +194 -0
- package/dist/portable-context-plan-request.d.ts +86 -0
- package/dist/portable-context-plan-request.js +102 -0
- package/dist/portable-context-plan.d.ts +229 -0
- package/dist/portable-context-plan.js +241 -0
- package/dist/portable-context-shared.d.ts +36 -0
- package/dist/portable-context-shared.js +46 -0
- package/dist/portable-context-transfer.d.ts +319 -0
- package/dist/portable-context-transfer.js +206 -0
- package/dist/portable-context.d.ts +5 -753
- package/dist/portable-context.js +5 -754
- package/dist/profile-diff.js +56 -47
- package/dist/provider-adapter.d.ts +45 -0
- package/dist/provider-adapter.js +1 -0
- package/dist/provider-config.d.ts +58 -0
- package/dist/provider-config.js +42 -0
- package/dist/runtime-control.d.ts +87 -10
- package/dist/runtime-control.js +159 -38
- package/dist/stream-events.d.ts +55 -0
- package/dist/stream-events.js +1 -0
- package/dist/workspace-branching-shared.d.ts +7 -0
- package/dist/workspace-branching-shared.js +20 -0
- package/dist/workspace-branching.d.ts +4 -254
- package/dist/workspace-branching.js +4 -400
- package/dist/workspace-checkpoint.d.ts +99 -0
- package/dist/workspace-checkpoint.js +169 -0
- package/dist/workspace-cleanup.d.ts +85 -0
- package/dist/workspace-cleanup.js +156 -0
- package/dist/workspace-confidentiality.d.ts +59 -0
- package/dist/workspace-confidentiality.js +123 -0
- package/dist/workspace-fork.d.ts +182 -0
- package/dist/workspace-fork.js +267 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ shapes; higher-level packages import from here rather than redefining them.
|
|
|
10
10
|
`AgentRunControlRef` identifies a retained run without depending on a live JavaScript object and may carry the provider's admission digest so reconstruction can reject changed-input reuse.
|
|
11
11
|
`RuntimeEventEnvelope` adds stable run, event, sequence, cursor, and timestamp fields around the existing `StreamEvent` union, and its runtime schema validates every canonical event variant.
|
|
12
12
|
Providers advertise `retainedControl` only when exact run, result, event, cancellation, replay, detach, turn, and session identity are all implemented together.
|
|
13
|
-
`AgentSession.cancelRun()` accepts a canonical request digest bound to one operation and `
|
|
13
|
+
`AgentSession.cancelRun()` accepts a canonical request digest bound to one operation and `AgentExactRunControlRef`, so a caller can safely repeat the same cancellation after losing the first acknowledgement.
|
|
14
14
|
Its acknowledgement repeats the operation, digest, and run coordinates and distinguishes a known cancellation effect from conflict or unknown state.
|
|
15
15
|
|
|
16
16
|
An environment advertises `interactions` only when it can originate and answer typed requests.
|
|
@@ -66,9 +66,9 @@ export declare const agentCandidateProfileSchema: z.ZodObject<{
|
|
|
66
66
|
mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<AgentCandidateMcpServer, unknown, z.core.$ZodTypeInternals<AgentCandidateMcpServer, unknown>>>>;
|
|
67
67
|
subagents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
68
68
|
prompt: z.ZodOptional<z.ZodString>;
|
|
69
|
-
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
70
69
|
tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
|
|
71
70
|
description: z.ZodOptional<z.ZodString>;
|
|
71
|
+
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
72
72
|
model: z.ZodOptional<z.ZodString>;
|
|
73
73
|
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
74
74
|
}, z.core.$strict>>>;
|
|
@@ -545,9 +545,9 @@ export declare const agentCandidateProfileSchema: z.ZodObject<{
|
|
|
545
545
|
}, z.core.$strict>>>>;
|
|
546
546
|
modes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
547
547
|
prompt: z.ZodOptional<z.ZodString>;
|
|
548
|
-
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
549
548
|
tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
|
|
550
549
|
description: z.ZodOptional<z.ZodString>;
|
|
550
|
+
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
551
551
|
model: z.ZodOptional<z.ZodString>;
|
|
552
552
|
}, z.core.$strict>>>;
|
|
553
553
|
confidential: z.ZodOptional<z.ZodObject<{
|
|
@@ -57,9 +57,9 @@ export declare const agentCandidateExperimentSchema: z.ZodObject<{
|
|
|
57
57
|
mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./agent-candidate.js").AgentCandidateMcpServer, unknown, z.core.$ZodTypeInternals<import("./agent-candidate.js").AgentCandidateMcpServer, unknown>>>>;
|
|
58
58
|
subagents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
59
59
|
prompt: z.ZodOptional<z.ZodString>;
|
|
60
|
-
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
61
60
|
tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
|
|
62
61
|
description: z.ZodOptional<z.ZodString>;
|
|
62
|
+
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
63
63
|
model: z.ZodOptional<z.ZodString>;
|
|
64
64
|
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
65
65
|
}, z.core.$strict>>>;
|
|
@@ -536,9 +536,9 @@ export declare const agentCandidateExperimentSchema: z.ZodObject<{
|
|
|
536
536
|
}, z.core.$strict>>>>;
|
|
537
537
|
modes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
538
538
|
prompt: z.ZodOptional<z.ZodString>;
|
|
539
|
-
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
540
539
|
tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
|
|
541
540
|
description: z.ZodOptional<z.ZodString>;
|
|
541
|
+
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
542
542
|
model: z.ZodOptional<z.ZodString>;
|
|
543
543
|
}, z.core.$strict>>>;
|
|
544
544
|
confidential: z.ZodOptional<z.ZodObject<{
|
|
@@ -887,9 +887,9 @@ export declare const agentCandidateExperimentSchema: z.ZodObject<{
|
|
|
887
887
|
mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./agent-candidate.js").AgentCandidateMcpServer, unknown, z.core.$ZodTypeInternals<import("./agent-candidate.js").AgentCandidateMcpServer, unknown>>>>;
|
|
888
888
|
subagents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
889
889
|
prompt: z.ZodOptional<z.ZodString>;
|
|
890
|
-
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
891
890
|
tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
|
|
892
891
|
description: z.ZodOptional<z.ZodString>;
|
|
892
|
+
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
893
893
|
model: z.ZodOptional<z.ZodString>;
|
|
894
894
|
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
895
895
|
}, z.core.$strict>>>;
|
|
@@ -1366,9 +1366,9 @@ export declare const agentCandidateExperimentSchema: z.ZodObject<{
|
|
|
1366
1366
|
}, z.core.$strict>>>>;
|
|
1367
1367
|
modes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1368
1368
|
prompt: z.ZodOptional<z.ZodString>;
|
|
1369
|
-
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
1370
1369
|
tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
|
|
1371
1370
|
description: z.ZodOptional<z.ZodString>;
|
|
1371
|
+
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
1372
1372
|
model: z.ZodOptional<z.ZodString>;
|
|
1373
1373
|
}, z.core.$strict>>>;
|
|
1374
1374
|
confidential: z.ZodOptional<z.ZodObject<{
|
|
@@ -3630,9 +3630,9 @@ export declare const agentImprovementMeasuredComparisonSchema: z.ZodObject<{
|
|
|
3630
3630
|
mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./agent-candidate.js").AgentCandidateMcpServer, unknown, z.core.$ZodTypeInternals<import("./agent-candidate.js").AgentCandidateMcpServer, unknown>>>>;
|
|
3631
3631
|
subagents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
3632
3632
|
prompt: z.ZodOptional<z.ZodString>;
|
|
3633
|
-
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
3634
3633
|
tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
|
|
3635
3634
|
description: z.ZodOptional<z.ZodString>;
|
|
3635
|
+
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
3636
3636
|
model: z.ZodOptional<z.ZodString>;
|
|
3637
3637
|
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
3638
3638
|
}, z.core.$strict>>>;
|
|
@@ -4109,9 +4109,9 @@ export declare const agentImprovementMeasuredComparisonSchema: z.ZodObject<{
|
|
|
4109
4109
|
}, z.core.$strict>>>>;
|
|
4110
4110
|
modes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4111
4111
|
prompt: z.ZodOptional<z.ZodString>;
|
|
4112
|
-
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
4113
4112
|
tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
|
|
4114
4113
|
description: z.ZodOptional<z.ZodString>;
|
|
4114
|
+
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
4115
4115
|
model: z.ZodOptional<z.ZodString>;
|
|
4116
4116
|
}, z.core.$strict>>>;
|
|
4117
4117
|
confidential: z.ZodOptional<z.ZodObject<{
|
|
@@ -4460,9 +4460,9 @@ export declare const agentImprovementMeasuredComparisonSchema: z.ZodObject<{
|
|
|
4460
4460
|
mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./agent-candidate.js").AgentCandidateMcpServer, unknown, z.core.$ZodTypeInternals<import("./agent-candidate.js").AgentCandidateMcpServer, unknown>>>>;
|
|
4461
4461
|
subagents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4462
4462
|
prompt: z.ZodOptional<z.ZodString>;
|
|
4463
|
-
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
4464
4463
|
tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
|
|
4465
4464
|
description: z.ZodOptional<z.ZodString>;
|
|
4465
|
+
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
4466
4466
|
model: z.ZodOptional<z.ZodString>;
|
|
4467
4467
|
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
4468
4468
|
}, z.core.$strict>>>;
|
|
@@ -4939,9 +4939,9 @@ export declare const agentImprovementMeasuredComparisonSchema: z.ZodObject<{
|
|
|
4939
4939
|
}, z.core.$strict>>>>;
|
|
4940
4940
|
modes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4941
4941
|
prompt: z.ZodOptional<z.ZodString>;
|
|
4942
|
-
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
4943
4942
|
tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
|
|
4944
4943
|
description: z.ZodOptional<z.ZodString>;
|
|
4944
|
+
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
4945
4945
|
model: z.ZodOptional<z.ZodString>;
|
|
4946
4946
|
}, z.core.$strict>>>;
|
|
4947
4947
|
confidential: z.ZodOptional<z.ZodObject<{
|
|
@@ -8365,22 +8365,22 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
|
|
|
8365
8365
|
changedSurfaces: z.ZodTuple<[z.ZodEnum<{
|
|
8366
8366
|
prompt: "prompt";
|
|
8367
8367
|
tools: "tools";
|
|
8368
|
+
skills: "skills";
|
|
8368
8369
|
mcp: "mcp";
|
|
8369
8370
|
subagents: "subagents";
|
|
8370
8371
|
hooks: "hooks";
|
|
8371
8372
|
code: "code";
|
|
8372
|
-
skills: "skills";
|
|
8373
8373
|
"agent-profile": "agent-profile";
|
|
8374
8374
|
memory: "memory";
|
|
8375
8375
|
knowledge: "knowledge";
|
|
8376
8376
|
}>], z.ZodEnum<{
|
|
8377
8377
|
prompt: "prompt";
|
|
8378
8378
|
tools: "tools";
|
|
8379
|
+
skills: "skills";
|
|
8379
8380
|
mcp: "mcp";
|
|
8380
8381
|
subagents: "subagents";
|
|
8381
8382
|
hooks: "hooks";
|
|
8382
8383
|
code: "code";
|
|
8383
|
-
skills: "skills";
|
|
8384
8384
|
"agent-profile": "agent-profile";
|
|
8385
8385
|
memory: "memory";
|
|
8386
8386
|
knowledge: "knowledge";
|
|
@@ -8623,9 +8623,9 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
|
|
|
8623
8623
|
mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./agent-candidate.js").AgentCandidateMcpServer, unknown, z.core.$ZodTypeInternals<import("./agent-candidate.js").AgentCandidateMcpServer, unknown>>>>;
|
|
8624
8624
|
subagents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
8625
8625
|
prompt: z.ZodOptional<z.ZodString>;
|
|
8626
|
-
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
8627
8626
|
tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
|
|
8628
8627
|
description: z.ZodOptional<z.ZodString>;
|
|
8628
|
+
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
8629
8629
|
model: z.ZodOptional<z.ZodString>;
|
|
8630
8630
|
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
8631
8631
|
}, z.core.$strict>>>;
|
|
@@ -9102,9 +9102,9 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
|
|
|
9102
9102
|
}, z.core.$strict>>>>;
|
|
9103
9103
|
modes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
9104
9104
|
prompt: z.ZodOptional<z.ZodString>;
|
|
9105
|
-
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
9106
9105
|
tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
|
|
9107
9106
|
description: z.ZodOptional<z.ZodString>;
|
|
9107
|
+
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
9108
9108
|
model: z.ZodOptional<z.ZodString>;
|
|
9109
9109
|
}, z.core.$strict>>>;
|
|
9110
9110
|
confidential: z.ZodOptional<z.ZodObject<{
|
|
@@ -9453,9 +9453,9 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
|
|
|
9453
9453
|
mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./agent-candidate.js").AgentCandidateMcpServer, unknown, z.core.$ZodTypeInternals<import("./agent-candidate.js").AgentCandidateMcpServer, unknown>>>>;
|
|
9454
9454
|
subagents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
9455
9455
|
prompt: z.ZodOptional<z.ZodString>;
|
|
9456
|
-
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
9457
9456
|
tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
|
|
9458
9457
|
description: z.ZodOptional<z.ZodString>;
|
|
9458
|
+
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
9459
9459
|
model: z.ZodOptional<z.ZodString>;
|
|
9460
9460
|
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
9461
9461
|
}, z.core.$strict>>>;
|
|
@@ -9932,9 +9932,9 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
|
|
|
9932
9932
|
}, z.core.$strict>>>>;
|
|
9933
9933
|
modes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
9934
9934
|
prompt: z.ZodOptional<z.ZodString>;
|
|
9935
|
-
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
9936
9935
|
tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
|
|
9937
9936
|
description: z.ZodOptional<z.ZodString>;
|
|
9937
|
+
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
9938
9938
|
model: z.ZodOptional<z.ZodString>;
|
|
9939
9939
|
}, z.core.$strict>>>;
|
|
9940
9940
|
confidential: z.ZodOptional<z.ZodObject<{
|
|
@@ -14054,11 +14054,11 @@ export declare const agentImprovementActivationSchema: z.ZodObject<{
|
|
|
14054
14054
|
surface: z.ZodEnum<{
|
|
14055
14055
|
prompt: "prompt";
|
|
14056
14056
|
tools: "tools";
|
|
14057
|
+
skills: "skills";
|
|
14057
14058
|
mcp: "mcp";
|
|
14058
14059
|
subagents: "subagents";
|
|
14059
14060
|
hooks: "hooks";
|
|
14060
14061
|
code: "code";
|
|
14061
|
-
skills: "skills";
|
|
14062
14062
|
"agent-profile": "agent-profile";
|
|
14063
14063
|
memory: "memory";
|
|
14064
14064
|
knowledge: "knowledge";
|
|
@@ -14069,11 +14069,11 @@ export declare const agentImprovementActivationSchema: z.ZodObject<{
|
|
|
14069
14069
|
surface: z.ZodEnum<{
|
|
14070
14070
|
prompt: "prompt";
|
|
14071
14071
|
tools: "tools";
|
|
14072
|
+
skills: "skills";
|
|
14072
14073
|
mcp: "mcp";
|
|
14073
14074
|
subagents: "subagents";
|
|
14074
14075
|
hooks: "hooks";
|
|
14075
14076
|
code: "code";
|
|
14076
|
-
skills: "skills";
|
|
14077
14077
|
"agent-profile": "agent-profile";
|
|
14078
14078
|
memory: "memory";
|
|
14079
14079
|
knowledge: "knowledge";
|
|
@@ -14099,11 +14099,11 @@ export declare const agentImprovementActivationResultSchema: z.ZodObject<{
|
|
|
14099
14099
|
surface: z.ZodEnum<{
|
|
14100
14100
|
prompt: "prompt";
|
|
14101
14101
|
tools: "tools";
|
|
14102
|
+
skills: "skills";
|
|
14102
14103
|
mcp: "mcp";
|
|
14103
14104
|
subagents: "subagents";
|
|
14104
14105
|
hooks: "hooks";
|
|
14105
14106
|
code: "code";
|
|
14106
|
-
skills: "skills";
|
|
14107
14107
|
"agent-profile": "agent-profile";
|
|
14108
14108
|
memory: "memory";
|
|
14109
14109
|
knowledge: "knowledge";
|
|
@@ -14115,11 +14115,11 @@ export declare const agentImprovementActivationResultSchema: z.ZodObject<{
|
|
|
14115
14115
|
surface: z.ZodEnum<{
|
|
14116
14116
|
prompt: "prompt";
|
|
14117
14117
|
tools: "tools";
|
|
14118
|
+
skills: "skills";
|
|
14118
14119
|
mcp: "mcp";
|
|
14119
14120
|
subagents: "subagents";
|
|
14120
14121
|
hooks: "hooks";
|
|
14121
14122
|
code: "code";
|
|
14122
|
-
skills: "skills";
|
|
14123
14123
|
"agent-profile": "agent-profile";
|
|
14124
14124
|
memory: "memory";
|
|
14125
14125
|
knowledge: "knowledge";
|
|
@@ -14134,11 +14134,11 @@ export declare const agentImprovementActivationResultSchema: z.ZodObject<{
|
|
|
14134
14134
|
surface: z.ZodEnum<{
|
|
14135
14135
|
prompt: "prompt";
|
|
14136
14136
|
tools: "tools";
|
|
14137
|
+
skills: "skills";
|
|
14137
14138
|
mcp: "mcp";
|
|
14138
14139
|
subagents: "subagents";
|
|
14139
14140
|
hooks: "hooks";
|
|
14140
14141
|
code: "code";
|
|
14141
|
-
skills: "skills";
|
|
14142
14142
|
"agent-profile": "agent-profile";
|
|
14143
14143
|
memory: "memory";
|
|
14144
14144
|
knowledge: "knowledge";
|
|
@@ -14149,11 +14149,11 @@ export declare const agentImprovementActivationResultSchema: z.ZodObject<{
|
|
|
14149
14149
|
surface: z.ZodEnum<{
|
|
14150
14150
|
prompt: "prompt";
|
|
14151
14151
|
tools: "tools";
|
|
14152
|
+
skills: "skills";
|
|
14152
14153
|
mcp: "mcp";
|
|
14153
14154
|
subagents: "subagents";
|
|
14154
14155
|
hooks: "hooks";
|
|
14155
14156
|
code: "code";
|
|
14156
|
-
skills: "skills";
|
|
14157
14157
|
"agent-profile": "agent-profile";
|
|
14158
14158
|
memory: "memory";
|
|
14159
14159
|
knowledge: "knowledge";
|
|
@@ -14167,11 +14167,11 @@ export declare const agentImprovementActivationResultSchema: z.ZodObject<{
|
|
|
14167
14167
|
surface: z.ZodEnum<{
|
|
14168
14168
|
prompt: "prompt";
|
|
14169
14169
|
tools: "tools";
|
|
14170
|
+
skills: "skills";
|
|
14170
14171
|
mcp: "mcp";
|
|
14171
14172
|
subagents: "subagents";
|
|
14172
14173
|
hooks: "hooks";
|
|
14173
14174
|
code: "code";
|
|
14174
|
-
skills: "skills";
|
|
14175
14175
|
"agent-profile": "agent-profile";
|
|
14176
14176
|
memory: "memory";
|
|
14177
14177
|
knowledge: "knowledge";
|
|
@@ -14182,11 +14182,11 @@ export declare const agentImprovementActivationResultSchema: z.ZodObject<{
|
|
|
14182
14182
|
surface: z.ZodEnum<{
|
|
14183
14183
|
prompt: "prompt";
|
|
14184
14184
|
tools: "tools";
|
|
14185
|
+
skills: "skills";
|
|
14185
14186
|
mcp: "mcp";
|
|
14186
14187
|
subagents: "subagents";
|
|
14187
14188
|
hooks: "hooks";
|
|
14188
14189
|
code: "code";
|
|
14189
|
-
skills: "skills";
|
|
14190
14190
|
"agent-profile": "agent-profile";
|
|
14191
14191
|
memory: "memory";
|
|
14192
14192
|
knowledge: "knowledge";
|
|
@@ -221,7 +221,7 @@ function configRecordSchema(keySchema) {
|
|
|
221
221
|
return z
|
|
222
222
|
.record(keySchema, agentCandidateConfigValueSchema)
|
|
223
223
|
.superRefine((config, ctx) => {
|
|
224
|
-
for (const
|
|
224
|
+
for (const name of Object.keys(config)) {
|
|
225
225
|
if (secretNamePattern.test(name)) {
|
|
226
226
|
ctx.addIssue({
|
|
227
227
|
code: "custom",
|
|
@@ -61,9 +61,9 @@ export declare const agentCandidateBundleSchema: z.ZodObject<{
|
|
|
61
61
|
mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./agent-candidate.js").AgentCandidateMcpServer, unknown, z.core.$ZodTypeInternals<import("./agent-candidate.js").AgentCandidateMcpServer, unknown>>>>;
|
|
62
62
|
subagents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
63
63
|
prompt: z.ZodOptional<z.ZodString>;
|
|
64
|
-
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
65
64
|
tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
|
|
66
65
|
description: z.ZodOptional<z.ZodString>;
|
|
66
|
+
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
67
67
|
model: z.ZodOptional<z.ZodString>;
|
|
68
68
|
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
69
69
|
}, z.core.$strict>>>;
|
|
@@ -540,9 +540,9 @@ export declare const agentCandidateBundleSchema: z.ZodObject<{
|
|
|
540
540
|
}, z.core.$strict>>>>;
|
|
541
541
|
modes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
542
542
|
prompt: z.ZodOptional<z.ZodString>;
|
|
543
|
-
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
544
543
|
tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
|
|
545
544
|
description: z.ZodOptional<z.ZodString>;
|
|
545
|
+
permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
|
|
546
546
|
model: z.ZodOptional<z.ZodString>;
|
|
547
547
|
}, z.core.$strict>>>;
|
|
548
548
|
confidential: z.ZodOptional<z.ZodObject<{
|
|
@@ -148,27 +148,27 @@ export type AgentExecutionPreparationValidationResult = {
|
|
|
148
148
|
};
|
|
149
149
|
export declare const agentExecutionPreparationAxisResultSchema: z.ZodObject<{
|
|
150
150
|
axis: z.ZodEnum<{
|
|
151
|
-
|
|
151
|
+
name: "name";
|
|
152
|
+
systemPrompt: "systemPrompt";
|
|
153
|
+
appendSystemPrompt: "appendSystemPrompt";
|
|
154
|
+
instructions: "instructions";
|
|
155
|
+
files: "files";
|
|
152
156
|
tools: "tools";
|
|
157
|
+
skills: "skills";
|
|
158
|
+
commands: "commands";
|
|
159
|
+
description: "description";
|
|
160
|
+
version: "version";
|
|
161
|
+
tags: "tags";
|
|
162
|
+
harness: "harness";
|
|
163
|
+
permissions: "permissions";
|
|
153
164
|
mcp: "mcp";
|
|
154
165
|
connections: "connections";
|
|
155
166
|
subagents: "subagents";
|
|
156
167
|
hooks: "hooks";
|
|
157
168
|
modes: "modes";
|
|
158
|
-
metadata: "metadata";
|
|
159
|
-
description: "description";
|
|
160
|
-
name: "name";
|
|
161
|
-
files: "files";
|
|
162
|
-
version: "version";
|
|
163
|
-
tags: "tags";
|
|
164
|
-
harness: "harness";
|
|
165
169
|
confidential: "confidential";
|
|
170
|
+
metadata: "metadata";
|
|
166
171
|
extensions: "extensions";
|
|
167
|
-
systemPrompt: "systemPrompt";
|
|
168
|
-
appendSystemPrompt: "appendSystemPrompt";
|
|
169
|
-
instructions: "instructions";
|
|
170
|
-
skills: "skills";
|
|
171
|
-
commands: "commands";
|
|
172
172
|
modelDefault: "modelDefault";
|
|
173
173
|
modelSmall: "modelSmall";
|
|
174
174
|
modelProvider: "modelProvider";
|
|
@@ -296,27 +296,27 @@ export declare const agentExecutionPreparationReceiptSchema: z.ZodObject<{
|
|
|
296
296
|
}, z.core.$strict>;
|
|
297
297
|
axisResults: z.ZodArray<z.ZodObject<{
|
|
298
298
|
axis: z.ZodEnum<{
|
|
299
|
-
|
|
299
|
+
name: "name";
|
|
300
|
+
systemPrompt: "systemPrompt";
|
|
301
|
+
appendSystemPrompt: "appendSystemPrompt";
|
|
302
|
+
instructions: "instructions";
|
|
303
|
+
files: "files";
|
|
300
304
|
tools: "tools";
|
|
305
|
+
skills: "skills";
|
|
306
|
+
commands: "commands";
|
|
307
|
+
description: "description";
|
|
308
|
+
version: "version";
|
|
309
|
+
tags: "tags";
|
|
310
|
+
harness: "harness";
|
|
311
|
+
permissions: "permissions";
|
|
301
312
|
mcp: "mcp";
|
|
302
313
|
connections: "connections";
|
|
303
314
|
subagents: "subagents";
|
|
304
315
|
hooks: "hooks";
|
|
305
316
|
modes: "modes";
|
|
306
|
-
metadata: "metadata";
|
|
307
|
-
description: "description";
|
|
308
|
-
name: "name";
|
|
309
|
-
files: "files";
|
|
310
|
-
version: "version";
|
|
311
|
-
tags: "tags";
|
|
312
|
-
harness: "harness";
|
|
313
317
|
confidential: "confidential";
|
|
318
|
+
metadata: "metadata";
|
|
314
319
|
extensions: "extensions";
|
|
315
|
-
systemPrompt: "systemPrompt";
|
|
316
|
-
appendSystemPrompt: "appendSystemPrompt";
|
|
317
|
-
instructions: "instructions";
|
|
318
|
-
skills: "skills";
|
|
319
|
-
commands: "commands";
|
|
320
320
|
modelDefault: "modelDefault";
|
|
321
321
|
modelSmall: "modelSmall";
|
|
322
322
|
modelProvider: "modelProvider";
|
package/dist/agent-profile.d.ts
CHANGED
|
@@ -442,9 +442,16 @@ export interface AgentProfileValidationResult {
|
|
|
442
442
|
/**
|
|
443
443
|
* Merge two public AgentProfile values.
|
|
444
444
|
*
|
|
445
|
-
* Overlay fields win on conflicts
|
|
446
|
-
*
|
|
447
|
-
*
|
|
445
|
+
* Overlay fields win on conflicts, but only where they carry a value: an
|
|
446
|
+
* `undefined` entry reads as "not specified" and keeps the base value, because
|
|
447
|
+
* removal is the `remove` channel's job on {@link AgentProfileDiff}. Keys that
|
|
448
|
+
* resolve to nothing are omitted rather than written as `undefined` — RFC 8785
|
|
449
|
+
* canonicalization enumerates own keys, so a present-but-undefined key is a
|
|
450
|
+
* different document from an absent one.
|
|
451
|
+
*
|
|
452
|
+
* Additive fields compose instead of overwriting: array-like instruction sets
|
|
453
|
+
* are concatenated, and `prompt.appendSystemPrompt` values are joined
|
|
454
|
+
* base-first with a blank line between them.
|
|
448
455
|
*/
|
|
449
456
|
export declare function mergeAgentProfiles(base: AgentProfile | undefined, overlay: AgentProfile | undefined): AgentProfile | undefined;
|
|
450
457
|
export {};
|
package/dist/agent-profile.js
CHANGED
|
@@ -23,10 +23,12 @@ export function defineInlineResource(name, content) {
|
|
|
23
23
|
export function defineGitHubResource(path, options = {}) {
|
|
24
24
|
return {
|
|
25
25
|
kind: "github",
|
|
26
|
-
repository: options.repository,
|
|
27
26
|
path,
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
...(options.repository === undefined
|
|
28
|
+
? {}
|
|
29
|
+
: { repository: options.repository }),
|
|
30
|
+
...(options.ref === undefined ? {} : { ref: options.ref }),
|
|
31
|
+
...(options.name === undefined ? {} : { name: options.name }),
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
@@ -67,6 +69,29 @@ export function defineAgentProfileSecretRef(key, format) {
|
|
|
67
69
|
export function defineAgentProfile(profile) {
|
|
68
70
|
return profile;
|
|
69
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Layer objects the way a spread would, except that an `undefined` entry means
|
|
74
|
+
* "not specified" and is never written to the result.
|
|
75
|
+
*
|
|
76
|
+
* Profile identity is an RFC 8785 digest over the profile, and canonicalization
|
|
77
|
+
* enumerates own keys: `{ tools: undefined }` is a different document from `{}`,
|
|
78
|
+
* so writing a key with no value moves the digest of a profile whose content did
|
|
79
|
+
* not change, or is refused outright by the canonical JSON domain. Later sources
|
|
80
|
+
* therefore win only where they carry a value; removal is expressed through
|
|
81
|
+
* {@link AgentProfileDiff}'s `remove` channel, never by overlaying `undefined`.
|
|
82
|
+
*/
|
|
83
|
+
function assignDefined(...sources) {
|
|
84
|
+
const merged = {};
|
|
85
|
+
for (const source of sources) {
|
|
86
|
+
if (source === undefined)
|
|
87
|
+
continue;
|
|
88
|
+
for (const [key, value] of Object.entries(source)) {
|
|
89
|
+
if (value !== undefined)
|
|
90
|
+
merged[key] = value;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return merged;
|
|
94
|
+
}
|
|
70
95
|
function mergeStringArrays(base, overlay) {
|
|
71
96
|
if (!base && !overlay)
|
|
72
97
|
return undefined;
|
|
@@ -88,10 +113,7 @@ function mergeAppendedSystemPrompts(base, overlay) {
|
|
|
88
113
|
function mergeRecord(base, overlay) {
|
|
89
114
|
if (!base && !overlay)
|
|
90
115
|
return undefined;
|
|
91
|
-
return
|
|
92
|
-
...(base ?? {}),
|
|
93
|
-
...(overlay ?? {}),
|
|
94
|
-
};
|
|
116
|
+
return assignDefined(base, overlay);
|
|
95
117
|
}
|
|
96
118
|
function mergeOptionalArrays(base, overlay) {
|
|
97
119
|
if (!base && !overlay)
|
|
@@ -101,36 +123,37 @@ function mergeOptionalArrays(base, overlay) {
|
|
|
101
123
|
/**
|
|
102
124
|
* Merge two public AgentProfile values.
|
|
103
125
|
*
|
|
104
|
-
* Overlay fields win on conflicts
|
|
105
|
-
*
|
|
106
|
-
*
|
|
126
|
+
* Overlay fields win on conflicts, but only where they carry a value: an
|
|
127
|
+
* `undefined` entry reads as "not specified" and keeps the base value, because
|
|
128
|
+
* removal is the `remove` channel's job on {@link AgentProfileDiff}. Keys that
|
|
129
|
+
* resolve to nothing are omitted rather than written as `undefined` — RFC 8785
|
|
130
|
+
* canonicalization enumerates own keys, so a present-but-undefined key is a
|
|
131
|
+
* different document from an absent one.
|
|
132
|
+
*
|
|
133
|
+
* Additive fields compose instead of overwriting: array-like instruction sets
|
|
134
|
+
* are concatenated, and `prompt.appendSystemPrompt` values are joined
|
|
135
|
+
* base-first with a blank line between them.
|
|
107
136
|
*/
|
|
108
137
|
export function mergeAgentProfiles(base, overlay) {
|
|
109
138
|
if (!base && !overlay)
|
|
110
139
|
return undefined;
|
|
111
140
|
const mergedPrompt = base?.prompt || overlay?.prompt
|
|
112
|
-
? {
|
|
113
|
-
...(base?.prompt ?? {}),
|
|
114
|
-
...(overlay?.prompt ?? {}),
|
|
141
|
+
? assignDefined(base?.prompt, overlay?.prompt, {
|
|
115
142
|
appendSystemPrompt: mergeAppendedSystemPrompts(base?.prompt?.appendSystemPrompt, overlay?.prompt?.appendSystemPrompt),
|
|
116
143
|
instructions: mergeStringArrays(base?.prompt?.instructions, overlay?.prompt?.instructions),
|
|
117
|
-
}
|
|
144
|
+
})
|
|
118
145
|
: undefined;
|
|
119
146
|
const mergedResources = base?.resources || overlay?.resources
|
|
120
|
-
? {
|
|
121
|
-
...(base?.resources ?? {}),
|
|
122
|
-
...(overlay?.resources ?? {}),
|
|
147
|
+
? assignDefined(base?.resources, overlay?.resources, {
|
|
123
148
|
files: mergeOptionalArrays(base?.resources?.files, overlay?.resources?.files),
|
|
124
149
|
tools: mergeOptionalArrays(base?.resources?.tools, overlay?.resources?.tools),
|
|
125
150
|
skills: mergeOptionalArrays(base?.resources?.skills, overlay?.resources?.skills),
|
|
126
151
|
agents: mergeOptionalArrays(base?.resources?.agents, overlay?.resources?.agents),
|
|
127
152
|
commands: mergeOptionalArrays(base?.resources?.commands, overlay?.resources?.commands),
|
|
128
153
|
instructions: overlay?.resources?.instructions ?? base?.resources?.instructions,
|
|
129
|
-
}
|
|
154
|
+
})
|
|
130
155
|
: undefined;
|
|
131
|
-
return {
|
|
132
|
-
...(base ?? {}),
|
|
133
|
-
...(overlay ?? {}),
|
|
156
|
+
return assignDefined(base, overlay, {
|
|
134
157
|
prompt: mergedPrompt,
|
|
135
158
|
permissions: mergeRecord(base?.permissions, overlay?.permissions),
|
|
136
159
|
tools: mergeRecord(base?.tools, overlay?.tools),
|
|
@@ -142,5 +165,5 @@ export function mergeAgentProfiles(base, overlay) {
|
|
|
142
165
|
modes: mergeRecord(base?.modes, overlay?.modes),
|
|
143
166
|
metadata: mergeRecord(base?.metadata, overlay?.metadata),
|
|
144
167
|
extensions: mergeRecord(base?.extensions, overlay?.extensions),
|
|
145
|
-
};
|
|
168
|
+
});
|
|
146
169
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { InputPart, Part } from "./parts.js";
|
|
2
|
+
export type BackendMessage = {
|
|
3
|
+
id: string;
|
|
4
|
+
role: "user" | "assistant" | "system";
|
|
5
|
+
parts: Array<Part | InputPart | unknown>;
|
|
6
|
+
timestamp: string;
|
|
7
|
+
metadata?: Record<string, unknown>;
|
|
8
|
+
};
|
|
9
|
+
export type GetMessagesOptions = {
|
|
10
|
+
sessionId: string;
|
|
11
|
+
limit?: number;
|
|
12
|
+
offset?: number;
|
|
13
|
+
since?: number;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Limits applied before a value is hashed, copied, or sent to a provider. */
|
|
3
|
+
export declare const CONTRACT_MAX_STRING_LENGTH = 16384;
|
|
4
|
+
export declare const CONTRACT_MAX_IDENTIFIER_LENGTH = 512;
|
|
5
|
+
export declare const CONTRACT_MAX_ARRAY_LENGTH = 1024;
|
|
6
|
+
export declare const CONTRACT_MAX_MAP_ENTRIES = 256;
|
|
7
|
+
export declare const CONTRACT_MAX_JSON_DEPTH = 16;
|
|
8
|
+
export declare const CONTRACT_MAX_JSON_BYTES = 1048576;
|
|
9
|
+
export declare const CONTRACT_MAX_JSON_NODES = 8192;
|
|
10
|
+
export declare const boundedStringSchema: z.ZodString;
|
|
11
|
+
export declare const boundedIdentifierSchema: z.ZodString;
|
|
12
|
+
/**
|
|
13
|
+
* Validate JSON without asking Zod to recursively copy an attacker-sized
|
|
14
|
+
* value. This is intentionally iterative so depth and collection limits are
|
|
15
|
+
* checked before canonical serialization.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isBoundedJsonValue(value: unknown): boolean;
|
|
18
|
+
/** Validate digest input while matching JSON's omission of undefined object fields. */
|
|
19
|
+
export declare function isBoundedJsonMaterial(value: unknown): boolean;
|
|
20
|
+
export declare const boundedJsonSchema: z.ZodCustom<unknown, unknown>;
|
|
21
|
+
export declare const boundedJsonRecordSchema: z.ZodCustom<Record<string, unknown>, Record<string, unknown>>;
|
|
22
|
+
export declare function assertBoundedJson(value: unknown): void;
|
|
23
|
+
export declare function assertBoundedSerializedJson(value: string): void;
|
|
24
|
+
/** Copy arbitrary metadata into a map that cannot inherit prototype keys. */
|
|
25
|
+
export declare function nullPrototypeRecord<T>(value: Record<string, T>): Record<string, T>;
|
|
26
|
+
export declare function hasOwn(value: object, key: PropertyKey): boolean;
|