Skip to content

Commit cd455c8

Browse files
os-steveclaude
andauthored
docs: four published READMEs stop documenting symbols that do not exist (#9544) (#9581)
* docs: four published READMEs stop documenting symbols that do not exist (#9544) driver-sql, mcp, objectql and spec each ship README.md in their `files` array with `private` unset, so these are the pages npm renders. Every claim was re-measured against the built `.d.ts`, which is what a consumer resolves through the `exports` map. Two of the five findings could not be fixed by renaming the symbol: - `IDriver` (driver-sql) exists nowhere in the repository, so the card's own "it lives on @objectstack/spec/contracts" was itself wrong. The real contract is `IDataDriver` — the one `SqlDriver` declares. - `MCPServerConfigSchema` -> `MCPServerRefSchema` (spec) fixes the import but leaves `.parse()` throwing: the documented payload was built for a schema that does not exist. The example is now one that parses green. The two `.configure` call sites are fixed at the call site, not the import: neither `MCPServerPlugin` nor `SqlDriver` has a static `configure`, and `driver:` is not a key of `defineStack` at all. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XqDQYVU5smx29ts9pAErja * chore(ci): drop the five now-resolved published-README baseline entries The gate and its baseline reached `main` after this branch was written, so the reconciliation this branch's report named as an ordering constraint now falls here. The four READMEs on this branch already make these five claims resolve, so their baseline entries are stale text and the shrink-only gate refuses them. Measured against the real gate on `main` (not the untracked copy the earlier run had to use): before the deletion it reports exactly these 5 as stale and exits 1; after, it is green with 5 known instances left — the `packages/spec/prompts/` group, which a separate card carries. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XqDQYVU5smx29ts9pAErja --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent ed4ca59 commit cd455c8

6 files changed

Lines changed: 150 additions & 236 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
"@objectstack/driver-sql": patch
3+
"@objectstack/mcp": patch
4+
"@objectstack/objectql": patch
5+
"@objectstack/spec": patch
6+
---
7+
8+
docs: four published READMEs stop documenting symbols and call sites that do not exist (#9544)
9+
10+
All four packages ship `README.md` in their `files` array with `private` unset, so these
11+
are the pages npm renders. Each finding was re-measured against the **built `.d.ts`**, not
12+
against source, because that is what a consumer resolves through the `exports` map.
13+
14+
- **`@objectstack/driver-sql`** — `import type { IDriver } from '@objectstack/spec'` named
15+
a type that exists **nowhere in the repository** (0 hits across every package's `src`
16+
and `dist`). The real contract is `IDataDriver` on `@objectstack/spec/contracts` — the
17+
one `SqlDriver` actually declares (`export class SqlDriver implements IDataDriver`). The
18+
adjacent operation list was corrected too: the method is `create`, not `insert`.
19+
20+
- **`@objectstack/mcp`** — `DriverSql` has never existed (the export is `SqlDriver`), and
21+
the README then called `DriverSql.configure({...})` on it. Renaming alone would have
22+
been wrong twice over: `SqlDriver` has **no static `configure` either**, and `driver:`
23+
is not a key of `defineStack` at all. The example now declares a datasource the way the
24+
shipped templates do. `MCPServerPlugin.configure({...})` — five call sites — becomes
25+
`new MCPServerPlugin({...})`, the form the class's own JSDoc and every in-repo caller
26+
use. The documented options block claimed `serverName`, `autoRegisterTools`,
27+
`autoExposeObjects`, `enableStreaming`, `port` and `debug`; the real
28+
`MCPServerPluginOptions` is `name`, `version`, `transport`, `autoStart`, `instructions`,
29+
and the env switches are named instead.
30+
31+
- **`@objectstack/objectql`** — `registerObject` is an **instance** method, so
32+
`SchemaRegistry.registerObject(...)` on the class could never run. The example now
33+
reaches it through the engine's registry and states the real parameter order
34+
(`schema, packageId, namespace?`).
35+
36+
- **`@objectstack/spec`** — the protocol package's own front page imported
37+
`MCPServerConfigSchema` from `@objectstack/spec/ai`, which exports `MCPServerRefSchema`.
38+
A rename by itself would have swapped a broken import for a broken **parse**: the
39+
documented payload was built for a schema that does not exist, and
40+
`MCPServerRefSchema.safeParse` rejects it (`transport` is an enum of
41+
`stdio | http | websocket`, not an object, and `endpoint` is required and was absent).
42+
The example is now a payload that parses green, and the page says plainly that tools,
43+
resources and prompts are derived from metadata at runtime rather than authored there.

‎packages/drivers/driver-sql/README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ interface SQLDriverConfig {
134134
The SQL driver implements the standard ObjectStack driver interface:
135135

136136
```typescript
137-
import type { IDriver } from '@objectstack/spec';
137+
import type { IDataDriver } from '@objectstack/spec/contracts';
138138

139-
// All standard operations are supported:
140-
// find, findOne, insert, update, delete, count
139+
// `SqlDriver implements IDataDriver` — all standard operations are supported:
140+
// find, findOne, create, update, delete, count
141141
```
142142

143143
### Advanced Queries

‎packages/mcp/README.md‎

Lines changed: 83 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -37,42 +37,45 @@ import { MCPServerPlugin } from '@objectstack/mcp';
3737

3838
const stack = defineStack({
3939
plugins: [
40-
MCPServerPlugin.configure({
41-
serverName: 'objectstack-server',
40+
new MCPServerPlugin({
41+
name: 'objectstack-server',
4242
version: '1.0.0',
43-
autoRegisterTools: true,
4443
}),
4544
],
4645
});
4746
```
4847

4948
## Configuration
5049

50+
The constructor takes `MCPServerPluginOptions`:
51+
5152
```typescript
52-
interface MCPServerConfig {
53-
/** Server name (shown to AI clients) */
54-
serverName?: string;
53+
interface MCPServerPluginOptions {
54+
/** Override MCP server name. Defaults to 'objectstack'. */
55+
name?: string;
5556

56-
/** Server version */
57+
/** Override MCP server version. Defaults to package version. */
5758
version?: string;
5859

59-
/** Auto-register tools from actions and flows */
60-
autoRegisterTools?: boolean;
61-
62-
/** Auto-expose objects as resources */
63-
autoExposeObjects?: boolean;
64-
65-
/** Enable streaming for large responses */
66-
enableStreaming?: boolean;
67-
68-
/** Transport mechanism ('stdio' | 'http') */
60+
/** Transport mode: 'stdio' (default). */
6961
transport?: 'stdio' | 'http';
7062

71-
/** HTTP port (if transport is 'http') */
72-
port?: number;
63+
/** Whether to auto-start the MCP server. Defaults to false. */
64+
autoStart?: boolean;
65+
66+
/** Custom instructions for the MCP server. */
67+
instructions?: string;
7368
}
7469
```
7570

71+
Tools and resources are **not** opted into per-option — the plugin bridges the
72+
AI tool registry, metadata service and data engine automatically when it
73+
starts. The HTTP surface needs no start at all: it is served per-request at
74+
`/api/v1/mcp` (default-on; `OS_MCP_SERVER_ENABLED=false` opts out).
75+
76+
Environment overrides: `OS_MCP_SERVER_NAME`, `OS_MCP_SERVER_TRANSPORT`,
77+
`OS_MCP_SERVER_ENABLED`.
78+
7679
## MCP Tools
7780

7881
### Auto-Generated Tools
@@ -389,43 +392,57 @@ Configure in Cline settings:
389392
### Stdio Transport (Default)
390393

391394
```typescript
392-
// server.ts
395+
// objectstack.config.ts
393396
import { defineStack } from '@objectstack/spec';
397+
import { defineDatasource } from '@objectstack/spec/data';
394398
import { MCPServerPlugin } from '@objectstack/mcp';
395-
import { DriverSql } from '@objectstack/driver-sql';
396399

397-
const stack = defineStack({
398-
driver: DriverSql.configure({
399-
client: 'better-sqlite3',
400-
connection: { filename: process.env.DATABASE_URL ?? './data/app.db' },
401-
}),
400+
export default defineStack({
401+
manifest: {
402+
id: 'com.example.crm',
403+
namespace: 'crm',
404+
version: '0.1.0',
405+
type: 'app',
406+
name: 'My CRM',
407+
engines: { protocol: '^17' },
408+
},
409+
// Optional: the CLI already anchors a persistent SQLite database at
410+
// `<project>/.objectstack/data/standalone.db`. Declare a datasource only
411+
// to point somewhere else.
412+
datasources: [
413+
defineDatasource({
414+
name: 'primary',
415+
label: 'Primary',
416+
driver: 'sqlite',
417+
config: { filename: '.objectstack/data/app.db' },
418+
}),
419+
],
402420
plugins: [
403-
MCPServerPlugin.configure({
404-
serverName: 'my-crm',
421+
new MCPServerPlugin({
422+
name: 'my-crm',
405423
transport: 'stdio', // Claude Desktop, Cursor, Cline
424+
autoStart: true, // stdio is a long-lived transport, so start it
406425
}),
407426
],
408427
});
409-
410-
await stack.boot();
411428
```
412429

430+
Run it with the CLI (`os dev` / `os serve`) — `defineStack()` returns the
431+
metadata definition; the CLI boots the kernel from it.
432+
413433
### HTTP Transport
414434

415435
```typescript
416-
const stack = defineStack({
417-
driver: DriverSql.configure({ /* ... */ }),
436+
export default defineStack({
437+
manifest: { /* ... */ },
418438
plugins: [
419-
MCPServerPlugin.configure({
420-
serverName: 'my-crm',
439+
new MCPServerPlugin({
440+
name: 'my-crm',
421441
transport: 'http',
422-
port: 3100,
423442
}),
424443
],
425444
});
426-
427-
await stack.boot();
428-
// MCP server running on http://localhost:3100
445+
// Served per-request by the running server at /api/v1/mcp
429446
```
430447

431448
## Advanced Features
@@ -549,13 +566,13 @@ The MCP server exposes these capabilities:
549566

550567
## Debugging
551568

552-
Enable debug logging:
569+
The plugin logs through the kernel logger — there is no `debug` option. The
570+
MCP surface is controlled by environment variables:
553571

554-
```typescript
555-
MCPServerPlugin.configure({
556-
serverName: 'my-crm',
557-
debug: true, // Log all MCP messages
558-
});
572+
```bash
573+
OS_MCP_SERVER_ENABLED=true # explicit true also auto-starts the stdio transport
574+
OS_MCP_SERVER_NAME=my-crm # override the server name
575+
OS_MCP_SERVER_TRANSPORT=http # override the transport
559576
```
560577

561578
View MCP messages in client:
@@ -566,51 +583,34 @@ View MCP messages in client:
566583
## Example: Complete CRM Server
567584

568585
```typescript
569-
import { defineStack, defineTool } from '@objectstack/spec';
586+
// objectstack.config.ts
587+
import { defineStack } from '@objectstack/spec';
570588
import { MCPServerPlugin } from '@objectstack/mcp';
571589

572-
const stack = defineStack({
573-
driver: /* ... */,
574-
plugins: [
575-
MCPServerPlugin.configure({
576-
serverName: 'crm-assistant',
577-
autoRegisterTools: true,
578-
}),
579-
],
580-
});
581-
582-
await stack.boot();
583-
584-
const mcp = stack.kernel.getService('mcp');
585-
586-
// Register custom tools
587-
mcp.registerTool(defineTool({
588-
name: 'forecast_revenue',
589-
description: 'Forecast revenue based on pipeline',
590-
async execute() {
591-
// Implementation
592-
},
593-
}));
594-
595-
// Register custom resources
596-
mcp.registerResource({
597-
uri: 'objectstack://dashboards/sales',
598-
name: 'Sales Dashboard',
599-
async read() {
600-
// Implementation
601-
},
602-
});
603-
604-
// Register prompts
605-
mcp.registerPrompt({
606-
name: 'weekly_report',
607-
description: 'Generate weekly sales report',
608-
async render() {
609-
// Implementation
590+
import * as objects from './src/objects/index.js';
591+
import { allActions } from './src/actions/index.js';
592+
593+
export default defineStack({
594+
manifest: {
595+
id: 'com.example.crm',
596+
namespace: 'crm',
597+
version: '0.1.0',
598+
type: 'app',
599+
name: 'CRM Assistant',
600+
engines: { protocol: '^17' },
610601
},
602+
objects: Object.values(objects),
603+
// Your actions become MCP tools — the plugin bridges them at start.
604+
actions: allActions,
605+
plugins: [new MCPServerPlugin({ name: 'crm-assistant' })],
611606
});
612607
```
613608

609+
There is no imperative "register a tool" call to make: the plugin derives the
610+
tool set from your metadata. The bridging helpers it uses —
611+
`registerObjectTools`, `registerActionTools` and `registerSkillPrompts` — are
612+
exported for hosts that drive an `MCPServerRuntime` directly.
613+
614614
## License
615615

616616
Apache-2.0. See [LICENSING.md](../../LICENSING.md).

‎packages/objectql/README.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ for (const obj of objects) {
6060
### Schema Registry
6161

6262
```typescript
63-
import { SchemaRegistry, computeFQN } from '@objectstack/objectql';
63+
import { computeFQN, type SchemaRegistry } from '@objectstack/objectql';
6464

65-
// Register an object under a namespace
66-
SchemaRegistry.registerObject(taskDef, 'com.acme.todo', 'todo');
65+
// `registerObject` is an INSTANCE method — reach the engine's registry.
66+
// Signature: (schema, packageId, namespace?, ownership?, priority?)
67+
const registry: SchemaRegistry = engine.registry;
68+
registry.registerObject(taskDef, 'com.acme.todo', 'todo');
6769

6870
// Resolve FQN
6971
computeFQN('todo', 'task'); // => 'todo__task'

0 commit comments

Comments
 (0)