@miadi/stateloom-mcp 0.1.1

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.
@@ -0,0 +1,11 @@
1
+ export interface SwitchResult {
2
+ /** Absolute path of the newly active document. */
3
+ path: string;
4
+ /** The previously active absolute path. */
5
+ previous: string;
6
+ /** Whether a file already exists at the new path (missing is fine). */
7
+ exists: boolean;
8
+ /** True when the new path equals the previous one. */
9
+ unchanged: boolean;
10
+ }
11
+ export declare function resolveProjectSwitch(next: string, previous: string): SwitchResult;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Pure logic behind the `set_project_file` MCP tool (path power — the agent
3
+ * chooses which `.smdf.json` document the loom weaves).
4
+ */
5
+ import { existsSync } from "fs";
6
+ import { resolve } from "path";
7
+ export function resolveProjectSwitch(next, previous) {
8
+ const path = resolve(next);
9
+ if (!path.endsWith(".json")) {
10
+ throw new Error(`project file must be a .json document (got '${path}') — the loom weaves .smdf.json files`);
11
+ }
12
+ return {
13
+ path,
14
+ previous,
15
+ exists: existsSync(path),
16
+ unchanged: path === previous,
17
+ };
18
+ }
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * SMCraft MCP Server
4
+ *
5
+ * Provides tools for LLM agents to design, validate, and generate
6
+ * state machines through conversation.
7
+ *
8
+ * Tools:
9
+ * - create_state_machine: Create a new state machine definition
10
+ * - add_state: Add a state to the definition
11
+ * - add_event: Add an event to the definition
12
+ * - add_transition: Add a transition to a state
13
+ * - remove_state: Remove a state from the definition
14
+ * - validate_definition: Validate the current definition
15
+ * - generate_code: Generate Python or TypeScript code
16
+ * - get_definition: Get the current definition as JSON
17
+ * - load_definition: Load a definition from JSON
18
+ * - list_states: List all states in the current definition
19
+ * - list_events: List all events in the current definition
20
+ * - set_project_file: Choose which .smdf.json path is the active document
21
+ * - get_project_file: Report the active document path and bridge status
22
+ *
23
+ * Resources:
24
+ * - smcraft://definition — Current state machine definition
25
+ *
26
+ * Prompts:
27
+ * - design-state-machine — Guided state machine design conversation
28
+ */
29
+ export {};