@agentvoy/core 0.1.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/dist/adapters/crewai.d.ts +8 -0
- package/dist/adapters/crewai.d.ts.map +1 -0
- package/dist/adapters/crewai.js +229 -0
- package/dist/adapters/crewai.js.map +1 -0
- package/dist/adapters/google-adk.d.ts +8 -0
- package/dist/adapters/google-adk.d.ts.map +1 -0
- package/dist/adapters/google-adk.js +146 -0
- package/dist/adapters/google-adk.js.map +1 -0
- package/dist/adapters/index.d.ts +7 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +23 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/openai.d.ts +8 -0
- package/dist/adapters/openai.d.ts.map +1 -0
- package/dist/adapters/openai.js +193 -0
- package/dist/adapters/openai.js.map +1 -0
- package/dist/adapters/registry.d.ts +13 -0
- package/dist/adapters/registry.d.ts.map +1 -0
- package/dist/adapters/registry.js +35 -0
- package/dist/adapters/registry.js.map +1 -0
- package/dist/config.d.ts +28 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +284 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +152 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/package.json +23 -0
- package/src/adapters/crewai.ts +254 -0
- package/src/adapters/google-adk.ts +167 -0
- package/src/adapters/index.ts +17 -0
- package/src/adapters/openai.ts +214 -0
- package/src/adapters/registry.ts +37 -0
- package/src/config.ts +315 -0
- package/src/index.ts +54 -0
- package/src/types.ts +203 -0
- package/tsconfig.json +8 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Framework Adapter Registry
|
|
4
|
+
*
|
|
5
|
+
* Central registry for all supported agent framework adapters.
|
|
6
|
+
* Each adapter knows how to scaffold a project for its framework.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.registerAdapter = registerAdapter;
|
|
10
|
+
exports.getAdapter = getAdapter;
|
|
11
|
+
exports.listAdapters = listAdapters;
|
|
12
|
+
exports.listFrameworks = listFrameworks;
|
|
13
|
+
exports.hasAdapter = hasAdapter;
|
|
14
|
+
const adapters = new Map();
|
|
15
|
+
function registerAdapter(adapter) {
|
|
16
|
+
adapters.set(adapter.name, adapter);
|
|
17
|
+
}
|
|
18
|
+
function getAdapter(framework) {
|
|
19
|
+
const adapter = adapters.get(framework);
|
|
20
|
+
if (!adapter) {
|
|
21
|
+
const available = Array.from(adapters.keys()).join(", ");
|
|
22
|
+
throw new Error(`Unknown framework: "${framework}". Available: ${available}`);
|
|
23
|
+
}
|
|
24
|
+
return adapter;
|
|
25
|
+
}
|
|
26
|
+
function listAdapters() {
|
|
27
|
+
return Array.from(adapters.values());
|
|
28
|
+
}
|
|
29
|
+
function listFrameworks() {
|
|
30
|
+
return Array.from(adapters.keys());
|
|
31
|
+
}
|
|
32
|
+
function hasAdapter(framework) {
|
|
33
|
+
return adapters.has(framework);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/adapters/registry.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAMH,0CAEC;AAED,gCASC;AAED,oCAEC;AAED,wCAEC;AAED,gCAEC;AA3BD,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA+B,CAAC;AAExD,SAAgB,eAAe,CAAC,OAAyB;IACvD,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACtC,CAAC;AAED,SAAgB,UAAU,CAAC,SAAoB;IAC7C,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACxC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzD,MAAM,IAAI,KAAK,CACb,uBAAuB,SAAS,iBAAiB,SAAS,EAAE,CAC7D,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAgB,YAAY;IAC1B,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;AACvC,CAAC;AAED,SAAgB,cAAc;IAC5B,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;AACrC,CAAC;AAED,SAAgB,UAAU,CAAC,SAAoB;IAC7C,OAAO,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentVoy Config Parser
|
|
3
|
+
*
|
|
4
|
+
* Loads, validates, and manages agent.guard.yml configuration files.
|
|
5
|
+
* This is the core innovation — a universal, declarative guardrails
|
|
6
|
+
* config that works across all agent frameworks.
|
|
7
|
+
*/
|
|
8
|
+
import type { AgentGuardConfig, ValidationResult } from "./types.js";
|
|
9
|
+
/**
|
|
10
|
+
* Load and parse an agent.guard.yml config file
|
|
11
|
+
*/
|
|
12
|
+
export declare function loadConfig(projectDir: string): AgentGuardConfig;
|
|
13
|
+
/**
|
|
14
|
+
* Find the config file by searching up the directory tree
|
|
15
|
+
*/
|
|
16
|
+
export declare function findConfigFile(startDir: string): string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Validate an agent guard config
|
|
19
|
+
*/
|
|
20
|
+
export declare function validateConfig(config: AgentGuardConfig): ValidationResult;
|
|
21
|
+
/**
|
|
22
|
+
* Generate a default agent.guard.yml config
|
|
23
|
+
*/
|
|
24
|
+
export declare function generateDefaultConfig(agentName: string, provider: string, model: string): string;
|
|
25
|
+
export declare class ConfigError extends Error {
|
|
26
|
+
constructor(message: string);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAGjB,MAAM,YAAY,CAAC;AASpB;;GAEG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB,CA0B/D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAiB9D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAsFzE;AAiDD;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GACZ,MAAM,CAiER;AAqBD,qBAAa,WAAY,SAAQ,KAAK;gBACxB,OAAO,EAAE,MAAM;CAI5B"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* AgentVoy Config Parser
|
|
4
|
+
*
|
|
5
|
+
* Loads, validates, and manages agent.guard.yml configuration files.
|
|
6
|
+
* This is the core innovation — a universal, declarative guardrails
|
|
7
|
+
* config that works across all agent frameworks.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.ConfigError = void 0;
|
|
11
|
+
exports.loadConfig = loadConfig;
|
|
12
|
+
exports.findConfigFile = findConfigFile;
|
|
13
|
+
exports.validateConfig = validateConfig;
|
|
14
|
+
exports.generateDefaultConfig = generateDefaultConfig;
|
|
15
|
+
const node_fs_1 = require("node:fs");
|
|
16
|
+
const node_path_1 = require("node:path");
|
|
17
|
+
const yaml_1 = require("yaml");
|
|
18
|
+
const CONFIG_FILENAMES = [
|
|
19
|
+
"agent.guard.yml",
|
|
20
|
+
"agent.guard.yaml",
|
|
21
|
+
"agentguard.yml",
|
|
22
|
+
"agentguard.yaml",
|
|
23
|
+
];
|
|
24
|
+
/**
|
|
25
|
+
* Load and parse an agent.guard.yml config file
|
|
26
|
+
*/
|
|
27
|
+
function loadConfig(projectDir) {
|
|
28
|
+
const configPath = findConfigFile(projectDir);
|
|
29
|
+
if (!configPath) {
|
|
30
|
+
throw new ConfigError(`No agent.guard.yml found in ${projectDir}. Run 'agentvoy init' to create one.`);
|
|
31
|
+
}
|
|
32
|
+
const raw = (0, node_fs_1.readFileSync)(configPath, "utf-8");
|
|
33
|
+
const parsed = (0, yaml_1.parse)(raw);
|
|
34
|
+
if (!parsed || typeof parsed !== "object") {
|
|
35
|
+
throw new ConfigError(`Invalid config file: ${configPath}`);
|
|
36
|
+
}
|
|
37
|
+
const validation = validateConfig(parsed);
|
|
38
|
+
if (!validation.valid) {
|
|
39
|
+
const errorMessages = validation.errors
|
|
40
|
+
.map((e) => ` - ${e.field}: ${e.message}`)
|
|
41
|
+
.join("\n");
|
|
42
|
+
throw new ConfigError(`Invalid agent.guard.yml:\n${errorMessages}`);
|
|
43
|
+
}
|
|
44
|
+
return applyDefaults(parsed);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Find the config file by searching up the directory tree
|
|
48
|
+
*/
|
|
49
|
+
function findConfigFile(startDir) {
|
|
50
|
+
let dir = (0, node_path_1.resolve)(startDir);
|
|
51
|
+
while (true) {
|
|
52
|
+
for (const filename of CONFIG_FILENAMES) {
|
|
53
|
+
const filePath = (0, node_path_1.resolve)(dir, filename);
|
|
54
|
+
if ((0, node_fs_1.existsSync)(filePath)) {
|
|
55
|
+
return filePath;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const parentDir = (0, node_path_1.dirname)(dir);
|
|
59
|
+
if (parentDir === dir)
|
|
60
|
+
break;
|
|
61
|
+
dir = parentDir;
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Validate an agent guard config
|
|
67
|
+
*/
|
|
68
|
+
function validateConfig(config) {
|
|
69
|
+
const errors = [];
|
|
70
|
+
const warnings = [];
|
|
71
|
+
// Required fields
|
|
72
|
+
if (!config.version) {
|
|
73
|
+
errors.push({ field: "version", message: "version is required" });
|
|
74
|
+
}
|
|
75
|
+
if (!config.identity) {
|
|
76
|
+
errors.push({ field: "identity", message: "identity is required" });
|
|
77
|
+
}
|
|
78
|
+
else if (!config.identity.name) {
|
|
79
|
+
errors.push({ field: "identity.name", message: "agent name is required" });
|
|
80
|
+
}
|
|
81
|
+
if (!config.model) {
|
|
82
|
+
errors.push({ field: "model", message: "model configuration is required" });
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
if (!config.model.provider) {
|
|
86
|
+
errors.push({
|
|
87
|
+
field: "model.provider",
|
|
88
|
+
message: "model provider is required",
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
if (!config.model.model) {
|
|
92
|
+
errors.push({ field: "model.model", message: "model name is required" });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// Validate permissions
|
|
96
|
+
if (config.permissions?.network) {
|
|
97
|
+
const net = config.permissions.network;
|
|
98
|
+
if (net.mode === "restricted" && !net.allow?.length) {
|
|
99
|
+
warnings.push({
|
|
100
|
+
field: "permissions.network",
|
|
101
|
+
message: "network mode is 'restricted' but no allow list specified — all network access will be blocked",
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// Validate guardrails
|
|
106
|
+
if (config.guardrails?.behavior) {
|
|
107
|
+
const behavior = config.guardrails.behavior;
|
|
108
|
+
if (behavior.max_iterations !== undefined && behavior.max_iterations < 1) {
|
|
109
|
+
errors.push({
|
|
110
|
+
field: "guardrails.behavior.max_iterations",
|
|
111
|
+
message: "max_iterations must be at least 1",
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
if (behavior.timeout) {
|
|
115
|
+
if (!isValidDuration(behavior.timeout)) {
|
|
116
|
+
errors.push({
|
|
117
|
+
field: "guardrails.behavior.timeout",
|
|
118
|
+
message: 'timeout must be a valid duration string (e.g., "5m", "1h", "30s")',
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (behavior.cost_limit) {
|
|
123
|
+
if (!isValidCost(behavior.cost_limit)) {
|
|
124
|
+
errors.push({
|
|
125
|
+
field: "guardrails.behavior.cost_limit",
|
|
126
|
+
message: 'cost_limit must be a valid cost string (e.g., "$0.50", "$10")',
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// Validate auth
|
|
132
|
+
if (config.auth) {
|
|
133
|
+
const validTypes = ["none", "api_key", "oauth2", "jwt"];
|
|
134
|
+
if (config.auth.type && !validTypes.includes(config.auth.type)) {
|
|
135
|
+
errors.push({
|
|
136
|
+
field: "auth.type",
|
|
137
|
+
message: `auth type must be one of: ${validTypes.join(", ")}`,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
valid: errors.length === 0,
|
|
143
|
+
errors,
|
|
144
|
+
warnings,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Apply default values to a config
|
|
149
|
+
*/
|
|
150
|
+
function applyDefaults(config) {
|
|
151
|
+
return {
|
|
152
|
+
...config,
|
|
153
|
+
version: config.version || "1.0",
|
|
154
|
+
permissions: {
|
|
155
|
+
network: { mode: "unrestricted", ...config.permissions?.network },
|
|
156
|
+
filesystem: { ...config.permissions?.filesystem },
|
|
157
|
+
tools: { ...config.permissions?.tools },
|
|
158
|
+
execution: {
|
|
159
|
+
allow_shell: false,
|
|
160
|
+
allow_subprocess: false,
|
|
161
|
+
...config.permissions?.execution,
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
guardrails: {
|
|
165
|
+
input: {
|
|
166
|
+
block_prompt_injection: true,
|
|
167
|
+
pii_detection: "warn",
|
|
168
|
+
content_filter: "moderate",
|
|
169
|
+
...config.guardrails?.input,
|
|
170
|
+
},
|
|
171
|
+
output: {
|
|
172
|
+
block_harmful_content: true,
|
|
173
|
+
pii_redaction: false,
|
|
174
|
+
hallucination_check: false,
|
|
175
|
+
...config.guardrails?.output,
|
|
176
|
+
},
|
|
177
|
+
behavior: {
|
|
178
|
+
max_iterations: 50,
|
|
179
|
+
timeout: "10m",
|
|
180
|
+
retry_limit: 3,
|
|
181
|
+
...config.guardrails?.behavior,
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
auth: config.auth || { type: "none" },
|
|
185
|
+
observability: {
|
|
186
|
+
tracing: false,
|
|
187
|
+
log_level: "info",
|
|
188
|
+
cost_tracking: true,
|
|
189
|
+
...config.observability,
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Generate a default agent.guard.yml config
|
|
195
|
+
*/
|
|
196
|
+
function generateDefaultConfig(agentName, provider, model) {
|
|
197
|
+
const config = {
|
|
198
|
+
version: "1.0",
|
|
199
|
+
identity: {
|
|
200
|
+
name: agentName,
|
|
201
|
+
description: `AI agent created with AgentVoy`,
|
|
202
|
+
version: "0.1.0",
|
|
203
|
+
},
|
|
204
|
+
model: {
|
|
205
|
+
provider: provider,
|
|
206
|
+
model,
|
|
207
|
+
api_key_env: getDefaultApiKeyEnv(provider),
|
|
208
|
+
},
|
|
209
|
+
permissions: {
|
|
210
|
+
network: {
|
|
211
|
+
mode: "restricted",
|
|
212
|
+
allow: ["*"],
|
|
213
|
+
},
|
|
214
|
+
filesystem: {
|
|
215
|
+
read: ["./**"],
|
|
216
|
+
write: ["./output/**"],
|
|
217
|
+
},
|
|
218
|
+
tools: {
|
|
219
|
+
require_approval: ["delete_*", "send_*", "deploy_*"],
|
|
220
|
+
max_cost_per_run: "$1.00",
|
|
221
|
+
},
|
|
222
|
+
execution: {
|
|
223
|
+
allow_shell: false,
|
|
224
|
+
allow_subprocess: false,
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
guardrails: {
|
|
228
|
+
input: {
|
|
229
|
+
block_prompt_injection: true,
|
|
230
|
+
max_tokens: 4096,
|
|
231
|
+
pii_detection: "warn",
|
|
232
|
+
content_filter: "moderate",
|
|
233
|
+
},
|
|
234
|
+
output: {
|
|
235
|
+
block_harmful_content: true,
|
|
236
|
+
max_output_tokens: 8192,
|
|
237
|
+
pii_redaction: false,
|
|
238
|
+
hallucination_check: false,
|
|
239
|
+
},
|
|
240
|
+
behavior: {
|
|
241
|
+
max_iterations: 20,
|
|
242
|
+
timeout: "5m",
|
|
243
|
+
max_tool_calls: 50,
|
|
244
|
+
human_approval_after: 10,
|
|
245
|
+
retry_limit: 3,
|
|
246
|
+
cost_limit: "$1.00",
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
auth: {
|
|
250
|
+
type: "api_key",
|
|
251
|
+
token_storage: "env",
|
|
252
|
+
},
|
|
253
|
+
observability: {
|
|
254
|
+
tracing: true,
|
|
255
|
+
log_level: "info",
|
|
256
|
+
cost_tracking: true,
|
|
257
|
+
},
|
|
258
|
+
};
|
|
259
|
+
return (0, yaml_1.stringify)(config, { lineWidth: 0 });
|
|
260
|
+
}
|
|
261
|
+
function getDefaultApiKeyEnv(provider) {
|
|
262
|
+
const envMap = {
|
|
263
|
+
openai: "OPENAI_API_KEY",
|
|
264
|
+
anthropic: "ANTHROPIC_API_KEY",
|
|
265
|
+
google: "GOOGLE_API_KEY",
|
|
266
|
+
groq: "GROQ_API_KEY",
|
|
267
|
+
mistral: "MISTRAL_API_KEY",
|
|
268
|
+
};
|
|
269
|
+
return envMap[provider] || `${provider.toUpperCase()}_API_KEY`;
|
|
270
|
+
}
|
|
271
|
+
function isValidDuration(duration) {
|
|
272
|
+
return /^\d+[smhd]$/.test(duration);
|
|
273
|
+
}
|
|
274
|
+
function isValidCost(cost) {
|
|
275
|
+
return /^\$\d+(\.\d{1,2})?$/.test(cost);
|
|
276
|
+
}
|
|
277
|
+
class ConfigError extends Error {
|
|
278
|
+
constructor(message) {
|
|
279
|
+
super(message);
|
|
280
|
+
this.name = "ConfigError";
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
exports.ConfigError = ConfigError;
|
|
284
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAsBH,gCA0BC;AAKD,wCAiBC;AAKD,wCAsFC;AAoDD,sDAqEC;AAxRD,qCAAmD;AACnD,yCAA6C;AAC7C,+BAAsE;AAQtE,MAAM,gBAAgB,GAAG;IACvB,iBAAiB;IACjB,kBAAkB;IAClB,gBAAgB;IAChB,iBAAiB;CAClB,CAAC;AAEF;;GAEG;AACH,SAAgB,UAAU,CAAC,UAAkB;IAC3C,MAAM,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;IAC9C,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,WAAW,CACnB,+BAA+B,UAAU,sCAAsC,CAChF,CAAC;IACJ,CAAC;IAED,MAAM,GAAG,GAAG,IAAA,sBAAY,EAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG,IAAA,YAAS,EAAC,GAAG,CAAC,CAAC;IAE9B,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC1C,MAAM,IAAI,WAAW,CAAC,wBAAwB,UAAU,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED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ACF;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,SAAS;YACf,aAAa,EAAE,KAAK;SACrB;QACD,aAAa,EAAE;YACb,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,MAAM;YACjB,aAAa,EAAE,IAAI;SACpB;KACF,CAAC;IAEF,OAAO,IAAA,gBAAa,EAAC,MAAM,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,mBAAmB,CAAC,QAAgB;IAC3C,MAAM,MAAM,GAA2B;QACrC,MAAM,EAAE,gBAAgB;QACxB,SAAS,EAAE,mBAAmB;QAC9B,MAAM,EAAE,gBAAgB;QACxB,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,iBAAiB;KAC3B,CAAC;IACF,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC;AACjE,CAAC;AAED,SAAS,eAAe,CAAC,QAAgB;IACvC,OAAO,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACtC,CAAC;AAED,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED,MAAa,WAAY,SAAQ,KAAK;IACpC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;IAC5B,CAAC;CACF;AALD,kCAKC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @agentvoy/core
|
|
3
|
+
*
|
|
4
|
+
* The universal agent development platform.
|
|
5
|
+
* Scaffold, configure, and guard AI agents across any framework.
|
|
6
|
+
*
|
|
7
|
+
* https://github.com/agentvoy
|
|
8
|
+
*/
|
|
9
|
+
export type { Framework, ModelProvider, AgentGuardConfig, AgentIdentity, ModelConfig, PermissionsConfig, NetworkPermissions, FilesystemPermissions, ToolPermissions, ExecutionPermissions, GuardrailsConfig, InputGuardrails, OutputGuardrails, BehaviorGuardrails, AuthConfig, ObservabilityConfig, FrameworkAdapter, ScaffoldConfig, ScaffoldResult, GeneratedFile, ValidationResult, ValidationError, ValidationWarning, ProjectConfig, } from "./types.js";
|
|
10
|
+
export { loadConfig, findConfigFile, validateConfig, generateDefaultConfig, ConfigError, } from "./config.js";
|
|
11
|
+
export { registerAdapter, getAdapter, listAdapters, listFrameworks, hasAdapter, } from "./adapters/index.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,YAAY,EACV,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,aAAa,GACd,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,WAAW,GACZ,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,eAAe,EACf,UAAU,EACV,YAAY,EACZ,cAAc,EACd,UAAU,GACX,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @agentvoy/core
|
|
4
|
+
*
|
|
5
|
+
* The universal agent development platform.
|
|
6
|
+
* Scaffold, configure, and guard AI agents across any framework.
|
|
7
|
+
*
|
|
8
|
+
* https://github.com/agentvoy
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.hasAdapter = exports.listFrameworks = exports.listAdapters = exports.getAdapter = exports.registerAdapter = exports.ConfigError = exports.generateDefaultConfig = exports.validateConfig = exports.findConfigFile = exports.loadConfig = void 0;
|
|
12
|
+
// Config
|
|
13
|
+
var config_js_1 = require("./config.js");
|
|
14
|
+
Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function () { return config_js_1.loadConfig; } });
|
|
15
|
+
Object.defineProperty(exports, "findConfigFile", { enumerable: true, get: function () { return config_js_1.findConfigFile; } });
|
|
16
|
+
Object.defineProperty(exports, "validateConfig", { enumerable: true, get: function () { return config_js_1.validateConfig; } });
|
|
17
|
+
Object.defineProperty(exports, "generateDefaultConfig", { enumerable: true, get: function () { return config_js_1.generateDefaultConfig; } });
|
|
18
|
+
Object.defineProperty(exports, "ConfigError", { enumerable: true, get: function () { return config_js_1.ConfigError; } });
|
|
19
|
+
// Adapters
|
|
20
|
+
var index_js_1 = require("./adapters/index.js");
|
|
21
|
+
Object.defineProperty(exports, "registerAdapter", { enumerable: true, get: function () { return index_js_1.registerAdapter; } });
|
|
22
|
+
Object.defineProperty(exports, "getAdapter", { enumerable: true, get: function () { return index_js_1.getAdapter; } });
|
|
23
|
+
Object.defineProperty(exports, "listAdapters", { enumerable: true, get: function () { return index_js_1.listAdapters; } });
|
|
24
|
+
Object.defineProperty(exports, "listFrameworks", { enumerable: true, get: function () { return index_js_1.listFrameworks; } });
|
|
25
|
+
Object.defineProperty(exports, "hasAdapter", { enumerable: true, get: function () { return index_js_1.hasAdapter; } });
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AA8BH,SAAS;AACT,yCAMqB;AALnB,uGAAA,UAAU,OAAA;AACV,2GAAA,cAAc,OAAA;AACd,2GAAA,cAAc,OAAA;AACd,kHAAA,qBAAqB,OAAA;AACrB,wGAAA,WAAW,OAAA;AAGb,WAAW;AACX,gDAM6B;AAL3B,2GAAA,eAAe,OAAA;AACf,sGAAA,UAAU,OAAA;AACV,wGAAA,YAAY,OAAA;AACZ,0GAAA,cAAc,OAAA;AACd,sGAAA,UAAU,OAAA"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentVoy Core Types
|
|
3
|
+
*
|
|
4
|
+
* These types define the universal agent configuration, guardrails,
|
|
5
|
+
* and framework adapter interfaces that power AgentVoy.
|
|
6
|
+
*/
|
|
7
|
+
export type Framework = "google-adk" | "openai" | "anthropic" | "crewai" | "langgraph" | "llamaindex" | "autogen" | "custom";
|
|
8
|
+
export type ModelProvider = "openai" | "anthropic" | "google" | "ollama" | "groq" | "mistral" | "azure" | "bedrock" | "custom";
|
|
9
|
+
export interface AgentGuardConfig {
|
|
10
|
+
version: string;
|
|
11
|
+
identity: AgentIdentity;
|
|
12
|
+
model: ModelConfig;
|
|
13
|
+
permissions: PermissionsConfig;
|
|
14
|
+
guardrails: GuardrailsConfig;
|
|
15
|
+
auth?: AuthConfig;
|
|
16
|
+
observability?: ObservabilityConfig;
|
|
17
|
+
}
|
|
18
|
+
export interface AgentIdentity {
|
|
19
|
+
name: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
owner?: string;
|
|
22
|
+
version?: string;
|
|
23
|
+
tags?: string[];
|
|
24
|
+
}
|
|
25
|
+
export interface ModelConfig {
|
|
26
|
+
provider: ModelProvider;
|
|
27
|
+
model: string;
|
|
28
|
+
api_key_env?: string;
|
|
29
|
+
temperature?: number;
|
|
30
|
+
max_tokens?: number;
|
|
31
|
+
base_url?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface PermissionsConfig {
|
|
34
|
+
network?: NetworkPermissions;
|
|
35
|
+
filesystem?: FilesystemPermissions;
|
|
36
|
+
tools?: ToolPermissions;
|
|
37
|
+
execution?: ExecutionPermissions;
|
|
38
|
+
}
|
|
39
|
+
export interface NetworkPermissions {
|
|
40
|
+
allow?: string[];
|
|
41
|
+
deny?: string[];
|
|
42
|
+
mode?: "unrestricted" | "restricted" | "blocked";
|
|
43
|
+
}
|
|
44
|
+
export interface FilesystemPermissions {
|
|
45
|
+
read?: string[];
|
|
46
|
+
write?: string[];
|
|
47
|
+
deny?: string[];
|
|
48
|
+
}
|
|
49
|
+
export interface ToolPermissions {
|
|
50
|
+
allowed?: string[];
|
|
51
|
+
denied?: string[];
|
|
52
|
+
require_approval?: string[];
|
|
53
|
+
max_cost_per_run?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface ExecutionPermissions {
|
|
56
|
+
allow_shell?: boolean;
|
|
57
|
+
allow_subprocess?: boolean;
|
|
58
|
+
allowed_commands?: string[];
|
|
59
|
+
denied_commands?: string[];
|
|
60
|
+
}
|
|
61
|
+
export interface GuardrailsConfig {
|
|
62
|
+
input?: InputGuardrails;
|
|
63
|
+
output?: OutputGuardrails;
|
|
64
|
+
behavior?: BehaviorGuardrails;
|
|
65
|
+
}
|
|
66
|
+
export interface InputGuardrails {
|
|
67
|
+
block_prompt_injection?: boolean;
|
|
68
|
+
max_tokens?: number;
|
|
69
|
+
pii_detection?: "block" | "warn" | "off";
|
|
70
|
+
content_filter?: "strict" | "moderate" | "off";
|
|
71
|
+
custom_validators?: string[];
|
|
72
|
+
}
|
|
73
|
+
export interface OutputGuardrails {
|
|
74
|
+
block_harmful_content?: boolean;
|
|
75
|
+
validate_schema?: string;
|
|
76
|
+
max_output_tokens?: number;
|
|
77
|
+
pii_redaction?: boolean;
|
|
78
|
+
hallucination_check?: boolean;
|
|
79
|
+
custom_validators?: string[];
|
|
80
|
+
}
|
|
81
|
+
export interface BehaviorGuardrails {
|
|
82
|
+
max_iterations?: number;
|
|
83
|
+
timeout?: string;
|
|
84
|
+
max_tool_calls?: number;
|
|
85
|
+
human_approval_after?: number;
|
|
86
|
+
retry_limit?: number;
|
|
87
|
+
cost_limit?: string;
|
|
88
|
+
}
|
|
89
|
+
export interface AuthConfig {
|
|
90
|
+
type?: "none" | "api_key" | "oauth2" | "jwt";
|
|
91
|
+
scopes?: string[];
|
|
92
|
+
token_storage?: "env" | "keychain" | "file";
|
|
93
|
+
session_timeout?: string;
|
|
94
|
+
}
|
|
95
|
+
export interface ObservabilityConfig {
|
|
96
|
+
tracing?: boolean;
|
|
97
|
+
log_level?: "debug" | "info" | "warn" | "error";
|
|
98
|
+
export_to?: string;
|
|
99
|
+
cost_tracking?: boolean;
|
|
100
|
+
}
|
|
101
|
+
export interface FrameworkAdapter {
|
|
102
|
+
readonly name: Framework;
|
|
103
|
+
readonly displayName: string;
|
|
104
|
+
readonly language: "typescript" | "python";
|
|
105
|
+
/** Generate project files for this framework */
|
|
106
|
+
scaffold(config: ScaffoldConfig): Promise<ScaffoldResult>;
|
|
107
|
+
/** Validate that the guardrails config is compatible with this framework */
|
|
108
|
+
validateConfig(config: AgentGuardConfig): ValidationResult;
|
|
109
|
+
/** Get the list of dependencies required for this framework */
|
|
110
|
+
getDependencies(): Record<string, string>;
|
|
111
|
+
}
|
|
112
|
+
export interface ScaffoldConfig {
|
|
113
|
+
projectName: string;
|
|
114
|
+
projectDir: string;
|
|
115
|
+
framework: Framework;
|
|
116
|
+
model: ModelConfig;
|
|
117
|
+
guardrails?: GuardrailsConfig;
|
|
118
|
+
auth?: AuthConfig;
|
|
119
|
+
features?: string[];
|
|
120
|
+
}
|
|
121
|
+
export interface ScaffoldResult {
|
|
122
|
+
files: GeneratedFile[];
|
|
123
|
+
dependencies: Record<string, string>;
|
|
124
|
+
devDependencies: Record<string, string>;
|
|
125
|
+
scripts: Record<string, string>;
|
|
126
|
+
postInstallInstructions?: string[];
|
|
127
|
+
}
|
|
128
|
+
export interface GeneratedFile {
|
|
129
|
+
path: string;
|
|
130
|
+
content: string;
|
|
131
|
+
executable?: boolean;
|
|
132
|
+
}
|
|
133
|
+
export interface ValidationResult {
|
|
134
|
+
valid: boolean;
|
|
135
|
+
errors: ValidationError[];
|
|
136
|
+
warnings: ValidationWarning[];
|
|
137
|
+
}
|
|
138
|
+
export interface ValidationError {
|
|
139
|
+
field: string;
|
|
140
|
+
message: string;
|
|
141
|
+
}
|
|
142
|
+
export interface ValidationWarning {
|
|
143
|
+
field: string;
|
|
144
|
+
message: string;
|
|
145
|
+
}
|
|
146
|
+
export interface ProjectConfig {
|
|
147
|
+
name: string;
|
|
148
|
+
framework: Framework;
|
|
149
|
+
model: ModelConfig;
|
|
150
|
+
guard: AgentGuardConfig;
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,MAAM,SAAS,GACjB,YAAY,GACZ,QAAQ,GACR,WAAW,GACX,QAAQ,GACR,WAAW,GACX,YAAY,GACZ,SAAS,GACT,QAAQ,CAAC;AAEb,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,WAAW,GACX,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,SAAS,GACT,OAAO,GACP,SAAS,GACT,QAAQ,CAAC;AAIb,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,aAAa,CAAC;IACxB,KAAK,EAAE,WAAW,CAAC;IACnB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,aAAa,CAAC,EAAE,mBAAmB,CAAC;CACrC;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACj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B;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAID,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,WAAW,CAAC;IACnB,KAAK,EAAE,gBAAgB,CAAC;CACzB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* AgentVoy Core Types
|
|
4
|
+
*
|
|
5
|
+
* These types define the universal agent configuration, guardrails,
|
|
6
|
+
* and framework adapter interfaces that power AgentVoy.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agentvoy/core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Core engine for AgentVoy — guardrails config parser, framework adapters, and agent runtime utilities",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"dev": "tsc --watch",
|
|
10
|
+
"clean": "rm -rf dist",
|
|
11
|
+
"lint": "tsc --noEmit"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"yaml": "^2.7.0",
|
|
15
|
+
"ajv": "^8.17.0",
|
|
16
|
+
"chalk": "^5.4.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"typescript": "^5.7.0",
|
|
20
|
+
"@types/node": "^20.0.0"
|
|
21
|
+
},
|
|
22
|
+
"license": "Apache-2.0"
|
|
23
|
+
}
|