Skip to content

我们将集中精力打造 @objectstack/core (ObjectOS) 的核心运行时,确保它在没有任何 UI 的情况下也能完美处理依赖注入、生命周期管理、多服务端口调度以及带有沙箱机制的数据引擎。 以下是为你重新梳理的纯后端开发序列 AI 提示词(Prompts)。 第一阶段:内核地基 (The Foundation) 目标:构建类型安全的微内核,实现插件加载、依赖管理和上下文传递。 Prompt 1: Initialize Microkernel Core Context: I a... - #338

Closed
hotlong with Copilot wants to merge 1 commit into
mainfrom
copilot/fix-254823548-1136691870-24aba2d6-cd8c-4eb2-b0d3-58edd41b730c

Conversation

Copilot AI commented Jan 28, 2026 •

Copy link
Copy Markdown
Contributor
  • Review current implementation in packages/runtime
  • Create errors.ts with ObjectStackError class for clear debugging
  • Update mini-kernel.ts to use ObjectStackError instead of generic Error
  • Update index.ts to export error classes
  • Build and test the changes
  • Update documentation if needed
Original prompt

我们将集中精力打造 @objectstack/core (ObjectOS) 的核心运行时,确保它在没有任何 UI 的情况下也能完美处理依赖注入、生命周期管理、多服务端口调度以及带有沙箱机制的数据引擎。

以下是为你重新梳理的纯后端开发序列 AI 提示词(Prompts)。

第一阶段:内核地基 (The Foundation)

目标:构建类型安全的微内核,实现插件加载、依赖管理和上下文传递。

Prompt 1: Initialize Microkernel Core

Context: I am building the backend for "ObjectStack", a low-code platform using a Microkernel Architecture. The core package is named @objectstack/core.

Task: Create the fundamental ObjectKernel class and TypeScript interfaces.

Requirements:

Interfaces (types.ts):

Plugin: Must include name (string), dependencies? (string[]), init(ctx), start(ctx), and destroy().

PluginContext: The object passed to plugins. It must support:

registerService(name, instance): Register a singleton.

getService(name): Retrieve a service (throw if missing).

hook(event, handler): Register an event listener.

trigger(event, payload): Async event emitter.

Kernel Logic (kernel.ts):

Implement use(plugin) to register plugins.

Implement bootstrap():

First, validate that all dependencies declared by plugins are present.

Run init() for all plugins (sequentially or parallel).

Then, run start() for all plugins.

Error Handling: Use a custom ObjectStackError class for clear debugging.

Output: Provide types.ts, errors.ts, and kernel.ts. Do NOT include any UI logic.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel

vercel Bot commented Jan 28, 2026 •

Copy link
Copy Markdown

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

Project Deployment Review Updated (UTC)
spec Ready Ready Preview, Comment Jan 28, 2026 4:52am

Request Review

This branch was successfully deployed

1 active deployment
Preview — 04f3f0c4 Deployed Jan 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants