open-agentic-web 0.0.0-stage → 1.0.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/LICENSE +17 -0
- package/README.md +286 -2
- package/bin/cli.mjs +351 -0
- package/package.json +48 -4
- package/src/actions.js +271 -0
- package/src/bridge.js +278 -0
- package/src/federation.js +340 -0
- package/src/index.js +10 -0
- package/src/validator.js +442 -0
- package/test/actions.test.mjs +140 -0
- package/test/federation.test.mjs +121 -0
- package/test/fixtures/hub-node/agent-manifest.json +20 -0
- package/test/fixtures/hub-node/bridge/action-bridge.html +1 -0
- package/test/fixtures/hub-node/hub.network.json +15 -0
- package/test/fixtures/hub-node/links.json +7 -0
- package/test/fixtures/hub-node/site-actions.js +22 -0
- package/test/fixtures/peer-node/agent-manifest.json +20 -0
- package/test/fixtures/peer-node/bridge/action-bridge.html +1 -0
- package/test/fixtures/peer-node/links.json +5 -0
- package/test/fixtures/peer-node/peer.network.json +15 -0
- package/test/fixtures/peer-node/site-actions.js +11 -0
- package/test/validator.test.mjs +93 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "fixture_hub",
|
|
3
|
+
"networks": [
|
|
4
|
+
{
|
|
5
|
+
"name": "fixture_hub_net",
|
|
6
|
+
"front_man": "hub_concierge",
|
|
7
|
+
"hocon": "./hub.network.json"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"llm_router": {
|
|
11
|
+
"base_url": "https://api.otari.ai/api/v1",
|
|
12
|
+
"default_model": "alibaba/qwen3.8-flash"
|
|
13
|
+
},
|
|
14
|
+
"actions": {
|
|
15
|
+
"agentTools": ["query_traveler_profile", "reserve_hub_package"]
|
|
16
|
+
},
|
|
17
|
+
"peer_policy": {
|
|
18
|
+
"mode": "open"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!doctype html><html><head><meta charset="utf-8"><title>Bridge</title></head><body></body></html>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tools": [
|
|
3
|
+
{
|
|
4
|
+
"name": "hub_concierge",
|
|
5
|
+
"instructions": "Autonomous fixture hub concierge agent coordinating travel bookings across peers.",
|
|
6
|
+
"function": {
|
|
7
|
+
"parameters": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": { "destination": { "type": "string" } },
|
|
10
|
+
"required": ["destination"]
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export class SiteActions {
|
|
2
|
+
static registerActions(registry) {
|
|
3
|
+
registry.register({
|
|
4
|
+
name: "query_traveler_profile",
|
|
5
|
+
description: "Retrieve active traveler preferences",
|
|
6
|
+
effect: "read",
|
|
7
|
+
inputSchema: { type: "object", properties: {} },
|
|
8
|
+
execute: async () => ({ destination: "San Francisco", budget: 500 })
|
|
9
|
+
});
|
|
10
|
+
registry.register({
|
|
11
|
+
name: "reserve_hub_package",
|
|
12
|
+
description: "Confirm hotel booking package",
|
|
13
|
+
effect: "irreversible",
|
|
14
|
+
inputSchema: {
|
|
15
|
+
type: "object",
|
|
16
|
+
properties: { nights: { type: "integer" } },
|
|
17
|
+
required: ["nights"]
|
|
18
|
+
},
|
|
19
|
+
execute: async (args) => ({ confirmed: true, booking_id: "HUB-123" })
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "fixture_peer",
|
|
3
|
+
"networks": [
|
|
4
|
+
{
|
|
5
|
+
"name": "fixture_peer_net",
|
|
6
|
+
"front_man": "peer_dispatcher",
|
|
7
|
+
"hocon": "./peer.network.json"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"llm_router": {
|
|
11
|
+
"base_url": "https://api.otari.ai/api/v1",
|
|
12
|
+
"default_model": "alibaba/qwen3.8-flash"
|
|
13
|
+
},
|
|
14
|
+
"actions": {
|
|
15
|
+
"agentTools": ["quote_ground_transit"]
|
|
16
|
+
},
|
|
17
|
+
"peer_policy": {
|
|
18
|
+
"mode": "open"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!doctype html><html><head><meta charset="utf-8"><title>Bridge</title></head><body></body></html>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tools": [
|
|
3
|
+
{
|
|
4
|
+
"name": "peer_dispatcher",
|
|
5
|
+
"instructions": "Autonomous fixture peer dispatcher agent quoting transit rates.",
|
|
6
|
+
"function": {
|
|
7
|
+
"parameters": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": { "origin": { "type": "string" } },
|
|
10
|
+
"required": ["origin"]
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class SiteActions {
|
|
2
|
+
static registerActions(registry) {
|
|
3
|
+
registry.register({
|
|
4
|
+
name: "quote_ground_transit",
|
|
5
|
+
description: "Quote ground transit transfer rates",
|
|
6
|
+
effect: "read",
|
|
7
|
+
inputSchema: { type: "object", properties: { origin: { type: "string" } } },
|
|
8
|
+
execute: async () => ({ fare: 50, vehicle: "Sedan" })
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import assert from "node:assert";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { describe, it } from "node:test";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { validateFederation, validateManifest, validateNetwork, validateNode } from "../src/validator.js";
|
|
6
|
+
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const repoRoot = join(__dirname, "..", "..", "..");
|
|
9
|
+
|
|
10
|
+
describe("Open Agentic Web - Conformance Validator", () => {
|
|
11
|
+
it("validates manifest schema correctly", () => {
|
|
12
|
+
const validManifest = {
|
|
13
|
+
name: "test_node",
|
|
14
|
+
networks: [
|
|
15
|
+
{ name: "test_net", front_man: "test_agent", hocon: "./net.json" }
|
|
16
|
+
],
|
|
17
|
+
llm_router: { base_url: "https://api.otari.ai/api/v1" },
|
|
18
|
+
actions: { agentTools: ["website_do_something"] }
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const report = validateManifest(validManifest);
|
|
22
|
+
assert.strictEqual(report.valid, true);
|
|
23
|
+
assert.strictEqual(report.failed, 0);
|
|
24
|
+
|
|
25
|
+
const invalidManifest = {
|
|
26
|
+
name: "broken"
|
|
27
|
+
// missing networks, llm_router
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const badReport = validateManifest(invalidManifest);
|
|
31
|
+
assert.strictEqual(badReport.valid, false);
|
|
32
|
+
assert.ok(badReport.failed > 0);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("validates declarative network graph correctly", () => {
|
|
36
|
+
const validNet = {
|
|
37
|
+
tools: [
|
|
38
|
+
{
|
|
39
|
+
name: "agent_concierge",
|
|
40
|
+
instructions: "Grounded instructions for the concierge agent to act on behalf of the user.",
|
|
41
|
+
function: {
|
|
42
|
+
parameters: { type: "object", properties: { dest: { type: "string" } } }
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const report = validateNetwork(validNet, { frontMan: "agent_concierge" });
|
|
49
|
+
assert.strictEqual(report.valid, true);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("validates standalone fixtures and federated mesh independently", async () => {
|
|
53
|
+
const fixtureHubDir = join(__dirname, "fixtures", "hub-node");
|
|
54
|
+
const fixturePeerDir = join(__dirname, "fixtures", "peer-node");
|
|
55
|
+
|
|
56
|
+
const hubSummary = await validateNode(fixtureHubDir);
|
|
57
|
+
assert.strictEqual(hubSummary.valid, true, `fixture hub failed: ${JSON.stringify(hubSummary.results.filter(r => r.status === 'FAIL'))}`);
|
|
58
|
+
|
|
59
|
+
const peerSummary = await validateNode(fixturePeerDir);
|
|
60
|
+
assert.strictEqual(peerSummary.valid, true, `fixture peer failed: ${JSON.stringify(peerSummary.results.filter(r => r.status === 'FAIL'))}`);
|
|
61
|
+
|
|
62
|
+
// Validate true cross-site federation (peer links, network alignment, allowed peers)
|
|
63
|
+
const fed = await validateFederation(fixtureHubDir, [fixturePeerDir]);
|
|
64
|
+
assert.strictEqual(fed.valid, true, `federation failed: ${JSON.stringify(fed.meshReport.results.filter(r => r.status === 'FAIL'))}`);
|
|
65
|
+
assert.ok(fed.totalChecks > 10);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it("validates live repository nodes (tripsteward-hub, cityglide-node, metropass-node)", async () => {
|
|
69
|
+
const hubDir = join(repoRoot, "sites", "tripsteward-hub");
|
|
70
|
+
const ridesDir = join(repoRoot, "sites", "cityglide-node");
|
|
71
|
+
const expDir = join(repoRoot, "sites", "metropass-node");
|
|
72
|
+
|
|
73
|
+
// Skip if running as standalone npm package where monorepo sites are absent
|
|
74
|
+
const { existsSync } = await import("node:fs");
|
|
75
|
+
if (!existsSync(hubDir)) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const hubSummary = await validateNode(hubDir);
|
|
80
|
+
assert.strictEqual(hubSummary.valid, true, `tripsteward-hub failed: ${JSON.stringify(hubSummary.results.filter(r => r.status === 'FAIL'))}`);
|
|
81
|
+
|
|
82
|
+
const ridesSummary = await validateNode(ridesDir);
|
|
83
|
+
assert.strictEqual(ridesSummary.valid, true, `cityglide-node failed: ${JSON.stringify(ridesSummary.results.filter(r => r.status === 'FAIL'))}`);
|
|
84
|
+
|
|
85
|
+
const expSummary = await validateNode(expDir);
|
|
86
|
+
assert.strictEqual(expSummary.valid, true, `metropass-node failed: ${JSON.stringify(expSummary.results.filter(r => r.status === 'FAIL'))}`);
|
|
87
|
+
|
|
88
|
+
// Test multi-node federation
|
|
89
|
+
const fed = await validateFederation(hubDir, [ridesDir, expDir]);
|
|
90
|
+
assert.strictEqual(fed.valid, true);
|
|
91
|
+
assert.ok(fed.totalChecks > 30);
|
|
92
|
+
});
|
|
93
|
+
});
|