You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/developers/ai-development-guide.mdx
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,12 @@ This guide enables AI agents to build production-grade enterprise applications (
31
31
3.**Convention over Configuration**: Follow file suffix system
32
32
4.**Progressive Development**: From simple to complex, iterative layers
33
33
34
+
### 🤖 AI Context Awareness
35
+
To better understand the codebase, every package now includes an **"AI Development Context"** section in its `README.md`. Agents should consult this section to understand:
36
+
- The package's specific role (Source of Truth vs. Runtime vs. Tooling)
logger.info(message, metadata?) // General information
157
-
logger.warn(message, metadata?) // Warnings
158
-
logger.error(message, metadata?) // Errors
159
-
logger.fatal(message, metadata?) // Fatal errors
173
+
ctx.registerServiceFactory({
174
+
name: 'my-service',
175
+
lifecycle: 'singleton',
176
+
factory: (context) =>newMyService(context)
177
+
});
160
178
```
161
179
180
+
### 2. Runtime Circular Dependency Detection
181
+
The Kernel protects against infinite recursion. If your plugins create a loop (Service A -> Service B -> Service A), the Kernel detects this at runtime and throws a clear error path instead of crashing the stack.
182
+
183
+
### 3. Configuration Validation
184
+
Plugins can define a Zod schema for their configuration. The Kernel automatically validates the config on load.
185
+
186
+
```typescript
187
+
const MyPlugin = {
188
+
configSchema: z.object({ apiKey: z.string() }),
189
+
init(ctx) { /* ... */ }
190
+
}
191
+
```
192
+
193
+
### 4. Reliable Error Handling
194
+
Factory errors (e.g., database connection failure during init) are propagated correctly up the stack, preserving the original error message for easier debugging.
Copy file name to clipboardExpand all lines: content/docs/references/packages.mdx
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,8 @@ description: Complete reference of all ObjectStack packages in the monorepo
7
7
8
8
ObjectStack is distributed as a monorepo containing **10 packages** organized into core packages and plugins.
9
9
10
+
> **Note for AI Agents**: Each package's `README.md` contains a specific "AI Development Context" section describing its architectural role and usage rules.
0 commit comments