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
16 changes: 16 additions & 0 deletions submissions/mcp-hackathon/kele0929-venueclock/RIGHTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Submission rights declaration

Project: `VenueClock`
Submission slug: `kele0929-venueclock`
Submitter: `kele0929`
Date: `2026-09-04`

The submitter confirms that they own, or have sufficient authorization for, the source code, dependencies, service, data, branding, and other materials submitted in this pull request.

Subject to the official program terms, the submitter authorizes X-Agent to retain, reproduce, audit, test, archive, and publish the submitted program artifact for judging, fraud prevention, dispute handling, ecosystem submission, and post-award accountability. Closing the pull request, deleting a fork, or deleting an external repository does not revoke the official archive rights attached to an accepted and rewarded entry.

Third-party components and their licenses: none. Runtime has no npm dependencies. Holiday dates were transcribed from public exchange/government calendars (Nasdaq Trader 2026 holiday schedule; NYSE Group holiday schedule; GOV.UK bank holidays) as facts, not as copied software.

Exceptions or restrictions: none

This template is an operational declaration, not a substitute for event terms reviewed by qualified counsel.
59 changes: 59 additions & 0 deletions submissions/mcp-hackathon/kele0929-venueclock/SUBMISSION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# VenueClock

## Capability

- **One-line description:** Return the market session state (pre-market, regular, after-hours, holiday, weekend, or closed) and next open/close for NYSE, Nasdaq, LSE, and 24/7 crypto.
- **Who it helps:** AI agents and tools that must not hallucinate trading hours, DST, or 2026 exchange holidays when scheduling or explaining market availability.
- **Capability boundary:** Session calendars only. No orders, prices, wallet scoring, exploit detection, or financial advice. Named holidays are encoded for 2026.

## Live API

- **API base URL:** https://kele0929.github.io/v1
- **Health-check URL:** https://kele0929.github.io/health.json
- **Authentication:** none
- **Rate limits / known limits:** Public GitHub Pages. Keep request volume modest. JSON bodies are small. Unknown static paths return GitHub Pages HTML 404; the Node server in `source/` returns JSON 404/400 instead.
- **API contract:** `source/openapi.json` and `source/README.md`

## Source and reproducibility

- **Source repository:** https://github.com/kele0929/venueclock
- **Review commit:** `d1b84e00cb87b7e8811a020f497855b67bc00303`
- **Source submitted in this PR:** `source/`
- **Run tests:** `npm test`
- **Run locally:** `REVIEW_COMMIT=$(git rev-parse HEAD) npm start` then `curl http://127.0.0.1:8787/health.json`
- **Deploy:** `REVIEW_COMMIT=<review commit> npm run generate -- --out ./site` and publish `site/` to the GitHub Pages user site `kele0929/kele0929.github.io` on `main`
- **Version binding:** `GET /health.json` and `GET /.well-known/xagent-verification.json` both report commit `d1b84e00cb87b7e8811a020f497855b67bc00303`

The API exposes:

```json
// GET https://kele0929.github.io/health.json
{"status":"ok","commit":"d1b84e00cb87b7e8811a020f497855b67bc00303"}
```

```json
// GET https://kele0929.github.io/.well-known/xagent-verification.json
{"schemaVersion":1,"slug":"kele0929-venueclock","commit":"d1b84e00cb87b7e8811a020f497855b67bc00303"}
```

## Verification

The reproducible call instructions and redacted example responses are in `verification/README.md`.

- **Health-check result:** HTTP 200 JSON `status=ok` with the review commit
- **Capability call:** `GET /v1/resolve/xnys/2026-09-04.json` returns Friday sessions including regular 09:30–16:00 America/New_York
- **Expected error behavior:** `GET /v1/resolve/xnys/2026-09-07.json` is Labor Day (`status=holiday`, empty sessions). Invalid dates / unknown venues on the Node server return JSON 400/404.

## Security and data handling

- **Data collected:** none
- **Purpose and retention:** none
- **Third parties / outbound network calls:** none at runtime (static JSON). Holiday tables were compiled from public Nasdaq/NYSE and GOV.UK calendars at build time.
- **Secrets:** No secrets are committed. Review access is supplied only through an approved private channel when required.
- **Known risks / restrictions:** Calendars can change if an exchange publishes an unscheduled close. This snapshot is the 2026 schedule encoded in source. Not trading advice.

## Support

- **Team / builder:** kele0929
- **Contact:** GitHub @kele0929 · 1253719405@qq.com
- **License / rights:** MIT. The submitter authored this source and authorizes review, archival, and deployment under the program terms.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: test
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: npm test
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
site/
.DS_Store
21 changes: 21 additions & 0 deletions submissions/mcp-hackathon/kele0929-venueclock/source/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 kele0929

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
99 changes: 99 additions & 0 deletions submissions/mcp-hackathon/kele0929-venueclock/source/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# VenueClock

Deterministic **market-session calendar** that AI agents can call. Given a venue and a timestamp (or a calendar date), it returns whether that market is in pre-market, regular hours, after-hours, holiday, weekend, or closed, plus the next open or close.

