open-agentic-web 0.0.0-stage β 1.0.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/LICENSE +17 -0
- package/README.md +250 -2
- package/bin/cli.mjs +304 -0
- package/package.json +48 -4
- package/src/actions.js +237 -0
- package/src/bridge.js +216 -0
- package/src/federation.js +159 -0
- package/src/index.js +10 -0
- package/src/validator.js +300 -0
- package/test/actions.test.mjs +95 -0
- package/test/federation.test.mjs +81 -0
- package/test/validator.test.mjs +71 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
Copyright 2026 Open Agentic Web Community / TripSteward Authors
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,251 @@
|
|
|
1
|
-
#
|
|
1
|
+
# π Open Agentic Web SDK (`open-agentic-web`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/open-agentic-web)
|
|
4
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
5
|
+
[](https://cognizant-ai-labs.github.io/agentic-web/specs/mvp-v0.3.json)
|
|
6
|
+
|
|
7
|
+
The **Open Agentic Web SDK** (`open-agentic-web`) is the official developer toolkit, conformance linter, and in-browser runtime for building, validating, and federating autonomous web agents.
|
|
8
|
+
|
|
9
|
+
Compliant with the **Cognizant AI Lab / Mozilla Otari / MIT NANDA Open Agentic Web (MVP Profile 0.3)** specification.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## β‘ Why `open-agentic-web`?
|
|
14
|
+
|
|
15
|
+
In the emerging Agentic Web, AI agents don't just chatβthey act directly on websites on behalf of users, discovering inventory, holding reservations, and issuing tickets across independent domains without aggregator markups.
|
|
16
|
+
|
|
17
|
+
Building a conforming agentic website previously required manually writing repetitive boilerplate:
|
|
18
|
+
1. **Manifest & Network validation**: No standard CLI existed to verify whether your `agent-manifest.json` or `*.network.json` met the Open Agentic Web specification.
|
|
19
|
+
2. **Action tool validation**: Tools called by LLMs (`website_*`) lacked standard runtime JSON schema enforcement and effect classification (`read` vs `irreversible`).
|
|
20
|
+
3. **Cross-origin iframe bridging**: Implementing secure postMessage handshakes and MessageChannels for `bridge/action-bridge.html` required hundreds of lines of fragile glue code.
|
|
21
|
+
4. **Dynamic Swarm Federation**: No reusable client existed to discover, consent-check, and mount remote agent nodes in browser RAM on the fly.
|
|
22
|
+
|
|
23
|
+
`open-agentic-web` provides a **zero-dependency**, universal toolkit for all of these needs.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## π¦ Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Install globally or as a dev dependency for CLI validation
|
|
31
|
+
npm install -D open-agentic-web
|
|
32
|
+
|
|
33
|
+
# Or use directly with npx
|
|
34
|
+
npx open-agentic-web validate .
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## π 1. Conformance Linter & CLI (`oaw` / `open-agentic-web`)
|
|
40
|
+
|
|
41
|
+
Validate any agentic website or scaffold a brand-new conforming node in seconds.
|
|
42
|
+
|
|
43
|
+
### Validate Conformance
|
|
44
|
+
Run automated checks against `agent-manifest.json`, declarative `*.network.json` graphs, `bridge/action-bridge.html`, and `site-actions.js`:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Validate current directory
|
|
48
|
+
npx open-agentic-web validate .
|
|
49
|
+
|
|
50
|
+
# Validate multiple agent nodes
|
|
51
|
+
npx oaw validate sites/hub sites/mobility sites/ticketing
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Output:
|
|
55
|
+
```text
|
|
56
|
+
βοΈ Running Open Agentic Web Conformance Linter
|
|
57
|
+
|
|
58
|
+
Testing Node: ./sites/tripsteward-hub
|
|
59
|
+
β
PASS: Contains 'agent-manifest.json'
|
|
60
|
+
β
PASS: Manifest declares valid name or brand ('HarborView Hotel')
|
|
61
|
+
β
PASS: Network[0] declares 'front_man' (travel_concierge)
|
|
62
|
+
β
PASS: Referenced network file exists: ./tripsteward_concierge.network.json
|
|
63
|
+
β
PASS: Manifest declares 'llm_router' with valid 'base_url'
|
|
64
|
+
β
PASS: Node provides 'bridge/action-bridge.html' for cross-origin tool execution
|
|
65
|
+
β
PASS: Front agent 'travel_concierge' has grounded instructions
|
|
66
|
+
β
PASS: site-actions provides registered action tools (7 declared)
|
|
67
|
+
|
|
68
|
+
All nodes conform 100% to Open Agentic Web MVP Profile 0.3!
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Validate Federated Mesh
|
|
72
|
+
Verify cross-site peer link mappings and compatibility between an orchestrator hub and peer nodes:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npx oaw federation sites/hub sites/mobility sites/ticketing
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Scaffold a New Agentic Web Node
|
|
79
|
+
Generate a conforming node structure ready to deploy on any static host:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
npx oaw init my-dining-node --name "tablebespoke_dining"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Generates:
|
|
86
|
+
```text
|
|
87
|
+
my-dining-node/
|
|
88
|
+
βββ agent-manifest.json # Machine discovery root
|
|
89
|
+
βββ tablebespoke_dining.network.json # Declarative Neuro SAN agent graph
|
|
90
|
+
βββ site-actions.js # Executable JavaScript tools (website_*)
|
|
91
|
+
βββ bridge/
|
|
92
|
+
β βββ action-bridge.html # Sandboxed cross-origin iframe bridge
|
|
93
|
+
βββ links.json # Peer network resolution map
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## π οΈ 2. Site Actions Framework (`open-agentic-web/actions`)
|
|
99
|
+
|
|
100
|
+
Define grounded, machine-executable action tools with built-in JSON schema validation and effect tagging.
|
|
101
|
+
|
|
102
|
+
```javascript
|
|
103
|
+
import { defineAction, createActionRegistry } from "open-agentic-web";
|
|
104
|
+
|
|
105
|
+
export class SiteActions {
|
|
106
|
+
static registerActions(registry) {
|
|
107
|
+
// 1. Read-only action (safe query, no confirmation needed)
|
|
108
|
+
registry.register(
|
|
109
|
+
defineAction({
|
|
110
|
+
name: "website_search_availability",
|
|
111
|
+
description: "Search open slots by category and party size.",
|
|
112
|
+
effect: "read", // "read" | "irreversible" | "undoable"
|
|
113
|
+
inputSchema: {
|
|
114
|
+
type: "object",
|
|
115
|
+
properties: {
|
|
116
|
+
category: { type: "string" },
|
|
117
|
+
party_size: { type: "integer", minimum: 1 }
|
|
118
|
+
},
|
|
119
|
+
required: ["party_size"],
|
|
120
|
+
additionalProperties: false
|
|
121
|
+
},
|
|
122
|
+
execute: async (args) => {
|
|
123
|
+
return {
|
|
124
|
+
ok: true,
|
|
125
|
+
available_slots: [
|
|
126
|
+
{ time: "7:00 PM", table: "Patio A" }
|
|
127
|
+
]
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
// 2. Irreversible action (triggers human confirmation dialog)
|
|
134
|
+
registry.register(
|
|
135
|
+
defineAction({
|
|
136
|
+
name: "website_commit_booking",
|
|
137
|
+
description: "Commit binding reservation with direct provider.",
|
|
138
|
+
effect: "irreversible",
|
|
139
|
+
inputSchema: {
|
|
140
|
+
type: "object",
|
|
141
|
+
properties: {
|
|
142
|
+
slot_id: { type: "string" },
|
|
143
|
+
guest_name: { type: "string" }
|
|
144
|
+
},
|
|
145
|
+
required: ["slot_id", "guest_name"],
|
|
146
|
+
additionalProperties: false
|
|
147
|
+
},
|
|
148
|
+
execute: async (args) => {
|
|
149
|
+
const bookingId = "BOOK-" + Math.floor(1000 + Math.random() * 9000);
|
|
150
|
+
return { ok: true, booking_id: bookingId, status: "CONFIRMED_DIRECT" };
|
|
151
|
+
}
|
|
152
|
+
})
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## π 3. Sandboxed Action Bridge (`open-agentic-web/bridge`)
|
|
161
|
+
|
|
162
|
+
Enable parent orchestrators to execute your site tools from an iframe using the standard `nsdeploy-actions-v1` protocol.
|
|
163
|
+
|
|
164
|
+
### In `bridge/action-bridge.html`:
|
|
165
|
+
```html
|
|
166
|
+
<!doctype html>
|
|
167
|
+
<html lang="en">
|
|
168
|
+
<head>
|
|
169
|
+
<meta charset="utf-8">
|
|
170
|
+
<title>Action Bridge</title>
|
|
171
|
+
<script type="module">
|
|
172
|
+
import { createActionRegistry, setupActionBridge } from "open-agentic-web";
|
|
173
|
+
import { SiteActions } from "../site-actions.js";
|
|
174
|
+
|
|
175
|
+
const registry = createActionRegistry();
|
|
176
|
+
SiteActions.registerActions(registry);
|
|
177
|
+
|
|
178
|
+
// Listens for postMessage and MessageChannel handshakes from orchestrators
|
|
179
|
+
setupActionBridge({ registry });
|
|
180
|
+
</script>
|
|
181
|
+
</head>
|
|
182
|
+
<body></body>
|
|
183
|
+
</html>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### In Orchestrator Client:
|
|
187
|
+
```javascript
|
|
188
|
+
import { createActionBridgeClient } from "open-agentic-web";
|
|
189
|
+
|
|
190
|
+
const client = createActionBridgeClient({
|
|
191
|
+
bridgeUrl: "https://partner-site.com/bridge/action-bridge.html",
|
|
192
|
+
brand: "Partner Transfers"
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
// Calls remote site action over sandboxed MessagePort
|
|
196
|
+
const quote = await client.execute("website_quote_transfer", {
|
|
197
|
+
destination: "HarborView Hotel",
|
|
198
|
+
flight_number: "UA 482"
|
|
199
|
+
});
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## π 4. Dynamic Federation & Swarm Engine (`open-agentic-web/federation`)
|
|
205
|
+
|
|
206
|
+
Mount and orchestrate third-party agentic web nodes on the fly in browser RAM with user consent:
|
|
207
|
+
|
|
208
|
+
```javascript
|
|
209
|
+
import { AgentSwarm } from "open-agentic-web";
|
|
210
|
+
|
|
211
|
+
const swarm = new AgentSwarm({
|
|
212
|
+
defaultRouter: "https://api.otari.ai/api/v1",
|
|
213
|
+
defaultModel: "alibaba/qwen3.8-flash"
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
// Mount an external specialist node with interactive user consent
|
|
217
|
+
await swarm.mountFromUrl("https://partner-dining.com", {
|
|
218
|
+
onConsent: async ({ candidate, origin }) => {
|
|
219
|
+
return window.confirm(`Allow agent '${candidate.name}' from ${origin} to join your journey?`);
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
// Search active specialist nodes in the swarm
|
|
224
|
+
const diningAgents = swarm.search({ category: "Dining" });
|
|
225
|
+
|
|
226
|
+
// Export current peer mappings to links.json format
|
|
227
|
+
const linksConfig = swarm.exportLinks("my_hub_network");
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## π API Reference
|
|
233
|
+
|
|
234
|
+
| Module | Export | Description |
|
|
235
|
+
|---|---|---|
|
|
236
|
+
| `open-agentic-web/validator` | `validateNode(dir)` | End-to-end conformance validator for an agentic web node |
|
|
237
|
+
| `open-agentic-web/validator` | `validateManifest(json)` | Validates `agent-manifest.json` against MVP Profile 0.3 |
|
|
238
|
+
| `open-agentic-web/validator` | `validateNetwork(json)` | Validates declarative `*.network.json` graph |
|
|
239
|
+
| `open-agentic-web/validator` | `validateFederation(hub, peers)` | Validates multi-site federated mesh and link mappings |
|
|
240
|
+
| `open-agentic-web/actions` | `defineAction(def)` | Defines action tool with runtime argument schema validation |
|
|
241
|
+
| `open-agentic-web/actions` | `createActionRegistry()` | Manages action registry, discovery catalog, and execution |
|
|
242
|
+
| `open-agentic-web/actions` | `validateSchema(schema, data)` | Pure-JS JSON schema validator (zero external deps) |
|
|
243
|
+
| `open-agentic-web/bridge` | `setupActionBridge(opts)` | Connects iframe postMessage handler to action registry |
|
|
244
|
+
| `open-agentic-web/bridge` | `createActionBridgeClient(opts)` | Parent orchestrator client for calling remote bridges |
|
|
245
|
+
| `open-agentic-web/federation` | `AgentSwarm` | Dynamic multi-agent swarm manager with consent hooks |
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## π‘οΈ License
|
|
250
|
+
|
|
251
|
+
Apache-2.0. Built for the Open Agentic Web community.
|
package/bin/cli.mjs
ADDED
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Open Agentic Web CLI (oaw / open-agentic-web)
|
|
5
|
+
* Validates, scaffolds, and inspects conforming Agentic Web nodes.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
9
|
+
import { basename, join, resolve } from "node:path";
|
|
10
|
+
import { validateFederation, validateNode } from "../src/validator.js";
|
|
11
|
+
|
|
12
|
+
const args = process.argv.slice(2);
|
|
13
|
+
const command = args[0] || "help";
|
|
14
|
+
|
|
15
|
+
const colors = {
|
|
16
|
+
reset: "\x1b[0m",
|
|
17
|
+
bold: "\x1b[1m",
|
|
18
|
+
green: "\x1b[32m",
|
|
19
|
+
red: "\x1b[31m",
|
|
20
|
+
yellow: "\x1b[33m",
|
|
21
|
+
cyan: "\x1b[36m",
|
|
22
|
+
gray: "\x1b[90m"
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
function printHelp() {
|
|
26
|
+
console.log(`
|
|
27
|
+
${colors.bold}${colors.cyan}π Open Agentic Web CLI${colors.reset} β Conformance Linter & Developer Toolkit
|
|
28
|
+
Spec: Cognizant / Mozilla / MIT NANDA MVP Profile 0.3
|
|
29
|
+
|
|
30
|
+
${colors.bold}USAGE:${colors.reset}
|
|
31
|
+
$ open-agentic-web <command> [options]
|
|
32
|
+
$ oaw <command> [options]
|
|
33
|
+
|
|
34
|
+
${colors.bold}COMMANDS:${colors.reset}
|
|
35
|
+
${colors.cyan}validate${colors.reset} [paths...] Validate one or more site directories for specification conformance.
|
|
36
|
+
${colors.cyan}federation${colors.reset} <hub> [peers...] Validate cross-site federation, peer links, and manifests.
|
|
37
|
+
${colors.cyan}init${colors.reset} [dir] Scaffold a new, 100% conforming Open Agentic Web node.
|
|
38
|
+
${colors.cyan}inspect${colors.reset} [path] Inspect and print the declarative agent graph and tool catalog.
|
|
39
|
+
${colors.cyan}help${colors.reset} Display this help message.
|
|
40
|
+
${colors.cyan}version${colors.reset} Print current package version.
|
|
41
|
+
|
|
42
|
+
${colors.bold}EXAMPLES:${colors.reset}
|
|
43
|
+
$ npx open-agentic-web validate .
|
|
44
|
+
$ npx oaw validate sites/tripsteward-hub sites/cityglide-node
|
|
45
|
+
$ npx oaw federation sites/tripsteward-hub sites/cityglide-node sites/metropass-node
|
|
46
|
+
$ npx oaw init my-dining-node --name "tablebespoke_dining"
|
|
47
|
+
`);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function runValidate() {
|
|
51
|
+
const targetDirs = args.slice(1).length > 0 ? args.slice(1) : ["."];
|
|
52
|
+
let overallFailed = 0;
|
|
53
|
+
|
|
54
|
+
console.log(`\n${colors.bold}βοΈ Running Open Agentic Web Conformance Linter${colors.reset}\n`);
|
|
55
|
+
|
|
56
|
+
for (const dir of targetDirs) {
|
|
57
|
+
const summary = await validateNode(dir);
|
|
58
|
+
console.log(`${colors.bold}Testing Node:${colors.reset} ${colors.cyan}${summary.target}${colors.reset}`);
|
|
59
|
+
|
|
60
|
+
summary.results.forEach(res => {
|
|
61
|
+
if (res.status === "PASS") {
|
|
62
|
+
console.log(` ${colors.green}β
PASS:${colors.reset} ${res.message}`);
|
|
63
|
+
} else if (res.status === "WARN") {
|
|
64
|
+
console.log(` ${colors.yellow}β οΈ WARN:${colors.reset} ${res.message}`);
|
|
65
|
+
} else {
|
|
66
|
+
console.log(` ${colors.red}β FAIL:${colors.reset} ${res.message}`);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
if (!summary.valid) {
|
|
71
|
+
overallFailed += summary.failed;
|
|
72
|
+
}
|
|
73
|
+
console.log("");
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (overallFailed > 0) {
|
|
77
|
+
console.error(`${colors.red}${colors.bold}Validation failed with ${overallFailed} error(s).${colors.reset}\n`);
|
|
78
|
+
process.exit(1);
|
|
79
|
+
} else {
|
|
80
|
+
console.log(`${colors.green}${colors.bold}All nodes conform 100% to Open Agentic Web MVP Profile 0.3!${colors.reset}\n`);
|
|
81
|
+
process.exit(0);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async function runFederation() {
|
|
86
|
+
const paths = args.slice(1);
|
|
87
|
+
if (paths.length < 1) {
|
|
88
|
+
console.error(`${colors.red}Error: 'federation' requires at least a hub directory.${colors.reset}`);
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const hubDir = paths[0];
|
|
93
|
+
const peerDirs = paths.slice(1);
|
|
94
|
+
|
|
95
|
+
console.log(`\n${colors.bold}π Validating Federated Mesh:${colors.reset} Hub (${hubDir}) + ${peerDirs.length} peer(s)\n`);
|
|
96
|
+
const fed = await validateFederation(hubDir, peerDirs);
|
|
97
|
+
|
|
98
|
+
console.log(`Total checks run: ${fed.totalChecks}`);
|
|
99
|
+
console.log(`Passed: ${colors.green}${fed.totalPassed}${colors.reset} | Failed: ${colors.red}${fed.totalFailed}${colors.reset}`);
|
|
100
|
+
|
|
101
|
+
if (!fed.valid) {
|
|
102
|
+
console.error(`\n${colors.red}${colors.bold}Federation validation failed.${colors.reset}\n`);
|
|
103
|
+
process.exit(1);
|
|
104
|
+
} else {
|
|
105
|
+
console.log(`\n${colors.green}${colors.bold}Federation verified successfully!${colors.reset}\n`);
|
|
106
|
+
process.exit(0);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function runInit() {
|
|
111
|
+
const targetDir = args[1] || "my-agentic-node";
|
|
112
|
+
const nameIndex = args.indexOf("--name");
|
|
113
|
+
const nodeName = nameIndex !== -1 && args[nameIndex + 1] ? args[nameIndex + 1] : basename(targetDir);
|
|
114
|
+
|
|
115
|
+
const fullPath = resolve(targetDir);
|
|
116
|
+
if (!existsSync(fullPath)) {
|
|
117
|
+
mkdirSync(fullPath, { recursive: true });
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const bridgeDir = join(fullPath, "bridge");
|
|
121
|
+
if (!existsSync(bridgeDir)) {
|
|
122
|
+
mkdirSync(bridgeDir, { recursive: true });
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// 1. agent-manifest.json
|
|
126
|
+
const manifest = {
|
|
127
|
+
specification: "https://cognizant-ai-labs.github.io/agentic-web/specs/mvp-v0.3.json",
|
|
128
|
+
name: nodeName,
|
|
129
|
+
version: "1.0.0",
|
|
130
|
+
description: `${nodeName}: Conforming Open Agentic Web Specialist Node`,
|
|
131
|
+
networks: [
|
|
132
|
+
{
|
|
133
|
+
name: `${nodeName}_network`,
|
|
134
|
+
hocon: `./${nodeName}.network.json`,
|
|
135
|
+
front_man: "specialist_concierge"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
llm_router: {
|
|
139
|
+
base_url: "https://api.otari.ai/api/v1",
|
|
140
|
+
default_model: "alibaba/qwen3.8-flash"
|
|
141
|
+
},
|
|
142
|
+
actions: {
|
|
143
|
+
agentTools: [
|
|
144
|
+
`website_query_inventory`,
|
|
145
|
+
`website_commit_reservation`
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
peer_policy: {
|
|
149
|
+
mode: "open"
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
writeFileSync(join(fullPath, "agent-manifest.json"), JSON.stringify(manifest, null, 2));
|
|
153
|
+
|
|
154
|
+
// 2. <nodeName>.network.json
|
|
155
|
+
const network = {
|
|
156
|
+
tools: [
|
|
157
|
+
{
|
|
158
|
+
name: "specialist_concierge",
|
|
159
|
+
role: "Specialist Provider Concierge",
|
|
160
|
+
instructions: `You are the ${nodeName} autonomous agent concierge. Inspect open inventory using website_query_inventory, and once the traveler approves, secure the booking directly via website_commit_reservation.`,
|
|
161
|
+
function: {
|
|
162
|
+
parameters: {
|
|
163
|
+
type: "object",
|
|
164
|
+
properties: {
|
|
165
|
+
request: { type: "string" }
|
|
166
|
+
},
|
|
167
|
+
required: ["request"]
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
};
|
|
173
|
+
writeFileSync(join(fullPath, `${nodeName}.network.json`), JSON.stringify(network, null, 2));
|
|
174
|
+
|
|
175
|
+
// 3. site-actions.js
|
|
176
|
+
const actionsJs = `// Grounded executable site actions for ${nodeName}
|
|
177
|
+
import { defineAction, createActionRegistry } from "open-agentic-web";
|
|
178
|
+
|
|
179
|
+
export class SiteActions {
|
|
180
|
+
static registerActions(registry) {
|
|
181
|
+
registry.register(
|
|
182
|
+
defineAction({
|
|
183
|
+
name: "website_query_inventory",
|
|
184
|
+
description: "Check live provider availability with zero middleman markup.",
|
|
185
|
+
effect: "read",
|
|
186
|
+
inputSchema: {
|
|
187
|
+
type: "object",
|
|
188
|
+
properties: {
|
|
189
|
+
category: { type: "string" }
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
execute: async (args) => {
|
|
193
|
+
return { ok: true, available: true, items: [] };
|
|
194
|
+
}
|
|
195
|
+
})
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
registry.register(
|
|
199
|
+
defineAction({
|
|
200
|
+
name: "website_commit_reservation",
|
|
201
|
+
description: "Confirm and commit a direct provider reservation.",
|
|
202
|
+
effect: "irreversible",
|
|
203
|
+
inputSchema: {
|
|
204
|
+
type: "object",
|
|
205
|
+
properties: {
|
|
206
|
+
item_id: { type: "string" }
|
|
207
|
+
},
|
|
208
|
+
required: ["item_id"]
|
|
209
|
+
},
|
|
210
|
+
execute: async (args) => {
|
|
211
|
+
return { ok: true, booking_id: "RES-" + Math.floor(1000 + Math.random() * 9000), status: "CONFIRMED" };
|
|
212
|
+
}
|
|
213
|
+
})
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
`;
|
|
218
|
+
writeFileSync(join(fullPath, "site-actions.js"), actionsJs);
|
|
219
|
+
|
|
220
|
+
// 4. bridge/action-bridge.html
|
|
221
|
+
const bridgeHtml = `<!doctype html>
|
|
222
|
+
<html lang="en">
|
|
223
|
+
<head>
|
|
224
|
+
<meta charset="utf-8">
|
|
225
|
+
<title>Action Bridge - ${nodeName}</title>
|
|
226
|
+
<script type="module">
|
|
227
|
+
import { createActionRegistry, setupActionBridge } from "open-agentic-web";
|
|
228
|
+
import { SiteActions } from "../site-actions.js";
|
|
229
|
+
|
|
230
|
+
const registry = createActionRegistry();
|
|
231
|
+
SiteActions.registerActions(registry);
|
|
232
|
+
setupActionBridge({ registry });
|
|
233
|
+
</script>
|
|
234
|
+
</head>
|
|
235
|
+
<body></body>
|
|
236
|
+
</html>
|
|
237
|
+
`;
|
|
238
|
+
writeFileSync(join(bridgeDir, "action-bridge.html"), bridgeHtml);
|
|
239
|
+
|
|
240
|
+
// 5. links.json
|
|
241
|
+
const links = {
|
|
242
|
+
networks: {
|
|
243
|
+
[`${nodeName}_network`]: {}
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
writeFileSync(join(fullPath, "links.json"), JSON.stringify(links, null, 2));
|
|
247
|
+
|
|
248
|
+
console.log(`\n${colors.green}${colors.bold}β¨ Scaffolding complete!${colors.reset}`);
|
|
249
|
+
console.log(`Created conforming Open Agentic Web node at: ${colors.cyan}${fullPath}${colors.reset}`);
|
|
250
|
+
console.log(`Files generated:
|
|
251
|
+
βββ agent-manifest.json
|
|
252
|
+
βββ ${nodeName}.network.json
|
|
253
|
+
βββ site-actions.js
|
|
254
|
+
βββ bridge/action-bridge.html
|
|
255
|
+
βββ links.json\n`);
|
|
256
|
+
console.log(`Verify conformance with: ${colors.cyan}npx open-agentic-web validate ${targetDir}${colors.reset}\n`);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
async function runInspect() {
|
|
260
|
+
const targetDir = args[1] || ".";
|
|
261
|
+
const manifestPath = join(resolve(targetDir), "agent-manifest.json");
|
|
262
|
+
if (!existsSync(manifestPath)) {
|
|
263
|
+
console.error(`${colors.red}Error: No 'agent-manifest.json' found at ${targetDir}${colors.reset}`);
|
|
264
|
+
process.exit(1);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const manifest = JSON.parse(readFileSync(manifestPath, "utf-8"));
|
|
268
|
+
console.log(`\n${colors.bold}π Agentic Node Inspection: ${manifest.name}${colors.reset}`);
|
|
269
|
+
console.log(`Description: ${manifest.description || "N/A"}`);
|
|
270
|
+
console.log(`Specification: ${manifest.specification || "N/A"}`);
|
|
271
|
+
console.log(`LLM Router: ${manifest.llm_router?.base_url || "N/A"} (${manifest.llm_router?.default_model || "N/A"})`);
|
|
272
|
+
console.log(`Registered Agent Tools (${manifest.actions?.agentTools?.length || 0}):`);
|
|
273
|
+
manifest.actions?.agentTools?.forEach(t => console.log(` β’ ${colors.cyan}${t}${colors.reset}`));
|
|
274
|
+
console.log("");
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
switch (command) {
|
|
278
|
+
case "validate":
|
|
279
|
+
case "test":
|
|
280
|
+
case "check":
|
|
281
|
+
runValidate();
|
|
282
|
+
break;
|
|
283
|
+
case "federation":
|
|
284
|
+
runFederation();
|
|
285
|
+
break;
|
|
286
|
+
case "init":
|
|
287
|
+
case "scaffold":
|
|
288
|
+
case "new":
|
|
289
|
+
runInit();
|
|
290
|
+
break;
|
|
291
|
+
case "inspect":
|
|
292
|
+
runInspect();
|
|
293
|
+
break;
|
|
294
|
+
case "version":
|
|
295
|
+
case "-v":
|
|
296
|
+
case "--version":
|
|
297
|
+
console.log("open-agentic-web v1.0.0");
|
|
298
|
+
break;
|
|
299
|
+
case "help":
|
|
300
|
+
case "--help":
|
|
301
|
+
default:
|
|
302
|
+
printHelp();
|
|
303
|
+
break;
|
|
304
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "open-agentic-web",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Standard developer toolkit, conformance linter & in-browser runtime for the Open Agentic Web (Cognizant / Mozilla / MIT NANDA MVP Profile 0.3)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./src/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"open-agentic-web": "./bin/cli.mjs",
|
|
9
|
+
"oaw": "./bin/cli.mjs"
|
|
10
|
+
},
|
|
11
|
+
"exports": {
|
|
12
|
+
".": "./src/index.js",
|
|
13
|
+
"./actions": "./src/actions.js",
|
|
14
|
+
"./validator": "./src/validator.js",
|
|
15
|
+
"./bridge": "./src/bridge.js",
|
|
16
|
+
"./federation": "./src/federation.js"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"test": "node test/validator.test.mjs && node test/actions.test.mjs && node test/federation.test.mjs"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"open-agentic-web",
|
|
23
|
+
"agentic-web",
|
|
24
|
+
"ai-agents",
|
|
25
|
+
"neuro-san",
|
|
26
|
+
"nsdeploy",
|
|
27
|
+
"multi-agent",
|
|
28
|
+
"byok",
|
|
29
|
+
"federation",
|
|
30
|
+
"web-agents",
|
|
31
|
+
"cognizant"
|
|
32
|
+
],
|
|
33
|
+
"author": "TripSteward & Open Agentic Web Community",
|
|
34
|
+
"license": "Apache-2.0",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/Elroi-thecreator/tripsteward-agentic-travel.git",
|
|
38
|
+
"directory": "packages/open-agentic-web"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/Elroi-thecreator/tripsteward-agentic-travel#readme",
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/Elroi-thecreator/tripsteward-agentic-travel/issues"
|
|
43
|
+
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
},
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=18.0.0"
|
|
49
|
+
}
|
|
50
|
+
}
|