@agentknight/sdk 0.9.35
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/LICENSE +201 -0
- package/dist/chunks/acp-adapter-4N2QCTAL.js +936 -0
- package/dist/chunks/chunk-AHJSR7OY.js +24 -0
- package/dist/chunks/chunk-ATMWDEPF.js +1017 -0
- package/dist/chunks/chunk-C7XDS2KG.js +24 -0
- package/dist/chunks/chunk-JFHUAIRY.js +2659 -0
- package/dist/chunks/chunk-MVUOCZFL.js +47 -0
- package/dist/chunks/chunk-SJHJER3B.js +340 -0
- package/dist/chunks/chunk-W3PG2W3C.js +139 -0
- package/dist/chunks/chunk-ZKAN2FO7.js +2654 -0
- package/dist/chunks/copilot-adapter-CLIDIK2S.js +5179 -0
- package/dist/chunks/managed-agent-adapter-HP5VE3AH.js +1252 -0
- package/dist/chunks/pi-adapter-GSDVA7EG.js +1177 -0
- package/dist/index.d.ts +1962 -0
- package/dist/index.js +9187 -0
- package/dist/runtime.d.ts +3 -0
- package/dist/runtime.js +13 -0
- package/package.json +65 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SECURE_MESSAGE_MAX_CIPHERTEXT_LENGTH
|
|
3
|
+
} from "./chunk-ZKAN2FO7.js";
|
|
4
|
+
|
|
5
|
+
// src/agent-selection.ts
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
var AgentSelectionSchema = z.object({
|
|
8
|
+
agents: z.array(z.enum(["copilot", "pi", "acp"])).max(3).refine((agents) => new Set(agents).size === agents.length, "Duplicate managed agent selection")
|
|
9
|
+
}).strict();
|
|
10
|
+
function assertSelectionSnapshotFits(sessions) {
|
|
11
|
+
const bytes = Buffer.byteLength(JSON.stringify(sessions), "utf8") + 4096;
|
|
12
|
+
if (Math.ceil(bytes / 3) * 4 > SECURE_MESSAGE_MAX_CIPHERTEXT_LENGTH) {
|
|
13
|
+
throw new Error("Selected agent session metadata exceeds the encrypted message limit. Select fewer agents.");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function supportsAgentSelection(adapter) {
|
|
17
|
+
return "listAgents" in adapter && typeof adapter.listAgents === "function" && "saveSelection" in adapter && typeof adapter.saveSelection === "function";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
AgentSelectionSchema,
|
|
22
|
+
assertSelectionSnapshotFits,
|
|
23
|
+
supportsAgentSelection
|
|
24
|
+
};
|