npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ovigroup/oap-devkit

v1.0.15

Published

OAP-Devkit MCP client — connect AI IDE to OAP Meta platform

Readme

@ovigroup/oap-devkit

Thin npm client cho OAP Meta MCP. Package này không phải nơi chứa implementation MCP chính.

Source of truth

Vai trò của package này

Package packages/oap-devkit/src/index.jspackages/oap-devkit/bin/oap-devkit.js chịu trách nhiệm:

  • stdio ↔ SSE/HTTP proxy cho AI IDE
  • profile / token management
  • reconnect / session bootstrap
  • local cache cho tools/resources
  • optional runtimeBaseUrl persistence cho browser preview / runtime verification flow
  • file-based preprocessing cho page và plugin authoring (v1.0.9+)
  • auto-clear cache khi npm version thay đổi (v1.0.11+)

File-Based Preprocessing

Client tự động xử lý local file paths và convert sang inline content cho server:

Page Tools

| Tool | File Parameters | Processing | |------|-----------------|------------| | update_page | metadataFile, translationsFile, eventsFile, pageTourFile, pageTourTranslationsFile, approvalFile | Read JSON → parse → inline → delete path |

Workflow:

// 1. Download page to local
inspect_page({ workspaceCode, appCode, pageCode });
// → Files written to: oap-devkit/page-builder/{ws}/{app}/{pageCode}/

// 2. Edit local files (metadata.json, translations.json, etc.)

// 3. Update page with file path
update_page({ 
  workspaceCode, appCode, pageCode,
  metadataFile: 'D:/DEV/oap-platform/oap-devkit/page-builder/OVI_SUITE/hcm/MY_PAGE/metadata.json'
});
// → Client reads file, inlines content, sends to server

Plugin Tools

| Tool | File Parameters | Processing | |------|-----------------|------------| | deploy_plugin | sourcePath (folder) | Read folder structure → map to filesContent → inline → delete path |

Expected Plugin Structure:

plugin-folder/
├── plugin.json              # Top-level metadata (exact match)
├── Component.tsx            # Main component (exact match)
├── Component.css            # Styles (exact match)
├── index.tsx                # Entry point (exact match)
├── sources/                 # SQL resources (flat - NOT recursive)
│   ├── *.sql               # Query type
│   ├── *.plsql             # PL/SQL type
│   └── *.dml               # DML type
├── hooks/                   # Custom hooks (RECURSIVE)
│   └── *.ts, *.tsx, *.js, *.jsx, *.css
├── components/              # Nested components (RECURSIVE)
│   └── *.ts, *.tsx, *.js, *.jsx, *.css
└── utils/                   # Utilities (RECURSIVE)
    └── *.ts, *.tsx, *.js, *.jsx, *.css

Ignored: .backup/, backup/, build/, node_modules/, .git/

Workflow:

// 1. Download plugin to local
inspect_plugin({ workspaceCode, pluginCode });
// → Files written to: oap-devkit/plugin-builder/{ws}/{app}/{code}/

// 2. Edit local files (Component.tsx, sources/*.sql, etc.)

// 3. Deploy with folder path
deploy_plugin({
  workspaceCode, 
  appCode,
  pluginCode,
  sourcePath: 'D:/DEV/oap-platform/oap-devkit/plugin-builder/demo/DEMO/my-plugin'
});
// → Client reads entire folder structure recursively
// → Converts to filesContent map with relative paths
// → Sends inline to server
// → Server runs esbuild and deploys

Report Tools

| Tool | File Parameters | Processing | |------|-----------------|------------| | manage_report, manage_report_template | filePath | Read binary/template file → base64 → inline before forwarding | | report_render response hints | _fileHint._inlineContent | Decode base64 and write binary output under current workspace oap-devkit/reporting-builder/... |

Cross-Platform Path Handling

Client tự động xử lý path normalization cho:

  • ✅ Windows (Git Bash / MINGW64) - giữ forward slashes
  • ✅ Windows (PowerShell / cmd) - convert to backslashes
  • ✅ Linux / macOS

Logic: buildPathCandidates() thử cả forward và backslash variants, không normalize absolute paths.

Version Management

Client tự động clear tools cache khi detect npm version mismatch:

// ~/.oap-devkit/version.txt tracks installed version
// On boot: if version.txt != package.json version → clear tools-cache.json
checkVersionAndClearCache();

Benefit: Không cần manual cache clear sau npm update.

Version History

| Version | Changes | |---------|---------| | v1.0.7 | Path normalization fix (Git Bash compat) | | v1.0.9 | File preprocessing: delete metadataFile after load | | v1.0.10 | File preprocessing: bundlePath & report filePath | | v1.0.11 | Auto-clear cache on version mismatch | | v1.0.12 | deploy_plugin folder preprocessing (basic) | | v1.0.13 | Recursive folder reading with SQL support | | v1.0.14 | Full backend structure match (sources/, hooks/, components/, utils/) | | v1.0.15 | Report tool consolidation, current-workspace auto-download, binary base64 file writes |

Không sửa package này khi

Nếu yêu cầu thuộc các nhóm sau, ưu tiên sửa backend MCP ở oap-meta/backend/src/mcp:

  • thêm MCP tool mới
  • sửa auth / execution context của MCP
  • sửa metadata resources
  • sửa tool registry / JSON schema exposure
  • sửa page/report/plugin/admin MCP behavior

Browser preview config

Tool add_server hỗ trợ thêm runtimeBaseUrl optional để lưu runtime URL riêng cho browser verification.

Ví dụ local profile trong .oap-devkit.json:

{
  "url": "http://localhost:3001",
  "token": "<jwt>",
  "runtimeBaseUrl": "http://localhost:5173"
}

Backend tool get_page_preview sẽ ưu tiên:

  1. runtimeBaseUrl truyền trực tiếp vào tool
  2. runtimeBaseUrl đã lưu trong profile/devkit config
  3. runtime URL derive từ meta URL hoặc fallback localhost

Split trách nhiệm cho get_page_preview

injectScript không còn nhét DEVKIT token trực tiếp vào browser. Thay vào đó backend sinh preview ticket một lần và script sẽ exchange ticket này qua /api/v1/auth/preview/exchange để lấy runtime session/token thật, rồi mới set sessionStorage['token'] và cookie auth_token.

Điểm vào chính

Rule of thumb

Khi ai hỏi "oap-devkit đang được code ở đâu?":

  1. Nếu hỏi về npm client / transport proxy → trả lời packages/oap-devkit
  2. Nếu hỏi về implementation MCP chính / source of truth → trả lời oap-meta/backend/src/mcp