Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

feat: add JavaScript and TypeScript SDK (#3147)

yufeng0536e6897b02
diff --git a/.github/workflows/typescript-sdk-release.yml b/.github/workflows/typescript-sdk-release.yml
new file mode 100644
index 000000000..9d9b6b543
--- /dev/null
+++ b/.github/workflows/typescript-sdk-release.yml
@@ -0,0 +1,59 @@
+name: TypeScript SDK Release
+
+on:
+ push:
+ tags:
+ - "typescript-sdk@*"
+ workflow_dispatch:
+
+permissions:
+ contents: read
+ id-token: write
+
+jobs:
+ publish:
+ runs-on: ubuntu-24.04
+ defaults:
+ run:
+ working-directory: sdk/typescript
+ steps:
+ - uses: actions/checkout@v6
+ - uses: actions/setup-node@v6
+ with:
+ node-version: "24"
+ registry-url: https://registry.npmjs.org
+ cache: npm
+ cache-dependency-path: sdk/typescript/package-lock.json
+ - run: npm ci
+ - name: Validate package
+ run: |
+ npm run typecheck
+ npm run format:check
+ npm run build
+ npm run test:browser
+ npm test
+ npm pack --dry-run
+ - name: Validate release tag
+ if: github.event_name == 'push'
+ env:
+ RELEASE_TAG: ${{ github.ref_name }}
+ run: |
+ PACKAGE_VERSION="$(node -p "require('./package.json').version")"
+ test "$RELEASE_TAG" = "typescript-sdk@$PACKAGE_VERSION"
+ - name: Check whether version already exists
+ id: published
+ run: |
+ PACKAGE_VERSION="$(node -p "require('./package.json').version")"
+ if npm view "@openviking/sdk@$PACKAGE_VERSION" version --registry=https://registry.npmjs.org >/dev/null 2>&1; then
+ echo "exists=true" >> "$GITHUB_OUTPUT"
+ echo "@openviking/sdk@$PACKAGE_VERSION already exists; skipping."
+ else
+ echo "exists=false" >> "$GITHUB_OUTPUT"
+ fi
+ - name: Publish package
+ if: steps.published.outputs.exists == 'false'
+ env:
+ # Required for the first automated publish. After @openviking/sdk has
+ # a Trusted Publisher configured for this workflow, npm prefers OIDC.
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
+ run: npm publish --access public --provenance
diff --git a/docs/en/api/01-overview.md b/docs/en/api/01-overview.md
index 51da8de15..8de8ac434 100644
--- a/docs/en/api/01-overview.md
+++ b/docs/en/api/01-overview.md
@@ -110,6 +110,32 @@ deployments or gateways that explicitly forward tenant identity.
It does not implement Python embedded mode or legacy `agent_id` compatibility.
See [`sdk/go/README.md`](../../../sdk/go/README.md) for package-level examples.
+#### JavaScript/TypeScript SDK Client
+
+The JavaScript/TypeScript SDK is an HTTP-only client for Node.js 18+ and modern
+browsers. It ships ESM, CommonJS and TypeScript declarations.
+
+```bash
+npm install @openviking/sdk
+```
+
+```ts
+import { OpenVikingClient } from "@openviking/sdk";
+
+const client = new OpenVikingClient({
+ baseUrl: "http://localhost:1933",
+ apiKey: "your-key",
+});
+
+const results = await client.search("deployment guide", {
+ targetUri: "viking://resources",
+});
+```
+
+It uses the same identity headers and response envelope as the Python and Go
+HTTP clients. See [`sdk/typescript/README.md`](../../../sdk/typescript/README.md)
+for package-level examples.
+
When `url` is not explicitly provided, the HTTP client automatically reads connection information from `ovcli.conf`. `ovcli.conf` is a configuration file shared between the HTTP client and CLI. Default path: `~/.openviking/ovcli.conf`. You can also specify the path via environment variable:
```bash
diff --git a/docs/zh/api/01-overview.md b/docs/zh/api/01-overview.md
index 14098cfa3..9ab4bc50a 100644
--- a/docs/zh/api/01-overview.md
+++ b/docs/zh/api/01-overview.md
@@ -106,6 +106,31 @@ Go SDK 发送的身份请求头与 Python HTTP client 一致:
Go SDK 不支持 Python embedded 模式,也不保留旧 `agent_id` 兼容路径。更多示例见 [`sdk/go/README_CN.md`](../../../sdk/go/README_CN.md)。
+#### JavaScript/TypeScript SDK 客户端
+
+JavaScript/TypeScript SDK 是面向 Node.js 18+ 和现代浏览器的 HTTP-only 客户端,
+同时发布 ESM、CommonJS 和 TypeScript 类型声明。
+
+```bash
+npm install @openviking/sdk
+```
+
+```ts
+import { OpenVikingClient } from "@openviking/sdk";
+
+const client = new OpenVikingClient({
+ baseUrl: "http://localhost:1933",
+ apiKey: "your-key",
+});
+
+const results = await client.search("部署文档", {
+ targetUri: "viking://resources",
+});
+```
+
+它与 Python、Go HTTP Client 使用相同的身份请求头和响应信封。更多示例见
+[`sdk/typescript/README_CN.md`](../../../sdk/typescript/README_CN.md)。
+
未显式传入 `url` 时,HTTP 客户端会自动从 `ovcli.conf` 读取连接信息。`ovcli.conf` 是 HTTP 客户端和 CLI 共享的配置文件,默认路径 `~/.openviking/ovcli.conf`,也可通过环境变量指定:
```bash
diff --git a/sdk/typescript/README.md b/sdk/typescript/README.md
new file mode 100644
index 000000000..43271edef
--- /dev/null
+++ b/sdk/typescript/README.md
@@ -0,0 +1,31 @@
+# @openviking/sdk
+
+Lightweight JavaScript and TypeScript HTTP client for an existing OpenViking server. It targets modern browsers and Node.js 18+ and has no runtime dependencies.
+
+```bash
+npm install @openviking/sdk
+```
+
+```ts
+import { OpenVikingClient } from "@openviking/sdk";
+
+const client = new OpenVikingClient({
+ baseUrl: "http://127.0.0.1:1933",
+ apiKey: "your-key",
+ // Optional: keep this aligned with deployments that require an upload mode.
+ uploadMode: "proxy",
+});
+
+const results = await client.search("deployment guide", {
+ targetUri: "viking://resources",
+ limit: 10,
+});
+```
+
+The client follows the same HTTP API, identity headers, response envelope and error codes as `openviking-sdk` for Python and the Go SDK. It supports resources and skills, filesystem/content operations, retrieval, sessions, tasks, watches, observer status and tenant administration.
+
+Local browser files can be passed as `Blob` or `File`. In Node.js, an existing string path is uploaded automatically (directories are zipped); other strings are sent to the server as URLs or server-side paths. Browsers cannot read arbitrary local paths, so browser applications should use a URL or file object.
+
+## Release
+
+Pushing a tag such as `[email protected]` publishes the matching package version automatically. The same workflow can be started manually from GitHub Actions. The first publish uses the repository `NPM_TOKEN` with `@openviking` scope access; after the package exists, configure npm Trusted Publishing for repository `volcengine/OpenViking` and workflow `typescript-sdk-release.yml` so subsequent publishes use OIDC like `@openviking/cli`.
diff --git a/sdk/typescript/README_CN.md b/sdk/typescript/README_CN.md
new file mode 100644
index 000000000..cf9d27d63
--- /dev/null
+++ b/sdk/typescript/README_CN.md
@@ -0,0 +1,31 @@
+# @openviking/sdk
+
+OpenViking 的轻量级 JavaScript/TypeScript HTTP SDK,面向现代浏览器和 Node.js 18+,没有运行时依赖。
+
+```bash
+npm install @openviking/sdk
+```
+
+```ts
+import { OpenVikingClient } from "@openviking/sdk";
+
+const client = new OpenVikingClient({
+ baseUrl: "http://127.0.0.1:1933",
+ apiKey: "your-key",
+ // 可选:部分部署会要求指定上传模式。
+ uploadMode: "proxy",
+});
+
+const results = await client.search("部署文档", {
+ targetUri: "viking://resources",
+ limit: 10,
+});
+```
+
+SDK 与 Python `openviking-sdk`、Go SDK 使用相同的 HTTP API、身份请求头、响应信封和错误码,覆盖资源与技能、文件系统与内容、检索、会话、任务、Watch、Observer 状态和租户管理接口。
+
+浏览器本地文件可直接传入 `Blob` 或 `File`。Node.js 中存在的字符串路径会自动上传(目录会先压缩);其他字符串会作为 URL 或服务端路径发送。浏览器无法读取任意本地路径,因此浏览器场景应传 URL 或文件对象。
+
+## 发布
+
+推送 `[email protected]` 格式的 tag 会自动发布对应版本,也可以从 GitHub Actions 手动触发同一 workflow。首次发布使用具备 `@openviking` scope 权限的仓库 `NPM_TOKEN`;包创建后,需要在 npm 为仓库 `volcengine/OpenViking` 和 workflow `typescript-sdk-release.yml` 配置 Trusted Publisher,后续发布即可像 `@openviking/cli` 一样使用 OIDC。
diff --git a/sdk/typescript/package-lock.json b/sdk/typescript/package-lock.json
new file mode 100644
index 000000000..fd4f96fb9
--- /dev/null
+++ b/sdk/typescript/package-lock.json
@@ -0,0 +1,2068 @@
+{
+ "name": "@openviking/sdk",
+ "version": "0.1.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "@openviking/sdk",
+ "version": "0.1.0",
+ "license": "Apache-2.0",
+ "devDependencies": {
+ "@types/node": "^22.15.3",
+ "fflate": "^0.8.2",
+ "prettier": "^3.6.2",
+ "tsup": "^8.5.0",
+ "typescript": "^5.8.3",
+ "vitest": "^3.2.4"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/aix-ppc64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz",
+ "integrity": "sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.7.tgz",
+ "integrity": "sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.7.tgz",
+ "integrity": "sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.7.tgz",
+ "integrity": "sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.7.tgz",
+ "integrity": "sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.7.tgz",
+ "integrity": "sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.7.tgz",
+ "integrity": "sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.7.tgz",
+ "integrity": "sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.7.tgz",
+ "integrity": "sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.7.tgz",
+ "integrity": "sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ia32": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.7.tgz",
+ "integrity": "sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-loong64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.7.tgz",
+ "integrity": "sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-mips64el": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.7.tgz",
+ "integrity": "sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ppc64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.7.tgz",
+ "integrity": "sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-riscv64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.7.tgz",
+ "integrity": "sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-s390x": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.7.tgz",
+ "integrity": "sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.7.tgz",
+ "integrity": "sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.7.tgz",
+ "integrity": "sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.7.tgz",
+ "integrity": "sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.7.tgz",
+ "integrity": "sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.7.tgz",
+ "integrity": "sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.7.tgz",
+ "integrity": "sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/sunos-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.7.tgz",
+ "integrity": "sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.7.tgz",
+ "integrity": "sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-ia32": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.7.tgz",
+ "integrity": "sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.7.tgz",
+ "integrity": "sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@jridgewell/gen-mapping": {
+ "version": "0.3.13",
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
+ "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.5.0",
+ "@jridgewell/trace-mapping": "^0.3.24"
+ }
+ },
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.5.5",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
+ "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.31",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
+ "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.1.0",
+ "@jridgewell/sourcemap-codec": "^1.4.14"
+ }
+ },
+ "node_modules/@rollup/rollup-android-arm-eabi": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.2.tgz",
+ "integrity": "sha512-6o7ZLZK+BeenkZCFNDXqpbjw9bD6nuWonvS/lwQJp7NoVVxm6p3qE7qQ5jGuBjiFsgvqjD8mZAU5oWxTmbOeOg==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-android-arm64": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.2.tgz",
+ "integrity": "sha512-BaH7BllCACHoH1LguOU56UItGfUWjujlO65kS9LAodViaN4bwIKd7oeW/ZHJ/4ljr/7MIiENnNy3HJ0zXv8Zkw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-arm64": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.2.tgz",
+ "integrity": "sha512-v39RCCvj4He82I9sFmk+M1VZ0PLM9sfsLVikjfx2hYBNALhrrOR2D3JjQA6AhlaSOgcR+RzrKY7e1+bT6SUO/A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-x64": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.2.tgz",
+ "integrity": "sha512-yl0y2vq3S3lHeuXhEdss6TWfKW8vkujImO12tn4ZkG/4oghr09LvdYm2RElVjokTQiUvDUGXLGsYeLqUMCKpGA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-arm64": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.2.tgz",
+ "integrity": "sha512-tT4pvt4qXD+vEoezupCWi+a1F0vvDiksiHc+PxRlYTOH1I6/X4id9jPxTP+Fg+545euaFT1jJVs4CEdHZAU1vw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-x64": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.2.tgz",
+ "integrity": "sha512-6nU5F2wCW+qvCBhTn1pdIU3bzsIoF7EUwsCDRxilWGprQR6yd508YnH9+OKFCwpfS8pjZqDUmnCAr7exax0XCg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.2.tgz",
+ "integrity": "sha512-n1GJHPOvpIfhi3TmrCeh6S6URt9BFCt0KQE3qvexyGCTAKpR4Lg+eWvNZEqu7epxwus/8ElT3hacYEucm49SZg==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-musleabihf": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.2.tgz",
+ "integrity": "sha512-JqgflS8wEB+UXV/vS1RpRbifGBeN4D5lz8D8oOFbFZw4vedvdOgCFAjfBmIMdW3yL10XpQQ0Ambepw6MXrhOnA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-gnu": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.2.tgz",
+ "integrity": "sha512-wnFJkogWvN4jm/hQRF2UBaeUmk20j5+DmHvoyWii2b8HJDyvz1MF2OU/6ynXt2KR63rbZLWkFpoytpdc/yBuSA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-musl": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.2.tgz",
+ "integrity": "sha512-HVu2bp0zhvJ8xHEV9+UUs7S90VadmBSY3LcIMvozbPo4AuMGDWlz3ymHLHZPX4hR67TKTt8Qp5PJ5RBg/i+RMQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-loong64-gnu": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.2.tgz",
+ "integrity": "sha512-mQqqAV8QaoSgr9I2fKDLY2BAVvmKjWoGiu/cSYQonsLvtqwEn1E4QYfnCOcp5zoEqNhsDYin1s6jx/VJmrxlZg==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-loong64-musl": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.2.tgz",
+ "integrity": "sha512-IxKLoxCQ2IWi6bT2akyDUBGsOImDKB+sPp4EsTmwFQ/fMwpCKm8uLSSgP/Kx/QYUgKis6SEZ5/Nlhup0DIA0PQ==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-ppc64-gnu": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.2.tgz",
+ "integrity": "sha512-Mk5ha2RQSgyFfmYYLkBpPnUk8D8FriBxesO1u9O75X0mHgXL1UQcH5Itl2lurWL2tj0RxV9b9tJgipac0hRY9A==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-ppc64-musl": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.2.tgz",
+ "integrity": "sha512-CjvEnqJL/0/TQ3TXX3OPIJ/kmBellrWd4heXUmHeJlTnmwjKpSJzoehLaL6Xk0ZnMHBu9dZuFADNOrtjF4v+2w==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-gnu": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.2.tgz",
+ "integrity": "sha512-1SiZbzwdkaDURsew/tSOrooKiYy7EQGT6m8ufavAi9NEyQb/6VuIxFXAL1fqa4iZe3g4NbNk4P7J32z2tw5Mgg==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-musl": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.2.tgz",
+ "integrity": "sha512-nQts12zJ3NQRoE6uYljOH89v7szzLDvG2JD/vsX+vGXU8w/At1GowTZ5/7qeFQ8m7L55rpR8Okugnuo5bgjy2Q==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-s390x-gnu": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.2.tgz",
+ "integrity": "sha512-E9/ll019jhPIJgpzfZoIkBGhcz+kKNgVWYRY0zr9srBdPPFVpvOKW8VaJKUbeK+eZXyQF9ltME+Kk6affeaPgg==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-gnu": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.2.tgz",
+ "integrity": "sha512-5BqxR/pshjey51iliyzTD5Xi3EN0aLmQ2lZ3lvefVV9c82BvrLo2/6OT55iifpWBufs6kdwWbuOKS841DrmK9A==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-musl": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.2.tgz",
+ "integrity": "sha512-uNN83XxQrRAh/w0/pmAfibcwyb6YWt4gP+dpnQKPVJshAloQ785ii8CT8ZCIxkGg9opVsvAlGhFitSm6D1Jjpg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-openbsd-x64": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.2.tgz",
+ "integrity": "sha512-srjEIxSH3LRnJN6THczDHWQplqEMFiAJrTab0msUryh9kwNpkICf3Ea6q6MN/2cZwRFUNx5w+h6Hpi4QuHS6Zg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-openharmony-arm64": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.2.tgz",
+ "integrity": "sha512-8hOJnxgbyObnCm5AlRA3A931xX19xq80RjVTKgJOvEKWqJruP/Uf12IbAOaDjjEXYRewwHLfmF0YRIdK3OwKWA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-arm64-msvc": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.2.tgz",
+ "integrity": "sha512-mmF4AY1i0hG/bLWUctUq59gtmgaSIRa3cu/A3JFRp/sCNEme2bgDEiDS22P9FbnJB8NJNF4jPJiSP5RHQpUTDg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-ia32-msvc": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.2.tgz",
+ "integrity": "sha512-DZgkknc6jhHrk46V25vbAM0zZkyP0nSDkJB8/dRkLTxv470dOmWDqGoEJl/9A0dFfS7yE3REOwNDxpHwSLSt0Q==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-gnu": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.2.tgz",
+ "integrity": "sha512-T6xr6ucWSFto+VGajA8YH26LdpHRuP4YLHEKAtCWvJDOlnmWcDZVCI2Jmjr+IFHDlt2zRaTAKE4tfjTaWLgJBg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-msvc": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.2.tgz",
+ "integrity": "sha512-BfzEnDJOt9T8M989/lA37EcJgat01wLRnoi5dQf3QzOH7jzpqTAzdDbVfRljVr5r+jzKqpbHeyOfAaXxAd0PAA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@types/chai": {
+ "version": "5.2.3",
+ "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz",
+ "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/deep-eql": "*",
+ "assertion-error": "^2.0.1"
+ }
+ },
+ "node_modules/@types/deep-eql": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz",
+ "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/estree": {
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz",
+ "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/node": {
+ "version": "22.20.1",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.1.tgz",
+ "integrity": "sha512-EANqOCF9QFyra+4pfxUcX9STKJpCLjMbObVzljIJomAWSnuSIEAvyzEU53GaajbXJEgdh0iEcPL+DGvpUd4k1Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "undici-types": "~6.21.0"
+ }
+ },
+ "node_modules/@vitest/expect": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.7.tgz",
+ "integrity": "sha512-E8eBXaKibuvH2pSZErOjdVb5vF4PbKYcrnluBTYxEk1l/VhhwZg1kZQsdtjq+CsF5CFydf2Rdkz7jDHKSisi3w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/chai": "^5.2.2",
+ "@vitest/spy": "3.2.7",
+ "@vitest/utils": "3.2.7",
+ "chai": "^5.2.0",
+ "tinyrainbow": "^2.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/mocker": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.7.tgz",
+ "integrity": "sha512-Trr0hYO9CM3Wj6ksWHRhK9IZpIY6wTMO5u/MqXurMxT57sWBaOPEtP3Oq60ihZuh5JsiagKfz95OcxdEP6dBrA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/spy": "3.2.7",
+ "estree-walker": "^3.0.3",
+ "magic-string": "^0.30.17"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ },
+ "peerDependencies": {
+ "msw": "^2.4.9",
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0"
+ },
+ "peerDependenciesMeta": {
+ "msw": {
+ "optional": true
+ },
+ "vite": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@vitest/pretty-format": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.7.tgz",
+ "integrity": "sha512-KUHlwqVu0sRlhCdyPdQ/wBoTfRahjUky1MubOmYw9fWfIZy1gNoHpuaaQBPAaMaVYdQYHJLurzj8ECCj5OwTqA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "tinyrainbow": "^2.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/runner": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.7.tgz",
+ "integrity": "sha512-sB9y4ovltoQP+WaUPwmSxO9WIg9Ig694Di5PalVPsYHklAdE027mehpWF2SQSVq+k6sFgaivbTjTJwZLSHbedA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/utils": "3.2.7",
+ "pathe": "^2.0.3",
+ "strip-literal": "^3.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/snapshot": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.7.tgz",
+ "integrity": "sha512-7C+MwShwtBSI5Buwoyg3s/iY1eHL9PKAf+O1wVh/TdnjXUtkoL/9YQtre90i4MtNXM6edP1wJ2zOBpfCyhIS7g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/pretty-format": "3.2.7",
+ "magic-string": "^0.30.17",
+ "pathe": "^2.0.3"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/spy": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.7.tgz",
+ "integrity": "sha512-Q2eQGI6d2L/hBtZ0qNuKcAGid68XK6cv1xsoaIma6PaJhHPoqcEJhYpXZ/5myCMqkNgtP6UKuBhbc0nHKnrkuQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "tinyspy": "^4.0.3"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/utils": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.7.tgz",
+ "integrity": "sha512-x6BDOd7dyo3PFLY3I9/HJ25X/6OurhGXk2/B9gOZNPF7XDVjeBK4k01lQE5uvDpbuheErh91qYuE1E2OEjK3Rw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/pretty-format": "3.2.7",
+ "loupe": "^3.1.4",
+ "tinyrainbow": "^2.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/acorn": {
+ "version": "8.17.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz",
+ "integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/any-promise": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
+ "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/assertion-error": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz",
+ "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/bundle-require": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.1.0.tgz",
+ "integrity": "sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "load-tsconfig": "^0.2.3"
+ },
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "peerDependencies": {
+ "esbuild": ">=0.18"
+ }
+ },
+ "node_modules/cac": {
+ "version": "6.7.14",
+ "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz",
+ "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/chai": {
+ "version": "5.3.3",
+ "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz",
+ "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "assertion-error": "^2.0.1",
+ "check-error": "^2.1.1",
+ "deep-eql": "^5.0.1",
+ "loupe": "^3.1.0",
+ "pathval": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/check-error": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz",
+ "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 16"
+ }
+ },
+ "node_modules/chokidar": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
+ "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "readdirp": "^4.0.1"
+ },
+ "engines": {
+ "node": ">= 14.16.0"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/commander": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz",
+ "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/confbox": {
+ "version": "0.1.8",
+ "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz",
+ "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/consola": {
+ "version": "3.4.2",
+ "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz",
+ "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^14.18.0 || >=16.10.0"
+ }
+ },
+ "node_modules/debug": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/deep-eql": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz",
+ "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/es-module-lexer": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz",
+ "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/esbuild": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz",
+ "integrity": "sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.27.7",
+ "@esbuild/android-arm": "0.27.7",
+ "@esbuild/android-arm64": "0.27.7",
+ "@esbuild/android-x64": "0.27.7",
+ "@esbuild/darwin-arm64": "0.27.7",
+ "@esbuild/darwin-x64": "0.27.7",
+ "@esbuild/freebsd-arm64": "0.27.7",
+ "@esbuild/freebsd-x64": "0.27.7",
+ "@esbuild/linux-arm": "0.27.7",
+ "@esbuild/linux-arm64": "0.27.7",
+ "@esbuild/linux-ia32": "0.27.7",
+ "@esbuild/linux-loong64": "0.27.7",
+ "@esbuild/linux-mips64el": "0.27.7",
+ "@esbuild/linux-ppc64": "0.27.7",
+ "@esbuild/linux-riscv64": "0.27.7",
+ "@esbuild/linux-s390x": "0.27.7",
+ "@esbuild/linux-x64": "0.27.7",
+ "@esbuild/netbsd-arm64": "0.27.7",
+ "@esbuild/netbsd-x64": "0.27.7",
+ "@esbuild/openbsd-arm64": "0.27.7",
+ "@esbuild/openbsd-x64": "0.27.7",
+ "@esbuild/openharmony-arm64": "0.27.7",
+ "@esbuild/sunos-x64": "0.27.7",
+ "@esbuild/win32-arm64": "0.27.7",
+ "@esbuild/win32-ia32": "0.27.7",
+ "@esbuild/win32-x64": "0.27.7"
+ }
+ },
+ "node_modules/estree-walker": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
+ "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "^1.0.0"
+ }
+ },
+ "node_modules/expect-type": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz",
+ "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "node_modules/fdir": {
+ "version": "6.5.0",
+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "peerDependencies": {
+ "picomatch": "^3 || ^4"
+ },
+ "peerDependenciesMeta": {
+ "picomatch": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/fflate": {
+ "version": "0.8.3",
+ "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.3.tgz",
+ "integrity": "sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/fix-dts-default-cjs-exports": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-1.0.1.tgz",
+ "integrity": "sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "magic-string": "^0.30.17",
+ "mlly": "^1.7.4",
+ "rollup": "^4.34.8"
+ }
+ },
+ "node_modules/fsevents": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
+ "node_modules/joycon": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz",
+ "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/js-tokens": {
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz",
+ "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/lilconfig": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz",
+ "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/antonk52"
+ }
+ },
+ "node_modules/lines-and-columns": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
+ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/load-tsconfig": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz",
+ "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ }
+ },
+ "node_modules/loupe": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz",
+ "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/magic-string": {
+ "version": "0.30.21",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz",
+ "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.5.5"
+ }
+ },
+ "node_modules/mlly": {
+ "version": "1.8.2",
+ "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.2.tgz",
+ "integrity": "sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "acorn": "^8.16.0",
+ "pathe": "^2.0.3",
+ "pkg-types": "^1.3.1",
+ "ufo": "^1.6.3"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/mz": {
+ "version": "2.7.0",
+ "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz",
+ "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "any-promise": "^1.0.0",
+ "object-assign": "^4.0.1",
+ "thenify-all": "^1.0.0"
+ }
+ },
+ "node_modules/nanoid": {
+ "version": "3.3.15",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.15.tgz",
+ "integrity": "sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "bin": {
+ "nanoid": "bin/nanoid.cjs"
+ },
+ "engines": {
+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
+ }
+ },
+ "node_modules/object-assign": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/pathe": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",
+ "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/pathval": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz",
+ "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 14.16"
+ }
+ },
+ "node_modules/picocolors": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/picomatch": {
+ "version": "4.0.5",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz",
+ "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/pirates": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz",
+ "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/pkg-types": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz",
+ "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "confbox": "^0.1.8",
+ "mlly": "^1.7.4",
+ "pathe": "^2.0.1"
+ }
+ },
+ "node_modules/postcss": {
+ "version": "8.5.16",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.16.tgz",
+ "integrity": "sha512-vuwillviilfKZsg0VGj5R/YwwcHx4SLsIOI/7K6mQkWx+l5cUHTjj5g0AasTBcyXsbfTgrwsUNmVUb5xVwyPwg==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/postcss"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "nanoid": "^3.3.12",
+ "picocolors": "^1.1.1",
+ "source-map-js": "^1.2.1"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >=14"
+ }
+ },
+ "node_modules/postcss-load-config": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz",
+ "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "lilconfig": "^3.1.1"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "peerDependencies": {
+ "jiti": ">=1.21.0",
+ "postcss": ">=8.0.9",
+ "tsx": "^4.8.1",
+ "yaml": "^2.4.2"
+ },
+ "peerDependenciesMeta": {
+ "jiti": {
+ "optional": true
+ },
+ "postcss": {
+ "optional": true
+ },
+ "tsx": {
+ "optional": true
+ },
+ "yaml": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/prettier": {
+ "version": "3.9.5",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.5.tgz",
+ "integrity": "sha512-/FVl766LpUfB5vXgCYOYa0MeV/441Ia99AeICQIQFTY/Nw0roZwULcXpku5i1/m5kt/baz+s4Zogspd839HSMg==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "prettier": "bin/prettier.cjs"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/prettier/prettier?sponsor=1"
+ }
+ },
+ "node_modules/readdirp": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz",
+ "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 14.18.0"
+ },
+ "funding": {
+ "type": "individual",
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/resolve-from": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
+ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/rollup": {
+ "version": "4.62.2",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.2.tgz",
+ "integrity": "sha512-RFnrW4lhXA3s3eqHDZvN654g8OTjzRfqpIRJYczCGB6HzphckVAi/Qh4tbPUbRuDi7s1Llv8g/NspLkttY3gTA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "1.0.9"
+ },
+ "bin": {
+ "rollup": "dist/bin/rollup"
+ },
+ "engines": {
+ "node": ">=18.0.0",
+ "npm": ">=8.0.0"
+ },
+ "optionalDependencies": {
+ "@rollup/rollup-android-arm-eabi": "4.62.2",
+ "@rollup/rollup-android-arm64": "4.62.2",
+ "@rollup/rollup-darwin-arm64": "4.62.2",
+ "@rollup/rollup-darwin-x64": "4.62.2",
+ "@rollup/rollup-freebsd-arm64": "4.62.2",
+ "@rollup/rollup-freebsd-x64": "4.62.2",
+ "@rollup/rollup-linux-arm-gnueabihf": "4.62.2",
+ "@rollup/rollup-linux-arm-musleabihf": "4.62.2",
+ "@rollup/rollup-linux-arm64-gnu": "4.62.2",
+ "@rollup/rollup-linux-arm64-musl": "4.62.2",
+ "@rollup/rollup-linux-loong64-gnu": "4.62.2",
+ "@rollup/rollup-linux-loong64-musl": "4.62.2",
+ "@rollup/rollup-linux-ppc64-gnu": "4.62.2",
+ "@rollup/rollup-linux-ppc64-musl": "4.62.2",
+ "@rollup/rollup-linux-riscv64-gnu": "4.62.2",
+ "@rollup/rollup-linux-riscv64-musl": "4.62.2",
+ "@rollup/rollup-linux-s390x-gnu": "4.62.2",
+ "@rollup/rollup-linux-x64-gnu": "4.62.2",
+ "@rollup/rollup-linux-x64-musl": "4.62.2",
+ "@rollup/rollup-openbsd-x64": "4.62.2",
+ "@rollup/rollup-openharmony-arm64": "4.62.2",
+ "@rollup/rollup-win32-arm64-msvc": "4.62.2",
+ "@rollup/rollup-win32-ia32-msvc": "4.62.2",
+ "@rollup/rollup-win32-x64-gnu": "4.62.2",
+ "@rollup/rollup-win32-x64-msvc": "4.62.2",
+ "fsevents": "~2.3.2"
+ }
+ },
+ "node_modules/siginfo": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz",
+ "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/source-map": {
+ "version": "0.7.6",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz",
+ "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">= 12"
+ }
+ },
+ "node_modules/source-map-js": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
+ "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/stackback": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",
+ "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/std-env": {
+ "version": "3.10.0",
+ "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz",
+ "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/strip-literal": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-3.1.0.tgz",
+ "integrity": "sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "js-tokens": "^9.0.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/antfu"
+ }
+ },
+ "node_modules/sucrase": {
+ "version": "3.35.1",
+ "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz",
+ "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/gen-mapping": "^0.3.2",
+ "commander": "^4.0.0",
+ "lines-and-columns": "^1.1.6",
+ "mz": "^2.7.0",
+ "pirates": "^4.0.1",
+ "tinyglobby": "^0.2.11",
+ "ts-interface-checker": "^0.1.9"
+ },
+ "bin": {
+ "sucrase": "bin/sucrase",
+ "sucrase-node": "bin/sucrase-node"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ }
+ },
+ "node_modules/thenify": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz",
+ "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "any-promise": "^1.0.0"
+ }
+ },
+ "node_modules/thenify-all": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz",
+ "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "thenify": ">= 3.1.0 < 4"
+ },
+ "engines": {
+ "node": ">=0.8"
+ }
+ },
+ "node_modules/tinybench": {
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz",
+ "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/tinyexec": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz",
+ "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/tinyglobby": {
+ "version": "0.2.17",
+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",
+ "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fdir": "^6.5.0",
+ "picomatch": "^4.0.4"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/SuperchupuDev"
+ }
+ },
+ "node_modules/tinypool": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz",
+ "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^18.0.0 || >=20.0.0"
+ }
+ },
+ "node_modules/tinyrainbow": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz",
+ "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/tinyspy": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.4.tgz",
+ "integrity": "sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/tree-kill": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz",
+ "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "tree-kill": "cli.js"
+ }
+ },
+ "node_modules/ts-interface-checker": {
+ "version": "0.1.13",
+ "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz",
+ "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==",
+ "dev": true,
+ "license": "Apache-2.0"
+ },
+ "node_modules/tsup": {
+ "version": "8.5.1",
+ "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.5.1.tgz",
+ "integrity": "sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "bundle-require": "^5.1.0",
+ "cac": "^6.7.14",
+ "chokidar": "^4.0.3",
+ "consola": "^3.4.0",
+ "debug": "^4.4.0",
+ "esbuild": "^0.27.0",
+ "fix-dts-default-cjs-exports": "^1.0.0",
+ "joycon": "^3.1.1",
+ "picocolors": "^1.1.1",
+ "postcss-load-config": "^6.0.1",
+ "resolve-from": "^5.0.0",
+ "rollup": "^4.34.8",
+ "source-map": "^0.7.6",
+ "sucrase": "^3.35.0",
+ "tinyexec": "^0.3.2",
+ "tinyglobby": "^0.2.11",
+ "tree-kill": "^1.2.2"
+ },
+ "bin": {
+ "tsup": "dist/cli-default.js",
+ "tsup-node": "dist/cli-node.js"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "peerDependencies": {
+ "@microsoft/api-extractor": "^7.36.0",
+ "@swc/core": "^1",
+ "postcss": "^8.4.12",
+ "typescript": ">=4.5.0"
+ },
+ "peerDependenciesMeta": {
+ "@microsoft/api-extractor": {
+ "optional": true
+ },
+ "@swc/core": {
+ "optional": true
+ },
+ "postcss": {
+ "optional": true
+ },
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/typescript": {
+ "version": "5.9.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
+ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
+ "node_modules/ufo": {
+ "version": "1.6.4",
+ "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.4.tgz",
+ "integrity": "sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/undici-types": {
+ "version": "6.21.0",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
+ "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/vite": {
+ "version": "7.3.6",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.6.tgz",
+ "integrity": "sha512-4XP60spRGjSZFf1qYH+dJIkK2znL3zQfl9KkOV9MkkRR/3Dls0dxaBsQPTloEc5BLXWPL9vsOxopxyKoMmDueg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "esbuild": "^0.27.0 || ^0.28.0",
+ "fdir": "^6.5.0",
+ "picomatch": "^4.0.3",
+ "postcss": "^8.5.6",
+ "rollup": "^4.43.0",
+ "tinyglobby": "^0.2.15"
+ },
+ "bin": {
+ "vite": "bin/vite.js"
+ },
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ },
+ "funding": {
+ "url": "https://github.com/vitejs/vite?sponsor=1"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.3"
+ },
+ "peerDependencies": {
+ "@types/node": "^20.19.0 || >=22.12.0",
+ "jiti": ">=1.21.0",
+ "less": "^4.0.0",
+ "lightningcss": "^1.21.0",
+ "sass": "^1.70.0",
+ "sass-embedded": "^1.70.0",
+ "stylus": ">=0.54.8",
+ "sugarss": "^5.0.0",
+ "terser": "^5.16.0",
+ "tsx": "^4.8.1",
+ "yaml": "^2.4.2"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ },
+ "jiti": {
+ "optional": true
+ },
+ "less": {
+ "optional": true
+ },
+ "lightningcss": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ },
+ "sass-embedded": {
+ "optional": true
+ },
+ "stylus": {
+ "optional": true
+ },
+ "sugarss": {
+ "optional": true
+ },
+ "terser": {
+ "optional": true
+ },
+ "tsx": {
+ "optional": true
+ },
+ "yaml": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/vite-node": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.2.4.tgz",
+ "integrity": "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "cac": "^6.7.14",
+ "debug": "^4.4.1",
+ "es-module-lexer": "^1.7.0",
+ "pathe": "^2.0.3",
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0"
+ },
+ "bin": {
+ "vite-node": "vite-node.mjs"
+ },
+ "engines": {
+ "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/vitest": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.7.tgz",
+ "integrity": "sha512-KrxIJ62Fd89gfysR4WotlgZABiz2dqFPgqGzX7s+CwsqLFomRH7777ZcrOD6+WVAh7khPQP41A+BKbpcJFrdEg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/chai": "^5.2.2",
+ "@vitest/expect": "3.2.7",
+ "@vitest/mocker": "3.2.7",
+ "@vitest/pretty-format": "^3.2.7",
+ "@vitest/runner": "3.2.7",
+ "@vitest/snapshot": "3.2.7",
+ "@vitest/spy": "3.2.7",
+ "@vitest/utils": "3.2.7",
+ "chai": "^5.2.0",
+ "debug": "^4.4.1",
+ "expect-type": "^1.2.1",
+ "magic-string": "^0.30.17",
+ "pathe": "^2.0.3",
+ "picomatch": "^4.0.2",
+ "std-env": "^3.9.0",
+ "tinybench": "^2.9.0",
+ "tinyexec": "^0.3.2",
+ "tinyglobby": "^0.2.14",
+ "tinypool": "^1.1.1",
+ "tinyrainbow": "^2.0.0",
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0",
+ "vite-node": "3.2.4",
+ "why-is-node-running": "^2.3.0"
+ },
+ "bin": {
+ "vitest": "vitest.mjs"
+ },
+ "engines": {
+ "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ },
+ "peerDependencies": {
+ "@edge-runtime/vm": "*",
+ "@types/debug": "^4.1.12",
+ "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
+ "@vitest/browser": "3.2.7",
+ "@vitest/ui": "3.2.7",
+ "happy-dom": "*",
+ "jsdom": "*"
+ },
+ "peerDependenciesMeta": {
+ "@edge-runtime/vm": {
+ "optional": true
+ },
+ "@types/debug": {
+ "optional": true
+ },
+ "@types/node": {
+ "optional": true
+ },
+ "@vitest/browser": {
+ "optional": true
+ },
+ "@vitest/ui": {
+ "optional": true
+ },
+ "happy-dom": {
+ "optional": true
+ },
+ "jsdom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/why-is-node-running": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz",
+ "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "siginfo": "^2.0.0",
+ "stackback": "0.0.2"
+ },
+ "bin": {
+ "why-is-node-running": "cli.js"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ }
+ }
+}
diff --git a/sdk/typescript/package.json b/sdk/typescript/package.json
new file mode 100644
index 000000000..2f0c381ac
--- /dev/null
+++ b/sdk/typescript/package.json
@@ -0,0 +1,37 @@
+{
+ "name": "@openviking/sdk",
+ "version": "0.1.0",
+ "description": "Lightweight JavaScript and TypeScript HTTP SDK for OpenViking",
+ "license": "Apache-2.0",
+ "repository": { "type": "git", "url": "git+https://github.com/volcengine/OpenViking.git", "directory": "sdk/typescript" },
+ "publishConfig": { "access": "public" },
+ "type": "module",
+ "main": "./dist/index.cjs",
+ "module": "./dist/index.js",
+ "types": "./dist/index.d.ts",
+ "exports": {
+ ".": {
+ "types": "./dist/index.d.ts",
+ "import": "./dist/index.js",
+ "require": "./dist/index.cjs"
+ }
+ },
+ "files": ["dist", "README.md", "README_CN.md"],
+ "scripts": {
+ "build": "tsup src/index.ts --format esm,cjs --dts --clean",
+ "format": "prettier --write src tests",
+ "format:check": "prettier --check src tests",
+ "test": "vitest run",
+ "test:browser": "esbuild dist/index.js --bundle --platform=browser --format=esm --outfile=/tmp/openviking-sdk-browser.js",
+ "typecheck": "tsc --noEmit"
+ },
+ "engines": { "node": ">=18" },
+ "devDependencies": {
+ "@types/node": "^22.15.3",
+ "fflate": "^0.8.2",
+ "prettier": "^3.6.2",
+ "tsup": "^8.5.0",
+ "typescript": "^5.8.3",
+ "vitest": "^3.2.4"
+ }
+}
diff --git a/sdk/typescript/src/client.ts b/sdk/typescript/src/client.ts
new file mode 100644
index 000000000..59d46b85b
--- /dev/null
+++ b/sdk/typescript/src/client.ts
@@ -0,0 +1,1047 @@
+import { OpenVikingError } from "./errors.js";
+import { zipSync } from "fflate/browser";
+import type {
+ AddResourceOptions,
+ ClientConfig,
+ CreateSessionOptions,
+ FindResult,
+ JsonObject,
+ ListOptions,
+ GetSkillOptions,
+ GrepOptions,
+ ImportPackOptions,
+ Message,
+ RequestOptions,
+ ResponseEnvelope,
+ SearchOptions,
+ TaskListOptions,
+ TreeOptions,
+ UpdateWatchOptions,
+ WaitOptions,
+} from "./types.js";
+
+const compact = (value: JsonObject): JsonObject =>
+ Object.fromEntries(
+ Object.entries(value).filter(
+ ([, item]) => item !== undefined && item !== null,
+ ),
+ );
+const pathPart = (value: string): string => encodeURIComponent(value);
+const isBlobLike = (value: unknown): value is Blob => {
+ if (!value || typeof value !== "object") return false;
+ const candidate = value as Partial<Blob>;
+ return (
+ typeof candidate.arrayBuffer === "function" &&
+ typeof candidate.type === "string" &&
+ typeof candidate.size === "number"
+ );
+};
+const blobFilename = (value: Blob, fallback: string): string => {
+ const name = (value as Blob & { name?: unknown }).name;
+ return typeof name === "string" && name ? name : fallback;
+};
+
+async function nodePathToBlob(
+ path: string,
+): Promise<{ blob: Blob; filename: string; sourceName?: string } | undefined> {
+ if (typeof process === "undefined" || !process.versions?.node)
+ return undefined;
+ // Keep Node built-ins as runtime-only imports so browser bundlers do not
+ // attempt to resolve them while building the browser branch.
+ const fsSpecifier = "node:fs/promises";
+ const pathSpecifier = "node:path";
+ const fs = await import(fsSpecifier);
+ const nodePath = await import(pathSpecifier);
+ let stat;
+ try {
+ stat = await fs.stat(path);
+ } catch (error) {
+ if ((error as NodeJS.ErrnoException).code === "ENOENT") return undefined;
+ throw error;
+ }
+ if (stat.isFile())
+ return {
+ blob: new Blob([await fs.readFile(path)]),
+ filename: nodePath.basename(path),
+ sourceName: nodePath.basename(path),
+ };
+ if (!stat.isDirectory()) return undefined;
+ const files: Record<string, Uint8Array> = {};
+ const walk = async (directory: string, prefix = ""): Promise<void> => {
+ for (const entry of await fs.readdir(directory, { withFileTypes: true })) {
+ if (entry.isSymbolicLink()) continue;
+ const fullPath = nodePath.join(directory, entry.name);
+ const archivePath = prefix ? `${prefix}/${entry.name}` : entry.name;
+ if (entry.isDirectory()) await walk(fullPath, archivePath);
+ else if (entry.isFile()) files[archivePath] = await fs.readFile(fullPath);
+ }
+ };
+ await walk(path);
+ return {
+ blob: new Blob([zipSync(files)]),
+ filename: `${nodePath.basename(path)}.zip`,
+ sourceName: nodePath.basename(path),
+ };
+}
+
+/** Normalize a short OpenViking URI to the canonical `viking://` form. */
+export const normalizeURI = (uri: string): string =>
+ uri.startsWith("viking://") ? uri : `viking://${uri.replace(/^\/+/, "")}`;
+
+/** HTTP client for an existing OpenViking server. */
+export class OpenVikingClient {
+ readonly baseUrl: string;
+ private readonly fetcher: typeof globalThis.fetch;
+ private readonly headers: Headers;
+ private readonly timeout: number;
+ private readonly profile: boolean;
+ private readonly uploadMode: string | undefined;
+
+ /** Create a client with explicit connection and identity configuration. */
+ constructor(config: ClientConfig) {
+ if (!config.baseUrl?.trim())
+ throw new TypeError("OpenViking: baseUrl is required");
+ const url = new URL(config.baseUrl);
+ if (!/^https?:$/.test(url.protocol))
+ throw new TypeError("OpenViking: baseUrl must use http or https");
+ this.baseUrl = config.baseUrl.replace(/\/+$/, "");
+ this.fetcher = config.fetch ?? globalThis.fetch;
+ if (!this.fetcher)
+ throw new TypeError("OpenViking: fetch is not available");
+ this.timeout = config.timeout ?? 60_000;
+ this.profile = config.profile ?? false;
+ this.uploadMode = config.uploadMode;
+ this.headers = new Headers(config.headers);
+ if (config.apiKey) this.headers.set("X-API-Key", config.apiKey);
+ if (config.account)
+ this.headers.set("X-OpenViking-Account", config.account);
+ if (config.user) this.headers.set("X-OpenViking-User", config.user);
+ if (config.actorPeerId)
+ this.headers.set("X-OpenViking-Actor-Peer", config.actorPeerId);
+ }
+
+ private async request<T>(
+ method: string,
+ path: string,
+ options: {
+ query?: JsonObject;
+ body?: unknown;
+ form?: FormData;
+ signal?: AbortSignal;
+ } = {},
+ ): Promise<T> {
+ const url = new URL(
+ `${this.baseUrl}${path.startsWith("/") ? path : `/${path}`}`,
+ );
+ for (const [key, value] of Object.entries(options.query ?? {})) {
+ if (value !== undefined && value !== null && value !== "")
+ url.searchParams.set(key, String(value));
+ }
+ if (this.profile) url.searchParams.set("profile", "1");
+ const headers = new Headers(this.headers);
+ let body: BodyInit | undefined;
+ if (options.form) body = options.form;
+ else if (options.body !== undefined) {
+ headers.set("Content-Type", "application/json");
+ body = JSON.stringify(options.body);
+ }
+ const controller = new AbortController();
+ const abort = () => controller.abort(options.signal?.reason);
+ options.signal?.addEventListener("abort", abort, { once: true });
+ const timer = setTimeout(
+ () =>
+ controller.abort(new DOMException("Request timed out", "TimeoutError")),
+ this.timeout,
+ );
+ try {
+ const init: RequestInit = { method, headers, signal: controller.signal };
+ if (body !== undefined) init.body = body;
+ const response = await this.fetcher(url, init);
+ const text = await response.text();
+ let envelope: ResponseEnvelope<T> = {};
+ if (text) {
+ try {
+ envelope = JSON.parse(text) as ResponseEnvelope<T>;
+ } catch (cause) {
+ throw new OpenVikingError(`HTTP ${response.status}: ${text}`, {
+ statusCode: response.status,
+ cause,
+ });
+ }
+ }
+ if (envelope.error || envelope.status === "error" || !response.ok) {
+ const info = envelope.error;
+ throw new OpenVikingError(
+ info?.message ?? String(envelope.detail ?? `HTTP ${response.status}`),
+ compact({
+ code: info?.code,
+ details: info?.details,
+ statusCode: response.status,
+ }) as { code?: string; details?: JsonObject; statusCode?: number },
+ );
+ }
+ return envelope.result as T;
+ } catch (error) {
+ if (error instanceof OpenVikingError) throw error;
+ if (controller.signal.aborted)
+ throw new OpenVikingError("Request timed out or was aborted", {
+ code: "DEADLINE_EXCEEDED",
+ cause: error,
+ });
+ throw new OpenVikingError(
+ error instanceof Error ? error.message : "Network request failed",
+ { code: "UNAVAILABLE", cause: error },
+ );
+ } finally {
+ clearTimeout(timer);
+ options.signal?.removeEventListener("abort", abort);
+ }
+ }
+
+ private async upload(file: Blob, filename = "upload"): Promise<string> {
+ const form = new FormData();
+ form.set("file", file, filename);
+ if (this.uploadMode) form.set("upload_mode", this.uploadMode);
+ const result = await this.request<{ temp_file_id: string }>(
+ "POST",
+ "/api/v1/resources/temp_upload",
+ { form },
+ );
+ if (!result?.temp_file_id)
+ throw new OpenVikingError(
+ "Upload response did not include temp_file_id",
+ { code: "INTERNAL" },
+ );
+ return result.temp_file_id;
+ }
+
+ private async download(path: string, body: JsonObject): Promise<Blob> {
+ const controller = new AbortController();
+ const timer = setTimeout(
+ () =>
+ controller.abort(new DOMException("Request timed out", "TimeoutError")),
+ this.timeout,
+ );
+ try {
+ const headers = new Headers(this.headers);
+ headers.set("Content-Type", "application/json");
+ const response = await this.fetcher(`${this.baseUrl}${path}`, {
+ method: "POST",
+ headers,
+ body: JSON.stringify(body),
+ signal: controller.signal,
+ });
+ if (!response.ok) {
+ const text = await response.text();
+ try {
+ const envelope = JSON.parse(text) as ResponseEnvelope<never>;
+ throw new OpenVikingError(
+ envelope.error?.message ??
+ String(envelope.detail ?? `HTTP ${response.status}`),
+ compact({
+ code: envelope.error?.code,
+ details: envelope.error?.details,
+ statusCode: response.status,
+ }) as { code?: string; details?: JsonObject; statusCode?: number },
+ );
+ } catch (error) {
+ if (error instanceof OpenVikingError) throw error;
+ throw new OpenVikingError(`HTTP ${response.status}: ${text}`, {
+ statusCode: response.status,
+ cause: error,
+ });
+ }
+ }
+ return response.blob();
+ } catch (error) {
+ if (error instanceof OpenVikingError) throw error;
+ if (controller.signal.aborted)
+ throw new OpenVikingError("Request timed out", {
+ code: "DEADLINE_EXCEEDED",
+ cause: error,
+ });
+ throw new OpenVikingError(
+ error instanceof Error ? error.message : "Network request failed",
+ { code: "UNAVAILABLE", cause: error },
+ );
+ } finally {
+ clearTimeout(timer);
+ }
+ }
+
+ /** Add a remote URL, browser Blob/File, or Node.js local file/directory as a resource. */
+ async addResource(
+ source: string | Blob,
+ options: AddResourceOptions = {},
+ ): Promise<JsonObject> {
+ if (options.to && options.parent)
+ throw new TypeError("OpenViking: cannot specify both to and parent");
+ const body: JsonObject = compact({
+ to: options.to,
+ parent: options.parent,
+ reason: options.reason,
+ instruction: options.instruction,
+ wait: options.wait ?? false,
+ timeout: options.timeout,
+ strict: options.strict ?? false,
+ ignore_dirs: options.ignoreDirs,
+ include: options.include,
+ exclude: options.exclude,
+ directly_upload_media: options.directlyUploadMedia ?? true,
+ preserve_structure: options.preserveStructure,
+ watch_interval: options.watchInterval ?? 0,
+ args:
+ options.args && Object.keys(options.args).length
+ ? options.args
+ : undefined,
+ telemetry: options.telemetry,
+ });
+ const local =
+ typeof source === "string" ? await nodePathToBlob(source) : undefined;
+ if (local) {
+ body.temp_file_id = await this.upload(local.blob, local.filename);
+ body.source_name = local.sourceName;
+ } else if (typeof source === "string") body.path = source;
+ else if (isBlobLike(source)) {
+ body.temp_file_id = await this.upload(
+ source,
+ blobFilename(source, "resource"),
+ );
+ }
+ return this.request("POST", "/api/v1/resources", { body });
+ }
+
+ /** Install a skill from inline data, a Blob/File, or an existing Node.js path. */
+ async addSkill(
+ source: unknown | Blob,
+ options: WaitOptions & { targetUri?: string } = {},
+ ): Promise<JsonObject> {
+ const body: JsonObject = compact({
+ wait: options.wait ?? false,
+ timeout: options.timeout,
+ telemetry: options.telemetry,
+ target_uri: options.targetUri,
+ });
+ const local =
+ typeof source === "string" ? await nodePathToBlob(source) : undefined;
+ if (local)
+ body.temp_file_id = await this.upload(local.blob, local.filename);
+ else if (isBlobLike(source)) {
+ body.temp_file_id = await this.upload(
+ source,
+ blobFilename(source, "skill"),
+ );
+ } else body.data = source;
+ return this.request("POST", "/api/v1/skills", { body });
+ }
+ /** List installed skills. */
+ listSkills(
+ options: { nodeLimit?: number; targetUri?: string } = {},
+ ): Promise<JsonObject> {
+ return this.request("GET", "/api/v1/skills", {
+ query: {
+ node_limit: options.nodeLimit ?? 1000,
+ target_uri: options.targetUri,
+ },
+ });
+ }
+ /** Search installed skills semantically. */
+ findSkills(
+ query: string,
+ options: {
+ limit?: number;
+ scoreThreshold?: number;
+ level?: number[];
+ targetUri?: string;
+ telemetry?: unknown;
+ } = {},
+ ): Promise<JsonObject> {
+ return this.request("POST", "/api/v1/skills/find", {
+ body: compact({
+ query,
+ limit: options.limit ?? 10,
+ score_threshold: options.scoreThreshold,
+ level: options.level,
+ target_uri: options.targetUri,
+ telemetry: options.telemetry,
+ }),
+ });
+ }
+ /** Validate skill data without installing it. */
+ validateSkill(
+ data: unknown,
+ options: {
+ strict?: boolean;
+ sourcePath?: string;
+ skillDirName?: string;
+ targetUri?: string;
+ } = {},
+ ): Promise<JsonObject> {
+ return this.request("POST", "/api/v1/skills/validate", {
+ body: compact({
+ data,
+ strict: options.strict ?? false,
+ source_path: options.sourcePath,
+ skill_dir_name: options.skillDirName,
+ target_uri: options.targetUri,
+ }),
+ });
+ }
+ /** Get an installed skill. */
+ getSkill(name: string, options: GetSkillOptions = {}): Promise<JsonObject> {
+ return this.request("GET", `/api/v1/skills/${pathPart(name)}`, {
+ query: {
+ include_content: options.includeContent,
+ include_files: options.includeFiles ?? true,
+ include_source: options.includeSource ?? false,
+ level: options.level,
+ target_uri: options.targetUri,
+ },
+ });
+ }
+ /** Replace an installed skill. */
+ async updateSkill(
+ name: string,
+ source: unknown | Blob,
+ options: WaitOptions & {
+ sourceMetadata?: JsonObject;
+ targetUri?: string;
+ } = {},
+ ): Promise<JsonObject> {
+ const body: JsonObject = compact({
+ wait: options.wait ?? false,
+ timeout: options.timeout,
+ source_metadata: options.sourceMetadata,
+ target_uri: options.targetUri,
+ telemetry: options.telemetry,
+ });
+ const local =
+ typeof source === "string" ? await nodePathToBlob(source) : undefined;
+ if (local)
+ body.temp_file_id = await this.upload(local.blob, local.filename);
+ else if (isBlobLike(source)) {
+ body.temp_file_id = await this.upload(
+ source,
+ blobFilename(source, "skill"),
+ );
+ } else body.data = source;
+ return this.request("PUT", `/api/v1/skills/${pathPart(name)}`, { body });
+ }
+ /** Delete an installed skill. */
+ deleteSkill(name: string, targetUri?: string): Promise<JsonObject> {
+ return this.request("DELETE", `/api/v1/skills/${pathPart(name)}`, {
+ query: { target_uri: targetUri },
+ });
+ }
+ /** List resource watches. */
+ listWatches(
+ options: { activeOnly?: boolean; toUri?: string } = {},
+ ): Promise<JsonObject> {
+ return this.request("GET", "/api/v1/watches", {
+ query: {
+ active_only: options.activeOnly ?? false,
+ to_uri: options.toUri ? normalizeURI(options.toUri) : undefined,
+ },
+ });
+ }
+ /** Get a watch by task ID. */
+ getWatch(taskId: string, toUri?: string): Promise<JsonObject> {
+ return this.request("GET", `/api/v1/watches/${pathPart(taskId)}`, {
+ query: { to_uri: toUri ? normalizeURI(toUri) : undefined },
+ });
+ }
+ /** Partially update a watch. */
+ updateWatch(
+ ref: { taskId?: string; toUri?: string },
+ changes: UpdateWatchOptions,
+ ): Promise<JsonObject> {
+ if (!ref.taskId && !ref.toUri) {
+ throw new TypeError("OpenViking: watch reference is required");
+ }
+ return this.request(
+ "PATCH",
+ ref.taskId
+ ? `/api/v1/watches/${pathPart(ref.taskId)}`
+ : "/api/v1/watches",
+ {
+ query: { to_uri: ref.toUri ? normalizeURI(ref.toUri) : undefined },
+ body: compact({
+ watch_interval: changes.watchInterval,
+ is_active: changes.isActive,
+ reason: changes.reason,
+ instruction: changes.instruction,
+ }),
+ },
+ );
+ }
+ /** Delete a watch. */
+ deleteWatch(ref: { taskId?: string; toUri?: string }): Promise<JsonObject> {
+ if (!ref.taskId && !ref.toUri)
+ throw new TypeError("OpenViking: watch reference is required");
+ return this.request(
+ "DELETE",
+ ref.taskId
+ ? `/api/v1/watches/${pathPart(ref.taskId)}`
+ : "/api/v1/watches",
+ { query: { to_uri: ref.toUri ? normalizeURI(ref.toUri) : undefined } },
+ );
+ }
+ /** Trigger a watch immediately. */
+ triggerWatch(ref: { taskId?: string; toUri?: string }): Promise<JsonObject> {
+ if (!ref.taskId && !ref.toUri)
+ throw new TypeError("OpenViking: watch reference is required");
+ return this.request(
+ "POST",
+ ref.taskId
+ ? `/api/v1/watches/${pathPart(ref.taskId)}/trigger`
+ : "/api/v1/watches/trigger",
+ { query: { to_uri: ref.toUri ? normalizeURI(ref.toUri) : undefined } },
+ );
+ }
+
+ /** Find relevant content without session context. */
+ async find(query: string, options: SearchOptions = {}): Promise<FindResult> {
+ return this.searchRequest("find", query, options);
+ }
+ /** Search relevant content with optional session context. */
+ async search(
+ query: string,
+ options: SearchOptions = {},
+ ): Promise<FindResult> {
+ return this.searchRequest("search", query, options);
+ }
+ private async searchRequest(
+ kind: "find" | "search",
+ query: string,
+ options: SearchOptions,
+ ): Promise<FindResult> {
+ let imageUrl =
+ typeof options.image === "string" ? options.image : undefined;
+ if (isBlobLike(options.image)) {
+ const bytes = new Uint8Array(await options.image.arrayBuffer());
+ let binary = "";
+ for (const byte of bytes) binary += String.fromCharCode(byte);
+ imageUrl = `data:${options.image.type || "application/octet-stream"};base64,${btoa(binary)}`;
+ }
+ return this.request("POST", `/api/v1/search/${kind}`, {
+ body: compact({
+ query,
+ target_uri: options.targetUri ?? "viking://",
+ image_url: imageUrl,
+ session_id: kind === "search" ? options.sessionId : undefined,
+ limit: options.nodeLimit ?? options.limit ?? 10,
+ score_threshold: options.scoreThreshold,
+ filter: options.filter,
+ context_type: options.contextType,
+ telemetry: options.telemetry,
+ since: options.since,
+ until: options.until,
+ time_field: options.timeField,
+ level: options.level,
+ tags: options.tags,
+ }),
+ });
+ }
+ /** Search file contents by pattern. */
+ grep(
+ uri: string,
+ pattern: string,
+ options: GrepOptions = {},
+ ): Promise<JsonObject> {
+ return this.request("POST", "/api/v1/search/grep", {
+ body: compact({
+ uri: normalizeURI(uri),
+ pattern,
+ case_insensitive: options.caseInsensitive ?? false,
+ node_limit: options.nodeLimit ?? 256,
+ level_limit: options.levelLimit,
+ exclude_uri: options.excludeUri
+ ? normalizeURI(options.excludeUri)
+ : undefined,
+ }),
+ });
+ }
+ /** Find files by glob pattern. */
+ glob(
+ pattern: string,
+ uri = "viking://",
+ nodeLimit = 256,
+ ): Promise<JsonObject> {
+ return this.request("POST", "/api/v1/search/glob", {
+ body: { pattern, uri: normalizeURI(uri), node_limit: nodeLimit },
+ });
+ }
+
+ /** List directory contents. */
+ list(uri: string, options: ListOptions = {}): Promise<unknown[]> {
+ return this.request("GET", "/api/v1/fs/ls", {
+ query: {
+ uri: normalizeURI(uri),
+ simple: options.simple ?? false,
+ recursive: options.recursive ?? false,
+ output: options.output ?? "original",
+ abs_limit: options.absLimit ?? 256,
+ show_all_hidden: options.showAllHidden ?? false,
+ node_limit: options.nodeLimit ?? 1000,
+ },
+ });
+ }
+ /** Return a directory tree. */
+ tree(uri: string, options: TreeOptions = {}): Promise<JsonObject[]> {
+ return this.request("GET", "/api/v1/fs/tree", {
+ query: {
+ uri: normalizeURI(uri),
+ output: options.output ?? "original",
+ abs_limit: options.absLimit ?? 128,
+ show_all_hidden: options.showAllHidden ?? false,
+ node_limit: options.nodeLimit ?? 1000,
+ },
+ });
+ }
+ /** Return URI metadata. */
+ stat(uri: string): Promise<JsonObject> {
+ return this.request("GET", "/api/v1/fs/stat", {
+ query: { uri: normalizeURI(uri) },
+ });
+ }
+ /** Return URI logical attributes. */
+ attrs(uri: string): Promise<JsonObject> {
+ return this.request("GET", "/api/v1/fs/attrs", {
+ query: { uri: normalizeURI(uri) },
+ });
+ }
+ /** Create a directory. */
+ mkdir(uri: string, description?: string): Promise<void> {
+ return this.request("POST", "/api/v1/fs/mkdir", {
+ body: compact({ uri: normalizeURI(uri), description }),
+ });
+ }
+ /** Remove a resource or directory. */
+ remove(
+ uri: string,
+ options: { recursive?: boolean; wait?: boolean; timeout?: number } = {},
+ ): Promise<void> {
+ return this.request("DELETE", "/api/v1/fs", {
+ query: {
+ uri: normalizeURI(uri),
+ recursive: options.recursive ?? false,
+ wait: options.wait ?? false,
+ timeout: options.timeout,
+ },
+ });
+ }
+ /** Move a URI. */
+ move(fromUri: string, toUri: string): Promise<void> {
+ return this.request("POST", "/api/v1/fs/mv", {
+ body: { from_uri: normalizeURI(fromUri), to_uri: normalizeURI(toUri) },
+ });
+ }
+ /** Read text content. */
+ read(uri: string, offset = 0, limit = -1): Promise<string> {
+ return this.request("GET", "/api/v1/content/read", {
+ query: { uri: normalizeURI(uri), offset, limit },
+ });
+ }
+ /** Read L0 abstract content. */
+ abstract(uri: string): Promise<string> {
+ return this.request("GET", "/api/v1/content/abstract", {
+ query: { uri: normalizeURI(uri) },
+ });
+ }
+ /** Read L1 overview content. */
+ overview(uri: string): Promise<string> {
+ return this.request("GET", "/api/v1/content/overview", {
+ query: { uri: normalizeURI(uri) },
+ });
+ }
+ /** Write text content, including an empty string used to clear a file. */
+ write(
+ uri: string,
+ content: string,
+ options: WaitOptions & { mode?: string } = {},
+ ): Promise<JsonObject> {
+ return this.request("POST", "/api/v1/content/write", {
+ body: compact({
+ uri: normalizeURI(uri),
+ content,
+ mode: options.mode ?? "replace",
+ wait: options.wait ?? false,
+ timeout: options.timeout,
+ telemetry: options.telemetry,
+ }),
+ });
+ }
+ /** Set retrieval tags. */
+ setTags(
+ uri: string,
+ tags: string[],
+ options: { mode?: string; recursive?: boolean; telemetry?: unknown } = {},
+ ): Promise<JsonObject> {
+ return this.request("POST", "/api/v1/fs/attrs/set_tags", {
+ body: compact({
+ uri: normalizeURI(uri),
+ tags,
+ mode: options.mode ?? "replace",
+ recursive: options.recursive ?? false,
+ telemetry: options.telemetry,
+ }),
+ });
+ }
+ /** Rebuild indexes for a URI. */
+ reindex(
+ uri: string,
+ options: { mode?: string; wait?: boolean } = {},
+ ): Promise<JsonObject> {
+ return this.request("POST", "/api/v1/content/reindex", {
+ body: {
+ uri: normalizeURI(uri),
+ mode: options.mode ?? "vectors_only",
+ wait: options.wait ?? true,
+ },
+ });
+ }
+
+ /** Create a session. */
+ createSession(options: CreateSessionOptions = {}): Promise<JsonObject> {
+ return this.request("POST", "/api/v1/sessions", {
+ body: compact({
+ session_id: options.sessionId,
+ memory_policy: options.memoryPolicy,
+ telemetry: options.telemetry,
+ }),
+ });
+ }
+ /** List sessions visible to the caller. */
+ listSessions(): Promise<unknown[]> {
+ return this.request("GET", "/api/v1/sessions");
+ }
+ /** Get one session. */
+ getSession(sessionId: string, autoCreate = false): Promise<JsonObject> {
+ return this.request("GET", `/api/v1/sessions/${pathPart(sessionId)}`, {
+ query: { auto_create: autoCreate || undefined },
+ });
+ }
+ /** Test whether a session exists. */
+ async sessionExists(sessionId: string): Promise<boolean> {
+ try {
+ await this.getSession(sessionId);
+ return true;
+ } catch (error) {
+ if (error instanceof OpenVikingError && error.code === "NOT_FOUND")
+ return false;
+ throw error;
+ }
+ }
+ /** Delete a session. */
+ deleteSession(sessionId: string): Promise<void> {
+ return this.request("DELETE", `/api/v1/sessions/${pathPart(sessionId)}`);
+ }
+ /** Assemble session context within a token budget. */
+ getSessionContext(
+ sessionId: string,
+ tokenBudget = 128_000,
+ ): Promise<JsonObject> {
+ return this.request(
+ "GET",
+ `/api/v1/sessions/${pathPart(sessionId)}/context`,
+ { query: { token_budget: tokenBudget } },
+ );
+ }
+ /** Get a committed session archive. */
+ getSessionArchive(sessionId: string, archiveId: string): Promise<JsonObject> {
+ return this.request(
+ "GET",
+ `/api/v1/sessions/${pathPart(sessionId)}/archives/${pathPart(archiveId)}`,
+ );
+ }
+ /** Append one message to a session. */
+ addMessage(sessionId: string, message: Message): Promise<JsonObject> {
+ if (message.content === undefined && !message.parts?.length) {
+ throw new TypeError("OpenViking: message requires content or parts");
+ }
+ const content = message.parts?.length ? undefined : message.content;
+ return this.request(
+ "POST",
+ `/api/v1/sessions/${pathPart(sessionId)}/messages`,
+ {
+ body: compact({
+ role: message.role,
+ content,
+ parts: message.parts?.length ? message.parts : undefined,
+ created_at: message.createdAt,
+ peer_id: message.peerId,
+ telemetry: message.telemetry,
+ }),
+ },
+ );
+ }
+ /** Append multiple messages to a session. */
+ batchAddMessages(
+ sessionId: string,
+ messages: Message[],
+ telemetry?: unknown,
+ ): Promise<JsonObject> {
+ return this.request(
+ "POST",
+ `/api/v1/sessions/${pathPart(sessionId)}/messages/batch`,
+ {
+ body: compact({
+ messages: messages.map((m) =>
+ compact({
+ role: m.role,
+ content: m.content,
+ parts: m.parts,
+ created_at: m.createdAt,
+ peer_id: m.peerId,
+ }),
+ ),
+ telemetry,
+ }),
+ },
+ );
+ }
+ /** Commit a session and extract memories. */
+ commitSession(
+ sessionId: string,
+ keepRecentCount = 0,
+ telemetry?: unknown,
+ ): Promise<JsonObject> {
+ return this.request(
+ "POST",
+ `/api/v1/sessions/${pathPart(sessionId)}/commit`,
+ { body: compact({ keep_recent_count: keepRecentCount, telemetry }) },
+ );
+ }
+ /** Export a resource subtree as an OVPack blob. */
+ exportOVPack(uri: string, includeVectors = false): Promise<Blob> {
+ return this.download("/api/v1/pack/export", {
+ uri: normalizeURI(uri),
+ include_vectors: includeVectors,
+ });
+ }
+ /** Back up public scopes as a restore-only OVPack blob. */
+ backupOVPack(includeVectors = false): Promise<Blob> {
+ return this.download("/api/v1/pack/backup", {
+ include_vectors: includeVectors,
+ });
+ }
+ /** Import an OVPack blob or Node.js local file under a parent URI. */
+ async importOVPack(
+ source: string | Blob,
+ parent: string,
+ options: ImportPackOptions = {},
+ ): Promise<string> {
+ const local =
+ typeof source === "string" ? await nodePathToBlob(source) : undefined;
+ const blob = local?.blob ?? (isBlobLike(source) ? source : undefined);
+ if (!blob)
+ throw new TypeError(
+ "OpenViking: importOVPack requires a Blob or an existing Node.js local file",
+ );
+ const result = await this.request<{ uri: string }>(
+ "POST",
+ "/api/v1/pack/import",
+ {
+ body: compact({
+ parent: normalizeURI(parent),
+ temp_file_id: await this.upload(
+ blob,
+ local?.filename ?? "import.ovpack",
+ ),
+ on_conflict: options.onConflict,
+ vector_mode: options.vectorMode,
+ }),
+ },
+ );
+ return result.uri;
+ }
+ /** Restore an OVPack backup blob or Node.js local file. */
+ async restoreOVPack(
+ source: string | Blob,
+ options: ImportPackOptions = {},
+ ): Promise<string> {
+ const local =
+ typeof source === "string" ? await nodePathToBlob(source) : undefined;
+ const blob = local?.blob ?? (isBlobLike(source) ? source : undefined);
+ if (!blob)
+ throw new TypeError(
+ "OpenViking: restoreOVPack requires a Blob or an existing Node.js local file",
+ );
+ const result = await this.request<{ uri: string }>(
+ "POST",
+ "/api/v1/pack/restore",
+ {
+ body: compact({
+ temp_file_id: await this.upload(
+ blob,
+ local?.filename ?? "restore.ovpack",
+ ),
+ on_conflict: options.onConflict,
+ vector_mode: options.vectorMode,
+ }),
+ },
+ );
+ return result.uri;
+ }
+ /** Get a background task. */
+ async getTask(taskId: string): Promise<JsonObject | null> {
+ try {
+ return await this.request("GET", `/api/v1/tasks/${pathPart(taskId)}`);
+ } catch (error) {
+ if (
+ error instanceof OpenVikingError &&
+ (error.code === "NOT_FOUND" || error.statusCode === 404)
+ ) {
+ return null;
+ }
+ throw error;
+ }
+ }
+ /** List background tasks. */
+ listTasks(options: TaskListOptions = {}): Promise<unknown[]> {
+ return this.request("GET", "/api/v1/tasks", {
+ query: {
+ task_type: options.taskType,
+ status: options.status,
+ resource_id: options.resourceId,
+ limit: options.limit,
+ },
+ });
+ }
+ /** Wait for queued processing to finish. */
+ waitProcessed(timeout?: number): Promise<JsonObject> {
+ return this.request("POST", "/api/v1/system/wait", {
+ body: compact({ timeout }),
+ });
+ }
+ /** Check the raw server health endpoint. */
+ async health(options: RequestOptions = {}): Promise<boolean> {
+ const controller = new AbortController();
+ const abort = () => controller.abort(options.signal?.reason);
+ options.signal?.addEventListener("abort", abort, { once: true });
+ const timer = setTimeout(() => controller.abort(), this.timeout);
+ try {
+ const response = await this.fetcher(`${this.baseUrl}/health`, {
+ headers: this.headers,
+ signal: controller.signal,
+ });
+ if (!response.ok) return false;
+ return ((await response.json()) as { status?: string }).status === "ok";
+ } finally {
+ clearTimeout(timer);
+ options.signal?.removeEventListener("abort", abort);
+ }
+ }
+ /** Check filesystem/index consistency. */
+ checkConsistency(uri: string): Promise<JsonObject> {
+ return this.request("POST", "/api/v1/system/consistency", {
+ body: { uri: normalizeURI(uri) },
+ });
+ }
+ /** Return aggregate observer status. */
+ getStatus(): Promise<JsonObject> {
+ return this.request("GET", "/api/v1/observer/system");
+ }
+ /** Return queue observer status. */
+ queueStatus(): Promise<JsonObject> {
+ return this.request("GET", "/api/v1/observer/queue");
+ }
+ /** Return VikingDB observer status. */
+ vikingDBStatus(): Promise<JsonObject> {
+ return this.request("GET", "/api/v1/observer/vikingdb");
+ }
+ /** Return model observer status. */
+ modelsStatus(): Promise<JsonObject> {
+ return this.request("GET", "/api/v1/observer/models");
+ }
+ /** Create a tenant account and its first administrator. */
+ adminCreateAccount(
+ accountId: string,
+ adminUserId: string,
+ options: { userConfig?: JsonObject; seed?: string } = {},
+ ): Promise<JsonObject> {
+ return this.request("POST", "/api/v1/admin/accounts", {
+ body: compact({
+ account_id: accountId,
+ admin_user_id: adminUserId,
+ user_config: options.userConfig,
+ seed: options.seed,
+ }),
+ });
+ }
+ /** List tenant accounts. */
+ adminListAccounts(): Promise<unknown[]> {
+ return this.request("GET", "/api/v1/admin/accounts");
+ }
+ /** Delete a tenant account. */
+ adminDeleteAccount(accountId: string): Promise<JsonObject> {
+ return this.request(
+ "DELETE",
+ `/api/v1/admin/accounts/${pathPart(accountId)}`,
+ );
+ }
+ /** Register a user in an account. */
+ adminRegisterUser(
+ accountId: string,
+ userId: string,
+ role: string,
+ options: { userConfig?: JsonObject; seed?: string } = {},
+ ): Promise<JsonObject> {
+ return this.request(
+ "POST",
+ `/api/v1/admin/accounts/${pathPart(accountId)}/users`,
+ {
+ body: compact({
+ user_id: userId,
+ role,
+ user_config: options.userConfig,
+ seed: options.seed,
+ }),
+ },
+ );
+ }
+ /** List users in an account. */
+ adminListUsers(accountId: string): Promise<unknown[]> {
+ return this.request(
+ "GET",
+ `/api/v1/admin/accounts/${pathPart(accountId)}/users`,
+ );
+ }
+ /** Remove a user from an account. */
+ adminRemoveUser(accountId: string, userId: string): Promise<JsonObject> {
+ return this.request(
+ "DELETE",
+ `/api/v1/admin/accounts/${pathPart(accountId)}/users/${pathPart(userId)}`,
+ );
+ }
+ /** Change a user's role. */
+ adminSetRole(
+ accountId: string,
+ userId: string,
+ role: string,
+ ): Promise<JsonObject> {
+ return this.request(
+ "PUT",
+ `/api/v1/admin/accounts/${pathPart(accountId)}/users/${pathPart(userId)}/role`,
+ { body: { role } },
+ );
+ }
+ /** Regenerate a user's API key. */
+ adminRegenerateKey(
+ accountId: string,
+ userId: string,
+ seed?: string,
+ ): Promise<JsonObject> {
+ return this.request(
+ "POST",
+ `/api/v1/admin/accounts/${pathPart(accountId)}/users/${pathPart(userId)}/key`,
+ { body: seed === undefined ? undefined : { seed } },
+ );
+ }
+ /** Start legacy-data migration or cleanup. */
+ adminMigrate(cleanup = false): Promise<JsonObject> {
+ return this.request("POST", "/api/v1/admin/migrate", {
+ body: { action: cleanup ? "cleanup" : "migrate" },
+ });
+ }
+}
diff --git a/sdk/typescript/src/errors.ts b/sdk/typescript/src/errors.ts
new file mode 100644
index 000000000..9c2c1c10d
--- /dev/null
+++ b/sdk/typescript/src/errors.ts
@@ -0,0 +1,32 @@
+import type { JsonObject } from "./types.js";
+
+/** Typed HTTP, server-contract, timeout and network error from the SDK. */
+export class OpenVikingError extends Error {
+ readonly code: string;
+ readonly details: JsonObject;
+ readonly statusCode: number | undefined;
+
+ constructor(
+ message: string,
+ options: {
+ code?: string;
+ details?: JsonObject;
+ statusCode?: number;
+ cause?: unknown;
+ } = {},
+ ) {
+ super(message, { cause: options.cause });
+ this.name = "OpenVikingError";
+ this.code = options.code ?? "UNKNOWN";
+ this.details = options.details ?? {};
+ this.statusCode = options.statusCode;
+ }
+}
+
+/** Test whether an unknown value is an OpenViking error with an optional code. */
+export const isOpenVikingError = (
+ error: unknown,
+ code?: string,
+): error is OpenVikingError =>
+ error instanceof OpenVikingError &&
+ (code === undefined || error.code === code);
diff --git a/sdk/typescript/src/index.ts b/sdk/typescript/src/index.ts
new file mode 100644
index 000000000..e260594a2
--- /dev/null
+++ b/sdk/typescript/src/index.ts
@@ -0,0 +1,3 @@
+export { OpenVikingClient, normalizeURI } from "./client.js";
+export { OpenVikingError, isOpenVikingError } from "./errors.js";
+export type * from "./types.js";
diff --git a/sdk/typescript/src/types.ts b/sdk/typescript/src/types.ts
new file mode 100644
index 000000000..266d7da50
--- /dev/null
+++ b/sdk/typescript/src/types.ts
@@ -0,0 +1,152 @@
+/** Arbitrary JSON object returned by APIs without a dedicated result type. */
+export type JsonObject = Record<string, unknown>;
+/** One target URI or multiple target scopes. */
+export type TargetURI = string | string[];
+
+/** Connection, identity and transport configuration. */
+export interface ClientConfig {
+ baseUrl: string;
+ apiKey?: string;
+ account?: string;
+ user?: string;
+ actorPeerId?: string;
+ timeout?: number;
+ headers?: HeadersInit;
+ fetch?: typeof globalThis.fetch;
+ profile?: boolean;
+ uploadMode?: string;
+}
+
+/** A browser file/blob, a Node.js local path, a remote URL, or inline skill data. */
+export type UploadSource = string | Blob;
+
+/** Options shared by OVPack import and restore operations. */
+export interface ImportPackOptions {
+ onConflict?: string;
+ vectorMode?: string;
+}
+
+/** Per-request cancellation options. */
+export interface RequestOptions {
+ signal?: AbortSignal;
+}
+/** Options shared by asynchronous processing APIs. */
+export interface WaitOptions {
+ wait?: boolean;
+ timeout?: number;
+ telemetry?: unknown;
+}
+/** Resource import options. */
+export interface AddResourceOptions extends WaitOptions {
+ to?: string;
+ parent?: string;
+ reason?: string;
+ instruction?: string;
+ strict?: boolean;
+ ignoreDirs?: string;
+ include?: string;
+ exclude?: string;
+ directlyUploadMedia?: boolean;
+ preserveStructure?: boolean;
+ watchInterval?: number;
+ args?: JsonObject;
+}
+/** Semantic retrieval options. */
+export interface SearchOptions {
+ targetUri?: TargetURI;
+ image?: string | Blob;
+ sessionId?: string;
+ limit?: number;
+ nodeLimit?: number;
+ scoreThreshold?: number;
+ filter?: JsonObject;
+ contextType?: unknown;
+ telemetry?: unknown;
+ since?: string;
+ until?: string;
+ timeField?: string;
+ level?: number[];
+ tags?: string[];
+}
+/** Content grep options. */
+export interface GrepOptions {
+ caseInsensitive?: boolean;
+ nodeLimit?: number;
+ levelLimit?: number;
+ excludeUri?: string;
+}
+/** Directory listing options. */
+export interface ListOptions {
+ simple?: boolean;
+ recursive?: boolean;
+ output?: string;
+ absLimit?: number;
+ showAllHidden?: boolean;
+ nodeLimit?: number;
+}
+/** Directory tree options. */
+export interface TreeOptions {
+ output?: string;
+ absLimit?: number;
+ showAllHidden?: boolean;
+ nodeLimit?: number;
+}
+/** Session message payload. */
+export interface Message {
+ role: string;
+ content?: string;
+ parts?: JsonObject[];
+ createdAt?: string;
+ peerId?: string;
+ telemetry?: unknown;
+}
+/** Session creation options. */
+export interface CreateSessionOptions {
+ sessionId?: string;
+ memoryPolicy?: JsonObject;
+ telemetry?: unknown;
+}
+/** Background task filters. */
+export interface TaskListOptions {
+ taskType?: string;
+ status?: string;
+ resourceId?: string;
+ limit?: number;
+}
+/** Options for retrieving an installed skill. */
+export interface GetSkillOptions {
+ includeContent?: boolean;
+ includeFiles?: boolean;
+ includeSource?: boolean;
+ level?: number;
+ targetUri?: TargetURI;
+}
+/** Fields that can be changed on a watch task. */
+export interface UpdateWatchOptions {
+ watchInterval?: number;
+ isActive?: boolean;
+ reason?: string;
+ instruction?: string;
+}
+/** Grouped semantic retrieval results. */
+export interface FindResult {
+ memories?: unknown[];
+ resources?: unknown[];
+ skills?: unknown[];
+ [key: string]: unknown;
+}
+/** Error payload returned by OpenViking. */
+export interface APIErrorInfo {
+ code?: string;
+ message?: string;
+ details?: JsonObject;
+}
+/** Standard OpenViking HTTP response envelope. */
+export interface ResponseEnvelope<T> {
+ status?: string;
+ result?: T;
+ error?: APIErrorInfo;
+ telemetry?: unknown;
+ profile?: string[];
+ detail?: unknown;
+}
diff --git a/sdk/typescript/tests/client.test.ts b/sdk/typescript/tests/client.test.ts
new file mode 100644
index 000000000..203c222fd
--- /dev/null
+++ b/sdk/typescript/tests/client.test.ts
@@ -0,0 +1,224 @@
+import { describe, expect, it, vi } from "vitest";
+import { mkdtemp, rm, writeFile } from "node:fs/promises";
+import { join } from "node:path";
+import { tmpdir } from "node:os";
+import {
+ OpenVikingClient,
+ OpenVikingError,
+ normalizeURI,
+} from "../src/index.js";
+
+const ok = (result: unknown) =>
+ new Response(JSON.stringify({ status: "ok", result }), {
+ status: 200,
+ headers: { "Content-Type": "application/json" },
+ });
+
+describe("OpenVikingClient", () => {
+ it("normalizes URIs", () => {
+ expect(normalizeURI("resources/docs")).toBe("viking://resources/docs");
+ expect(normalizeURI("viking://resources/docs")).toBe(
+ "viking://resources/docs",
+ );
+ });
+
+ it("sends identity headers and the Python/Go compatible search body", async () => {
+ const fetcher = vi
+ .fn<typeof fetch>()
+ .mockResolvedValue(ok({ resources: [] }));
+ const client = new OpenVikingClient({
+ baseUrl: "https://example.com/",
+ apiKey: "key",
+ account: "acme",
+ user: "alice",
+ actorPeerId: "peer",
+ fetch: fetcher,
+ });
+ await client.find("hello", { targetUri: "viking://resources", limit: 5 });
+ const [url, init] = fetcher.mock.calls[0]!;
+ expect(String(url)).toBe("https://example.com/api/v1/search/find");
+ expect(new Headers(init?.headers).get("X-OpenViking-Actor-Peer")).toBe(
+ "peer",
+ );
+ expect(JSON.parse(String(init?.body))).toMatchObject({
+ query: "hello",
+ target_uri: "viking://resources",
+ limit: 5,
+ });
+ });
+
+ it("maps response envelopes to typed errors", async () => {
+ const fetcher = vi.fn<typeof fetch>().mockResolvedValue(
+ new Response(
+ JSON.stringify({
+ status: "error",
+ error: { code: "NOT_FOUND", message: "missing" },
+ }),
+ { status: 404 },
+ ),
+ );
+ const client = new OpenVikingClient({
+ baseUrl: "https://example.com",
+ fetch: fetcher,
+ });
+ await expect(client.stat("missing")).rejects.toMatchObject({
+ code: "NOT_FOUND",
+ statusCode: 404,
+ } satisfies Partial<OpenVikingError>);
+ });
+
+ it("uses the raw health contract", async () => {
+ const fetcher = vi
+ .fn<typeof fetch>()
+ .mockResolvedValue(
+ new Response(JSON.stringify({ status: "ok" }), { status: 200 }),
+ );
+ const client = new OpenVikingClient({
+ baseUrl: "https://example.com",
+ fetch: fetcher,
+ });
+ await expect(client.health()).resolves.toBe(true);
+ expect(String(fetcher.mock.calls[0]![0])).toBe(
+ "https://example.com/health",
+ );
+ });
+
+ it("uploads blobs through the shared resource upload endpoint", async () => {
+ const fetcher = vi
+ .fn<typeof fetch>()
+ .mockResolvedValueOnce(ok({ temp_file_id: "temp-1" }))
+ .mockResolvedValueOnce(ok({ task_id: "task-1" }));
+ const client = new OpenVikingClient({
+ baseUrl: "https://example.com",
+ fetch: fetcher,
+ });
+ await client.addResource(new Blob(["hello"], { type: "text/plain" }));
+ expect(String(fetcher.mock.calls[0]![0])).toBe(
+ "https://example.com/api/v1/resources/temp_upload",
+ );
+ expect(fetcher.mock.calls[0]![1]?.body).toBeInstanceOf(FormData);
+ expect(JSON.parse(String(fetcher.mock.calls[1]![1]?.body))).toMatchObject({
+ temp_file_id: "temp-1",
+ });
+ });
+
+ it("preserves browser file names and sends the configured upload mode", async () => {
+ const fetcher = vi
+ .fn<typeof fetch>()
+ .mockResolvedValueOnce(ok({ temp_file_id: "temp-file" }))
+ .mockResolvedValueOnce(ok({ task_id: "task-file" }));
+ const client = new OpenVikingClient({
+ baseUrl: "https://example.com",
+ fetch: fetcher,
+ uploadMode: "proxy",
+ });
+ const file = new Blob(["# guide"], { type: "text/markdown" }) as Blob & {
+ name: string;
+ };
+ Object.defineProperty(file, "name", { value: "guide.md" });
+
+ await client.addResource(file);
+
+ const form = fetcher.mock.calls[0]![1]?.body as FormData;
+ expect((form.get("file") as File).name).toBe("guide.md");
+ expect(form.get("upload_mode")).toBe("proxy");
+ });
+
+ it("maps typed watch options to the server contract", async () => {
+ const fetcher = vi.fn<typeof fetch>().mockResolvedValue(ok({}));
+ const client = new OpenVikingClient({
+ baseUrl: "https://example.com",
+ fetch: fetcher,
+ });
+
+ await client.updateWatch(
+ { taskId: "task-1" },
+ { watchInterval: 30, isActive: false, reason: "pause" },
+ );
+
+ expect(JSON.parse(String(fetcher.mock.calls[0]![1]?.body))).toEqual({
+ watch_interval: 30,
+ is_active: false,
+ reason: "pause",
+ });
+ });
+
+ it("uses Go SDK defaults for skill details and returns null for missing tasks", async () => {
+ const fetcher = vi
+ .fn<typeof fetch>()
+ .mockResolvedValueOnce(ok({ name: "demo" }))
+ .mockResolvedValueOnce(
+ new Response(
+ JSON.stringify({
+ status: "error",
+ error: { code: "NOT_FOUND", message: "missing" },
+ }),
+ { status: 404 },
+ ),
+ );
+ const client = new OpenVikingClient({
+ baseUrl: "https://example.com",
+ fetch: fetcher,
+ });
+
+ await client.getSkill("demo");
+ await expect(client.getTask("missing")).resolves.toBeNull();
+
+ const skillUrl = new URL(String(fetcher.mock.calls[0]![0]));
+ expect(skillUrl.searchParams.get("include_files")).toBe("true");
+ expect(skillUrl.searchParams.get("include_source")).toBe("false");
+ });
+
+ it("preserves empty content in write and message requests", async () => {
+ const fetcher = vi
+ .fn<typeof fetch>()
+ .mockImplementation(async () => ok({}));
+ const client = new OpenVikingClient({
+ baseUrl: "https://example.com",
+ fetch: fetcher,
+ });
+ await client.write("resources/empty.md", "");
+ await client.addMessage("session", { role: "assistant", content: "" });
+ expect(JSON.parse(String(fetcher.mock.calls[0]![1]?.body))).toMatchObject({
+ content: "",
+ });
+ expect(JSON.parse(String(fetcher.mock.calls[1]![1]?.body))).toMatchObject({
+ content: "",
+ });
+ });
+
+ it("maps non-JSON upload failures to OpenVikingError", async () => {
+ const fetcher = vi
+ .fn<typeof fetch>()
+ .mockResolvedValue(new Response("gateway failure", { status: 502 }));
+ const client = new OpenVikingClient({
+ baseUrl: "https://example.com",
+ fetch: fetcher,
+ });
+ await expect(client.addResource(new Blob(["hello"]))).rejects.toMatchObject(
+ { statusCode: 502 },
+ );
+ });
+
+ it("uploads an existing Node.js local file instead of sending its path to the server", async () => {
+ const directory = await mkdtemp(join(tmpdir(), "openviking-sdk-"));
+ const path = join(directory, "resource.md");
+ await writeFile(path, "local content");
+ try {
+ const fetcher = vi
+ .fn<typeof fetch>()
+ .mockResolvedValueOnce(ok({ temp_file_id: "temp-local" }))
+ .mockResolvedValueOnce(ok({}));
+ const client = new OpenVikingClient({
+ baseUrl: "https://example.com",
+ fetch: fetcher,
+ });
+ await client.addResource(path);
+ expect(JSON.parse(String(fetcher.mock.calls[1]![1]?.body))).toMatchObject(
+ { temp_file_id: "temp-local", source_name: "resource.md" },
+ );
+ } finally {
+ await rm(directory, { recursive: true, force: true });
+ }
+ });
+});
diff --git a/sdk/typescript/tsconfig.json b/sdk/typescript/tsconfig.json
new file mode 100644
index 000000000..5ebe65d40
--- /dev/null
+++ b/sdk/typescript/tsconfig.json
@@ -0,0 +1,15 @@
+{
+ "compilerOptions": {
+ "target": "ES2022",
+ "module": "ESNext",
+ "moduleResolution": "Bundler",
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
+ "types": ["node"],
+ "strict": true,
+ "noUncheckedIndexedAccess": true,
+ "exactOptionalPropertyTypes": true,
+ "declaration": true,
+ "skipLibCheck": true
+ },
+ "include": ["src", "tests"]
+}