@vraxis/agent-v 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +8 -2
- package/ARCHITECTURE.md +27 -0
- package/CHANGELOG.md +14 -0
- package/README.md +91 -16
- package/compatibility.json +32 -1
- package/dist/adapters/ai-sdk/index.d.ts.map +1 -1
- package/dist/adapters/ai-sdk/index.js +2 -1
- package/dist/adapters/ai-sdk/index.js.map +1 -1
- package/dist/adapters/local-cli/parsing.d.ts.map +1 -1
- package/dist/adapters/local-cli/parsing.js +28 -3
- package/dist/adapters/local-cli/parsing.js.map +1 -1
- package/dist/adapters/providers/index.d.ts +100 -0
- package/dist/adapters/providers/index.d.ts.map +1 -0
- package/dist/adapters/providers/index.js +195 -0
- package/dist/adapters/providers/index.js.map +1 -0
- package/dist/core/agent-v.d.ts.map +1 -1
- package/dist/core/agent-v.js +6 -0
- package/dist/core/agent-v.js.map +1 -1
- package/dist/core/contracts.d.ts +11 -0
- package/dist/core/contracts.d.ts.map +1 -1
- package/dist/core/extensions.d.ts +4 -0
- package/dist/core/extensions.d.ts.map +1 -1
- package/dist/core/extensions.js +2 -0
- package/dist/core/extensions.js.map +1 -1
- package/dist/core/memory.d.ts +9 -1
- package/dist/core/memory.d.ts.map +1 -1
- package/dist/core/memory.js +17 -0
- package/dist/core/memory.js.map +1 -1
- package/dist/core/version.d.ts +1 -1
- package/dist/core/version.js +1 -1
- package/dist/node/credentials.d.ts +30 -0
- package/dist/node/credentials.d.ts.map +1 -0
- package/dist/node/credentials.js +104 -0
- package/dist/node/credentials.js.map +1 -0
- package/dist/node/doctor.js +6 -6
- package/dist/node/doctor.js.map +1 -1
- package/dist/node/index.d.ts +2 -0
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +2 -0
- package/dist/node/index.js.map +1 -1
- package/dist/node/skills.d.ts.map +1 -1
- package/dist/node/skills.js +10 -0
- package/dist/node/skills.js.map +1 -1
- package/dist/runtime/index.d.ts +55 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +94 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/skills/index.d.ts +37 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +128 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/tools/approval.d.ts +26 -0
- package/dist/tools/approval.d.ts.map +1 -0
- package/dist/tools/approval.js +23 -0
- package/dist/tools/approval.js.map +1 -0
- package/dist/tools/browser.d.ts +25 -0
- package/dist/tools/browser.d.ts.map +1 -0
- package/dist/tools/browser.js +118 -0
- package/dist/tools/browser.js.map +1 -0
- package/dist/tools/http.d.ts +9 -0
- package/dist/tools/http.d.ts.map +1 -0
- package/dist/tools/http.js +123 -0
- package/dist/tools/http.js.map +1 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +6 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/names.d.ts +19 -0
- package/dist/tools/names.d.ts.map +1 -0
- package/dist/tools/names.js +19 -0
- package/dist/tools/names.js.map +1 -0
- package/dist/tools/node/index.d.ts +20 -0
- package/dist/tools/node/index.d.ts.map +1 -0
- package/dist/tools/node/index.js +406 -0
- package/dist/tools/node/index.js.map +1 -0
- package/dist/tools/pure.d.ts +13 -0
- package/dist/tools/pure.d.ts.map +1 -0
- package/dist/tools/pure.js +170 -0
- package/dist/tools/pure.js.map +1 -0
- package/examples/providers.ts +35 -0
- package/examples/runtime-kit.ts +25 -0
- package/examples/smoke.ts +8 -0
- package/llms.txt +1 -1
- package/package.json +31 -15
- package/skills/agent-v/SKILL.md +8 -2
- package/skills/agent-v/references/integration-patterns.md +11 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AgentV,
|
|
3
|
+
EngineRegistry,
|
|
4
|
+
MemoryConfigStore,
|
|
5
|
+
defineAgent,
|
|
6
|
+
defaultConfig,
|
|
7
|
+
type CredentialResolver,
|
|
8
|
+
} from "@vraxis/agent-v";
|
|
9
|
+
import { ProviderRuntime, defineProviderProfile } from "@vraxis/agent-v/providers";
|
|
10
|
+
|
|
11
|
+
export function createHostedProviderAgent(credentials: CredentialResolver) {
|
|
12
|
+
const providers = new ProviderRuntime({ credentials });
|
|
13
|
+
const profile = defineProviderProfile({
|
|
14
|
+
id: "primary-provider",
|
|
15
|
+
name: "Primary hosted model",
|
|
16
|
+
provider: "openai",
|
|
17
|
+
credentialRef: "keychain://providers/openai",
|
|
18
|
+
});
|
|
19
|
+
const config = new MemoryConfigStore({ ...defaultConfig(), profiles: [profile] });
|
|
20
|
+
const runtime = new AgentV({
|
|
21
|
+
config,
|
|
22
|
+
engines: new EngineRegistry().register(providers.agent).register(providers.structured),
|
|
23
|
+
});
|
|
24
|
+
const agent = defineAgent({
|
|
25
|
+
id: "hosted-assistant",
|
|
26
|
+
name: "Hosted assistant",
|
|
27
|
+
profileId: profile.id,
|
|
28
|
+
instructions: "Answer clearly using only context supplied by the host.",
|
|
29
|
+
skills: [],
|
|
30
|
+
tools: [],
|
|
31
|
+
requiredCapabilities: ["streaming"],
|
|
32
|
+
maxSteps: 8,
|
|
33
|
+
});
|
|
34
|
+
return { runtime, agent, profile, providers };
|
|
35
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createAgentRuntime } from "@vraxis/agent-v/runtime";
|
|
2
|
+
import { createStandardApprovalPolicy } from "@vraxis/agent-v/tools";
|
|
3
|
+
import { createWorkspaceTools } from "@vraxis/agent-v/tools/node";
|
|
4
|
+
import { FakeToolAgentEngine } from "@vraxis/agent-v/testing";
|
|
5
|
+
|
|
6
|
+
export async function createReviewRuntime(projectRoot: string) {
|
|
7
|
+
const tools = await createWorkspaceTools({
|
|
8
|
+
rootPath: projectRoot,
|
|
9
|
+
allowedCommands: [process.execPath],
|
|
10
|
+
});
|
|
11
|
+
return createAgentRuntime({
|
|
12
|
+
execution: { type: "engine", engine: new FakeToolAgentEngine() },
|
|
13
|
+
agent: {
|
|
14
|
+
id: "project-reviewer",
|
|
15
|
+
name: "Project reviewer",
|
|
16
|
+
instructions: "Review the project against the product's supplied requirements.",
|
|
17
|
+
recipe: "review",
|
|
18
|
+
requiredCapabilities: ["tools"],
|
|
19
|
+
},
|
|
20
|
+
tools,
|
|
21
|
+
approvalPolicy: createStandardApprovalPolicy({
|
|
22
|
+
categories: { write: "denied", command: "denied", network: "denied", browser: "denied", credentials: "denied", destructive: "denied" },
|
|
23
|
+
}),
|
|
24
|
+
});
|
|
25
|
+
}
|
package/examples/smoke.ts
CHANGED
|
@@ -8,6 +8,8 @@ import { createRepositorySummaryRequest } from "./local-cli.ts";
|
|
|
8
8
|
import { createStatefulRuntime } from "./sessions-and-events.ts";
|
|
9
9
|
import { createResolvedModelEngine } from "./custom-model-resolver.ts";
|
|
10
10
|
import { registerFilesystemSkill } from "./filesystem-skill.ts";
|
|
11
|
+
import { createHostedProviderAgent } from "./providers.ts";
|
|
12
|
+
import { createReviewRuntime } from "./runtime-kit.ts";
|
|
11
13
|
|
|
12
14
|
const usage = {
|
|
13
15
|
inputTokens: { total: 1, noCache: 1, cacheRead: undefined, cacheWrite: undefined },
|
|
@@ -34,3 +36,9 @@ assert.equal(createStatefulRuntime(basic.runtime.engines.require("primary-agent"
|
|
|
34
36
|
assert.equal(createResolvedModelEngine(() => model).descriptor.id, "profiled-agent");
|
|
35
37
|
assert.equal((await registerFilesystemSkill("skills/agent-v")).loaded.skill.id, "agent-v");
|
|
36
38
|
assert.equal(new EngineRegistry().list().length, 0);
|
|
39
|
+
const hosted = createHostedProviderAgent({ resolve: async () => crypto.randomUUID() });
|
|
40
|
+
assert.equal(hosted.profile.options?.provider, "openai");
|
|
41
|
+
assert.equal((await hosted.providers.inspect(hosted.profile)).availability, "ready");
|
|
42
|
+
const review = await createReviewRuntime(process.cwd());
|
|
43
|
+
assert.equal(review.agent.id, "project-reviewer");
|
|
44
|
+
assert.equal(review.approvalPolicy.constructor.name, "StandardApprovalPolicy");
|
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# agent-v
|
|
2
2
|
|
|
3
|
-
> Provider-neutral TypeScript execution contracts for scoped agents, validated tools, approvals,
|
|
3
|
+
> Provider-neutral TypeScript execution contracts for scoped agents, validated standard tools, categorized approvals, built-in hosted providers, local coding runtimes, Ollama, secure credential references, sessions, events, portable skills, and starter recipes.
|
|
4
4
|
|
|
5
5
|
## Canonical guidance
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vraxis/agent-v",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "A provider-neutral engine for building inspectable, extensible agentic products.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -46,6 +46,26 @@
|
|
|
46
46
|
"types": "./dist/adapters/ai-sdk/index.d.ts",
|
|
47
47
|
"import": "./dist/adapters/ai-sdk/index.js"
|
|
48
48
|
},
|
|
49
|
+
"./providers": {
|
|
50
|
+
"types": "./dist/adapters/providers/index.d.ts",
|
|
51
|
+
"import": "./dist/adapters/providers/index.js"
|
|
52
|
+
},
|
|
53
|
+
"./runtime": {
|
|
54
|
+
"types": "./dist/runtime/index.d.ts",
|
|
55
|
+
"import": "./dist/runtime/index.js"
|
|
56
|
+
},
|
|
57
|
+
"./skills": {
|
|
58
|
+
"types": "./dist/skills/index.d.ts",
|
|
59
|
+
"import": "./dist/skills/index.js"
|
|
60
|
+
},
|
|
61
|
+
"./tools": {
|
|
62
|
+
"types": "./dist/tools/index.d.ts",
|
|
63
|
+
"import": "./dist/tools/index.js"
|
|
64
|
+
},
|
|
65
|
+
"./tools/node": {
|
|
66
|
+
"types": "./dist/tools/node/index.d.ts",
|
|
67
|
+
"import": "./dist/tools/node/index.js"
|
|
68
|
+
},
|
|
49
69
|
"./local-cli": {
|
|
50
70
|
"types": "./dist/adapters/local-cli/index.d.ts",
|
|
51
71
|
"import": "./dist/adapters/local-cli/index.js"
|
|
@@ -72,27 +92,23 @@
|
|
|
72
92
|
"test:package": "node test/package-smoke.mjs",
|
|
73
93
|
"check": "npm run typecheck && npm test && npm run build && npm run test:examples && npm run test:package && npm pack --dry-run --cache .npm-cache"
|
|
74
94
|
},
|
|
75
|
-
"peerDependencies": {
|
|
76
|
-
"ai": ">=7.0.0 <8",
|
|
77
|
-
"ai-sdk-ollama": ">=4.2.0 <5"
|
|
78
|
-
},
|
|
79
|
-
"peerDependenciesMeta": {
|
|
80
|
-
"ai": {
|
|
81
|
-
"optional": true
|
|
82
|
-
},
|
|
83
|
-
"ai-sdk-ollama": {
|
|
84
|
-
"optional": true
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
95
|
"devDependencies": {
|
|
88
96
|
"@types/node": "^24.10.0",
|
|
89
|
-
"ai": "^7.0.79",
|
|
90
|
-
"ai-sdk-ollama": "^4.2.0",
|
|
91
97
|
"tsx": "^4.23.12",
|
|
92
98
|
"typescript": "^5.9.3"
|
|
93
99
|
},
|
|
94
100
|
"dependencies": {
|
|
101
|
+
"@ai-sdk/anthropic": "^4.0.46",
|
|
102
|
+
"@ai-sdk/deepseek": "^3.0.37",
|
|
103
|
+
"@ai-sdk/google": "^4.0.58",
|
|
104
|
+
"@ai-sdk/openai": "^4.0.52",
|
|
105
|
+
"@ai-sdk/openai-compatible": "^3.0.41",
|
|
106
|
+
"ai": "^7.0.85",
|
|
107
|
+
"ai-sdk-ollama": "^4.2.0",
|
|
95
108
|
"jsonc-parser": "^3.3.1",
|
|
96
109
|
"yaml": "^2.9.0"
|
|
110
|
+
},
|
|
111
|
+
"optionalDependencies": {
|
|
112
|
+
"@napi-rs/keyring": "^1.3.0"
|
|
97
113
|
}
|
|
98
114
|
}
|
package/skills/agent-v/SKILL.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: agent-v
|
|
3
3
|
description: Integrate or extend the agent-v TypeScript library for scoped agents, tools, approvals, AI SDK models, local coding runtimes, Ollama, sessions, events, or Agent Skills.
|
|
4
4
|
metadata:
|
|
5
|
-
version: "0.
|
|
5
|
+
version: "0.7.1"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Use agent-v accurately
|
|
@@ -13,9 +13,14 @@ Read the installed package's `README.md` and type declarations before coding. Do
|
|
|
13
13
|
|
|
14
14
|
- Use `@vraxis/agent-v` for contracts, scopes, agent blueprints, tool/skill definitions, registries, and policies.
|
|
15
15
|
- Use `@vraxis/agent-v/ai-sdk` for structured model calls and tool-loop agents backed by AI SDK 7.
|
|
16
|
+
- Use `@vraxis/agent-v/providers` for built-in hosted-provider profiles and model resolution. Keep only credential references in profiles.
|
|
17
|
+
- Use `@vraxis/agent-v/runtime` for the high-level, deny-by-default model/tool-loop factory.
|
|
18
|
+
- Use `@vraxis/agent-v/tools` for pure utilities, allowlisted HTTP, browser-controller contracts, and standard approval policies.
|
|
19
|
+
- Use `@vraxis/agent-v/tools/node` for canonical-root filesystem, Git-read, and allowlisted argument-array command tools.
|
|
20
|
+
- Use `@vraxis/agent-v/skills` for opt-in operational skills and starter recipes. Supply product-owned instructions.
|
|
16
21
|
- Use `@vraxis/agent-v/ollama` only for an Ollama model server. Inspect readiness before registration.
|
|
17
22
|
- Use `@vraxis/agent-v/local-cli` when Codex, OpenCode, Claude Code, or another coding CLI must operate on a workspace.
|
|
18
|
-
- Use `@vraxis/agent-v/node` for local sessions, run ledgers, diagnostics, filesystem Agent Skills,
|
|
23
|
+
- Use `@vraxis/agent-v/node` for local sessions, run ledgers, diagnostics, filesystem Agent Skills, cross-runtime skill inventory, environment credential resolution, and system-keyring storage.
|
|
19
24
|
- Use `@vraxis/agent-v/testing` for deterministic tests without provider calls.
|
|
20
25
|
|
|
21
26
|
Do not substitute a coding CLI adapter for an ordinary model provider or treat Ollama as a coding-workspace runtime.
|
|
@@ -26,6 +31,7 @@ Do not substitute a coding CLI adapter for an ordinary model provider or treat O
|
|
|
26
31
|
- Declare every agent's skills, tools, and required capabilities explicitly.
|
|
27
32
|
- Give each tool stable input and output contracts, version, risk, side-effect classification, permissions, approval behavior, and timeout.
|
|
28
33
|
- Use an agent `toolPolicy` when evidence reads must occur in an exact order. Require `tool-sequencing` and `tool-audit`, and inspect `result.toolAudit.sequenceSatisfied`.
|
|
34
|
+
- Treat every standard host tool as opt-in. Supply explicit roots, command/host/origin allowlists, scope permissions, and approval decisions.
|
|
29
35
|
- Require approval for external side effects and privileged actions. Never weaken policy after a denial or adapter failure.
|
|
30
36
|
- Treat artifacts as host-supplied evidence. Keep product-specific evidence judgment, retrieval, prompts, and UX in the consuming product.
|
|
31
37
|
- Persist returned normalized events and provenance when runs must be auditable.
|
|
@@ -16,6 +16,11 @@ Choose from required behavior, not provider preference:
|
|
|
16
16
|
| --- | --- | --- |
|
|
17
17
|
| One schema-bound model operation | `@vraxis/agent-v/ai-sdk` | `StructuredModelEngine` |
|
|
18
18
|
| Bounded model/tool loop | `@vraxis/agent-v/ai-sdk` | `ToolAgentEngine` |
|
|
19
|
+
| Built-in hosted model provider | `@vraxis/agent-v/providers` | AI SDK engines through `ProviderRuntime` |
|
|
20
|
+
| High-level model/tool runtime | `@vraxis/agent-v/runtime` | `createAgentRuntime()` with provider or custom engine selection |
|
|
21
|
+
| Portable standard tools | `@vraxis/agent-v/tools` | Pure tools, HTTP/browser contracts, approval policy |
|
|
22
|
+
| Bounded Node host tools | `@vraxis/agent-v/tools/node` | Filesystem, Git, and allowlisted commands |
|
|
23
|
+
| Operational starter recipes | `@vraxis/agent-v/skills` | Coding, research, review, and document composition |
|
|
19
24
|
| Local or remote Ollama model | `@vraxis/agent-v/ollama` | AI SDK engines through `OllamaRuntime` |
|
|
20
25
|
| Coding agent against a workspace | `@vraxis/agent-v/local-cli` | `CodingRuntimeEngine` |
|
|
21
26
|
| Local persistence or diagnostics | `@vraxis/agent-v/node` | Store and doctor ports |
|
|
@@ -30,6 +35,8 @@ Validate the tool's returned value with `output`. Tool implementation bugs must
|
|
|
30
35
|
|
|
31
36
|
Keep product-specific tools with their product until their contract and safety semantics are demonstrably reusable.
|
|
32
37
|
|
|
38
|
+
Standard tools grant no ambient authority. Node workspace tools require a canonical root; command tools require an allowlist; HTTP requires allowed hosts; browser tools require allowed origins and a host controller. Guarded tools carry an approval category, and the standard policy denies categories the host has not decided explicitly.
|
|
39
|
+
|
|
33
40
|
## Composing an agent
|
|
34
41
|
|
|
35
42
|
Use `defineAgent()` with either `engineId` or `profileId`, never both. Profiles select deploy-time engine, model, credential reference, and provider options without changing the blueprint.
|
|
@@ -38,6 +45,8 @@ When skills are selected, their combined tool allowlist constrains the blueprint
|
|
|
38
45
|
|
|
39
46
|
Declare only capabilities the workflow actually needs. Selection should fail if the engine cannot enforce one.
|
|
40
47
|
|
|
48
|
+
Starter recipes provide operational tool/skill composition, not product meaning. The product must supply the agent id, name, instructions, scope, persistence, and approval UX.
|
|
49
|
+
|
|
41
50
|
For governed evidence-first loops, declare `toolPolicy.requiredSequence` on the blueprint and use `afterRequired: "disable"` when final synthesis must not invoke more tools. Include `tool-sequencing` and `tool-audit` in `requiredCapabilities`. Vraxis validates tool availability and step budget before inference and returns redacted execution evidence in `result.toolAudit`.
|
|
42
51
|
|
|
43
52
|
## Persistence and provenance
|
|
@@ -48,6 +57,8 @@ Every `RunProvenance` has an `adapterStrategy`. Local CLI and Ollama runs also i
|
|
|
48
57
|
|
|
49
58
|
Configuration contains credential references. Resolve credential values inside the host's model resolver; never write values to config, events, sessions, examples, or fixtures.
|
|
50
59
|
|
|
60
|
+
For built-in hosted providers, use `defineProviderProfile()` and `ProviderRuntime` instead of importing provider SDKs into a product. Use `SystemCredentialStore` or another host-owned `CredentialResolver`; persist only the `keychain://` or `env://` reference. Provider inspection is configuration-only and makes no inference request.
|
|
61
|
+
|
|
51
62
|
## Common mistakes
|
|
52
63
|
|
|
53
64
|
- Importing provider SDK types into product domain code instead of registering an adapter.
|