notis-apps

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Notis Apps Skill

Notis Apps 技能

Use this skill when the user wants a packaged Notis app -- task manager, CRM, dashboard, internal tool, etc. Notis apps are Vite + React projects that deploy into the Notis portal as installed apps for the current user or team.
Run the Notis CLI through NPX, for example
npx --package @notis_ai/cli@latest -- notis apps list
. Sign the CLI in once with
notis login
; each account you authorize is a profile you can switch between with
notis profile use
. The CLI bundles this
notis-apps
base skill and refreshes its canonical copy under
~/.notis/skills/base/
on every launch. It is independent of account-skill sync, feature flags, target selection, and cloud deletion.
当用户需要一个打包好的Notis应用(如任务管理器、CRM、仪表盘、内部工具等)时,使用此技能。Notis应用是Vite + React项目,可部署到Notis门户中,作为当前用户或团队的已安装应用。
通过NPX运行Notis CLI,例如
npx --package @notis_ai/cli@latest -- notis apps list
。使用
notis login
完成一次CLI登录;您授权的每个账户都是一个配置文件,可通过
notis profile use
在不同配置文件之间切换。CLI会捆绑这个
notis-apps
基础技能,并在每次启动时刷新其标准副本至
~/.notis/skills/base/
目录下。它独立于账户技能同步、功能标志、目标选择和云删除操作。

How Apps Are Built

应用构建方式

All Notis apps are built using the Notis CLI, either locally in a repo workspace or inside a Vercel Sandbox. The platform contract is the same in both cases:
  • the app is a Vite + React project
  • the app uses
    @notis/sdk
  • the app is packaged as an ES module bundle
  • the portal renders it as a React component inside the portal's React tree
所有Notis应用均使用Notis CLI构建,可在本地仓库工作区或Vercel沙箱内进行。两种场景下的平台约定一致:
  • 应用为Vite + React项目
  • 应用使用
    @notis/sdk
  • 应用打包为ES模块包
  • 门户将其作为React组件渲染在门户的React树中

App Workspace Tool Rules

应用工作区工具规则

  • Apps are the top-level packaging unit in Notis.
  • Choose the execution path before changing an app. A prompt that says the shell is a hosted/Vercel sandbox, or a shell rooted at
    /vercel/sandbox
    , is the hosted sandbox path. A shell on the user's computer with Notis Desktop available is the local Desktop path.
  • In a hosted sandbox, do not run
    apps dev
    : the user's Desktop cannot mount that sandbox filesystem. Unless the user explicitly requests preview-only, read-only, or no deployment, a request to create or edit an app authorizes deploying that app to the user's Workspace after
    apps build
    and automated
    apps verify
    pass. An opt-out stops after those tests with no remote app create/link, database mutation, deploy, or post-deploy checks. Pulling an existing app provides its exact link. For a new app, test first, then reconcile profile state and
    apps list --json
    against the canonical
    notis.config.ts
    name
    and intended personal/team scope: link one exact editable non-development match after a metadata-only (
    include_documents: false
    ) detail read proves scope, fail on ambiguity or scope mismatch, or create only when none exists. New CLI-created apps default to personal scope. Before creation, prove that canonicalizing the config
    title
    yields the config
    name
    . For personal scope, run
    apps create "<canonical-config-title>" . --json
    exactly once. For explicitly requested team scope, discover and inspect
    LOCAL_NOTIS_CREATE_APP
    , dry-run it, execute it exactly once with team visibility and the verified current team scope, verify the returned id/slug/team scope/edit permission, then
    apps link
    that exact id. Stop for read-only reconciliation if creation is ambiguous or outcome-unknown. In the local Desktop path, use
    apps dev [folder]
    , let the user test the DEV app, and deploy that development identity directly only after an explicit request. Use
    LOCAL_NOTIS_CREATE_APP
    only for a hosted team-scoped creation or another non-CLI administrative flow that explicitly requires a server-side app row.
  • Use
    LOCAL_NOTIS_UPDATE_APP
    to update app metadata.
  • Use
    LOCAL_NOTIS_LIST_APPS
    to discover the user's apps.
  • The full app lifecycle uses the CLI in the shell. Always run it through the registry-resolved package, for example
    npx --package @notis_ai/cli@latest -- notis apps init
    ; use the same prefix for
    build
    and
    deploy
    . In hosted shells, the CLI is pre-authenticated through
    NOTIS_JWT
    .
  • There are no
    save_app
    or
    load_app
    tools. Do not attempt to call them. Use only the CLI for app file operations.
  • Use
    npx --package @notis_ai/cli@latest -- notis apps scaffolds list
    (optionally with
    --search <term>
    ) to discover starting points before scaffolding. Every published Store app is a scaffold; the catalog is served from the public registry, not bundled inside the CLI.
  • Use
    LOCAL_NOTIS_LIST_PUBLIC_APP_STORE
    only to help users choose apps to install, not as a source-clone workflow.
  • Use
    LOCAL_NOTIS_INSTALL_APP
    only when the user explicitly wants to install from a listing.
  • Before installing, inspect the listing's
    required_capabilities
    . Explain each requested capability and obtain explicit approval; only then pass the matching token in
    approved_capabilities
    . Never infer capability approval. The current workspace-wide read token is
    workspace_databases_read
    ; the read-only cloud computer token is
    cloud_computer_read
    .
  • 应用是Notis中的顶级打包单元。
  • 修改应用前先选择执行路径。若提示shell为托管/Vercel沙箱,或shell根目录为
    /vercel/sandbox
    ,则为托管沙箱路径;若用户电脑上的shell可使用Notis Desktop,则为本地Desktop路径。
  • 在托管沙箱中,请勿运行
    apps dev
    :用户的Desktop无法挂载该沙箱文件系统。除非用户明确要求仅预览、只读或不部署,否则创建或编辑应用的请求意味着在
    apps build
    和自动化
    apps verify
    通过后,授权将应用部署到用户的工作区。选择退出的话,在完成这些测试后将停止操作,不会进行远程应用创建/关联、数据库变更、部署或部署后检查。拉取现有应用会提供其精确链接。对于新应用,先测试,再核对配置文件状态和
    apps list --json
    与标准
    notis.config.ts
    的
    name
    及预期个人/团队范围:在仅读取元数据(
    include_documents: false
    )的详情验证范围后,关联一个精确的可编辑非开发匹配项;若存在歧义或范围不匹配则失败,仅在无匹配项时创建。CLI创建的新应用默认使用个人范围。创建前,需验证将配置
    title
    标准化后是否等于配置
    name
    。对于个人范围,精确运行一次
    apps create "<canonical-config-title>" . --json
    。对于明确要求的团队范围,发现并检查
    LOCAL_NOTIS_CREATE_APP
    ,进行试运行,然后精确运行一次并设置团队可见性和已验证的当前团队范围,验证返回的id/slug/团队范围/编辑权限,再使用
    apps link
    关联该精确id。若创建存在歧义或结果未知,则停止操作并仅进行只读核对。在本地Desktop路径中,使用
    apps dev [folder]
    ,让用户测试DEV应用,仅在明确请求后直接部署该开发标识。仅在托管团队范围创建或其他明确需要服务器端应用行的非CLI管理流程中使用
    LOCAL_NOTIS_CREATE_APP
    。
  • 使用
    LOCAL_NOTIS_UPDATE_APP
    更新应用元数据。
  • 使用
    LOCAL_NOTIS_LIST_APPS
    发现用户的应用。
  • 完整的应用生命周期需在shell中使用CLI。始终通过注册表解析的包运行,例如
    npx --package @notis_ai/cli@latest -- notis apps init
    ;
    build
    和
    deploy
    命令使用相同前缀。在托管shell中,CLI通过
    NOTIS_JWT
    预认证。
  • 不存在
    save_app
    或
    load_app
    工具。请勿尝试调用它们。仅使用CLI进行应用文件操作。
  • 在搭建应用前,使用
    npx --package @notis_ai/cli@latest -- notis apps scaffolds list
    (可添加
    --search <term>
    进行筛选)发现起始模板。每个已发布的商店应用都是一个模板;目录来自公共注册表,而非捆绑在CLI内。
  • 仅在帮助用户选择要安装的应用时使用
    LOCAL_NOTIS_LIST_PUBLIC_APP_STORE
    ,而非作为源码克隆流程。
  • 仅当用户明确想要从列表安装应用时使用
    LOCAL_NOTIS_INSTALL_APP
    。
  • 安装前,检查列表中的
    required_capabilities
    。解释每个请求的权限并获得明确批准;之后再在
    approved_capabilities
    中传递匹配的令牌。切勿推断权限已获批准。当前工作区范围的只读令牌为
    workspace_databases_read
    ;只读云计算机令牌为
    cloud_computer_read
    。

Architecture

架构

Notis CLI (local workspace or Vercel Sandbox)
  -> Vite + React project with @notis/sdk
  -> notis apps init / dev / build / verify / create / link / pull / deploy
  -> ES module bundle (app.js + app.css) + manifest
  -> Portal renders as React component with real tools/databases
deploy
updates the linked installed app for the current account or team. After the user explicitly confirms the App Details page is ready,
apps publish --confirm-ready
submits that deployed version to the Team or Public Store review flow.
Notis CLI(本地工作区或Vercel沙箱)
  -> 集成@notis/sdk的Vite + React项目
  -> notis apps init / dev / build / verify / create / link / pull / deploy
  -> ES模块包(app.js + app.css)+ 清单
  -> 门户将其作为React组件渲染,并对接真实工具/数据库
deploy
命令会更新当前账户或团队的关联已安装应用。在用户明确确认应用详情页面准备就绪后,
apps publish --confirm-ready
会将该已部署版本提交至团队或公共商店审核流程。

Key Components

核心组件

  1. @notis/sdk (
    packages/sdk/
    ) -- SDK for app developers
    • @notis/sdk
      -- NotisProvider, runtime hooks, editors, selection helpers, and shortcut primitives
    • @notis/sdk/interactions
      -- headless collection actions and interaction types
    • @notis/sdk/config
      --
      defineNotisApp()
      for notis.config.ts
    • @notis/sdk/vite
      --
      notisViteConfig()
      for vite.config.ts
    • @notis/sdk/styles.css
      -- shadow-safe app shell styles and base app-surface classes
  2. CLI (
    packages/cli/src/command-specs/apps.js
    ) -- local development should center on
    apps dev
    , plus init, build, verify, create, deploy, link, pull, doctor, and list
  3. Server (
    server/routers/portal_views/
    ) -- Returns signed bundle URLs, proxies tool calls
  4. Portal (
    portal/src/components/apps/
    ) -- Renders app bundles as React components via AppViewRenderer
  1. @notis/sdk(
    packages/sdk/
    )——面向应用开发者的SDK
    • @notis/sdk
      ——NotisProvider、运行时钩子、编辑器、选择助手和快捷方式原语
    • @notis/sdk/interactions
      ——无UI集合操作和交互类型
    • @notis/sdk/config
      ——用于notis.config.ts的
      defineNotisApp()
    • @notis/sdk/vite
      ——用于vite.config.ts的
      notisViteConfig()
    • @notis/sdk/styles.css
      ——支持shadow DOM的应用外壳样式和基础应用表面类
  2. CLI(
    packages/cli/src/command-specs/apps.js
    )——本地开发应围绕
    apps dev
    展开,同时包含init、build、verify、create、deploy、link、pull、doctor和list命令
  3. Server(
    server/routers/portal_views/
    )——返回签名的包URL,代理工具调用
  4. Portal(
    portal/src/components/apps/
    )——通过AppViewRenderer将应用包渲染为React组件

Runtime Bridge

运行时桥接

Apps communicate with the platform through the
NotisRuntime
interface, provided by the portal via React context:
  • Portal development: the portal loads a local bundle for an active dev session and still provides a real
    NotisRuntime
    .
  • Portal: the portal creates a real
    NotisRuntime
    and passes it as a prop to
    NotisProvider
    . All calls go to
    /portal_views/runtime_query
    via fetch with the user's JWT.
  • The portal mounts the app inside a shadow-scoped content surface and injects the runtime before app mount. There is no supported window-global runtime fallback.
App code never accesses the runtime directly -- it uses SDK hooks (
useTool
,
useTools
,
useNotis
, etc.) which read from the
NotisProvider
context.
应用通过
NotisRuntime
接口与平台通信,该接口由门户通过React上下文提供:
  • 门户开发模式:门户为活跃的开发会话加载本地包,并仍提供真实的
    NotisRuntime
    。
  • 正式门户:门户创建真实的
    NotisRuntime
    ,并将其作为props传递给
    NotisProvider
    。所有调用均通过fetch发送至
    /portal_views/runtime_query
    ,并携带用户的JWT。
  • 门户将应用挂载在shadow作用域的内容表面,并在应用挂载前注入运行时。不支持全局window运行时作为 fallback。
