@graview/studio

中文文档
0.2.5发布于 2026/11/16Elastic-2.0TypeScriptES Module构建来源已验证近 30 天下载 8769

The declaration itself as a graph: kinds, fields, edges, acts, rules, roles and grants as nodes, edited with ordinary mutations in Graview's own interface, checked before they are applied, migrated, and written back as the files graview create writes.

原始使用文档

@graview/studio

The declaration itself as a graph. Kinds, fields, edges, acts, rules, roles, grants, lenses and the brand are nodes of a meta-schema declared with the same defineNode an app uses, so the studio is a Graview app over the declaration: adding a field is an act, renaming a kind is an act, every change is an op with an author, an intent and an inverse, and graview check judges the result before it is applied.

import { createStudio, createStudioLens } from "@graview/studio";

const studio = createStudio(app);                 // the app's declaration, as a store
studio.store.apply({ name: "add-field", args: { kind: "kind:plot", label: "soil", type: "enum", required: true, options: ["clay", "loam"] } });
studio.check();                                   // graview check on what it would become
const applied = studio.apply();                   // { app, migration } — refused while there are errors
studio.files();                                   // src/domain/schema.ts, mutations.ts, invariants.ts, policy.ts

// An agent proposes; a person keeps or takes back.
studio.propose({ name: "add-kind", args: { label: "bed" } }, { kind: "agent", id: "planner" });
studio.proposals();                               // the agent's batches still standing
studio.decline("proposal:1");                     // undo, like any turn of an agent's

createStudioLens(app).View, registered over the studio's kinds with a title, is a place: what the checker says, judged on every change.

What a graph can carry is the declaration's shape. An act's hand-written body and a rule's judgment are code: the studio keeps the checkout's by name, writes a body for an act it declared from what the act says (create, connect, sever, write), and writes a rule it declared as one that judges nothing until the checkout gives it an evaluate.

版本与发布记录

@graview/studio 共发布 78 个版本,首次发布于 2026/10/02;过去 12 个月发布了 78 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.2.5latest2026/11/16今天
0.2.42026/11/161 天前
0.2.32026/11/152 天前
0.2.22026/11/152 天前
0.2.12026/11/152 天前
0.2.02026/11/134 天前

关于 @graview/studio 的常见问题

@graview/studio 是什么?

The declaration itself as a graph: kinds, fields, edges, acts, rules, roles and grants as nodes, edited with ordinary mutations in Graview's own interface, checked before they are applied, migrated, and written back as the files graview create writes.

如何安装 @graview/studio?

在项目目录运行 npm install @graview/studio,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=19.2.7)、react-dom(>=19.2.7)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@graview/studio 支持 TypeScript 吗?

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

@graview/studio 支持 ESM 还是 CommonJS?

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

@graview/studio 需要什么版本的 Node.js?

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

@graview/studio 可以商用吗?

@graview/studio 使用 Elastic-2.0 许可。声明的许可为 Elastic-2.0,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@graview/studio 的下载量有多少?

根据 npm 官方下载统计,@graview/studio 在 2026/10/17 – 2026/11/15 这 30 天内被下载 8,769 次,日均约 292 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@graview/studio 还在维护吗?

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