@agentvoy/core 0.2.0 → 0.4.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 +65 -0
- package/dist/adapters/anthropic.d.ts.map +1 -1
- package/dist/adapters/anthropic.js +75 -75
- package/dist/adapters/anthropic.js.map +1 -1
- package/dist/adapters/app-scaffold.d.ts +12 -0
- package/dist/adapters/app-scaffold.d.ts.map +1 -0
- package/dist/adapters/app-scaffold.js +49 -0
- package/dist/adapters/app-scaffold.js.map +1 -0
- package/dist/adapters/autogen.d.ts +8 -0
- package/dist/adapters/autogen.d.ts.map +1 -0
- package/dist/adapters/autogen.js +259 -0
- package/dist/adapters/autogen.js.map +1 -0
- package/dist/adapters/crewai.d.ts.map +1 -1
- package/dist/adapters/crewai.js +80 -52
- package/dist/adapters/crewai.js.map +1 -1
- package/dist/adapters/google-adk.d.ts.map +1 -1
- package/dist/adapters/google-adk.js +73 -37
- package/dist/adapters/google-adk.js.map +1 -1
- package/dist/adapters/index.js +4 -0
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/langgraph.d.ts.map +1 -1
- package/dist/adapters/langgraph.js +41 -42
- package/dist/adapters/langgraph.js.map +1 -1
- package/dist/adapters/llamaindex.d.ts +8 -0
- package/dist/adapters/llamaindex.d.ts.map +1 -0
- package/dist/adapters/llamaindex.js +230 -0
- package/dist/adapters/llamaindex.js.map +1 -0
- package/dist/adapters/openai.d.ts.map +1 -1
- package/dist/adapters/openai.js +76 -53
- package/dist/adapters/openai.js.map +1 -1
- package/dist/deployers/api-wrapper.d.ts +11 -0
- package/dist/deployers/api-wrapper.d.ts.map +1 -0
- package/dist/deployers/api-wrapper.js +86 -0
- package/dist/deployers/api-wrapper.js.map +1 -0
- package/dist/deployers/aws-lambda.d.ts +3 -0
- package/dist/deployers/aws-lambda.d.ts.map +1 -0
- package/dist/deployers/aws-lambda.js +101 -0
- package/dist/deployers/aws-lambda.js.map +1 -0
- package/dist/deployers/docker.d.ts +3 -0
- package/dist/deployers/docker.d.ts.map +1 -0
- package/dist/deployers/docker.js +123 -0
- package/dist/deployers/docker.js.map +1 -0
- package/dist/deployers/fly-io.d.ts +3 -0
- package/dist/deployers/fly-io.d.ts.map +1 -0
- package/dist/deployers/fly-io.js +84 -0
- package/dist/deployers/fly-io.js.map +1 -0
- package/dist/deployers/gcp-cloud-run.d.ts +3 -0
- package/dist/deployers/gcp-cloud-run.d.ts.map +1 -0
- package/dist/deployers/gcp-cloud-run.js +75 -0
- package/dist/deployers/gcp-cloud-run.js.map +1 -0
- package/dist/deployers/guard-mapper.d.ts +6 -0
- package/dist/deployers/guard-mapper.d.ts.map +1 -0
- package/dist/deployers/guard-mapper.js +63 -0
- package/dist/deployers/guard-mapper.js.map +1 -0
- package/dist/deployers/index.d.ts +6 -0
- package/dist/deployers/index.d.ts.map +1 -0
- package/dist/deployers/index.js +30 -0
- package/dist/deployers/index.js.map +1 -0
- package/dist/deployers/pipeline.d.ts +9 -0
- package/dist/deployers/pipeline.d.ts.map +1 -0
- package/dist/deployers/pipeline.js +55 -0
- package/dist/deployers/pipeline.js.map +1 -0
- package/dist/deployers/railway.d.ts +3 -0
- package/dist/deployers/railway.d.ts.map +1 -0
- package/dist/deployers/railway.js +53 -0
- package/dist/deployers/railway.js.map +1 -0
- package/dist/deployers/registry.d.ts +7 -0
- package/dist/deployers/registry.d.ts.map +1 -0
- package/dist/deployers/registry.js +29 -0
- package/dist/deployers/registry.js.map +1 -0
- package/dist/deployers/streamlit-app.d.ts +10 -0
- package/dist/deployers/streamlit-app.d.ts.map +1 -0
- package/dist/deployers/streamlit-app.js +80 -0
- package/dist/deployers/streamlit-app.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +41 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +17 -1
- package/src/adapters/anthropic.ts +0 -268
- package/src/adapters/crewai.ts +0 -254
- package/src/adapters/google-adk.ts +0 -167
- package/src/adapters/index.ts +0 -21
- package/src/adapters/langgraph.ts +0 -336
- package/src/adapters/openai.ts +0 -214
- package/src/adapters/registry.ts +0 -37
- package/src/config.ts +0 -315
- package/src/index.ts +0 -54
- package/src/types.ts +0 -203
- package/tsconfig.json +0 -8
package/src/config.ts
DELETED
|
@@ -1,315 +0,0 @@
|
|
|
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
|
-
|
|
9
|
-
import { readFileSync, existsSync } from "node:fs";
|
|
10
|
-
import { resolve, dirname } from "node:path";
|
|
11
|
-
import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
|
|
12
|
-
import type {
|
|
13
|
-
AgentGuardConfig,
|
|
14
|
-
ValidationResult,
|
|
15
|
-
ValidationError,
|
|
16
|
-
ValidationWarning,
|
|
17
|
-
} from "./types.js";
|
|
18
|
-
|
|
19
|
-
const CONFIG_FILENAMES = [
|
|
20
|
-
"agent.guard.yml",
|
|
21
|
-
"agent.guard.yaml",
|
|
22
|
-
"agentguard.yml",
|
|
23
|
-
"agentguard.yaml",
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Load and parse an agent.guard.yml config file
|
|
28
|
-
*/
|
|
29
|
-
export function loadConfig(projectDir: string): AgentGuardConfig {
|
|
30
|
-
const configPath = findConfigFile(projectDir);
|
|
31
|
-
if (!configPath) {
|
|
32
|
-
throw new ConfigError(
|
|
33
|
-
`No agent.guard.yml found in ${projectDir}. Run 'agentvoy init' to create one.`
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const raw = readFileSync(configPath, "utf-8");
|
|
38
|
-
const parsed = parseYaml(raw);
|
|
39
|
-
|
|
40
|
-
if (!parsed || typeof parsed !== "object") {
|
|
41
|
-
throw new ConfigError(`Invalid config file: ${configPath}`);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const validation = validateConfig(parsed as AgentGuardConfig);
|
|
45
|
-
if (!validation.valid) {
|
|
46
|
-
const errorMessages = validation.errors
|
|
47
|
-
.map((e) => ` - ${e.field}: ${e.message}`)
|
|
48
|
-
.join("\n");
|
|
49
|
-
throw new ConfigError(
|
|
50
|
-
`Invalid agent.guard.yml:\n${errorMessages}`
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return applyDefaults(parsed as AgentGuardConfig);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Find the config file by searching up the directory tree
|
|
59
|
-
*/
|
|
60
|
-
export function findConfigFile(startDir: string): string | null {
|
|
61
|
-
let dir = resolve(startDir);
|
|
62
|
-
|
|
63
|
-
while (true) {
|
|
64
|
-
for (const filename of CONFIG_FILENAMES) {
|
|
65
|
-
const filePath = resolve(dir, filename);
|
|
66
|
-
if (existsSync(filePath)) {
|
|
67
|
-
return filePath;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const parentDir = dirname(dir);
|
|
72
|
-
if (parentDir === dir) break;
|
|
73
|
-
dir = parentDir;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return null;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Validate an agent guard config
|
|
81
|
-
*/
|
|
82
|
-
export function validateConfig(config: AgentGuardConfig): ValidationResult {
|
|
83
|
-
const errors: ValidationError[] = [];
|
|
84
|
-
const warnings: ValidationWarning[] = [];
|
|
85
|
-
|
|
86
|
-
// Required fields
|
|
87
|
-
if (!config.version) {
|
|
88
|
-
errors.push({ field: "version", message: "version is required" });
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if (!config.identity) {
|
|
92
|
-
errors.push({ field: "identity", message: "identity is required" });
|
|
93
|
-
} else if (!config.identity.name) {
|
|
94
|
-
errors.push({ field: "identity.name", message: "agent name is required" });
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (!config.model) {
|
|
98
|
-
errors.push({ field: "model", message: "model configuration is required" });
|
|
99
|
-
} else {
|
|
100
|
-
if (!config.model.provider) {
|
|
101
|
-
errors.push({
|
|
102
|
-
field: "model.provider",
|
|
103
|
-
message: "model provider is required",
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
if (!config.model.model) {
|
|
107
|
-
errors.push({ field: "model.model", message: "model name is required" });
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// Validate permissions
|
|
112
|
-
if (config.permissions?.network) {
|
|
113
|
-
const net = config.permissions.network;
|
|
114
|
-
if (net.mode === "restricted" && !net.allow?.length) {
|
|
115
|
-
warnings.push({
|
|
116
|
-
field: "permissions.network",
|
|
117
|
-
message:
|
|
118
|
-
"network mode is 'restricted' but no allow list specified — all network access will be blocked",
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// Validate guardrails
|
|
124
|
-
if (config.guardrails?.behavior) {
|
|
125
|
-
const behavior = config.guardrails.behavior;
|
|
126
|
-
if (behavior.max_iterations !== undefined && behavior.max_iterations < 1) {
|
|
127
|
-
errors.push({
|
|
128
|
-
field: "guardrails.behavior.max_iterations",
|
|
129
|
-
message: "max_iterations must be at least 1",
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
if (behavior.timeout) {
|
|
133
|
-
if (!isValidDuration(behavior.timeout)) {
|
|
134
|
-
errors.push({
|
|
135
|
-
field: "guardrails.behavior.timeout",
|
|
136
|
-
message:
|
|
137
|
-
'timeout must be a valid duration string (e.g., "5m", "1h", "30s")',
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
if (behavior.cost_limit) {
|
|
142
|
-
if (!isValidCost(behavior.cost_limit)) {
|
|
143
|
-
errors.push({
|
|
144
|
-
field: "guardrails.behavior.cost_limit",
|
|
145
|
-
message:
|
|
146
|
-
'cost_limit must be a valid cost string (e.g., "$0.50", "$10")',
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// Validate auth
|
|
153
|
-
if (config.auth) {
|
|
154
|
-
const validTypes = ["none", "api_key", "oauth2", "jwt"];
|
|
155
|
-
if (config.auth.type && !validTypes.includes(config.auth.type)) {
|
|
156
|
-
errors.push({
|
|
157
|
-
field: "auth.type",
|
|
158
|
-
message: `auth type must be one of: ${validTypes.join(", ")}`,
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return {
|
|
164
|
-
valid: errors.length === 0,
|
|
165
|
-
errors,
|
|
166
|
-
warnings,
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Apply default values to a config
|
|
172
|
-
*/
|
|
173
|
-
function applyDefaults(config: AgentGuardConfig): AgentGuardConfig {
|
|
174
|
-
return {
|
|
175
|
-
...config,
|
|
176
|
-
version: config.version || "1.0",
|
|
177
|
-
permissions: {
|
|
178
|
-
network: { mode: "unrestricted", ...config.permissions?.network },
|
|
179
|
-
filesystem: { ...config.permissions?.filesystem },
|
|
180
|
-
tools: { ...config.permissions?.tools },
|
|
181
|
-
execution: {
|
|
182
|
-
allow_shell: false,
|
|
183
|
-
allow_subprocess: false,
|
|
184
|
-
...config.permissions?.execution,
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
guardrails: {
|
|
188
|
-
input: {
|
|
189
|
-
block_prompt_injection: true,
|
|
190
|
-
pii_detection: "warn",
|
|
191
|
-
content_filter: "moderate",
|
|
192
|
-
...config.guardrails?.input,
|
|
193
|
-
},
|
|
194
|
-
output: {
|
|
195
|
-
block_harmful_content: true,
|
|
196
|
-
pii_redaction: false,
|
|
197
|
-
hallucination_check: false,
|
|
198
|
-
...config.guardrails?.output,
|
|
199
|
-
},
|
|
200
|
-
behavior: {
|
|
201
|
-
max_iterations: 50,
|
|
202
|
-
timeout: "10m",
|
|
203
|
-
retry_limit: 3,
|
|
204
|
-
...config.guardrails?.behavior,
|
|
205
|
-
},
|
|
206
|
-
},
|
|
207
|
-
auth: config.auth || { type: "none" },
|
|
208
|
-
observability: {
|
|
209
|
-
tracing: false,
|
|
210
|
-
log_level: "info",
|
|
211
|
-
cost_tracking: true,
|
|
212
|
-
...config.observability,
|
|
213
|
-
},
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Generate a default agent.guard.yml config
|
|
219
|
-
*/
|
|
220
|
-
export function generateDefaultConfig(
|
|
221
|
-
agentName: string,
|
|
222
|
-
provider: string,
|
|
223
|
-
model: string
|
|
224
|
-
): string {
|
|
225
|
-
const config: AgentGuardConfig = {
|
|
226
|
-
version: "1.0",
|
|
227
|
-
identity: {
|
|
228
|
-
name: agentName,
|
|
229
|
-
description: `AI agent created with AgentVoy`,
|
|
230
|
-
version: "0.1.0",
|
|
231
|
-
},
|
|
232
|
-
model: {
|
|
233
|
-
provider: provider as AgentGuardConfig["model"]["provider"],
|
|
234
|
-
model,
|
|
235
|
-
api_key_env: getDefaultApiKeyEnv(provider),
|
|
236
|
-
},
|
|
237
|
-
permissions: {
|
|
238
|
-
network: {
|
|
239
|
-
mode: "restricted",
|
|
240
|
-
allow: ["*"],
|
|
241
|
-
},
|
|
242
|
-
filesystem: {
|
|
243
|
-
read: ["./**"],
|
|
244
|
-
write: ["./output/**"],
|
|
245
|
-
},
|
|
246
|
-
tools: {
|
|
247
|
-
require_approval: ["delete_*", "send_*", "deploy_*"],
|
|
248
|
-
max_cost_per_run: "$1.00",
|
|
249
|
-
},
|
|
250
|
-
execution: {
|
|
251
|
-
allow_shell: false,
|
|
252
|
-
allow_subprocess: false,
|
|
253
|
-
},
|
|
254
|
-
},
|
|
255
|
-
guardrails: {
|
|
256
|
-
input: {
|
|
257
|
-
block_prompt_injection: true,
|
|
258
|
-
max_tokens: 4096,
|
|
259
|
-
pii_detection: "warn",
|
|
260
|
-
content_filter: "moderate",
|
|
261
|
-
},
|
|
262
|
-
output: {
|
|
263
|
-
block_harmful_content: true,
|
|
264
|
-
max_output_tokens: 8192,
|
|
265
|
-
pii_redaction: false,
|
|
266
|
-
hallucination_check: false,
|
|
267
|
-
},
|
|
268
|
-
behavior: {
|
|
269
|
-
max_iterations: 20,
|
|
270
|
-
timeout: "5m",
|
|
271
|
-
max_tool_calls: 50,
|
|
272
|
-
human_approval_after: 10,
|
|
273
|
-
retry_limit: 3,
|
|
274
|
-
cost_limit: "$1.00",
|
|
275
|
-
},
|
|
276
|
-
},
|
|
277
|
-
auth: {
|
|
278
|
-
type: "api_key",
|
|
279
|
-
token_storage: "env",
|
|
280
|
-
},
|
|
281
|
-
observability: {
|
|
282
|
-
tracing: true,
|
|
283
|
-
log_level: "info",
|
|
284
|
-
cost_tracking: true,
|
|
285
|
-
},
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
return stringifyYaml(config, { lineWidth: 0 });
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
function getDefaultApiKeyEnv(provider: string): string {
|
|
292
|
-
const envMap: Record<string, string> = {
|
|
293
|
-
openai: "OPENAI_API_KEY",
|
|
294
|
-
anthropic: "ANTHROPIC_API_KEY",
|
|
295
|
-
google: "GOOGLE_API_KEY",
|
|
296
|
-
groq: "GROQ_API_KEY",
|
|
297
|
-
mistral: "MISTRAL_API_KEY",
|
|
298
|
-
};
|
|
299
|
-
return envMap[provider] || `${provider.toUpperCase()}_API_KEY`;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
function isValidDuration(duration: string): boolean {
|
|
303
|
-
return /^\d+[smhd]$/.test(duration);
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
function isValidCost(cost: string): boolean {
|
|
307
|
-
return /^\$\d+(\.\d{1,2})?$/.test(cost);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
export class ConfigError extends Error {
|
|
311
|
-
constructor(message: string) {
|
|
312
|
-
super(message);
|
|
313
|
-
this.name = "ConfigError";
|
|
314
|
-
}
|
|
315
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
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
|
-
|
|
10
|
-
// Types
|
|
11
|
-
export type {
|
|
12
|
-
Framework,
|
|
13
|
-
ModelProvider,
|
|
14
|
-
AgentGuardConfig,
|
|
15
|
-
AgentIdentity,
|
|
16
|
-
ModelConfig,
|
|
17
|
-
PermissionsConfig,
|
|
18
|
-
NetworkPermissions,
|
|
19
|
-
FilesystemPermissions,
|
|
20
|
-
ToolPermissions,
|
|
21
|
-
ExecutionPermissions,
|
|
22
|
-
GuardrailsConfig,
|
|
23
|
-
InputGuardrails,
|
|
24
|
-
OutputGuardrails,
|
|
25
|
-
BehaviorGuardrails,
|
|
26
|
-
AuthConfig,
|
|
27
|
-
ObservabilityConfig,
|
|
28
|
-
FrameworkAdapter,
|
|
29
|
-
ScaffoldConfig,
|
|
30
|
-
ScaffoldResult,
|
|
31
|
-
GeneratedFile,
|
|
32
|
-
ValidationResult,
|
|
33
|
-
ValidationError,
|
|
34
|
-
ValidationWarning,
|
|
35
|
-
ProjectConfig,
|
|
36
|
-
} from "./types.js";
|
|
37
|
-
|
|
38
|
-
// Config
|
|
39
|
-
export {
|
|
40
|
-
loadConfig,
|
|
41
|
-
findConfigFile,
|
|
42
|
-
validateConfig,
|
|
43
|
-
generateDefaultConfig,
|
|
44
|
-
ConfigError,
|
|
45
|
-
} from "./config.js";
|
|
46
|
-
|
|
47
|
-
// Adapters
|
|
48
|
-
export {
|
|
49
|
-
registerAdapter,
|
|
50
|
-
getAdapter,
|
|
51
|
-
listAdapters,
|
|
52
|
-
listFrameworks,
|
|
53
|
-
hasAdapter,
|
|
54
|
-
} from "./adapters/index.js";
|
package/src/types.ts
DELETED
|
@@ -1,203 +0,0 @@
|
|
|
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
|
-
|
|
8
|
-
// ─── Supported Frameworks ────────────────────────────────────────
|
|
9
|
-
|
|
10
|
-
export type Framework =
|
|
11
|
-
| "google-adk"
|
|
12
|
-
| "openai"
|
|
13
|
-
| "anthropic"
|
|
14
|
-
| "crewai"
|
|
15
|
-
| "langgraph"
|
|
16
|
-
| "llamaindex"
|
|
17
|
-
| "autogen"
|
|
18
|
-
| "custom";
|
|
19
|
-
|
|
20
|
-
export type ModelProvider =
|
|
21
|
-
| "openai"
|
|
22
|
-
| "anthropic"
|
|
23
|
-
| "google"
|
|
24
|
-
| "ollama"
|
|
25
|
-
| "groq"
|
|
26
|
-
| "mistral"
|
|
27
|
-
| "azure"
|
|
28
|
-
| "bedrock"
|
|
29
|
-
| "custom";
|
|
30
|
-
|
|
31
|
-
// ─── Agent Guard Config (agent.guard.yml) ────────────────────────
|
|
32
|
-
|
|
33
|
-
export interface AgentGuardConfig {
|
|
34
|
-
version: string;
|
|
35
|
-
identity: AgentIdentity;
|
|
36
|
-
model: ModelConfig;
|
|
37
|
-
permissions: PermissionsConfig;
|
|
38
|
-
guardrails: GuardrailsConfig;
|
|
39
|
-
auth?: AuthConfig;
|
|
40
|
-
observability?: ObservabilityConfig;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface AgentIdentity {
|
|
44
|
-
name: string;
|
|
45
|
-
description?: string;
|
|
46
|
-
owner?: string;
|
|
47
|
-
version?: string;
|
|
48
|
-
tags?: string[];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface ModelConfig {
|
|
52
|
-
provider: ModelProvider;
|
|
53
|
-
model: string;
|
|
54
|
-
api_key_env?: string;
|
|
55
|
-
temperature?: number;
|
|
56
|
-
max_tokens?: number;
|
|
57
|
-
base_url?: string;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface PermissionsConfig {
|
|
61
|
-
network?: NetworkPermissions;
|
|
62
|
-
filesystem?: FilesystemPermissions;
|
|
63
|
-
tools?: ToolPermissions;
|
|
64
|
-
execution?: ExecutionPermissions;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface NetworkPermissions {
|
|
68
|
-
allow?: string[];
|
|
69
|
-
deny?: string[];
|
|
70
|
-
mode?: "unrestricted" | "restricted" | "blocked";
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export interface FilesystemPermissions {
|
|
74
|
-
read?: string[];
|
|
75
|
-
write?: string[];
|
|
76
|
-
deny?: string[];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface ToolPermissions {
|
|
80
|
-
allowed?: string[];
|
|
81
|
-
denied?: string[];
|
|
82
|
-
require_approval?: string[];
|
|
83
|
-
max_cost_per_run?: string;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export interface ExecutionPermissions {
|
|
87
|
-
allow_shell?: boolean;
|
|
88
|
-
allow_subprocess?: boolean;
|
|
89
|
-
allowed_commands?: string[];
|
|
90
|
-
denied_commands?: string[];
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export interface GuardrailsConfig {
|
|
94
|
-
input?: InputGuardrails;
|
|
95
|
-
output?: OutputGuardrails;
|
|
96
|
-
behavior?: BehaviorGuardrails;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export interface InputGuardrails {
|
|
100
|
-
block_prompt_injection?: boolean;
|
|
101
|
-
max_tokens?: number;
|
|
102
|
-
pii_detection?: "block" | "warn" | "off";
|
|
103
|
-
content_filter?: "strict" | "moderate" | "off";
|
|
104
|
-
custom_validators?: string[];
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export interface OutputGuardrails {
|
|
108
|
-
block_harmful_content?: boolean;
|
|
109
|
-
validate_schema?: string;
|
|
110
|
-
max_output_tokens?: number;
|
|
111
|
-
pii_redaction?: boolean;
|
|
112
|
-
hallucination_check?: boolean;
|
|
113
|
-
custom_validators?: string[];
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export interface BehaviorGuardrails {
|
|
117
|
-
max_iterations?: number;
|
|
118
|
-
timeout?: string;
|
|
119
|
-
max_tool_calls?: number;
|
|
120
|
-
human_approval_after?: number;
|
|
121
|
-
retry_limit?: number;
|
|
122
|
-
cost_limit?: string;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export interface AuthConfig {
|
|
126
|
-
type?: "none" | "api_key" | "oauth2" | "jwt";
|
|
127
|
-
scopes?: string[];
|
|
128
|
-
token_storage?: "env" | "keychain" | "file";
|
|
129
|
-
session_timeout?: string;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export interface ObservabilityConfig {
|
|
133
|
-
tracing?: boolean;
|
|
134
|
-
log_level?: "debug" | "info" | "warn" | "error";
|
|
135
|
-
export_to?: string;
|
|
136
|
-
cost_tracking?: boolean;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// ─── Framework Adapter Interface ──────────────────────────────────
|
|
140
|
-
|
|
141
|
-
export interface FrameworkAdapter {
|
|
142
|
-
readonly name: Framework;
|
|
143
|
-
readonly displayName: string;
|
|
144
|
-
readonly language: "typescript" | "python";
|
|
145
|
-
|
|
146
|
-
/** Generate project files for this framework */
|
|
147
|
-
scaffold(config: ScaffoldConfig): Promise<ScaffoldResult>;
|
|
148
|
-
|
|
149
|
-
/** Validate that the guardrails config is compatible with this framework */
|
|
150
|
-
validateConfig(config: AgentGuardConfig): ValidationResult;
|
|
151
|
-
|
|
152
|
-
/** Get the list of dependencies required for this framework */
|
|
153
|
-
getDependencies(): Record<string, string>;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export interface ScaffoldConfig {
|
|
157
|
-
projectName: string;
|
|
158
|
-
projectDir: string;
|
|
159
|
-
framework: Framework;
|
|
160
|
-
model: ModelConfig;
|
|
161
|
-
guardrails?: GuardrailsConfig;
|
|
162
|
-
auth?: AuthConfig;
|
|
163
|
-
features?: string[];
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
export interface ScaffoldResult {
|
|
167
|
-
files: GeneratedFile[];
|
|
168
|
-
dependencies: Record<string, string>;
|
|
169
|
-
devDependencies: Record<string, string>;
|
|
170
|
-
scripts: Record<string, string>;
|
|
171
|
-
postInstallInstructions?: string[];
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export interface GeneratedFile {
|
|
175
|
-
path: string;
|
|
176
|
-
content: string;
|
|
177
|
-
executable?: boolean;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export interface ValidationResult {
|
|
181
|
-
valid: boolean;
|
|
182
|
-
errors: ValidationError[];
|
|
183
|
-
warnings: ValidationWarning[];
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export interface ValidationError {
|
|
187
|
-
field: string;
|
|
188
|
-
message: string;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export interface ValidationWarning {
|
|
192
|
-
field: string;
|
|
193
|
-
message: string;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
// ─── Project Config ───────────────────────────────────────────────
|
|
197
|
-
|
|
198
|
-
export interface ProjectConfig {
|
|
199
|
-
name: string;
|
|
200
|
-
framework: Framework;
|
|
201
|
-
model: ModelConfig;
|
|
202
|
-
guard: AgentGuardConfig;
|
|
203
|
-
}
|