应用代码永远不会直接访问运行时——它使用SDK钩子(
useTool
、
useTools
、
useNotis
等),这些钩子从
NotisProvider
上下文中读取数据。

Hard Rules

硬性规则

  1. React + Vite only -- No Next.js, no custom server
  2. ES module bundle -- Vite builds a library-mode bundle with React externalized
  3. Component rendering -- Apps render as React components directly in the portal. No iframes. The portal owns the
    ShadowRoot
    , theme tokens, and runtime provider.
  4. HTTP bridge -- Runtime calls use fetch to
    /portal_views/runtime_query
  5. Declarative tools -- Tool access is declared in
    notis.config.ts
    by the final names returned by tool discovery and enforced server-side. Views can call native Notis, connected integrations, PostForMe, and MCP tools directly; metered calls use the same credit-cap and usage-billing path as the CLI.
  6. shadcn + Notis theme -- Apps must use shadcn components with the live Notis theme provided by the portal
  7. Phosphor icons only -- Always
    phosphor:
    prefix. Never emojis.
  8. Database refs only --
    notis.config.ts
    references existing databases by slug. The schema source of truth lives in the
    databases
    table, not in the manifest. Every native database is owned by exactly one app (
    databases.owner_app_id
    ): creating one through
    LOCAL_NOTIS_DATABASE_UPSERT_DATABASE
    requires the owning app's slug or id in the
    app
    argument, install/dev materialization stamps ownership automatically, and deleting an app deletes its databases and their documents. An app-owned database slug is a stable deployed contract because bundles and collection routes may call it directly. Do not try to rename that slug with a schema tool; rename the display title instead.
  9. Use NPX for CLI commands -- Always run
    npx --package @notis_ai/cli@latest -- notis ...
    .
  10. apps deploy
    is not store publishing
    --
    apps deploy
    updates an installed app only and persists its source snapshot. Store review starts separately with
    apps publish --confirm-ready
    after explicit user approval.
  11. Routes are canonical -- Define navigation only in
    manifest.routes
    . Every configured route must declare an explicit
    slug
    . Do not rely on legacy
    manifest.views
    .
  12. Portal-owned sidebars stay portal-owned -- If a route uses
    collection.sidebar
    , treat that sidebar as platform chrome. Do not remove it, recreate it inside app JSX, or replace it with a custom in-app folder rail.
  13. Portal globals are off-limits -- Never use
    window.__NOTIS_RUNTIME__
    , query portal-owned DOM hooks, or create global DOM portals.
  14. Prefer inline optimistic edits -- Rename-like edits for collections, app-owned rows, and sidebar-backed entities should use inline editing with an optimistic UI update, then roll back on backend failure. Use modals only when the edit requires multiple fields or destructive confirmation.
  15. The execution environment determines the deploy gate -- In the local Desktop path, run
    apps dev [folder]
    , let the user test the automatically mounted DEV app, and do not deploy until the user asks; first deploy promotes that
    dev_app_id
    directly, so never create a second app first. In a hosted sandbox,
    apps dev
    cannot reach the user's Desktop; bootstrap
    agent-browser
    , build and verify first, then resolve exact identity/resources and deploy to the user's Workspace, verify the remote version and live runtime, and return the exact Portal URL. Automatic deployment is the default for create/edit requests only; an explicit preview-only, read-only, or no-deploy request wins. This standing sandbox authorization does not authorize Store submission.
  16. Installed app identity is exact, editable, and scope-proven -- Validate an explicit persisted link for this API/user profile before using it. Otherwise inspect every accessible exact-canonical-slug row, including development rows; link only one editable non-development candidate whose exact detail proves the intended personal/team scope. Fail closed on a development collision, multiple matches, missing scope proof, or scope mismatch, and never infer identity from display name. After first install, keep the validated profile-scoped link so Portal and CLI update the same app instead of creating duplicates.
  17. Development identities stay separate --
    .notis/state.json
    uses
    dev_app_id
    for the hidden development-runtime row and
    app_id
    only for an accessible installed workspace app, scoped under the authenticated environment. Never pass a runtime app whose manifest has
    is_dev: true
    to
    notis apps link
    .
  18. Automatic mounts are multi-instance and least-authority -- Prod, Beta, and source-development Desktop instances may mount the same source simultaneously with independent authenticated runtimes. Automatic mounting never grants capabilities: reuse existing grants and leave restricted capabilities denied until approved. Consumer leases expire after crashes so the shared host exits after the last live instance. There are no offline rows or manual start/stop controls.
  19. Store submission is user-gated -- Run
    apps publish --confirm-ready
    only after the user explicitly confirms the current App Details page and Store listing are ready. Deploy the exact approved local state first. The command must reject missing confirmation, incomplete listing media, a local/deployed version mismatch, private visibility, or an existing pending review.
  20. Bump
    notisAppVersion
    before linked development and every Store update
    --
    package.json
    must contain a semver
    notisAppVersion
    . A linked local source substitutes its installed Workspace app only when the local version is strictly greater than the installed manifest's
    release_version
    ; equal, lower, missing, or invalid versions keep serving the online bundle.
    apps pull
    retrieves the online version, so increment
    notisAppVersion
    before
    apps dev
    when continuing development. For an existing Store app, also increment it beyond the currently published registry version before deploy and submission; registry CI rejects equal or lower versions.
  21. CHANGELOG.md
    owns release history
    -- Keep the complete release history in one root
    CHANGELOG.md
    , newest entry first. Do not add new
    versionNotes
    values to
    notis.config.ts
    . Use
    ## [Release title] - YYYY-MM-DD
    , or
    {PR_MERGE_DATE}
    for an unpublished entry. App Details reads What’s New and Version History from the deployed package manifest, while the Store reads them from the latest published snapshot; unpublished workspace edits must never change the Store page. The manifest also exposes
    package.json
    notisAppVersion
    as the package version shown in App Details.
  22. Database rows are private unless explicitly seeded -- A string declaration such as
    databases: ['notes']
    publishes schema only and never includes the developer's rows. Use
    { slug: 'templates', seedDocuments: true }
    only for small, intentional starter content that every installer should receive. Never enable it for user-created notes, history, leads, or other personal data.
  23. Public submissions are complete, reviewable packages -- The registry PR must contain the full editable source tree, Store assets, exact source-declared database schemas, and only explicitly seeded starter rows. Registry CI validates those boundaries before merge; do not hand-edit
    notis-listing.json
    or strip source files to make a check pass. Fix the app locally, redeploy, and resubmit.
  24. New projects default to
    ~/.notis/apps/<slug>
    , and
    [dir]
    overrides it
    --
    apps init
    and
    apps pull
    use this stable, predictable home unless the app belongs in a specific repository, monorepo, or user-chosen location. In those cases, pass
    [dir]
    and report the resulting path. Do not nest an app inside a directory whose local workspace metadata selects an unrelated Notis runtime or profile: later CLI calls inherit that routing and may target the wrong environment.
  25. Machine names and display titles use different casing -- In
    notis.config.ts
    ,
    name
    is the stable machine identity and must be lowercase kebab-case (
    name: 'link-building'
    ).
    title
    is the human-facing app name and must use deliberate display casing (
    title: 'Link Building'
    ), preserving product spelling and acronyms such as
    Notis
    and
    SEO
    . Never put a title-cased phrase in
    name
    , never show a raw slug as the title, and never change an existing canonical
    name
    or remote slug merely to repair display casing. The persisted
    apps.name
    , Workspace sidebar, App Details, and Store listing must use
    title
    .
  1. 仅支持React + Vite——不支持Next.js,不支持自定义服务器
  2. ES模块包——Vite构建库模式包,React作为外部依赖
  3. 组件渲染——应用直接作为React组件在门户中渲染,不使用iframe。门户拥有
    ShadowRoot
    、主题令牌和运行时提供者。
  4. HTTP桥接——运行时调用通过fetch发送至
    /portal_views/runtime_query
  5. 声明式工具——工具访问权限在
    notis.config.ts
    中声明,使用工具发现返回的最终名称,并由服务器端强制执行。视图可直接调用原生Notis、已连接的集成、PostForMe和MCP工具;计量调用使用与CLI相同的信用上限和使用计费路径。
  6. shadcn + Notis主题——应用必须使用shadcn组件,并搭配门户提供的实时Notis主题
  7. 仅使用Phosphor图标——始终使用
    phosphor:
    前缀,切勿使用emoji
  8. 仅引用数据库——
    notis.config.ts
    通过slug引用现有数据库。模式的唯一来源是
    databases
    表,而非清单。每个原生数据库仅归一个应用所有(
    databases.owner_app_id
    ):通过
    LOCAL_NOTIS_DATABASE_UPSERT_DATABASE
    创建数据库时,需在
    app
    参数中传入所属应用的slug或id,安装/开发实例化会自动标记所有权,删除应用会删除其数据库及文档。应用所属的数据库slug是稳定的部署约定,因为包和集合路由可能直接调用它。请勿尝试使用模式工具重命名该slug;请改为重命名显示标题。
  9. 使用NPX执行CLI命令——始终运行
    npx --package @notis_ai/cli@latest -- notis ...
  10. apps deploy
    不等于商店发布
    ——
    apps deploy
    仅更新已安装的应用,并保留其源码快照。商店审核需在用户明确批准后,通过
    apps publish --confirm-ready
    单独启动。
  11. 路由为标准配置——仅在
    manifest.routes
    中定义导航。每个配置的路由必须声明明确的
    slug
    。请勿依赖旧版
    manifest.views
    。
  12. 门户侧边栏归门户所有——若路由使用
    collection.sidebar
    ,则将该侧边栏视为平台框架。请勿移除它、在应用JSX中重新创建它,或用自定义应用内文件夹导航栏替换它。
  13. 禁止访问门户全局对象——切勿使用
    window.__NOTIS_RUNTIME__
    、查询门户所有的DOM钩子,或创建全局DOM门户。
  14. 优先使用内联乐观编辑——集合、应用所属行和侧边栏支持实体的重命名类编辑应使用内联编辑和乐观UI更新,然后在后端失败时回滚。仅当编辑需要多个字段或破坏性确认时使用模态框。
  15. 执行环境决定部署条件——在本地Desktop路径中,运行
    apps dev [folder]
    ,让用户测试自动挂载的DEV应用,直到用户要求再部署;首次部署会直接升级该
    dev_app_id
    ,因此切勿先创建第二个应用。在托管沙箱中,
    apps dev
    无法连接到用户的Desktop;启动
    agent-browser
    ,先构建并验证,再解析精确标识/资源并部署到用户的工作区,验证远程版本和实时运行时,然后返回精确的门户URL。自动部署是创建/编辑请求的默认操作;明确的仅预览、只读或不部署请求优先。此沙箱授权不包括商店提交权限。
  16. 已安装应用的标识精确、可编辑且范围可验证——使用前验证此API/用户配置文件的明确持久链接。否则检查所有可访问的精确标准slug行,包括开发行;仅关联一个可编辑的非开发候选项,其仅元数据的精确应用详情可验证预期的个人/团队范围。若存在开发冲突、多个匹配项、缺少范围证明或范围不匹配,则失败,切勿从显示名称推断标识。首次安装后,保留已验证的配置文件范围链接,以便门户和CLI更新同一应用,而非创建重复项。
  17. 开发标识保持独立——
    .notis/state.json
    使用
    dev_app_id
    表示隐藏的开发运行时行,仅使用
    app_id
    表示可访问的已安装工作区应用,范围限定在已认证环境下。切勿将清单中
    is_dev: true
    的运行时应用传递给
    notis apps link
    。
  18. 自动挂载为多实例且权限最小化——生产、Beta和源码开发Desktop实例可同时挂载同一源码,且具有独立的已认证运行时。自动挂载永远不会授予权限:重用现有授权,受限权限在获得批准前保持拒绝状态。消费者租约在崩溃后过期,因此共享主机会在最后一个活动实例退出后退出。不存在离线行或手动启动/停止控件。
  19. 商店提交需用户确认——仅在用户明确确认当前应用详情页面和商店列表准备就绪后,运行
    apps publish --confirm-ready
    。先部署已批准的本地状态。若缺少确认、列表媒体不完整、本地/已部署版本不匹配、可见性为私有或存在待处理审核,该命令会拒绝执行。
  20. 在关联开发和每次商店更新前提升
    notisAppVersion
    ——
    package.json
    必须包含语义化版本的
    notisAppVersion
    。仅当本地版本严格大于已安装清单的
    release_version
    时,关联的本地源码才会替代其已安装的工作区应用;版本相等、更低、缺失或无效时,仍会提供在线包。
    apps pull
    会获取在线版本,因此在继续开发前,需在
    apps dev
    前提升
    notisAppVersion
    。对于现有商店应用,在部署和提交前,也需将其提升至当前已发布注册表版本之上;注册表CI会拒绝相等或更低的版本。
  21. CHANGELOG.md
    管理发布历史
    ——将完整的发布历史保存在根目录的
    CHANGELOG.md
    中,最新条目放在最前面。请勿向
    notis.config.ts
    添加新的
    versionNotes
    值。使用
    ## [Release title] - YYYY-MM-DD
    格式,或对于未发布条目使用
    {PR_MERGE_DATE}
    。应用详情页面的“新增功能”和“版本历史”从已部署包的清单读取,而商店从最新已发布快照读取;未发布的工作区编辑永远不得更改商店页面。清单还会将
    package.json
    中的
    notisAppVersion
    作为应用详情页面显示的包版本。
  22. 数据库行默认为私有,除非明确植入——类似
    databases: ['notes']
    的字符串声明仅发布模式,绝不包含开发者的行。仅当每个安装者都应接收少量有意的起始内容时,使用
    { slug: 'templates', seedDocuments: true }
    。切勿为用户创建的笔记、历史记录、销售线索或其他个人数据启用此选项。
  23. 公共提交需为完整、可审核的包——注册表PR必须包含完整的可编辑源码树、商店资源、源码声明的精确数据库模式,以及仅明确植入的起始行。注册表CI在合并前会验证这些边界;请勿手动编辑
    notis-listing.json
    或剥离源文件以通过检查。请在本地修复应用,重新部署并重新提交。
  24. 新项目默认位于
    ~/.notis/apps/<slug>
    ,
    [dir]
    可覆盖此路径
    ——
    apps init
    和
    apps pull
    使用此稳定、可预测的目录,除非应用属于特定仓库、单体仓库或用户选择的位置。在这些情况下,传入
    [dir]
    并报告最终路径。请勿将应用嵌套在本地工作区元数据选择无关Notis运行时或配置文件的目录中:后续CLI调用会继承该路由,可能指向错误的环境。
  25. 机器名称和显示标题使用不同大小写——在
    notis.config.ts
    中,
    name
    是稳定的机器标识,必须为小写短横线命名(如
    name: 'link-building'
    )。
    title
    是面向用户的应用名称,必须使用明确的显示大小写(如
    title: 'Link Building'
    ),保留产品拼写和缩写,如
    Notis
    和
    SEO
    。切勿在
    name
    中使用标题大小写短语,切勿将原始slug作为标题显示,切勿仅为修复显示大小写而更改现有标准
    name
    或远程slug。持久化的
    apps.name
    、工作区侧边栏、应用详情页面和商店列表必须使用
    title
    。

