Skip to content

feat(runtime): gate features.aiStudio on the environment's plan#1598

Merged
xuyushun441-sys merged 1 commit into
mainfrom
feat/runtime-config-ai-studio-by-plan
Jun 5, 2026
Merged

feat(runtime): gate features.aiStudio on the environment's plan#1598
xuyushun441-sys merged 1 commit into
mainfrom
feat/runtime-config-ai-studio-by-plan

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

背景

ObjectStack Cloud 能力付费墙 MVP:Free 跑 app,付费档解锁在线 Studio + AI 开发。门控按用户决策是纯 UI 区分(共享容器里 AIStudioPlugin 对所有租户环境照常挂载,不做按环境动态挂载)。

改动

租户运行时的 RuntimeConfigPluginGET /api/v1/runtime/config)本就按 hostname per-request 解析环境。本 PR 让它读取解析出的环境 plan,据此设 features.aiStudiofree → off,任何付费档 → on

SPA(objectui ConsoleLayout)已经在 features.aiStudio === false 时隐藏 Studio/AI 开发入口,所以这是纯 UI flag。

plan 由控制面 GET /api/v1/cloud/resolve-hostname 提供(见 objectstack-ai/cloud PR #117)。解析不到 plan 时(file/CLI 模式、旧控制面)保留静态默认 flag,绝不误锁。

测试

新增 runtime-config-plugin.test.ts(5 例):free→off、paid→on、plan 缺失保留默认、显式 aiStudio:false 默认、free 覆盖 aiStudio:true 默认。

配套

The tenant runtime serves GET /api/v1/runtime/config per request, resolving
the environment by hostname. It now reads the resolved environment's billing
`plan` and sets features.aiStudio accordingly: free → off, any paid tier → on.

The SPA already hides the Studio/AI online-development surface when
features.aiStudio is false (objectui ConsoleLayout), so this is a pure UI
distinction — the AIStudioPlugin stays mounted on every shared-container
tenant environment. Plan is supplied by the control plane's
/api/v1/cloud/resolve-hostname (objectstack-ai/cloud). When the plan can't be
resolved (file/CLI mode, legacy control plane), the static default flag is
preserved so nobody is locked out.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Building Building Preview, Comment Jun 5, 2026 3:15pm

Request Review

@xuyushun441-sys xuyushun441-sys merged commit 308c936 into main Jun 5, 2026
10 of 11 checks passed
@xuyushun441-sys xuyushun441-sys deleted the feat/runtime-config-ai-studio-by-plan branch June 5, 2026 15:15
xuyushun441-sys added a commit that referenced this pull request Jun 5, 2026
…an (#1598)" (#1599)

This reverts commit 308c936.

Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
xuyushun441-sys added a commit that referenced this pull request Jun 5, 2026
…cts (#1600)

BREAKING CHANGE: the multi-tenant ObjectOS runtime moves out of the
open-source framework to the cloud distribution (@objectstack/objectos-runtime).

The framework now supports only the SINGLE-environment local runtime. Removed
from @objectstack/runtime: createObjectOSStack, KernelManager (impl),
ArtifactApiClient, FileArtifactApiClient, ArtifactEnvironmentRegistry,
ArtifactKernelFactory, AuthProxyPlugin, the capability loader, the
per-environment owner/org seeds, and platform-SSO.

Kept (the local `os serve` console needs them): RuntimeConfigPlugin (now
plan-agnostic again), MarketplaceProxyPlugin, MarketplaceInstallLocalPlugin,
resolveCloudUrl/DEFAULT_CLOUD_URL. Also kept as pure interface contracts so a
host runtime can accept an externally-supplied multi-tenant kernel router:
EnvironmentDriverRegistry and a minimal KernelManager (getOrCreate) — the
http-dispatcher's optional `kernelManager` seam now types against these.

Why: cloud business / multi-tenant routing must not live in the open-source
framework, and evolving cloud policy must never require a framework change
(see the reverted #1598). The cloud side already consumes the relocated code
from @objectstack/objectos-runtime; apps/objectos + apps/cloud no longer import
any multi-tenant symbol from @objectstack/runtime.

runtime build (ESM+CJS+DTS) green; 138 runtime tests pass.

Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants