Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Validate onX Compliance

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
validate:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install server dependencies
run: npm ci
working-directory: ./server

- name: Build server
run: npm run build
working-directory: ./server

- name: Install validator dependencies
run: npm ci
working-directory: ./validator

- name: Build validator
run: npm run build
working-directory: ./validator

- name: Validate MCP Server
working-directory: ./validator
env:
ADAPTER_TYPE: built-in
ADAPTER_NAME: mock
run: |
node dist/cli/index.js stdio node -a "../server/dist/index.js"

- name: Generate JSON Report
if: always()
working-directory: ./validator
env:
ADAPTER_TYPE: built-in
ADAPTER_NAME: mock
run: |
node dist/cli/index.js stdio node -a "../server/dist/index.js" -f json > compliance-report.json || true
cat compliance-report.json

- name: Upload Compliance Report
if: always()
uses: actions/upload-artifact@v4
with:
name: compliance-report
path: validator/compliance-report.json
39 changes: 20 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
# Node.js dependencies
server/node_modules/
server/npm-debug.log*
server/yarn-debug.log*
server/yarn-error.log*
node_modules/

# Debug logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Environment variables
server/.env
server/.env.local
server/.env.*.local
.env
.env.local
.env.*.local

# Build output
server/dist/
server/build/
server/coverage/
server/.next/
server/.nuxt/
server/.cache/
server/.parcel-cache/
dist/
build/
coverage/
.next/
.nuxt/
.cache/
.parcel-cache/

# OS files
.DS_Store
Thumbs.db

# Logs
server/logs/
server/*.log
logs/
*.log

# Temporary files
tmp/
server/tmp/
server/temp/
server/.tmp/
temp/
.tmp/
working-docs/

# IDE files
Expand Down
55 changes: 55 additions & 0 deletions schemas/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* onX Schema Package
* Canonical definitions for the Order Network eXchange specification
*/

import { createRequire } from 'node:module';

const require = createRequire(import.meta.url);

/**
* Tools required for onX spec compliance
*/
export const ONX_TOOLS = [
// Order operations
'create-sales-order',
'update-order',
'cancel-order',
'fulfill-order',
'create-return',

// Query operations
'get-orders',
'get-customers',
'get-products',
'get-product-variants',
'get-inventory',
'get-fulfillments',
'get-returns',
];

/**
* Load schemas for all tools
*/
function loadSchemas() {
const schemas = new Map();

for (const toolName of ONX_TOOLS) {
try {
const schema = require(`./tool-inputs/${toolName}.json`);
schemas.set(toolName, schema);
} catch {
console.warn(`Warning: Schema file missing for ${toolName}`);
}
}

return schemas;
}

// Export schemas as a Map (loaded once at module initialization)
export const toolInputSchemas = loadSchemas();

// Export getter for individual schema
export function getToolInputSchema(toolName) {
return toolInputSchemas.get(toolName) || null;
}
9 changes: 9 additions & 0 deletions schemas/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "@onx/schemas",
"version": "1.0.0",
"description": "Canonical onX data schemas",
"type": "module",
"exports": {
".": "./index.js"
}
}
Loading