@aurigax-ai/ostia-extension-sdk

中文文档
0.5.12发布于 2026/10/22MITTypeScriptES Module构建来源已验证近 30 天下载 2335

Write extensions for Ostia: the client library, its types, manifest schemas and a project generator

原始使用文档
文档目录8 节
  1. Start a new extension
  2. Add it to an existing project
  3. What is in the package
  4. Check an extension or a marketplace
  5. Publish
  6. Source
  7. Versions
  8. Licence

Ostia extension SDK

Write extensions for Ostia: the client library and its types, JSON Schemas for the manifest files, a generator for a new extension project, and a command that checks an extension the way Ostia does.

An extension is a folder with a ostia.json manifest and, usually, a main.js that Ostia starts as its own process. The process talks to Ostia over a local socket; this SDK wraps that protocol. The full contract is in docs/EXTENSIONS.md.

Start a new extension

pnpm dlx @aurigax-ai/ostia-extension-sdk create weather
cd weather
pnpm install
pnpm validate     # builds dist/weather and checks it the way Ostia will

create <id> [folder] writes a small TypeScript project: a ostia.json with your id, one command in src/main.ts, a build that bundles it into a single main.js, and this SDK as a dev dependency. The id is 2 to 40 lowercase letters, digits or dashes; it becomes the ostia <id> ... command.

dist/weather is the extension. To try it, copy that folder to ~/.config/ostia/extensions/weather; Ostia notices it within a moment and asks you to approve it. Then run ostia weather greet you in a pane, or "Weather: Greet" from the palette.

The project translates itself: locales/zh-Hant.json holds its manifest strings and messages in Traditional Chinese, locales/en.json its English messages, and src/main.ts answers in the caller's language with createTranslator(). See "Translations" in docs/EXTENSIONS.md.

Ostia never runs a build, a package manager or a script from an extension, so ship one bundled main.js, as the generated build.mjs does.

Add it to an existing project

pnpm add -D @aurigax-ai/ostia-extension-sdk

The package is built: there is no install script to approve. It needs Node 20 or newer.

What is in the package

ImportWhat it is
@aurigax-ai/ostia-extension-sdkconnect() and the OstiaExtension API: commands, events, sidebar items, pane chips, settings, secrets, notifications, panels, diffs, terminals, the human's language, createTranslator, runTool, startPanelServer, onShutdown
@aurigax-ai/ostia-extension-sdk/panelFor the page inside a panel: call, onChange, context, h, icon, panel sizes
@aurigax-ai/ostia-extension-sdk/splitterA resizable split for panel pages
@aurigax-ai/ostia-extension-sdk/atomicWritewriteFileAtomic and writeFileAtomicAsync: replace a file in one rename, with the file and folder modes set from the start
@aurigax-ai/ostia-extension-sdk/panel.cssBase panel styles on Ostia's theme variables
@aurigax-ai/ostia-extension-sdk/assistThe engine behind Ostia's assistant. Give runAssistExtension a ProviderCatalog to serve chat, completions and prompt help from your own model provider. Needs ai, zod, @ai-sdk-tool/parser and undici installed
schemas/ostia.schema.jsonJSON Schema for the extension manifest (ostia.json)
schemas/ostia-marketplace.schema.jsonJSON Schema for a marketplace manifest (ostia-marketplace.json)

Point your editor at the schema from the manifest:

{ "$schema": "./node_modules/@aurigax-ai/ostia-extension-sdk/schemas/ostia.schema.json" }

The schema catches shape mistakes while you type. ostia-extension validate is the authority: it runs the same checks Ostia runs when it loads the extension.

Check an extension or a marketplace

pnpm exec ostia-extension validate dist/weather     # one extension folder
pnpm exec ostia-extension validate .                # a marketplace: a folder with ostia-marketplace.json
pnpm exec ostia-extension unlist extensions/weather # hide it in Ostia: installable only by the printed code

It exits 0 when Ostia would accept it and prints one line per problem otherwise. For an extension it also checks what a marketplace install requires: regular files only, at most 8000 files and 50 MiB. Run it on the folder you publish, not on a project folder that holds node_modules.

Publish

A marketplace is a git repository with an ostia-marketplace.json that lists extension folders. Commit your built folder to one, and people add the repository in Ostia under Settings → Extensions → Marketplaces. See "Marketplaces" in docs/EXTENSIONS.md.

Source

dist/ is what you import: the SDK bundled into a few plain, unminified JavaScript files. src/ holds the TypeScript it was built from, at the same paths as in packages/extension-sdk of the Ostia repository (src/client is the library, src/assist the assistant engine, src/contract the contract types, src/manifest the manifest loader and the ostia-extension command that runs it). It is there to read. The SDK is developed in the Ostia repository and published from it on every release, so the SDK and the app cannot drift apart. Report problems in that repository's issues.

Versions

Two numbers matter:

  • The extension API version (EXTENSION_API_VERSION, ostiaExtensionApi in package.json, api.json): the version of the contract, major.minor. Put it in your manifest as "api". A minor adds things and keeps every existing extension working; Ostia provides exactly one major. Ostia refuses an extension whose api it doesn't provide, and connect() refuses to run against an app older than the SDK it was built with.
  • The package version: the version of Ostia this SDK was built from.

Licence

MIT

版本与发布记录

@aurigax-ai/ostia-extension-sdk 共发布 19 个版本,首次发布于 2026/10/06;过去 12 个月发布了 19 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.5.12latest2026/10/2216 天前
0.5.12-rc.7next2026/10/2018 天前
0.5.12-rc.32026/10/1424 天前
0.5.12-rc.22026/10/1425 天前
0.5.112026/10/1226 天前
0.5.11-rc.22026/10/1226 天前

关于 @aurigax-ai/ostia-extension-sdk 的常见问题

@aurigax-ai/ostia-extension-sdk 是什么?

Write extensions for Ostia: the client library, its types, manifest schemas and a project generator

如何安装 @aurigax-ai/ostia-extension-sdk?

在项目目录运行 npm install @aurigax-ai/ostia-extension-sdk,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 ostia-extension,可以用 npx ostia-extension 直接运行。

@aurigax-ai/ostia-extension-sdk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@aurigax-ai/ostia-extension-sdk 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@aurigax-ai/ostia-extension-sdk 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@aurigax-ai/ostia-extension-sdk 可以商用吗?

@aurigax-ai/ostia-extension-sdk 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@aurigax-ai/ostia-extension-sdk 的下载量有多少?

根据 npm 官方下载统计,@aurigax-ai/ostia-extension-sdk 在 2026/10/07 – 2026/11/05 这 30 天内被下载 2,335 次,日均约 78 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aurigax-ai/ostia-extension-sdk 还在维护吗?

最新版本 0.5.12 发布于 2026/10/22(16 天前);至今共发布 19 个版本,其中过去 12 个月发布了 19 个;首次发布于 2026/10/06。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。