@happyvertical/smrt-dev-mcp 0.47.1 → 0.47.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +3 -0
- package/README.md +63 -0
- package/dist/http.d.ts +95 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/index.d.ts +11 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1775 -1298
- package/dist/index.js.map +1 -1
- package/dist/{knowledge-DmZ-7GO9.js → knowledge-CY6sQzpj.js} +61 -2
- package/dist/knowledge-CY6sQzpj.js.map +1 -0
- package/dist/knowledge.js +1 -1
- package/dist/server-info.d.ts +3 -0
- package/dist/server-info.d.ts.map +1 -0
- package/dist/tool-catalog.d.ts.map +1 -1
- package/dist/tools/runtime/boot.d.ts +60 -0
- package/dist/tools/runtime/boot.d.ts.map +1 -0
- package/dist/tools/runtime/connection.d.ts.map +1 -1
- package/dist/tools/runtime/observation.d.ts +31 -0
- package/dist/tools/runtime/observation.d.ts.map +1 -0
- package/dist/tools/runtime/tools.d.ts +19 -0
- package/dist/tools/runtime/tools.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/knowledge-DmZ-7GO9.js.map +0 -1
package/AGENTS.md
CHANGED
|
@@ -29,6 +29,9 @@ deterministic SMRT ecosystem knowledge, and portable agent workflows.
|
|
|
29
29
|
| `dispatch-health` | Live dispatch health from the `_smrt_dispatch`/`_smrt_dispatch_subscriptions` system tables — stuck/pending by type/status, subscription topology; payloads/metadata never read (runtime provenance; read-only, #1824) |
|
|
30
30
|
| `recent-changes` | Tail of the `_smrt_changes` append-only change feed with cursor semantics, filterable by table and tenant (runtime provenance; read-only, #1824) |
|
|
31
31
|
| `registry-drift` | Registry drift report — `_smrt_registry` is retired and reported as such, never queried or fabricated (read-only, #1824) |
|
|
32
|
+
| `runtime-registry` | Sanitized snapshot of the booted `ObjectRegistry` from project + installed manifests; no project code executed (booted provenance; read-only, #1831) |
|
|
33
|
+
| `runtime-object` | One booted object's sanitized definition plus generated DDL (booted provenance; read-only, #1831) |
|
|
34
|
+
| `runtime-schema-diff` | Booted registry schemas vs live dev DB via the `db:diff` comparer; introspection only, no drops/relaxations (runtime provenance; read-only, #1831) |
|
|
32
35
|
|
|
33
36
|
`pnpm knowledge:check --strict --format markdown` compares this catalog and the
|
|
34
37
|
README parameter tables to the exported `TOOLS` definitions. Add or change a
|
package/README.md
CHANGED
|
@@ -535,6 +535,44 @@ static manifest tools. Read-only.
|
|
|
535
535
|
| `dbUrl` | `string` | No | Optional dev database URL override (read-only diagnostics); prefer `SMRT_DEV_DB_URL` or `cli.database` config |
|
|
536
536
|
| `dbType` | `'sqlite' \| 'postgres' \| 'duckdb'` | No | Optional engine hint for `dbUrl` or the environment connection; inferred from the URL scheme when omitted |
|
|
537
537
|
|
|
538
|
+
### `runtime-registry`
|
|
539
|
+
|
|
540
|
+
Sanitized snapshot of the booted `ObjectRegistry`: objects, packages, tables,
|
|
541
|
+
fields, methods, tenancy, and inheritance, projected through a plain-JSON DTO.
|
|
542
|
+
The boot registers the project's `.smrt/manifest.json` (or `dist/manifest.json`)
|
|
543
|
+
and every installed s-m-r-t package manifest; no project code is imported. Booted
|
|
544
|
+
provenance (`booted (registry)`); read-only.
|
|
545
|
+
|
|
546
|
+
| Parameter | Type | Required | Description |
|
|
547
|
+
|-----------|------|----------|-------------|
|
|
548
|
+
| `projectPath` | `string` | No | Project root to boot manifests from (default: the server working directory; ignored by the HTTP host, which boots once) |
|
|
549
|
+
| `objects` | `string[]` | No | Restrict field/method detail to these simple or qualified object names |
|
|
550
|
+
| `detail` | `boolean` | No | Include field and method detail for every object (default: only when `objects` is given) |
|
|
551
|
+
|
|
552
|
+
### `runtime-object`
|
|
553
|
+
|
|
554
|
+
One booted object: sanitized fields, methods, tenancy, inheritance, and the
|
|
555
|
+
DDL the registry would generate for it. Booted provenance; read-only.
|
|
556
|
+
|
|
557
|
+
| Parameter | Type | Required | Description |
|
|
558
|
+
|-----------|------|----------|-------------|
|
|
559
|
+
| `projectPath` | `string` | No | Project root to boot manifests from (default: the server working directory; ignored by the HTTP host, which boots once) |
|
|
560
|
+
| `name` | `string` | Yes | Simple or qualified object name |
|
|
561
|
+
| `engine` | `'sqlite' \| 'postgres' \| 'duckdb'` | No | Engine for the DDL preview (default: registry default) |
|
|
562
|
+
|
|
563
|
+
### `runtime-schema-diff`
|
|
564
|
+
|
|
565
|
+
Booted registry schemas versus the live dev database, using the same comparer
|
|
566
|
+
as `db:diff`/`db:migrate`. Introspection only: drops and relaxations are never
|
|
567
|
+
proposed and nothing is executed. Runtime provenance; read-only. Without a
|
|
568
|
+
configured connection it returns a successful static-only result.
|
|
569
|
+
|
|
570
|
+
| Parameter | Type | Required | Description |
|
|
571
|
+
|-----------|------|----------|-------------|
|
|
572
|
+
| `projectPath` | `string` | No | Project root to boot manifests from (default: the server working directory; ignored by the HTTP host, which boots once) |
|
|
573
|
+
| `dbUrl` | `string` | No | Optional dev database URL override (read-only diagnostics); prefer `SMRT_DEV_DB_URL` or `cli.database` config |
|
|
574
|
+
| `dbType` | `'sqlite' \| 'postgres' \| 'duckdb'` | No | Optional engine hint for `dbUrl` or the environment connection; inferred from the URL scheme when omitted |
|
|
575
|
+
|
|
538
576
|
## Runtime Diagnostics (Optional Live DB)
|
|
539
577
|
|
|
540
578
|
The six runtime-diagnostics tools above (`migration-status`, `job-health`,
|
|
@@ -569,6 +607,31 @@ not `smrt-app-mcp` and never writes.
|
|
|
569
607
|
(passwords and token query params masked); driver errors pass through a
|
|
570
608
|
redacting normalizer before they can appear in a diagnostic.
|
|
571
609
|
|
|
610
|
+
## Runtime Dev-Plane Host (HTTP, Level 2)
|
|
611
|
+
|
|
612
|
+
`smrt-dev-mcp --http [--port N] [--project DIR]` boots the confined runtime
|
|
613
|
+
once and serves a **positive, read-only** catalog over the stateless
|
|
614
|
+
Streamable HTTP transport (no SSE, no `Mcp-Session-Id`, no sticky routing):
|
|
615
|
+
`runtime-registry`, `runtime-object`, `runtime-schema-diff`, and the six
|
|
616
|
+
live-DB diagnostics above. The static stdio catalog is not mounted, and
|
|
617
|
+
generated CRUD, custom actions, `do()`, and tool-backed `is()` are never
|
|
618
|
+
exposed.
|
|
619
|
+
|
|
620
|
+
- Binds loopback only; the SDK's localhost Host and Origin validation runs on
|
|
621
|
+
every request.
|
|
622
|
+
- Every request needs `Authorization: Bearer <token>`. Set
|
|
623
|
+
`SMRT_DEV_MCP_TOKEN`, or let the process mint one and print it once to
|
|
624
|
+
stderr. A supplied token is never echoed.
|
|
625
|
+
- No authenticated principal exists on this plane, so scope is fail-closed
|
|
626
|
+
global-only exactly as for the stdio diagnostics.
|
|
627
|
+
- Per-request `projectPath` arguments are ignored: the booted project is fixed
|
|
628
|
+
at start. Restart the process to observe a rebuilt manifest.
|
|
629
|
+
|
|
630
|
+
```bash
|
|
631
|
+
SMRT_DEV_MCP_TOKEN=dev-secret smrt-dev-mcp --http --port 3939 --project .
|
|
632
|
+
# → [smrt-dev-mcp] runtime dev-plane listening at http://127.0.0.1:3939/mcp
|
|
633
|
+
```
|
|
634
|
+
|
|
572
635
|
## MCP Resources And Prompts
|
|
573
636
|
|
|
574
637
|
Resources:
|
package/dist/http.d.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { Server } from '@modelcontextprotocol/server';
|
|
2
|
+
import { RuntimeBoot } from './tools/runtime/boot.js';
|
|
3
|
+
/**
|
|
4
|
+
* The complete Level 2 catalog. A tool is exposed over HTTP only if it is
|
|
5
|
+
* named here; the static stdio catalog is deliberately not mounted.
|
|
6
|
+
*/
|
|
7
|
+
export declare const RUNTIME_HTTP_TOOL_NAMES: readonly ["runtime-registry", "runtime-object", "runtime-schema-diff", "migration-status", "job-health", "schedule-health", "dispatch-health", "recent-changes", "registry-drift"];
|
|
8
|
+
export type RuntimeHttpToolName = (typeof RUNTIME_HTTP_TOOL_NAMES)[number];
|
|
9
|
+
/** Catalog definitions for the HTTP plane, in catalog order. */
|
|
10
|
+
export declare function runtimeHttpTools(): {
|
|
11
|
+
inputSchema: {
|
|
12
|
+
[x: string]: unknown;
|
|
13
|
+
type: "object";
|
|
14
|
+
properties?: {
|
|
15
|
+
[x: string]: string | number | boolean | {
|
|
16
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
|
|
17
|
+
} | (string | number | boolean | {
|
|
18
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
|
|
19
|
+
} | (string | number | boolean | {
|
|
20
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
|
|
21
|
+
} | (string | number | boolean | {
|
|
22
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
|
|
23
|
+
} | (string | number | boolean | {
|
|
24
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
|
|
25
|
+
} | (string | number | boolean | {
|
|
26
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
|
|
27
|
+
} | (string | number | boolean | {
|
|
28
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null;
|
|
29
|
+
} | (string | number | boolean | {
|
|
30
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null;
|
|
31
|
+
} | (string | number | boolean | {
|
|
32
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null;
|
|
33
|
+
} | (string | number | boolean | {
|
|
34
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null;
|
|
35
|
+
} | (string | number | boolean | {
|
|
36
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null;
|
|
37
|
+
} | (string | number | boolean | {
|
|
38
|
+
[x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
|
|
39
|
+
} | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
|
|
40
|
+
} | undefined;
|
|
41
|
+
required?: string[] | undefined;
|
|
42
|
+
};
|
|
43
|
+
name: string;
|
|
44
|
+
description?: string | undefined;
|
|
45
|
+
outputSchema?: {
|
|
46
|
+
[x: string]: unknown;
|
|
47
|
+
$schema?: string | undefined;
|
|
48
|
+
} | undefined;
|
|
49
|
+
annotations?: {
|
|
50
|
+
title?: string | undefined;
|
|
51
|
+
readOnlyHint?: boolean | undefined;
|
|
52
|
+
destructiveHint?: boolean | undefined;
|
|
53
|
+
idempotentHint?: boolean | undefined;
|
|
54
|
+
openWorldHint?: boolean | undefined;
|
|
55
|
+
} | undefined;
|
|
56
|
+
execution?: {
|
|
57
|
+
taskSupport?: "optional" | "required" | "forbidden" | undefined;
|
|
58
|
+
} | undefined;
|
|
59
|
+
_meta?: {
|
|
60
|
+
[x: string]: unknown;
|
|
61
|
+
} | undefined;
|
|
62
|
+
icons?: {
|
|
63
|
+
src: string;
|
|
64
|
+
mimeType?: string | undefined;
|
|
65
|
+
sizes?: string[] | undefined;
|
|
66
|
+
theme?: "light" | "dark" | undefined;
|
|
67
|
+
}[] | undefined;
|
|
68
|
+
title?: string | undefined;
|
|
69
|
+
}[];
|
|
70
|
+
/**
|
|
71
|
+
* Build a fresh protocol server per request (stateless transport contract).
|
|
72
|
+
* `projectRoot` is fixed at host start; per-request `projectPath` arguments
|
|
73
|
+
* are ignored so a client cannot re-point the booted process.
|
|
74
|
+
*/
|
|
75
|
+
export declare function createRuntimeProtocolServer(projectRoot: string): Server;
|
|
76
|
+
export interface RuntimeHttpHostOptions {
|
|
77
|
+
projectRoot?: string;
|
|
78
|
+
/** Loopback interface only; anything else is refused at startup. */
|
|
79
|
+
host?: '127.0.0.1' | 'localhost' | '::1';
|
|
80
|
+
/** `0` (default) picks a free port. */
|
|
81
|
+
port?: number;
|
|
82
|
+
/** Bearer token; defaults to `SMRT_DEV_MCP_TOKEN` or a per-process random token. */
|
|
83
|
+
token?: string;
|
|
84
|
+
/** Path the MCP endpoint is mounted on (default `/mcp`). */
|
|
85
|
+
path?: string;
|
|
86
|
+
}
|
|
87
|
+
export interface RuntimeHttpHost {
|
|
88
|
+
url: string;
|
|
89
|
+
token: string;
|
|
90
|
+
boot: RuntimeBoot;
|
|
91
|
+
close(): Promise<void>;
|
|
92
|
+
}
|
|
93
|
+
/** Start the Level 2 host. Boots the confined runtime before listening. */
|
|
94
|
+
export declare function startRuntimeHttpHost(options?: RuntimeHttpHostOptions): Promise<RuntimeHttpHost>;
|
|
95
|
+
//# sourceMappingURL=http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAgBH,OAAO,EAAoB,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAGxE,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAexE;;;GAGG;AACH,eAAO,MAAM,uBAAuB,oLAU1B,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAiB3E,gEAAgE;AAChE,wBAAgB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAG/B;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CA0BvE;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,IAAI,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,KAAK,CAAC;IACzC,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oFAAoF;IACpF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAsBD,2EAA2E;AAC3E,wBAAsB,oBAAoB,CACxC,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,eAAe,CAAC,CAiE1B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { Server } from '@modelcontextprotocol/server';
|
|
2
|
+
export { SERVER_VERSION } from './server-info.js';
|
|
2
3
|
export { TOOLS } from './tool-catalog.js';
|
|
3
|
-
export declare const SERVER_VERSION: string;
|
|
4
4
|
export declare function createServer(): Server;
|
|
5
|
+
/**
|
|
6
|
+
* `smrt-dev-mcp --http [--port N] [--project DIR]` starts the Level 2 runtime
|
|
7
|
+
* dev-plane host (#1831) instead of the stdio server. Loopback-only, bearer
|
|
8
|
+
* protected, positive read-only catalog; see `http.ts`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseHttpCliArgs(argv: readonly string[]): {
|
|
11
|
+
http: boolean;
|
|
12
|
+
port?: number;
|
|
13
|
+
projectRoot?: string;
|
|
14
|
+
};
|
|
5
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAGL,MAAM,EACP,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAGL,MAAM,EACP,MAAM,8BAA8B,CAAC;AAqCtC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AA8B1C,wBAAgB,YAAY,IAAI,MAAM,CA0sBrC;AAyND;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG;IACzD,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAsBA"}
|