Anti-patterns -- NEVER do these

反模式——切勿执行以下操作

These are the most common mistakes agents make. Each one wastes time and produces broken results.
  • NEVER assume app deploys create databases for you -- Create or update databases through native Notis database tools or the assistant first, then reference them by slug in
    notis.config.ts
    . Database creation requires the owning app to exist: pass its slug or id in the
    app
    argument of
    LOCAL_NOTIS_DATABASE_UPSERT_DATABASE
    (create the app first with
    LOCAL_NOTIS_CREATE_APP
    if needed). A database can only be referenced by the app that owns it.
  • NEVER bypass the supported workflow by manually stitching together low-level save or lint calls from a local workspace -- Local agents should go through the NPX Notis CLI for
    apps pull
    ,
    apps dev
    ,
    apps build
    ,
    apps verify
    ,
    apps create
    ,
    apps link
    , and
    apps deploy
    .
  • NEVER use
    apps pull
    to clone a Store listing
    --
    npx --package @notis_ai/cli@latest -- notis apps pull
    only pulls source for an app the user can already access as an installed app. To fork a published Store app, run
    npx --package @notis_ai/cli@latest -- notis apps init "My App" --from <slug>
    instead: it downloads that app's source from the public registry, and installing the app first is not required.
  • NEVER apply the local deploy gate to a hosted sandbox -- On the user's local computer, a clean
    apps build
    +
    apps verify
    is not deploy consent: hand off the DEV app and wait. In a hosted sandbox, the user's create or edit request is deploy consent for that app because
    apps dev
    cannot reach their Desktop; deploy only after both commands pass, then verify the remote version. Neither path authorizes Store submission.
  • NEVER submit without explicit approval -- A deploy request alone does not authorize Store submission. Run
    npx --package @notis_ai/cli@latest -- notis apps publish --confirm-ready
    only when the user confirms App Details is ready for Store review.
  • NEVER write raw
    views/<slug>/index.js
    files
    -- Write standard React pages in
    app/
    .
  • NEVER invent
    npx --package @notis_ai/cli@latest -- notis apps push
    or bypass the review flow
    -- Source moves through
    apps pull
    and
    apps deploy
    ;
    apps publish --confirm-ready
    submits the deployed snapshot through the same authenticated review endpoint as App Details.
  • NEVER treat
    apps deploy
    as store submission
    -- It updates the linked installed app for the current account or team scope only. Store submission is a separate, explicitly confirmed step.
  • NEVER explore server code or tool schemas to invent an alternative app workflow -- Use the Notis CLI.
  • NEVER work around a missing
    collection.sidebar
    portal tree by rendering a duplicate sidebar inside the app
    -- keep the route manifest as the source of truth and escalate the missing portal sidebar as a platform bug instead.
  • NEVER invent a custom visual language -- Do not ship full-screen gradients, glassmorphism, bright neon palettes, or raw HTML controls as the primary UI. Apps should look like a natural extension of the portal.
  • NEVER hand-roll buttons/cards/badges when the scaffold already provides shadcn primitives -- Prefer
    @/components/ui/*
    and portal token classes such as
    bg-background
    ,
    bg-card
    ,
    border-border
    , and
    text-muted-foreground
    .
这些是代理最常犯的错误,每个错误都会浪费时间并产生无效结果。
  • 切勿假设应用部署会自动创建数据库——先通过原生Notis数据库工具或助手创建或更新数据库,然后在
    notis.config.ts
    中通过slug引用它们。创建数据库需要所属应用已存在:在
    LOCAL_NOTIS_DATABASE_UPSERT_DATABASE
    的
    app
    参数中传入其slug或id(若需要,先使用
    LOCAL_NOTIS_CREATE_APP
    创建应用)。数据库仅可由所属应用引用。
  • 切勿通过手动拼接本地工作区的低级保存或lint调用来绕过支持的工作流——本地代理应通过NPX Notis CLI执行
    apps pull
    、
    apps dev
    、
    apps build
    、
    apps verify
    、
    apps create
    、
    apps link
    和
    apps deploy
    命令。
  • 切勿使用
    apps pull
    克隆商店列表
    ——
    npx --package @notis_ai/cli@latest -- notis apps pull
    仅拉取用户已作为已安装应用访问的应用源码。要复刻已发布的商店应用,请运行
    npx --package @notis_ai/cli@latest -- notis apps init "My App" --from <slug>
    :它会从公共注册表下载该应用的源码,无需先安装应用。
  • 切勿将本地部署条件应用于托管沙箱——在用户的本地计算机上,成功的
    apps build
    +
    apps verify
    并不代表同意部署:交付DEV应用并等待用户确认。在托管沙箱中,用户的创建或编辑请求即为该应用的部署同意,因为
    apps dev
    无法连接到他们的Desktop;仅在两个命令都通过后部署,然后验证远程版本。两种路径均不授权商店提交。
  • 切勿未经明确批准提交——仅部署请求并不授权商店提交。仅当用户确认应用详情页面准备好进行商店审核时,才运行
    npx --package @notis_ai/cli@latest -- notis apps publish --confirm-ready
    。
  • 切勿编写原始
    views/<slug>/index.js
    文件
    ——在
    app/
    目录中编写标准React页面。
  • 切勿发明
    npx --package @notis_ai/cli@latest -- notis apps push
    命令或绕过审核流程
    ——源码通过
    apps pull
    和
    apps deploy
    传递;
    apps publish --confirm-ready
    通过与应用详情页面相同的已认证审核端点提交已部署快照。
  • 切勿将
    apps deploy
    视为商店提交
    ——它仅更新当前账户或团队范围的关联已安装应用。商店提交是一个单独的、需明确确认的步骤。
  • 切勿探索服务器代码或工具模式以发明替代应用工作流——使用Notis CLI。
  • 切勿通过在应用内渲染重复侧边栏来解决缺少
    collection.sidebar
    门户树的问题
    ——将路由清单作为唯一来源,并将缺少门户侧边栏视为平台漏洞上报。
  • 切勿发明自定义视觉语言——切勿将全屏渐变、毛玻璃效果、亮霓虹调色板或原始HTML控件作为主要UI。应用应看起来像是门户的自然扩展。
  • 切勿在模板已提供shadcn原语时手动编写按钮/卡片/徽章——优先使用
    @/components/ui/*
    和门户令牌类,如
    bg-background
    、
    bg-card
    、
    border-border
    和
    text-muted-foreground
    。

Workflow

工作流

Default to the Store scaffold catalog, not a blank project. Every published Store app is a scaffold:
notis apps scaffolds list
reads the catalog from the public registry, and
notis apps init --from <slug>
downloads that app's source. Most user requests overlap with a published app, and starting from one is faster than a bare app.
  1. Find a starting point. Run
    npx --package @notis_ai/cli@latest -- notis apps scaffolds list
    (add
    --search <term>
    to filter) to list the published Store apps. If something close matches, run
    npx --package @notis_ai/cli@latest -- notis apps init "My App" --from <slug>
    to download that app's source from the registry. Only run plain
    notis apps init "My App"
    when no published app fits. Either way the project lands in
    ~/.notis/apps/<slug>
    ; add a
    [dir]
    argument when the user wants it somewhere else (a tracked git repo, an existing monorepo), and report the path you used.
  2. Pull your own apps; fork Store apps with
    --from
    .
    apps pull
    is for apps the user already has installed or deployed: run
    npx --package @notis_ai/cli@latest -- notis apps list
    , preserve any local edits in the target directory, then run
    npx --package @notis_ai/cli@latest -- notis apps pull <app-id>
    (lands in
    ~/.notis/apps/<app-slug>
    ; pass a
    [dir]
    argument to place it elsewhere). A pull reproduces the installed release, so increment
    package.json
    notisAppVersion
    above that release before
    apps dev
    ; until then the online bundle remains active. To fork a published Store app, use
    apps init --from <slug>
    instead -- it downloads the source from the registry and does not require installing the app first.
  3. Edit the listing source. In
    notis.config.ts
    , set
    name
    to the stable lowercase kebab-case identity and set
    title
    to the correctly cased human-facing name; for example,
    name: 'link-building'
    with
    title: 'Link Building'
    . Treat acronym and brand casing as editorial input, not something to derive mechanically from the slug. Then update description, icon, accent, author, categories, tagline, databases, routes, and tools. Declare a database as a string for schema-only Store packaging; use
    { slug: 'templates', seedDocuments: true }
    only when its rows are deliberate starter content for every installer. Keep the complete Store release history in the root
    CHANGELOG.md
    , newest entry first, using
    ## [Release title] - YYYY-MM-DD
    (or
    {PR_MERGE_DATE}
    before publication). The first entry powers What’s New and the same file powers Version History.
    icon
    is a
    phosphor:<name>
    value or
    metadata/icon.png
    ; when unset the app shows its two-letter initials everywhere (store, sidebar, app details).
    accent
    optionally pins the avatar color to one of
    blue|violet|emerald|amber|rose|sky|fuchsia|teal
    (default derived from the app id). Icon/accent flow through deploy onto the app row + listing and can also be set later via the
    update_app
    tool.
  4. Build pages in
    app/
    .
    Reuse scaffold code wherever it fits.
  5. Test the source before remote mutation. Before changing a linked installed app, increment
    package.json
    notisAppVersion
    above the installed release. In a fresh hosted sandbox, bootstrap Agent Browser with
    npm exec --yes --package agent-browser@latest -- agent-browser install
    . Generate configured screenshots; use
    theme: 'dark'
    or
    theme: 'light'
    where appropriate and reserve screenshot
    --raw
    for diagnostics. Run
    npm install
    , run
    npx --package @notis_ai/cli@latest -- notis apps build
    , then run
    npx --yes --package @notis_ai/cli@latest --package agent-browser@latest -- notis apps verify
    in the sandbox (or the normal NPX verification command locally). Fix every failure. Do not create an app, mutate a database, or deploy before both checks pass.
    --no-browser
    is manual triage, not a passing automated gate.
  6. Finish the local Desktop path at the DEV handoff. Run
    npx --package @notis_ai/cli@latest -- notis apps dev [folder]
    ; it creates the development identity and materializes available scaffold database snapshots without requiring a hosted app id. Hand off after the user can see and test the app in its DEV-badged Workspace row. Do not deploy until the user asks, and then run
    apps deploy
    directly so the existing
    dev_app_id
    is promoted in place; never run
    apps create
    after
    apps dev
    . Before handing off, complete all three acceptance checks:
    1. Root:
      apps roots list
      contains the intended folder (or the app is under the implicit default root).
    2. Bundle: the loopback
      /snapshot
      responds successfully and contains the expected manifest/routes.
    3. Mount and render: the app appears exactly once with a compact
      DEV
      badge and its default route renders. For multi-instance work, verify each requested Desktop independently. See Troubleshooting → App is missing from the sidebar if any check fails.
  7. Gate and resolve one hosted identity after tests pass. If the request is preview-only, read-only, or no-deploy, stop after step 5: do not create or link an app, mutate a database, deploy, or run post-deploy checks. Otherwise, existing edits keep the exact profile-scoped id linked by
    apps pull
    , after a metadata-only (
    include_documents: false
    ) app-detail read validates its edit permission and scope without materializing databases. For a new hosted app, default the intended scope to personal unless the user explicitly requests team scope, inspect
    .notis/state.json
    , and run
    apps list --json
    . Consider every accessible exact canonical-slug row, including development rows. Link only one editable, non-development candidate whose metadata-only exact app-detail read proves the intended scope; fail on multiple matches, development-row collisions, missing scope proof, or scope mismatch. Create only when there are zero exact-slug rows. First prove that lowercasing the config
    title
    , replacing non-alphanumeric runs with
    -
    , and trimming hyphens yields the config
    name
    . For personal scope, run
    npx --package @notis_ai/cli@latest -- notis apps create "<canonical-config-title>" . --json
    exactly once and verify the returned id, remote slug, edit permission, and personal scope. For explicitly requested team scope, use
    notis tools search
    to discover the team-capable app-creation tool, inspect its schema, dry-run it, then execute
    LOCAL_NOTIS_CREATE_APP
    exactly once with the canonical display title,
    visibility: "team"
    , and the exact current
    team_id
    when resolved. Verify the result's id, canonical slug,
    team_id
    , team visibility, and edit permission, then run
    notis apps link <returned-id> .
    before database reconciliation. Never retry an outcome-unknown create; reconcile read-only and stop on ambiguity or any returned identity/scope mismatch.
  8. Reconcile hosted database schemas safely. Read the exact app detail and current schemas first; mutate only missing or changed declarations. For creation, pass the exact app id in the database tool's
    app
    argument. For an update, resolve the exact
    database_id
    , verify its
    owner_app_id
    equals the linked app id, update by that
    database_id
    , then read back slug, owner, and schema. Apply only backward-compatible schema expansion before deployment. Stage breaking or destructive changes through an expand-contract sequence and obtain the required destructive approval; never make the currently deployed bundle incompatible before its replacement is live.
  9. Deploy and prove the hosted sandbox result. Use only the exact id established in step 7. Run
    npx --package @notis_ai/cli@latest -- notis apps deploy
    , read the matching row back with
    npx --package @notis_ai/cli@latest -- notis apps list --json
    , confirm its id and deployed version, then run
    npx --yes --package @notis_ai/cli@latest --package agent-browser@latest -- notis apps verify --mode live
    . Return that row's exact profile-appropriate
    portal_url
    only after every proof passes. Report state precisely: a definite pre-commit rejection is tested but not deployed; a timeout/network/incomplete mutation response is tested, deployment outcome unknown; a confirmed deploy followed by failed readback is deployed but not remotely verified; a failed live check is deployed but live verification failed. Never retry an outcome-unknown mutation.
  10. Submit only after confirmation. When the user explicitly confirms the current App Details page is ready, ensure the approved state is deployed, then run
    npx --package @notis_ai/cli@latest -- notis apps publish --confirm-ready
    . The command submits Team apps immediately or opens the Public Store registry review PR. Without that confirmation, stop after deploy.
默认使用商店模板目录,而非空白项目。每个已发布的商店应用都是一个模板:
notis apps scaffolds list
从公共注册表读取目录,
notis apps init --from <slug>
下载该应用的源码。大多数用户请求与已发布应用重叠,从模板开始比从空白应用更快。
  1. 找到起始模板。运行
    npx --package @notis_ai/cli@latest -- notis apps scaffolds list
    (添加
    --search <term>
    进行筛选)列出已发布的商店应用。若有相近匹配项,运行
    npx --package @notis_ai/cli@latest -- notis apps init "My App" --from <slug>
    从注册表下载该应用的源码。仅当没有已发布应用符合需求时,才运行纯
    notis apps init "My App"
    。无论哪种方式,项目都会位于
    ~/.notis/apps/<slug>
    ;当用户希望将其放在其他位置(如已跟踪的git仓库、现有单体仓库)时,添加
    [dir]
    参数,并报告使用的路径。
  2. 拉取自己的应用;使用
    --from
    复刻商店应用
    。
    apps pull
    用于用户已安装或部署的应用:运行
    npx --package @notis_ai/cli@latest -- notis apps list
    ,保留目标目录中的任何本地编辑,然后运行
    npx --package @notis_ai/cli@latest -- notis apps pull <app-id>
    (位于
    ~/.notis/apps/<app-slug>
    ;传入
    [dir]
    参数可将其放在其他位置)。拉取操作会重现已安装的版本,因此在
    apps dev
    前需将
    package.json
    中的
    notisAppVersion
    提升至该版本之上;在此之前,在线包仍会生效。要复刻已发布的商店应用,请使用
    apps init --from <slug>
    ——它会从注册表下载源码,无需先安装应用。
  3. 编辑列表源码。在
    notis.config.ts
    中,设置
    name
    为稳定的小写短横线标识,设置
    title
    为正确大小写的用户友好名称;例如,
    name: 'link-building'
    搭配
    title: 'Link Building'
    。将缩写和品牌大小写视为编辑输入,而非从slug机械推导的内容。然后更新描述、图标、强调色、作者、类别、标语、数据库、路由和工具。将数据库声明为字符串仅用于商店打包模式;仅当数据库行是每个安装者都应接收的有意起始内容时,使用
    { slug: 'templates', seedDocuments: true }
    。将完整的商店发布历史保存在根目录的
    CHANGELOG.md
    中,最新条目放在最前面,使用
    ## [Release title] - YYYY-MM-DD
    格式(发布前使用
    {PR_MERGE_DATE}
    )。第一条目用于“新增功能”,同一文件用于“版本历史”。
    icon
    是
    phosphor:<name>
    值或
    metadata/icon.png
    ;未设置时,应用在所有位置(商店、侧边栏、应用详情)显示其两个字母的首字母缩写。
    accent
    可将头像颜色固定为
    blue|violet|emerald|amber|rose|sky|fuchsia|teal
    之一(默认从应用id派生)。图标/强调色会随部署应用到应用行+列表,也可稍后通过
    update_app
    工具设置。
  4. 在
    app/
    目录中构建页面
    。尽可能重用模板代码。
  5. 远程变更前测试源码。在更改关联的已安装应用前,将
    package.json
    中的
    notisAppVersion
    提升至已安装版本之上。在新的托管沙箱中,使用
    npm exec --yes --package agent-browser@latest -- agent-browser install
    启动Agent Browser。生成配置的截图;根据需要使用
    theme: 'dark'
    或
    theme: 'light'
    ,仅在诊断时保留截图
    --raw
    选项。运行
    npm install
    ,运行
    npx --package @notis_ai/cli@latest -- notis apps build
    ,然后在沙箱中运行
    npx --yes --package @notis_ai/cli@latest --package agent-browser@latest -- notis apps verify
    (本地使用常规NPX验证命令)。修复所有失败项。在两项检查通过前,请勿创建应用、变更数据库或部署。
    --no-browser
    仅用于手动排查,不视为通过自动化检查。
  6. 本地Desktop路径在DEV交付时完成。运行
    npx --package @notis_ai/cli@latest -- notis apps dev [folder]
    ;它会创建开发标识,并实例化可用的模板数据库快照,无需托管应用id。在用户可在其DEV标记的工作区行中查看并测试应用后交付。直到用户要求再部署,然后直接运行
    apps deploy
    ,以便现有
    dev_app_id
    直接升级;切勿在
    apps dev
    后运行
    apps create
    。交付前完成三项验收检查:
    1. 根目录:
      apps roots list
      包含预期文件夹(或应用在隐式默认根目录下)。
    2. 包:环回
      /snapshot
      响应成功,并包含预期的清单/路由。
    3. 挂载和渲染:应用仅显示一次,带有紧凑的
      DEV
      徽章,且其默认路由已渲染。对于多实例工作,独立验证每个请求的Desktop。 若任何检查失败,请参阅故障排除→应用未出现在侧边栏。
  7. 测试通过后锁定并解析一个托管标识。若请求为仅预览、只读或不部署,则在步骤5后停止:请勿创建或关联应用、变更数据库、部署或运行部署后检查。否则,现有编辑会保留
    apps pull
    关联的精确配置文件范围id,通过仅读取元数据(
    include_documents: false
    )的应用详情验证其编辑权限和范围,无需实例化数据库。对于新的托管应用,默认预期范围为个人,除非用户明确要求团队范围,检查
    .notis/state.json
    ,并运行
    apps list --json
    。检查所有可访问的精确标准slug行,包括开发行。仅关联一个可编辑的非开发候选项,其仅元数据的精确应用详情可验证预期范围;若存在多个匹配项、开发行冲突、缺少范围证明或范围不匹配,则失败。仅当没有精确slug行时才创建。首先验证将配置
    title
    转为小写、将非字母数字序列替换为
    -
    并修剪
    -
    后是否等于配置
    name
    。对于个人范围,精确运行一次
    npx --package @notis_ai/cli@latest -- notis apps create "<canonical-config-title>" . --json
    ,并验证返回的id、远程slug、编辑权限和个人范围。对于明确要求的团队范围,使用
    notis tools search
    发现支持团队的应用创建工具,检查其模式,进行试运行,然后精确运行
    LOCAL_NOTIS_CREATE_APP
    ,传入标准显示标题、
    visibility: "team"
    和解析后的精确当前
    team_id
    。验证结果的id、标准slug、
    team_id
    、团队可见性和编辑权限,然后在数据库核对前运行
    notis apps link <returned-id> .
    。切勿重试结果未知的创建操作;若存在歧义或任何返回的标识/范围不匹配,则停止操作并仅进行只读核对。
  8. 安全核对托管数据库模式。先读取精确的应用详情和当前模式;仅变更缺失或已更改的声明。创建时,在数据库工具的
    app
    参数中传入精确的应用id。更新时,解析精确的
    database_id
    ,验证其
    owner_app_id
    等于关联应用的id,通过该
    database_id
    更新,然后回读slug、所有者和模式。部署前仅应用向后兼容的模式扩展。通过扩展-收缩序列分步进行破坏性变更,并获得所需的破坏性批准;切勿在替代包上线前使当前已部署包不兼容。
  9. 部署并验证托管沙箱结果。仅使用步骤7中确定的精确id。运行
    npx --package @notis_ai/cli@latest -- notis apps deploy
    ,使用
    npx --package @notis_ai/cli@latest -- notis apps list --json
    回读匹配的行,确认其id和已部署版本,然后运行
    npx --yes --package @notis_ai/cli@latest --package agent-browser@latest -- notis apps verify --mode live
    。仅在所有验证通过后,返回该行的精确配置文件对应的
    portal_url
    。精确报告状态:明确的预提交拒绝为已测试但未部署;超时/网络/不完整变更响应为已测试,部署结果未知;确认部署但回读失败为已部署但未远程验证;实时检查失败为已部署但实时验证失败。切勿重试结果未知的变更操作。
  10. 仅在确认后提交。当用户明确确认当前应用详情页面准备就绪时,确保已批准的状态已部署,然后运行
    npx --package @notis_ai/cli@latest -- notis apps publish --confirm-ready
    。该命令会立即提交团队应用,或打开公共商店注册表审核PR。若无该确认,则在部署后停止操作。

Quick start

快速开始

Choose the local or hosted finish after verification. Local deployment is user-gated; hosted-sandbox deployment is the default for app create or edit tasks unless the user explicitly requests preview-only, read-only, or no deploy.
bash
undefined
验证后选择本地或托管完成方式。本地部署需用户确认;托管沙箱部署是应用创建或编辑任务的默认方式,除非用户明确要求仅预览、只读或不部署。
bash
undefined

1. Pick a published Store app as the scaffold (catalog comes from the public registry)

1. 选择已发布的商店应用作为模板(目录来自公共注册表)

The project lands in ~/.notis/apps/<slug>; append a directory argument when

项目会位于~/.notis/apps/<slug>;当用户希望将应用放在其跟踪的仓库中时,追加目录参数。

the user wants the app in a repo they track.

—
npx --package @notis_ai/cli@latest -- notis apps scaffolds list npx --package @notis_ai/cli@latest -- notis apps init "My App" --from <slug> cd ~/.notis/apps/my-app npm install
npx --package @notis_ai/cli@latest -- notis apps scaffolds list npx --package @notis_ai/cli@latest -- notis apps init "My App" --from <slug> cd ~/.notis/apps/my-app npm install

2. LOCAL COMPUTER: register with Desktop and iterate. After the user approves

2. 本地计算机:在Desktop注册并迭代。用户批准部署后,直接运行deploy升级现有dev_app_id。

deployment, run deploy directly to promote the existing dev_app_id.

—
npx --package @notis_ai/cli@latest -- notis apps dev
npx --package @notis_ai/cli@latest -- notis apps dev

... user tests the DEV-badged app ...

... 用户测试带有DEV徽章的应用 ...

npx --package @notis_ai/cli@latest -- notis apps build npx --package @notis_ai/cli@latest -- notis apps screenshot npx --package @notis_ai/cli@latest -- notis apps verify npx --package @notis_ai/cli@latest -- notis apps deploy

Hosted sandbox finish — never run `apps dev`. Test first, then reconcile the
exact app identity and changed databases before deployment:

```bash
npm exec --yes --package agent-browser@latest -- agent-browser install
npx --yes --package @notis_ai/cli@latest --package agent-browser@latest -- notis apps screenshot
npx --package @notis_ai/cli@latest -- notis apps build
npx --yes --package @notis_ai/cli@latest --package agent-browser@latest -- notis apps verify
npx --package @notis_ai/cli@latest -- notis apps build npx --package @notis_ai/cli@latest -- notis apps screenshot npx --package @notis_ai/cli@latest -- notis apps verify npx --package @notis_ai/cli@latest -- notis apps deploy

托管沙箱完成方式——切勿运行`apps dev`。先测试,然后在部署前核对精确的应用标识和已更改的数据库:

```bash
npm exec --yes --package agent-browser@latest -- agent-browser install
npx --yes --package @notis_ai/cli@latest --package agent-browser@latest -- notis apps screenshot
npx --package @notis_ai/cli@latest -- notis apps build
npx --yes --package @notis_ai/cli@latest --package agent-browser@latest -- notis apps verify

New unlinked app only: reconcile exact canonical slug with apps list. If no

仅针对新的未关联应用:核对精确标准slug与apps list。若无匹配项,使用配置标题创建一次并验证返回的slug。

match exists, create once with the config title and verify the returned slug.

—
npx --package @notis_ai/cli@latest -- notis apps list --json
npx --package @notis_ai/cli@latest -- notis apps list --json

Before create, prove canonicalize(config.title) == config.name.

创建前,验证canonicalize(config.title) == config.name。

npx --package @notis_ai/cli@latest -- notis apps create "<canonical-config-title>" . --json
npx --package @notis_ai/cli@latest -- notis apps create "<canonical-config-title>" . --json

Compare schemas, then create only missing databases or update changed ones by

比较模式,然后仅创建缺失的数据库或通过已验证的database_id更新已更改的数据库,在继续前回读所有者/模式。

verified database_id and read back owner/schema before continuing.

—
npx --package @notis_ai/cli@latest -- notis apps deploy npx --package @notis_ai/cli@latest -- notis apps list --json npx --yes --package @notis_ai/cli@latest --package agent-browser@latest -- notis apps verify --mode live

Store submission on either path remains a separate approval-gated action:

```bash
npx --package @notis_ai/cli@latest -- notis apps publish --confirm-ready
For an existing app, link the checkout first so every later command uses the same profile-scoped installed identity:
bash
npx --package @notis_ai/cli@latest -- notis apps link <app-id> .
npx --package @notis_ai/cli@latest -- notis apps deploy
Or if editing an installed app locally:
bash
npx --package @notis_ai/cli@latest -- notis apps list
npx --package @notis_ai/cli@latest -- notis apps pull <installed-app-id>
cd ~/.notis/apps/my-app
npm install
npx --package @notis_ai/cli@latest -- notis apps deploy npx --package @notis_ai/cli@latest -- notis apps list --json npx --yes --package @notis_ai/cli@latest --package agent-browser@latest -- notis apps verify --mode live

无论哪种路径,商店提交都是单独的需批准操作:

```bash
npx --package @notis_ai/cli@latest -- notis apps publish --confirm-ready
对于现有应用,先关联检出的代码,以便后续每个命令都使用相同的配置文件范围已安装标识:
bash
npx --package @notis_ai/cli@latest -- notis apps link <app-id> .
npx --package @notis_ai/cli@latest -- notis apps deploy
或者在本地编辑已安装的应用:
bash
npx --package @notis_ai/cli@latest -- notis apps list
npx --package @notis_ai/cli@latest -- notis apps pull <installed-app-id>
cd ~/.notis/apps/my-app
npm install

Increment package.json notisAppVersion above the pulled online release.

将package.json中的notisAppVersion提升至拉取的在线版本之上。

npx --package @notis_ai/cli@latest -- notis apps dev npx --package @notis_ai/cli@latest -- notis apps build npx --package @notis_ai/cli@latest -- notis apps verify npx --package @notis_ai/cli@latest -- notis apps link <installed-app-id> .
npx --package @notis_ai/cli@latest -- notis apps dev npx --package @notis_ai/cli@latest -- notis apps build npx --package @notis_ai/cli@latest -- notis apps verify npx --package @notis_ai/cli@latest -- notis apps link <installed-app-id> .

Only after the user explicitly asks to deploy:

仅在用户明确要求部署时运行:

npx --package @notis_ai/cli@latest -- notis apps deploy

In a hosted sandbox, use the same pull/build/verify sequence but omit `apps
dev`; bootstrap `agent-browser`, materialize any new or changed database schemas
against the exact linked id, deploy automatically after verification, read back
the exact app id/version and `portal_url` with `apps list --json`, run live verification, and return that
exact Portal URL. Never run `apps publish --confirm-ready` without separate
Store approval.
npx --package @notis_ai/cli@latest -- notis apps deploy

在托管沙箱中,使用相同的拉取/构建/验证序列,但省略`apps dev`;启动`agent-browser`,针对精确的关联id实例化任何新的或已更改的数据库模式,验证后自动部署,使用`apps list --json`回读精确的应用id/版本和`portal_url`,运行实时验证,然后返回该精确的门户URL。若无单独的商店批准,切勿运行`apps publish --confirm-ready`。

Building an App

构建应用

Step 1: Define the config

步骤1:定义配置

Create
notis.config.ts
with:
  • name -- Stable machine identity in lowercase kebab-case, such as
    link-building
    ; do not use display casing here
  • title -- Human-facing app name with deliberate casing, such as
    Link Building
    ; preserve brands and acronyms exactly
  • databases -- Slug references to existing Notis databases
  • routes -- Route-first sidebar entries with explicit
    slug
    , optional
    parentSlug
    , and optional
    collection.sidebar
    tree config
  • tools -- Final tool names the app can call at runtime. Use the shared discovery flow (
    COMPOSIO_SEARCH_TOOLS
    , then
    COMPOSIO_GET_TOOL_SCHEMAS
    ) while building the app, and copy the returned final names into this list. Examples include
    LOCAL_NOTIS_DATABASE_QUERY
    ,
    LOCAL_NOTIS_MONID_RUN
    ,
    GMAIL_SEND_EMAIL
    ,
    LOCAL_POSTFORME_CREATE_POST
    , and
    LOCAL_MCP_<SERVER>_<TOOL>
    . App code calls each declared name directly through
    useTool
    ; it does not wrap provider or MCP calls in
    COMPOSIO_MULTI_EXECUTE_TOOL
    . Access stays scoped to the signed-in user's own connections, native database tools stay scoped to the app's databases unless
    capabilities.workspaceDatabases: 'read'
    is granted, and metered tools use the CLI-equivalent credit-cap and fail-closed usage-billing path.
For collection-backed sidebars, use the route schema directly:
ts
routes: [
  {
    path: '/',
    slug: 'notes',
    name: 'Notes',
    icon: 'phosphor:note-pencil',
    default: true,
    collection: {
      database: 'notes',
      titleProperty: 'Title',
      parentProperty: 'Parent note',
      sidebar: {
        mode: 'tree',
        allowCreate: true,
      },
    },
  },
]
Use the same page template for the root Notes route and collection/sub-collection detail states. The portal sidebar injects live collection items under the static route row when
collection.sidebar.mode === 'tree'
.
For arbitrary app-owned resources that are not Notis collection rows, set
resourceDeepLinks: true
on the route. Read the decoded
?resource=
identifier from
useNotis().resourceId
, and link between routes with
toRoute('/inbox', { resourceId })
. Keep collection links on
?item=
. Publish external preview/source links as the resource
url
; the host separately supplies the exact Notis review link as
active_resource.view_url
for opted-in routes. Handle missing or deleted identifiers with a safe view-level fallback.
创建
notis.config.ts
,包含:
  • name——稳定的机器标识,使用小写短横线命名,如
    link-building
    ;此处请勿使用显示大小写
  • title——用户友好的应用名称,使用明确的大小写,如
    Link Building
    ;精确保留品牌和缩写
  • databases——对现有Notis数据库的slug引用
  • routes——基于路由的侧边栏条目,带有明确的
    slug
    、可选的
    parentSlug
    和可选的
    collection.sidebar
    树配置
  • tools——应用在运行时可调用的最终工具名称。构建应用时使用共享发现流程(
    COMPOSIO_SEARCH_TOOLS
    ,然后
    COMPOSIO_GET_TOOL_SCHEMAS
    ),并将返回的最终名称复制到此列表中。示例包括
    LOCAL_NOTIS_DATABASE_QUERY
    、
    LOCAL_NOTIS_MONID_RUN
    、
    GMAIL_SEND_EMAIL
    、
    LOCAL_POSTFORME_CREATE_POST
    和
    LOCAL_MCP_<SERVER>_<TOOL>
    。应用代码通过
    useTool
    直接调用每个声明的名称;它不会在
    COMPOSIO_MULTI_EXECUTE_TOOL
    中包装提供者或MCP调用。访问权限限定在已登录用户自己的连接范围内,原生数据库工具限定在应用的数据库范围内,除非授予
    capabilities.workspaceDatabases: 'read'
    权限;计量工具使用与CLI等效的信用上限和失败关闭的使用计费路径。
对于集合支持的侧边栏,直接使用路由模式:
ts
routes: [
  {
    path: '/',
    slug: 'notes',
    name: 'Notes',
    icon: 'phosphor:note-pencil',
    default: true,
    collection: {
      database: 'notes',
      titleProperty: 'Title',
      parentProperty: 'Parent note',
      sidebar: {
        mode: 'tree',
        allowCreate: true,
      },
    },
  },
]
为根Notes路由和集合/子集合详情状态使用相同的页面模板。当
collection.sidebar.mode === 'tree'
时,门户侧边栏会在静态路由行下注入实时集合项。
对于不属于Notis集合行的任意应用所属资源,在路由上设置
resourceDeepLinks: true
。从
useNotis().resourceId
读取解码后的
?resource=
标识符,并使用
toRoute('/inbox', { resourceId })
在路由之间跳转。将集合链接保留在
?item=
上。将外部预览/源码链接发布为资源
url
;主机单独为选择加入的路由提供精确的Notis审核链接作为
active_resource.view_url
。使用安全的视图级回退处理缺失或已删除的标识符。

Step 2: Build pages

步骤2:构建页面

Standard React pages in
app/
. Use generic SDK tool hooks for data and build on top of the scaffolded shadcn components and portal shell classes (
notis-app-shell
,
notis-app-surface
):
tsx
'use client';
import { useEffect, useState } from 'react';
import { useTool } from '@notis/sdk';
import { Card } from '@/components/ui/card';

type QueryTasksArgs = { database_id?: string; database_slug?: string; query: { page_size?: number } };
type TaskDoc = { document_id?: string; id?: string; title?: string; properties?: Record<string, unknown> };
type QueryTasksResult = { documents?: TaskDoc[] };

export default function TasksPage() {
  const queryTasks = useTool<QueryTasksArgs, QueryTasksResult>('LOCAL_NOTIS_DATABASE_QUERY');
  const [documents, setDocuments] = useState<TaskDoc[]>([]);

  useEffect(() => {
    void queryTasks
      .call({ database_id: 'tasks-db-id', query: { page_size: 25 } })
      .then((result) => setDocuments(result.documents || []));
  }, [queryTasks.call]);

  if (queryTasks.loading) return <div>Loading...</div>;

  return (
    <div className="p-6 space-y-4">
      {documents.map((doc) => (
        <Card key={doc.id || doc.document_id} className="p-4">
          <h3>{doc.title || 'Untitled'}</h3>
          <p className="text-muted-foreground">{String(doc.properties?.status || '')}</p>
        </Card>
      ))}
    </div>
  );
}
在
app/
目录中创建标准React页面。使用通用SDK工具钩子获取数据,并基于模板的shadcn组件和门户外壳类(
notis-app-shell
、
notis-app-surface
)构建:
tsx
'use client';
import { useEffect, useState } from 'react';
import { useTool } from '@notis/sdk';
import { Card } from '@/components/ui/card';

type QueryTasksArgs = { database_id?: string; database_slug?: string; query: { page_size?: number } };
type TaskDoc = { document_id?: string; id?: string; title?: string; properties?: Record<string, unknown> };
type QueryTasksResult = { documents?: TaskDoc[] };

export default function TasksPage() {
  const queryTasks = useTool<QueryTasksArgs, QueryTasksResult>('LOCAL_NOTIS_DATABASE_QUERY');
  const [documents, setDocuments] = useState<TaskDoc[]>([]);

  useEffect(() => {
    void queryTasks
      .call({ database_id: 'tasks-db-id', query: { page_size: 25 } })
      .then((result) => setDocuments(result.documents || []));
  }, [queryTasks.call]);

  if (queryTasks.loading) return <div>加载中...</div>;

  return (
    <div className="p-6 space-y-4">
      {documents.map((doc) => (
        <Card key={doc.id || doc.document_id} className="p-4">
          <h3>{doc.title || '无标题'}</h3>
          <p className="text-muted-foreground">{String(doc.properties?.status || '')}</p>
        </Card>
      ))}
    </div>
  );
}

Discovering database schema

发现数据库模式

Before writing app code, inspect the database schema to know what properties exist:
bash
npx --package @notis_ai/cli@latest -- notis tools search "list Notis databases"
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_LIST_DATABASES --arguments '{}'
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_GET_DATABASE --arguments '{"database_slug":"social_media_calendar"}'
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_QUERY --arguments '{"database_id":"social-media-calendar-db-id","query":{"page_size":1}}'
Prefer the database
id
returned by
LOCAL_NOTIS_DATABASE_LIST_DATABASES
or
LOCAL_NOTIS_DATABASE_GET_DATABASE
when calling
LOCAL_NOTIS_DATABASE_QUERY
; use
database_slug
only as a fallback.
Use
LOCAL_NOTIS_DATABASE_GET_DATABASE
through
useTool
when an app needs schema detail at runtime. Keep database-specific result and property helper types inside the app code. For document writes, declare the generated canonical tool for the target database, such as
LOCAL_NOTIS_DATABASE_UPSERT_TASKS
, and call it through
useTool
. Pass flat property values; the server wraps them:
tsx
const upsertTask = useTool<Record<string, unknown>, { document?: { id: string } }>('LOCAL_NOTIS_DATABASE_UPSERT_TASKS');

await upsertTask.call({
  title: 'My Task',
  Status: 'Todo',
  Priority: 'P1',
  Due: '2025-04-01',
  Done: false,
  Count: 5,
});
Do NOT pass Notion-style wrappers (
{select: {name: "Todo"}}
) when upserting.
编写应用代码前,检查数据库模式以了解存在哪些属性:
bash
npx --package @notis_ai/cli@latest -- notis tools search "list Notis databases"
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_LIST_DATABASES --arguments '{}'
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_GET_DATABASE --arguments '{"database_slug":"social_media_calendar"}'
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_QUERY --arguments '{"database_id":"social-media-calendar-db-id","query":{"page_size":1}}'
调用
LOCAL_NOTIS_DATABASE_QUERY
时,优先使用
LOCAL_NOTIS_DATABASE_LIST_DATABASES
或
LOCAL_NOTIS_DATABASE_GET_DATABASE
返回的数据库
id
;仅作为回退使用
database_slug
。
当应用在运行时需要模式详情时,通过
useTool
使用
LOCAL_NOTIS_DATABASE_GET_DATABASE
。将数据库特定的结果和属性助手类型保留在应用代码中。对于文档写入,声明目标数据库的生成标准工具,如
LOCAL_NOTIS_DATABASE_UPSERT_TASKS
,并通过
useTool
调用它。传递扁平的属性值;服务器会自动包装它们:
tsx
const upsertTask = useTool<Record<string, unknown>, { document?: { id: string } }>('LOCAL_NOTIS_DATABASE_UPSERT_TASKS');

await upsertTask.call({
  title: '我的任务',
  Status: '待办',
  Priority: 'P1',
  Due: '2025-04-01',
  Done: false,
  Count: 5,
});
写入时请勿传递Notion风格的包装器(如
{select: {name: "Todo"}}
)。

Design rules

设计规则

  • Start from the scaffolded
    @/components/ui/*
    components before writing new UI primitives.
  • Use restrained portal surfaces:
    bg-background
    ,
    bg-card
    ,
    border-border
    ,
    text-foreground
    ,
    text-muted-foreground
    .
  • Keep layouts compact and dashboard-like. Prefer cards, sections, badges, and tables over marketing-style hero treatments.
  • Respect the portal theme. Do not hardcode dark mode or create an app-specific palette.
  • If a screen looks like a standalone microsite instead of a portal tool, it is too custom.
  • For Notes-style apps, the folder tree belongs to the portal sidebar when configured via
    collection.sidebar
    . The page content should complement that chrome, not duplicate or replace it.
  • Never indicate selected items with a heavy left-border bar (e.g.
    border-l-2 border-l-foreground
    paired with a muted background). It looks dated and clashes with the portal chrome. Use a single subtle background change (
    bg-muted
    for selected,
    hover:bg-muted/50
    for hover) and let typography or an icon carry the rest of the state.
  • Do not render any search input inside the app (in-page search rails, "Ask Notis…" pills, command-palette-style bars, etc.). The portal already owns the top-bar search field. Wire your view to it with
    useTopBarSearch({ value, onChange, placeholder, onSubmit })
    from
    @notis/sdk
    and let the page filter or refetch on the values it receives. The hook also exposes
    setLoading
    so the standard top-bar spinner reflects in-flight queries.
  • 在编写新UI原语前,先从模板的
    @/components/ui/*
    组件开始。
  • 使用克制的门户表面类:
    bg-background
    、
    bg-card
    、
    border-border
    、
    text-foreground
    、
    text-muted-foreground
    。
  • 保持布局紧凑,类似仪表盘。优先使用卡片、区块、徽章和表格,而非营销风格的英雄区设计。
  • 遵循门户主题。请勿硬编码深色模式或创建应用特定的调色板。
  • 若屏幕看起来像独立的微站点而非门户工具,则过于自定义。
  • 对于笔记类应用,当通过
    collection.sidebar
    配置时,文件夹树属于门户侧边栏。页面内容应补充该框架,而非重复或替换它。
  • 切勿使用粗左边框(如
    border-l-2 border-l-foreground
    搭配暗淡背景)标记选中项。这种样式过时且与门户框架冲突。使用单一微妙的背景变化(选中时为
    bg-muted
    ,悬停时为
    hover:bg-muted/50
    ),让排版或图标传达其余状态。
  • 请勿在应用内渲染任何搜索输入(页内搜索栏、“询问Notis…”输入框、命令面板式栏等)。门户已拥有顶部栏搜索字段。使用
    @notis/sdk
    中的
    useTopBarSearch({ value, onChange, placeholder, onSubmit })
    将视图与它关联,让页面根据接收的值进行筛选或重新获取数据。该钩子还暴露
    setLoading
    ,以便标准顶部栏加载器反映正在进行的查询。

Sidebar invariants

侧边栏不变量

  • When a user asks for folders, sections, or hierarchy in the app sidebar, express that through
    routes
    and
    collection.sidebar
    in
    notis.config.ts
    .
  • Treat an existing collection-tree sidebar as a locked structural requirement unless the user explicitly asks to change navigation architecture.
  • If the sidebar appears missing for the substituted DEV entry or deployed portal build, do not silently redesign around it. Preserve the manifest contract, call out the discrepancy, and treat it as a portal/runtime bug.
  • 当用户要求应用侧边栏包含文件夹、区块或层次结构时,通过
    notis.config.ts
    中的
    routes
    和
    collection.sidebar
    实现。
  • 除非用户明确要求更改导航架构,否则将现有集合树侧边栏视为锁定的结构要求。
  • 若替换的DEV条目或已部署的门户构建中侧边栏缺失,请勿默默重新设计。保留清单约定,指出差异,并将其视为门户/运行时漏洞。

Step 3: Root layout

步骤3:根布局

tsx
import { NotisProvider } from '@notis/sdk';
import '@notis/sdk/styles.css';
import './globals.css';

export default function AppShell({ children }: { children: React.ReactNode }) {
  return <NotisProvider>{children}</NotisProvider>;
}
tsx
import { NotisProvider } from '@notis/sdk';
import '@notis/sdk/styles.css';
import './globals.css';

export default function AppShell({ children }: { children: React.ReactNode }) {
  return <NotisProvider>{children}</NotisProvider>;
}

Manifest Format

清单格式

Generated by
npx --package @notis_ai/cli@latest -- notis apps build
at
.notis/output/manifest.json
:
json
{
  "version": 1,
  "spec_version": 4,
  "app": { "name": "My App", "slug": "my-app", "title": "My App", "description": "...", "icon": "phosphor:..." },
  "routes": [
    {
      "path": "/",
      "slug": "index",
      "name": "Dashboard",
      "icon": "phosphor:squares-four",
      "default": true,
      "export_name": "index",
      "collection": null
    }
  ],
  "bundle": {
    "js": "bundle/app.js",
    "css": "bundle/app.css"
  },
  "databases": ["tasks", { "slug": "templates", "seed_documents": true }],
  "tools": ["LOCAL_NOTIS_DATABASE_QUERY"]
}
Use canonical
notis-*
tool names for explicit app tool declarations. App-specific TypeScript shapes for tool arguments and results live in the app code; the SDK exposes the generic
useTool<TArgs, TResult>()
hook instead of database-specific tool hooks.
Database strings package schema only. The object form shown above opts that database into copying its current rows as Store starter content. Use it sparingly and only for non-personal fixtures/templates every installer is meant to receive.
For a read-only database catalog app, declare
["LOCAL_NOTIS_DATABASE_LIST_DATABASES", "LOCAL_NOTIS_DATABASE_GET_DATABASE"]
. Use the list tool for the left/catalog pane and the get tool for the selected database detail pane.
由
npx --package @notis_ai/cli@latest -- notis apps build
生成,位于
.notis/output/manifest.json
:
json
{
  "version": 1,
  "spec_version": 4,
  "app": { "name": "My App", "slug": "my-app", "title": "My App", "description": "...", "icon": "phosphor:..." },
  "routes": [
    {
      "path": "/",
      "slug": "index",
      "name": "Dashboard",
      "icon": "phosphor:squares-four",
      "default": true,
      "export_name": "index",
      "collection": null
    }
  ],
  "bundle": {
    "js": "bundle/app.js",
    "css": "bundle/app.css"
  },
  "databases": ["tasks", { "slug": "templates", "seed_documents": true }],
  "tools": ["LOCAL_NOTIS_DATABASE_QUERY"]
}
使用标准
notis-*
工具名称进行明确的应用工具声明。工具参数和结果的应用特定TypeScript类型保留在应用代码中;SDK暴露通用的
useTool<TArgs, TResult>()
钩子,而非数据库特定的工具钩子。
数据库字符串仅打包模式。上面显示的对象形式选择该数据库将其当前行复制为商店起始内容。谨慎使用,仅用于每个安装者都应接收的非个人固定数据/模板。
对于只读数据库目录应用,声明
["LOCAL_NOTIS_DATABASE_LIST_DATABASES", "LOCAL_NOTIS_DATABASE_GET_DATABASE"]
。使用列表工具作为左侧/目录窗格,使用获取工具作为选中数据库的详情窗格。

Database Schema

数据库模式

apps table

apps表

ColumnTypeDescription
iduuid PKApp ID
user_iduuid FKOwner
team_iduuid FKTeam (nullable)
nametextDisplay name
slugtext UNIQUEURL slug
descriptiontextApp description
icontextPhosphor icon (e.g. "phosphor:list")
statustextdraft, active, archived
visibilitytextprivate, team
manifestjsonbLatest deployed manifest
current_versionintegerVersion counter
source_listing_iduuid FKSource App Store listing for installed store apps; cleared when submitted as a derivative
installed_snapshotjsonbStore-installed baseline used for update/reset comparison
customization_overlayjsonbUser changes over the installed store baseline
update_statustextup_to_date, update_available, needs_resolution, update_failed
bundled_automation_idsuuid[]Linked automations
bundled_skill_idsuuid[]Linked skills
列名类型描述
iduuid PK应用ID
user_iduuid FK所有者
team_iduuid FK团队(可为空)
nametext显示名称
slugtext UNIQUEURL slug
descriptiontext应用描述
icontextPhosphor图标(如"phosphor:list")
statustextdraft, active, archived
visibilitytextprivate, team
manifestjsonb最新已部署清单
current_versioninteger版本计数器
source_listing_iduuid FK已安装商店应用的源应用商店列表;作为派生应用提交时清除
installed_snapshotjsonb商店安装的基线,用于更新/重置比较
customization_overlayjsonb用户对已安装商店基线的更改
update_statustextup_to_date, update_available, needs_resolution, update_failed
bundled_automation_idsuuid[]关联的自动化流程
bundled_skill_idsuuid[]关联的技能

databases ownership

数据库所有权

Every row in the
databases
table carries
owner_app_id
(uuid FK to
apps.id
,
ON DELETE CASCADE
): a database belongs to exactly one app, and deleting the app deletes its databases and their documents (
documents
cascade from
databases
). Install, dev materialization, and store updates stamp
owner_app_id
automatically; standalone creation requires the
app
argument.
databases
表中的每一行都带有
owner_app_id
(uuid FK指向
apps.id
,
ON DELETE CASCADE
):一个数据库仅归一个应用所有,删除应用会删除其数据库及文档(
documents
从
databases
级联删除)。安装、开发实例化和商店更新会自动标记
owner_app_id
;单独创建需要
app
参数。

Storage (Supabase)

存储(Supabase)

Files stored in
app-code
bucket at
{app_id}/v{version}/
:
  • manifest.json
  • bundle/app.js
  • bundle/app.css
Editable source snapshots are stored in the private
app-source
bucket at
{app_id}/v{version}/
. Portal App Store listing screenshots are uploaded to the public
app-listing-assets
bucket before submission.
文件存储在
app-code
存储桶的
{app_id}/v{version}/
路径下:
  • manifest.json
  • bundle/app.js
  • bundle/app.css
可编辑的源码快照存储在私有
app-source
存储桶的
{app_id}/v{version}/
路径下。门户应用商店列表截图在提交前上传到公共
app-listing-assets
存储桶。

Related tables

相关表

  • databases -- Apps reference these rows by slug. Schema lives on the database row (
    schema_metadata
    /
    original_fields
    ), not in the app manifest.
  • documents --
    database_id
    links to databases. Properties in
    properties
    jsonb.
  • app_store_listings -- Snapshots for publishing to the app store.
  • app_submissions -- Portal review submissions keyed to an app source version and registry slug.
  • databases——应用通过slug引用这些行。模式存储在数据库行上(
    schema_metadata
    /
    original_fields
    ),而非应用清单中。
  • documents——
    database_id
    链接到数据库。属性存储在
    properties
    jsonb中。
  • app_store_listings——用于发布到应用商店的快照。
  • app_submissions——与应用源码版本和注册表slug关联的门户审核提交。

Server Endpoints

服务器端点

EndpointMethodPurpose
/portal_views/get
GETRoute detail + runtime descriptor with signed bundle URLs
/portal_views/runtime_query
POSTProxy tool calls and DB operations
/portal_views/collection_items
GETList collection items
/portal_views/collection_tree
GETList normalized collection tree nodes for a tree sidebar route
/portal_views/collection_tree/create
POSTCreate a root or child collection row from the sidebar
/portal_views/collection_tree/rename
POSTRename a collection tree item inline
/portal_views/collection_tree/delete
POSTDelete a collection tree item from the sidebar
/portal_apps/list
GETList apps
/portal_apps/get
GETGet app detail
/portal_apps/publish
POSTSubmit a deployed app source snapshot for public store review
/portal_apps/listing_assets/upload
POSTLegacy pre-manifest screenshot upload; do not use for current manifest-media workflows
/portal_apps/submissions
GET/PATCHList or edit App Store submissions
/portal_apps/submissions/withdraw
POSTClose a pending App Store submission
/cli_tools
POSTCLI tool execution (save_app_files, create_app, etc.)
端点方法用途
/portal_views/get
GET路由详情 + 带有签名包URL的运行时描述符
/portal_views/runtime_query
POST代理工具调用和数据库操作
/portal_views/collection_items
GET列出集合项
/portal_views/collection_tree
GET为树侧边栏路由列出标准化的集合树节点
/portal_views/collection_tree/create
POST从侧边栏创建根或子集合行
/portal_views/collection_tree/rename
POST内联重命名集合树项
/portal_views/collection_tree/delete
POST从侧边栏删除集合树项
/portal_apps/list
GET列出应用
/portal_apps/get
GET获取应用详情
/portal_apps/publish
POST提交已部署的应用源码快照以进行公共商店审核
/portal_apps/listing_assets/upload
POST旧版清单前截图上传;当前清单媒体工作流请勿使用
/portal_apps/submissions
GET/PATCH列出或编辑应用商店提交
/portal_apps/submissions/withdraw
POST关闭待处理的应用商店提交
/cli_tools
POSTCLI工具执行(save_app_files, create_app等)

SDK Hook Reference

SDK钩子参考

All hooks and components below are imported from
@notis/sdk
.
NotisProvider
already installs
ShortcutProvider
; app code should not add a second provider.
APISignatureDescription
useNotis()
() => { app, route, databases, collectionItem, resourceId, ready }
App metadata, current route, selected collection item, decoded exact-resource id, ready state
useTool<TArgs, TResult>(name)
(name: string) => { call, loading, error }
Call a declared tool with app-defined argument/result types. Identical idempotent reads may use
call(args, { dedupe: true })
; never dedupe writes
useTools()
() => { tools, loading }
List available tools
useNotisNavigation()
() => { toRoute, toDocument, toApp }
Navigate between routes (including
toRoute(path, { resourceId })
), documents, or the app root
useTopBarSearch(opts)
({ value, onChange, placeholder?, onSubmit? }) => { setLoading }
Bind the current view to the Portal-owned top-bar search input
useBackend()
() => { request }
Raw backend request proxy with JWT auth
useDatabaseSubscription(slug, opts?)
(slug: string, opts?) => { rows, documents, loading, error, refetch, live }
Query a database and refetch it when its rows change.
live
is false on hosts without a change feed (dev harness, vite preview) -- keep a manual refresh for those
useHandover()
() => { handover, pending, error, available }
Open manager chat with app/resource context plus an optional starter prompt or declared skill. Omit
prompt
for a context-only composer.
available
is false on hosts with no chat -- fall back to a copyable prompt
useCloudComputer()
() => { facts, loading, error, refresh }
Read-only cloud computer facts: sandbox existence/status and whether the GitHub CLI is signed in. Requires
capabilities.cloudComputer: 'read'
plus the user's approval;
facts.available === false
means answer from the app's own fallback
useActiveResource(resource)
(ContextResource | null) => void
Publish the record currently open in the app so manager handover and context menus stay grounded
useCollectionInteractions(opts)
(opts) => CollectionInteractionController
Keyboard navigation, active-row state, range/toggle selection, marquee selection, and action dispatch for collection UIs
useShortcuts(definitions, opts?)
(definitions, opts?) => void
Register scoped keyboard shortcuts. Editable targets are ignored unless explicitly allowed; use
ShortcutHints
to display them
MarkdownEditor
(NotisMarkdownEditorProps) => ReactElement
Use the host editor with app-owned persistence, stable
resourceKey
, revision-aware
onSave
, and optional
onUploadFile
returning a durable URL
NotisSelectionBoundary
(NotisSelectionBoundaryProps) => ReactElement
Attach structured, explicitly untrusted app/resource/selection context to selected content and copy operations
SelectionCheckbox
/
SelectionMarquee
componentsStandard selection controls backed by
useCollectionInteractions
MultiSelectActionBar
componentStandard bulk actions with pending/disabled state and shortcut support
Import headless collection action types and helpers from
@notis/sdk/interactions
. Keep an open detail view synchronized with
useActiveResource
, and wrap its selectable content in
NotisSelectionBoundary
so the manager receives both the active record and the user's exact selection. For
MarkdownEditor
, keep
resourceKey
stable per record, pass the latest revision back from
onSave
, reject revision conflicts instead of overwriting newer data, and implement
onUploadFile
whenever the editor should accept media or file blocks.
以下所有钩子和组件均从
@notis/sdk
导入。
NotisProvider
已安装
ShortcutProvider
;应用代码不应添加第二个提供者。
API签名描述
useNotis()
() => { app, route, databases, collectionItem, resourceId, ready }
应用元数据、当前路由、选中的集合项、解码后的精确资源id、就绪状态
useTool<TArgs, TResult>(name)
(name: string) => { call, loading, error }
使用应用定义的参数/结果类型调用声明的工具。相同的幂等读取可使用
call(args, { dedupe: true })
;切勿对写入去重
useTools()
() => { tools, loading }
列出可用工具
useNotisNavigation()
() => { toRoute, toDocument, toApp }
在路由(包括
toRoute(path, { resourceId })
)、文档或应用根之间导航
useTopBarSearch(opts)
({ value, onChange, placeholder?, onSubmit? }) => { setLoading }
将当前视图与门户拥有的顶部栏搜索输入绑定
useBackend()
() => { request }
带有JWT认证的原始后端请求代理
useDatabaseSubscription(slug, opts?)
(slug: string, opts?) => { rows, documents, loading, error, refetch, live }
查询数据库,并在其行更改时重新获取。
live
在无变更 feed 的主机上为false(开发工具、vite预览)——为这些主机保留手动刷新
useHandover()
() => { handover, pending, error, available }
打开带有应用/资源上下文的管理器聊天,可选择起始提示或声明的技能。省略
prompt
仅传递上下文。
available
在无聊天的主机上为false——回退到可复制的提示
useCloudComputer()
() => { facts, loading, error, refresh }
只读云计算机信息:沙箱存在/状态以及GitHub CLI是否已登录。需要
capabilities.cloudComputer: 'read'
权限和用户批准;
facts.available === false
意味着从应用自身的回退回答
useActiveResource(resource)
(ContextResource | null) => void
发布应用中当前打开的记录,以便管理器交接和上下文菜单保持关联
useCollectionInteractions(opts)
(opts) => CollectionInteractionController
集合UI的键盘导航、活动行状态、范围/切换选择、框选和操作调度
useShortcuts(definitions, opts?)
(definitions, opts?) => void
注册作用域内的键盘快捷键。可编辑目标除非明确允许否则会被忽略;使用
ShortcutHints
显示它们
MarkdownEditor
(NotisMarkdownEditorProps) => ReactElement
使用主机编辑器,带有应用拥有的持久化、稳定的
resourceKey
、感知修订的
onSave
,以及可选的返回持久URL的
onUploadFile
NotisSelectionBoundary
(NotisSelectionBoundaryProps) => ReactElement
将结构化、明确不受信任的应用/资源/选择上下文附加到选中内容和复制操作
SelectionCheckbox
/
SelectionMarquee
组件基于
useCollectionInteractions
的标准选择控件
MultiSelectActionBar
组件带有待处理/禁用状态和快捷键支持的标准批量操作
从
@notis/sdk/interactions
导入无UI集合操作类型和助手。使用
useActiveResource
保持打开的详情视图同步,并将其可选择内容包装在
NotisSelectionBoundary
中,以便管理器接收活动记录和用户的精确选择。对于
MarkdownEditor
,保持
resourceKey
每个记录稳定,从
onSave
返回最新修订,拒绝修订冲突而非覆盖更新的数据,并在编辑器应接受媒体或文件块时实现
onUploadFile
。

App configuration additions

应用配置补充

  • devSlug
    is the stable local-development identity. Set it when a display rename must not create a second DEV app; otherwise the CLI derives it from
    name
    .
  • toolBindings
    is only for provider-generated public tool names whose upstream action cannot be reconstructed. Keep the exact final public
    name
    in
    tools
    , then bind it to
    providerToolName
    ; the public name remains the permission boundary.
  • devSlug
    是稳定的本地开发标识。当显示重命名不得创建第二个DEV应用时设置它;否则CLI从
    name
    派生它。
  • toolBindings
    仅用于提供者生成的公共工具名称,其上游操作无法重构。在
    tools
    中保留精确的最终公共
    name
    ,然后将其绑定到
    providerToolName
    ;公共名称仍是权限边界。

Typed tool calls

类型化工具调用

useTool
accepts generic argument and result types. Query the database at dev time to discover actual property shapes, then keep those types in the app:
tsx
type QueryTasksArgs = { database_id?: string; database_slug?: string; query: { page_size?: number } };
interface TaskDoc {
  title: string;
  properties: {
    Status: string;
    Priority: string;
    Due: string;
  };
};
type QueryTasksResult = { documents: TaskDoc[] };

const queryTasks = useTool<QueryTasksArgs, QueryTasksResult>('LOCAL_NOTIS_DATABASE_QUERY');
const result = await queryTasks.call({ database_id: 'tasks-db-id', query: { page_size: 25 } });
// result.documents[0].properties.Status is typed as string
useTool
接受通用参数和结果类型。在开发时查询数据库以发现实际属性形状,然后将这些类型保留在应用中:
tsx
type QueryTasksArgs = { database_id?: string; database_slug?: string; query: { page_size?: number } };
interface TaskDoc {
  title: string;
  properties: {
    Status: string;
    Priority: string;
    Due: string;
  };
};
type QueryTasksResult = { documents: TaskDoc[] };

const queryTasks = useTool<QueryTasksArgs, QueryTasksResult>('LOCAL_NOTIS_DATABASE_QUERY');
const result = await queryTasks.call({ database_id: 'tasks-db-id', query: { page_size: 25 } });
// result.documents[0].properties.Status类型为string

Development Modes

开发模式

Hosted sandbox development

托管沙箱开发

Do not run
apps dev
in a hosted sandbox. The sandbox filesystem is not on the user's computer, so Desktop cannot mount it. Bootstrap sandbox
agent-browser
, then build and verify before any remote mutation. For a create or edit request, unless the user explicitly says preview-only, read-only, or no-deploy, resolve one exact identity, safely materialize only missing or changed database schemas, deploy, read back the exact app id/version, run live verification, and return the exact Portal URL. Inspection, review, and diagnosis remain read-only.
请勿在托管沙箱中运行
apps dev
。沙箱文件系统不在用户的计算机上,因此Desktop无法挂载它。启动沙箱
agent-browser
,然后在进行任何远程变更前构建并验证。对于创建或编辑请求,除非用户明确表示仅预览、只读或不部署,否则解析一个精确标识,安全实例化仅缺失或已更改的数据库模式,部署,回读精确的应用id/版本,运行实时验证,然后返回精确的门户URL。检查、审核和诊断保持只读。

Canonical local development

标准本地开发

bash
npx --package @notis_ai/cli@latest -- notis apps dev
Runs the real desktop-local development workflow. The CLI should discover all apps in the target workspace and serve their bundles from loopback. Unpublished apps appear in the Electron Portal's Workspace group; linked apps substitute their installed entry only when the local
notisAppVersion
is strictly greater than the installed
release_version
.
bash
npx --package @notis_ai/cli@latest -- notis apps dev
运行真实的桌面本地开发工作流。CLI应发现目标工作区中的所有应用,并从环回提供其包。未发布的应用出现在Electron门户的工作区组中;仅当本地
notisAppVersion
严格大于已安装的
release_version
时,关联的应用才会替换其已安装条目。

Testing

测试

  1. Build validation:
    npx --package @notis_ai/cli@latest -- notis apps build
    must succeed without errors. Vite surfaces TypeScript and bundling errors during this step.
  2. Headless render verification (recommended after every build): run
    npx --package @notis_ai/cli@latest -- notis apps verify
    locally. In a hosted sandbox, first run
    npm exec --yes --package agent-browser@latest -- agent-browser install
    , then run
    npx --yes --package @notis_ai/cli@latest --package agent-browser@latest -- notis apps verify
    . It builds unless
    --skip-build
    is passed, spins up a loopback harness, drives
    agent-browser
    against every route, and reports per-route pass/fail with captured render errors and runtime calls.
  3. Local development acceptance: Run
    notis apps dev [folder]
    once to register the root, then verify each signed-in Desktop instance independently. For an unpublished app, expect one DEV-badged Workspace row. For a linked app, first confirm local
    notisAppVersion
    is strictly greater than installed
    release_version
    , then expect one substituted DEV-badged row; equal or lower must keep the online row and bundle. Verify the default route renders and live edits appear without restarting the CLI or Desktop. Use
    notis apps roots list
    as the persistence proof. Loopback bundle health alone does not prove that an authenticated instance mounted or rendered the app.
  4. Post-deploy: Read back the exact app id, version, and
    portal_url
    with
    apps list --json
    , run
    apps verify --mode live
    , verify the deployed bundle via
    /portal_views/get
    ->
    runtime_descriptor.bundle.js_url
    , and return that profile-appropriate exact Portal URL. A confirmed deploy followed by failed readback is deployed but not remotely verified; a failed live check is deployed but live verification failed. The portal renders app bundles directly as React components, so navigate to the app page when an authenticated browser is available.
  1. 构建验证:
    npx --package @notis_ai/cli@latest -- notis apps build
    必须成功且无错误。Vite在此步骤中会显示TypeScript和打包错误。
  2. 无头渲染验证(建议每次构建后运行):在本地运行
    npx --package @notis_ai/cli@latest -- notis apps verify
    。在托管沙箱中,先运行
    npm exec --yes --package agent-browser@latest -- agent-browser install
    ,然后运行
    npx --yes --package @notis_ai/cli@latest --package agent-browser@latest -- notis apps verify
    。除非传入
    --skip-build
    ,否则它会构建,启动环回工具,驱动
    agent-browser
    测试每个路由,并报告每个路由的通过/失败情况,以及捕获的渲染错误和运行时调用。
  3. 本地开发验收:运行一次
    notis apps dev [folder]
    注册根目录,然后独立验证每个已登录的Desktop实例。对于未发布的应用,预期有一个带有DEV徽章的工作区行。对于关联的应用,先确认本地
    notisAppVersion
    严格大于已安装的
    release_version
    ,然后预期有一个替换的带有DEV徽章的行;版本相等或更低时必须保留在线行和包。验证默认路由已渲染,且实时编辑无需重启CLI或Desktop即可显示。使用
    notis apps roots list
    作为持久化证明。仅环回包健康无法证明已认证实例已挂载或渲染应用。
  4. 部署后:使用
    apps list --json
    回读精确的应用id、版本和
    portal_url
    ,运行
    apps verify --mode live
    ,通过
    /portal_views/get
    ->
    runtime_descriptor.bundle.js_url
    验证已部署的包,然后返回该配置文件对应的精确门户URL。确认部署但回读失败为已部署但未远程验证;实时检查失败为已部署但实时验证失败。门户直接将应用包渲染为React组件,因此当有已认证浏览器可用时,导航到应用页面。

Headless harness verification

无头工具验证

Run
npx --package @notis_ai/cli@latest -- notis apps verify
after
npx --package @notis_ai/cli@latest -- notis apps build
. Use
--mode live
after deploy to exercise the real
/portal_views/runtime_query
with the CLI JWT instead of stub data; live mode also fails a route whose runtime calls all errored, which a well-behaved error state would otherwise hide. In a hosted sandbox, put
agent-browser
on the verification process's
PATH
with the combined-package command above.
--no-browser
only prints URLs for manual triage and does not satisfy the automated deployment gate.
在
npx --package @notis_ai/cli@latest -- notis apps build
后运行
npx --package @notis_ai/cli@latest -- notis apps verify
。部署后使用
--mode live
,使用CLI JWT调用真实的
/portal_views/runtime_query
而非存根数据;实时模式还会失败所有运行时调用均出错的路由,而行为良好的错误状态会隐藏这些错误。在托管沙箱中,通过上述组合包命令将
agent-browser
添加到验证进程的
PATH
中。
--no-browser
仅打印URL供手动排查,不满足自动化部署条件。

What the harness catches that
npx --package @notis_ai/cli@latest -- notis apps build
does not

工具能捕获但
npx --package @notis_ai/cli@latest -- notis apps build
不能捕获的问题

  • Hooks that mount but throw on first read (
    useTool
    called with the wrong tool name or argument shape, accessing nested props that are undefined).
  • Runtime database queries whose slug is not declared by the app, and collection routes that never query their configured collection database. Declared databases may also support automations or agent workflows, so ordinary routes do not need to query every app database.
  • Tool names referenced by hooks but missing from
    notis.config.ts -> tools
    .
  • Suspense / async boundaries that never resolve because a runtime stub returned the wrong shape.
  • Render-time exceptions that the portal would surface as the
    View crashed
    error boundary.
  • 挂载但首次读取时抛出错误的钩子(
    useTool
    使用错误的工具名称或参数形状,访问未定义的嵌套属性)。
  • 运行时数据库查询的slug未被应用声明,以及集合路由从未查询其配置的集合数据库。声明的数据库也可能支持自动化流程或代理工作流,因此普通路由无需查询每个应用数据库。
  • 钩子引用但
    notis.config.ts -> tools
    中缺失的工具名称。
  • 因运行时存根返回错误形状而从未解析的Suspense / 异步边界。
  • 门户会显示为
    View crashed
    错误边界的渲染时异常。

What the harness does not catch

工具不能捕获的问题

  • Bugs that only manifest with real backend data (auth-scoped filters, RLS, malformed prod records). For those, swap the stub runtime for a real one that posts to
    /portal_views/runtime_query
    with a JWT.
  • Visual regressions (use
    agent-browser screenshot
    + a baseline compare if you need this).
  • Bugs that depend on the portal's shadow-DOM stylesheet wrapping. The harness mounts in light DOM, so global Tailwind/shadcn classes work normally; portal-specific theme tokens injected as inline styles are not present.
  • 仅在真实后端数据下才会出现的bug(认证范围筛选、RLS、格式错误的生产记录)。对于这些问题,将存根运行时替换为使用JWT提交到
    /portal_views/runtime_query
    的真实运行时。
  • 视觉回归(若需要,使用
    agent-browser screenshot
    + 基线对比)。
  • 依赖门户shadow-DOM样式表包装的bug。工具在普通DOM中挂载,因此全局Tailwind/shadcn类正常工作;作为内联样式注入的门户特定主题令牌不存在。

Troubleshooting

故障排除

Common issues

常见问题

  • Deploy fails with network error: Run
    notis doctor
    , then retry with the authenticated API available. Do not bypass DEV-app promotion or installed-app identity with a direct database/storage write.
  • App shows old code after deploy: Bundle cache is stale. Hard refresh (Cmd+Shift+R) or clear site data in DevTools.
  • App is missing from the sidebar: Run
    apps roots list
    , confirm the app is at the root, one direct child, or
    apps/*
    , and confirm its first build succeeds. For a linked app, compare
    package.json
    notisAppVersion
    with the installed manifest's
    release_version
    : equal, lower, missing, or invalid intentionally keeps the online app without a DEV badge. If source is stale, preserve any local edits, run
    apps pull <app-id> <dir> --force
    to refresh it, then increment
    notisAppVersion
    before continuing development. Restarting Desktop reattaches the same persistent roots; no terminal process or manual sidebar action is required.
  • LOCAL_NOTIS_DATABASE_QUERY
    returns empty documents
    : Check that the database ID passed to the tool matches the intended database. Use
    npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_LIST_DATABASES --arguments '{}'
    to verify the ID; use the database slug only as a fallback.
  • Properties are
    undefined
    : Keep app-local result types for
    useTool<TArgs, TResult>
    and guard optional nested properties when reading live data.
  • 部署因网络错误失败:运行
    notis doctor
    ,然后在已认证API可用时重试。请勿绕过DEV应用升级或已安装应用标识,直接进行数据库/存储写入。
  • 部署后应用显示旧代码:包缓存过期。强制刷新(Cmd+Shift+R)或在DevTools中清除站点数据。
  • 应用未出现在侧边栏:运行
    apps roots list
    ,确认应用位于根目录、直接子目录或
    apps/*
    ,且首次构建成功。对于关联的应用,比较
    package.json
    中的
    notisAppVersion
    与已安装清单的
    release_version
    :版本相等、更低、缺失或无效时,会有意保留在线应用且无DEV徽章。若源码过期,保留任何本地编辑,运行
    apps pull <app-id> <dir> --force
    刷新,然后在继续开发前提升
    notisAppVersion
    。重启Desktop会重新连接相同的持久根目录;无需终端进程或手动侧边栏操作。
  • LOCAL_NOTIS_DATABASE_QUERY
    返回空文档
    :检查传递给工具的数据库ID是否与预期数据库匹配。使用
    npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_LIST_DATABASES --arguments '{}'
    验证ID;仅作为回退使用数据库slug。
  • 属性为
    undefined
    :为
    useTool<TArgs, TResult>
    保留应用本地的结果类型,并在读取实时数据时保护可选的嵌套属性。