This is an Open Innovation entry for the [X-Agent AI MCP Hackathon 2026](https://xagt.ai/hackathon?lang=en). It is **not** a trading bot, not a risk scorer, and not an on-chain security tool.

- Live API origin: https://kele0929.github.io
- Source: https://github.com/kele0929/venueclock
- MCP tool list: https://kele0929.github.io/mcp/tools.json
- Local MCP stdio: `node src/mcp.js`

## Why this is agent-useful

Agents that schedule orders, fetch prices, or write “is the market open?” answers routinely hallucinate holidays, early closes, and DST. VenueClock answers from explicit calendars and session rules, with ISO-8601 timestamps and machine-readable phases.

Supported venues:

| id | MIC | Market | Timezone |
| --- | --- | --- | --- |
| `xnys` | XNYS | New York Stock Exchange | America/New_York |
| `xnas` | XNAS | Nasdaq Stock Market | America/New_York |
| `xlon` | XLON | London Stock Exchange | Europe/London |
| `crypto` | — | 24/7 crypto (synthetic) | UTC |

US 2026 holidays and 13:00 ET early closes follow the Nasdaq / NYSE 2026 calendars. LSE 2026 dates follow UK bank holidays. Crypto is always in `regular`.

## HTTP API

All JSON, CORS `*`, no authentication.

| Method | Path | Purpose |
| --- | --- | --- |
| GET | `/health.json` | `{ "status": "ok", "commit": "<sha>" }` |
| GET | `/.well-known/xagent-verification.json` | X-Agent deployment proof |
| GET | `/v1/venues.json` | Venue index |
| GET | `/v1/venues/{id}.json` | Rules, sessions, 2026 holidays |
| GET | `/v1/resolve/{id}/{YYYY-MM-DD}.json` | Full day schedule in the venue timezone |
| GET | `/v1/resolve?venue={id}&at={iso8601}` | Instant session state (Node server) |
| GET | `/mcp/tools.json` | MCP tool descriptors |

The GitHub Pages deploy is a static snapshot of the same router used by `node src/server.js`. Instant query-string resolve is available on the Node server; the public Pages origin exposes the day-schedule capability plus health/proof.

### Example

```bash
curl -sS https://kele0929.github.io/v1/resolve/xnys/2026-09-04.json
```

Friday 4 September 2026 is a normal NYSE day: pre 04:00–09:30, regular 09:30–16:00, after-hours 16:00–20:00 America/New_York (EDT).

```bash
curl -sS https://kele0929.github.io/v1/resolve/xnys/2026-09-07.json
```

Labor Day 2026: `status` is `holiday`, `sessions` is empty.

Unknown venues return HTTP 404 JSON `{ "error": "not_found", ... }`. Invalid dates return HTTP 400.

## Run locally

Requires Node.js 18.17+.

```bash
npm test
REVIEW_COMMIT=$(git rev-parse HEAD) npm start
# http://127.0.0.1:8787/health.json
# http://127.0.0.1:8787/v1/resolve?venue=xnys&at=2026-09-04T15:00:00Z
```

MCP stdio:

```bash
node src/mcp.js
```

Generate the static GitHub Pages snapshot:

```bash
REVIEW_COMMIT=$(git rev-parse HEAD) npm run generate -- --out ./site
```

## Deploy

1. Push this repository to `https://github.com/kele0929/venueclock`.
2. Record `REVIEW_COMMIT=$(git rev-parse HEAD)`.
3. Generate the site with that commit and publish the `site/` tree to `https://github.com/kele0929/kele0929.github.io` on branch `main` (GitHub Pages user site).
4. Confirm:
- `GET https://kele0929.github.io/health.json` → `status=ok` and the same commit
- `GET https://kele0929.github.io/.well-known/xagent-verification.json` → slug `kele0929-venueclock` and the same commit

The Pages origin is `https://kele0929.github.io`, so the well-known proof sits at the origin root as required by X-Agent.

## Boundary

VenueClock reports **session calendars**. It does not place orders, return prices, score wallets, detect exploits, or provide financial advice. Holiday tables cover **2026** (the review year). Other years use the same weekly hours and DST rules but only 2026 named holidays are encoded.

## License

MIT. Builder: kele0929.
46 changes: 46 additions & 0 deletions submissions/mcp-hackathon/kele0929-venueclock/source/openapi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"openapi": "3.0.3",
"info": {
"title": "VenueClock",
"version": "1.0.0",
"description": "Agent-callable market session calendar."
},
"servers": [{ "url": "https://kele0929.github.io" }],
"paths": {
"/health.json": {
"get": {
"summary": "Health and commit binding",
"responses": { "200": { "description": "ok" } }
}
},
"/.well-known/xagent-verification.json": {
"get": {
"summary": "X-Agent deployment proof",
"responses": { "200": { "description": "ok" } }
}
},
"/v1/venues.json": {
"get": {
"summary": "List venues",
"responses": { "200": { "description": "ok" } }
}
},
"/v1/venues/{id}.json": {
"get": {
"summary": "Venue rules",
"parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
"responses": { "200": { "description": "ok" }, "404": { "description": "unknown venue" } }
}
},
"/v1/resolve/{id}/{date}.json": {
"get": {
"summary": "Day schedule",
"parameters": [
{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } },
{ "name": "date", "in": "path", "required": true, "schema": { "type": "string", "format": "date" } }
],
"responses": { "200": { "description": "ok" }, "400": { "description": "bad date" }, "404": { "description": "unknown venue" } }
}
}
}
}
17 changes: 17 additions & 0 deletions submissions/mcp-hackathon/kele0929-venueclock/source/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "venueclock",
"version": "1.0.0",
"private": false,
"type": "module",
"description": "Agent-callable market session calendar: session state, holidays, and next open/close for NYSE, Nasdaq, LSE, and 24/7 crypto.",
"license": "MIT",
"engines": {
"node": ">=18.17"
},
"scripts": {
"start": "node src/server.js",
"mcp": "node src/mcp.js",
"test": "node --test",
"generate": "node src/generate-site.js"
}
}
Loading