@voiden/runner 2.2.0 → 2.3.0-beta.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.
Files changed (63) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/bundled-runners/versions.json +8 -6
  3. package/bundled-runners/voiden-advanced-auth-runner.js +1 -1
  4. package/bundled-runners/voiden-graphql-runner.js +1 -1
  5. package/bundled-runners/voiden-mcp-client-runner.js +1 -0
  6. package/bundled-runners/voiden-mcp-tool-runner.js +143 -0
  7. package/bundled-runners/voiden-rest-api-runner.js +1 -1
  8. package/bundled-runners/voiden-sockets-grpcs-runner.js +1 -1
  9. package/dist/envFile.d.ts +2 -0
  10. package/dist/envFile.d.ts.map +1 -0
  11. package/dist/envFile.js +59 -0
  12. package/dist/envFile.js.map +1 -0
  13. package/dist/headlessContext.d.ts.map +1 -1
  14. package/dist/headlessContext.js +43 -0
  15. package/dist/headlessContext.js.map +1 -1
  16. package/dist/index.js +252 -24
  17. package/dist/index.js.map +1 -1
  18. package/dist/lib.d.ts +9 -7
  19. package/dist/lib.d.ts.map +1 -1
  20. package/dist/lib.js +9 -8
  21. package/dist/lib.js.map +1 -1
  22. package/dist/mcpServing.d.ts +39 -0
  23. package/dist/mcpServing.d.ts.map +1 -0
  24. package/dist/mcpServing.js +154 -0
  25. package/dist/mcpServing.js.map +1 -0
  26. package/dist/mcpToolCapability.d.ts +120 -0
  27. package/dist/mcpToolCapability.d.ts.map +1 -0
  28. package/dist/mcpToolCapability.js +87 -0
  29. package/dist/mcpToolCapability.js.map +1 -0
  30. package/dist/plugins/loader.d.ts.map +1 -1
  31. package/dist/plugins/loader.js +6 -0
  32. package/dist/plugins/loader.js.map +1 -1
  33. package/dist/requestContainerRegistry.d.ts +36 -0
  34. package/dist/requestContainerRegistry.d.ts.map +1 -0
  35. package/dist/requestContainerRegistry.js +42 -0
  36. package/dist/requestContainerRegistry.js.map +1 -0
  37. package/dist/resultBlock.d.ts +7 -1
  38. package/dist/resultBlock.d.ts.map +1 -1
  39. package/dist/resultBlock.js +28 -6
  40. package/dist/resultBlock.js.map +1 -1
  41. package/dist/runner.d.ts +9 -0
  42. package/dist/runner.d.ts.map +1 -1
  43. package/dist/runner.js +25 -9
  44. package/dist/runner.js.map +1 -1
  45. package/dist/toolRegistry.d.ts +93 -0
  46. package/dist/toolRegistry.d.ts.map +1 -0
  47. package/dist/toolRegistry.js +38 -0
  48. package/dist/toolRegistry.js.map +1 -0
  49. package/dist/types.d.ts +1 -5
  50. package/dist/types.d.ts.map +1 -1
  51. package/package.json +5 -3
  52. package/dist/mcpInstall.d.ts +0 -48
  53. package/dist/mcpInstall.d.ts.map +0 -1
  54. package/dist/mcpInstall.js +0 -194
  55. package/dist/mcpInstall.js.map +0 -1
  56. package/dist/parser.d.ts +0 -24
  57. package/dist/parser.d.ts.map +0 -1
  58. package/dist/parser.js +0 -87
  59. package/dist/parser.js.map +0 -1
  60. package/dist/skillContent.d.ts +0 -8
  61. package/dist/skillContent.d.ts.map +0 -1
  62. package/dist/skillContent.js +0 -42
  63. package/dist/skillContent.js.map +0 -1
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Tool Registry — lets the plugin that owns the `/tool` block declare its own
3
+ * block→tool-declaration extraction, instead of voiden-runner's core
4
+ * hardcoding knowledge of that block's shape.
5
+ *
6
+ * Mirrors requestContainerRegistry.ts exactly, but for a different purpose:
7
+ * a `/tool` block is not itself a request container (it doesn't have a
8
+ * url/method to expose) — it's a marker attached to a request that already
9
+ * exists in the same section. So instead of a single `{type, urlType,
10
+ * methodType}` definition per protocol, this registry holds *extraction
11
+ * functions* (one per tool-owning plugin, realistically just one today) that
12
+ * each get a section's blocks and return whatever `/tool` declarations they
13
+ * find in it.
14
+ *
15
+ * Plugins call context.registerToolProvider() in their runner.ts onload().
16
+ * Cleared/rebuilt fresh on every loadEnabledPlugins() call, same as the
17
+ * other two registries — a disabled plugin's tools shouldn't linger.
18
+ */
19
+ export type ToolParamType = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array';
20
+ export type ToolParamSource = 'agent' | 'environment';
21
+ export type ToolVerifyRole = 'happy-path' | 'error-contract' | 'auth-check';
22
+ /** Per-verify-entry, not tool-wide (matches voiden-mcp-blocks-spec.md §1.9's
23
+ * illustrative shape, where only some entries specify a mode).
24
+ *
25
+ * `sandbox` is a declarative label, not a redirection mechanism — Voiden
26
+ * does not substitute or validate any URL for it. It runs exactly like
27
+ * `live` (this is why the runnable-check below is `mode !== 'none'`, not
28
+ * `mode === 'live'` — sandbox needs zero special-casing). The *only*
29
+ * meaning it carries is "the request this entry points at already targets
30
+ * a sandbox endpoint, by the author's own choice" — same relationship
31
+ * `cadence` already has to voiden-runner: a tag Voiden reports/filters by,
32
+ * never interprets. If a row's referenced request doesn't actually target
33
+ * a sandbox URL, marking it `sandbox` doesn't protect anything — the
34
+ * author is responsible for that, same as choosing which URL to write in
35
+ * the request in the first place. */
36
+ export type ToolVerifyMode = 'live' | 'sandbox' | 'none';
37
+ export type ToolOnFailure = 'withdraw' | 'advertise-degraded';
38
+ export interface ToolParamDef {
39
+ name: string;
40
+ binds: string;
41
+ type: ToolParamType;
42
+ required: boolean;
43
+ description?: string;
44
+ source: ToolParamSource;
45
+ }
46
+ export interface ToolVerifyEntry {
47
+ /** Defaults to the same file the /tool block lives in when omitted. */
48
+ filePath?: string;
49
+ sectionLabel: string;
50
+ role: ToolVerifyRole;
51
+ /** Free-text tag (e.g. "nightly") — filtered by `voiden-runner tool verify --cadence`, not scheduled by voiden-runner itself. */
52
+ cadence?: string;
53
+ /** Defaults to 'live' when omitted. 'none' skips running this specific entry automatically. */
54
+ mode?: ToolVerifyMode;
55
+ }
56
+ export interface ToolAnnotations {
57
+ readOnlyHint?: boolean;
58
+ destructiveHint?: boolean;
59
+ idempotentHint?: boolean;
60
+ openWorldHint?: boolean;
61
+ }
62
+ /** What a tool-owning plugin's extraction function returns — everything
63
+ * derivable from a section's blocks alone. discoverTools() (toolVerification.ts)
64
+ * fills in filePath/sectionLabel, which the block itself can't know. */
65
+ export interface ToolExtraction {
66
+ name: string;
67
+ title?: string;
68
+ description: string;
69
+ annotations?: ToolAnnotations;
70
+ toolBlockUid: string;
71
+ /** Best-effort link to the sibling request block's uid — informational only, not used to run the tool (that happens by filePath+sectionLabel). */
72
+ requestUid?: string;
73
+ params: ToolParamDef[];
74
+ verifies: ToolVerifyEntry[];
75
+ onFailure: ToolOnFailure;
76
+ /** Manual serve override, independent of verification state — set via the
77
+ * MCP tab's Serve preview. Core never interprets this, just carries it
78
+ * through; the plugin's own decideServing() is what acts on it. */
79
+ enabled: boolean;
80
+ }
81
+ /** Full tool declaration once discovered project-wide. */
82
+ export interface ToolDef extends ToolExtraction {
83
+ filePath: string;
84
+ sectionLabel?: string;
85
+ }
86
+ export type ToolExtractFn = (blocks: any[]) => ToolExtraction[];
87
+ export declare function registerToolProvider(extractFn: ToolExtractFn): void;
88
+ export declare function clearToolProviders(): void;
89
+ /** Runs every registered extraction function against a section's blocks. */
90
+ export declare function extractTools(blocks: any[]): ToolExtraction[];
91
+ /** Returns whether any tool provider is currently registered — useful for debugging. */
92
+ export declare function hasToolProviders(): boolean;
93
+ //# sourceMappingURL=toolRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolRegistry.d.ts","sourceRoot":"","sources":["../src/toolRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;AAC5F,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,aAAa,CAAA;AACrD,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,gBAAgB,GAAG,YAAY,CAAA;AAC3E;;;;;;;;;;;;;sCAasC;AACtC,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAA;AACxD,MAAM,MAAM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,aAAa,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,cAAc,EAAE,CAAA;AAI/D,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,aAAa,GAAG,IAAI,CAEnE;AAED,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,cAAc,EAAE,CAM5D;AAED,wFAAwF;AACxF,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Tool Registry — lets the plugin that owns the `/tool` block declare its own
3
+ * block→tool-declaration extraction, instead of voiden-runner's core
4
+ * hardcoding knowledge of that block's shape.
5
+ *
6
+ * Mirrors requestContainerRegistry.ts exactly, but for a different purpose:
7
+ * a `/tool` block is not itself a request container (it doesn't have a
8
+ * url/method to expose) — it's a marker attached to a request that already
9
+ * exists in the same section. So instead of a single `{type, urlType,
10
+ * methodType}` definition per protocol, this registry holds *extraction
11
+ * functions* (one per tool-owning plugin, realistically just one today) that
12
+ * each get a section's blocks and return whatever `/tool` declarations they
13
+ * find in it.
14
+ *
15
+ * Plugins call context.registerToolProvider() in their runner.ts onload().
16
+ * Cleared/rebuilt fresh on every loadEnabledPlugins() call, same as the
17
+ * other two registries — a disabled plugin's tools shouldn't linger.
18
+ */
19
+ const providers = [];
20
+ export function registerToolProvider(extractFn) {
21
+ providers.push(extractFn);
22
+ }
23
+ export function clearToolProviders() {
24
+ providers.length = 0;
25
+ }
26
+ /** Runs every registered extraction function against a section's blocks. */
27
+ export function extractTools(blocks) {
28
+ const found = [];
29
+ for (const extractFn of providers) {
30
+ found.push(...extractFn(blocks));
31
+ }
32
+ return found;
33
+ }
34
+ /** Returns whether any tool provider is currently registered — useful for debugging. */
35
+ export function hasToolProviders() {
36
+ return providers.length > 0;
37
+ }
38
+ //# sourceMappingURL=toolRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolRegistry.js","sourceRoot":"","sources":["../src/toolRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AA6EH,MAAM,SAAS,GAAoB,EAAE,CAAA;AAErC,MAAM,UAAU,oBAAoB,CAAC,SAAwB;IAC3D,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;AAC3B,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAA;AACtB,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,YAAY,CAAC,MAAa;IACxC,MAAM,KAAK,GAAqB,EAAE,CAAA;IAClC,KAAK,MAAM,SAAS,IAAI,SAAS,EAAE,CAAC;QAClC,KAAK,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;IAClC,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,gBAAgB;IAC9B,OAAO,SAAS,CAAC,MAAM,GAAG,CAAC,CAAA;AAC7B,CAAC"}
package/dist/types.d.ts CHANGED
@@ -1,8 +1,4 @@
1
- export interface Block {
2
- type: string;
3
- attrs?: Record<string, any>;
4
- content?: Block[] | string;
5
- }
1
+ export type { Block } from '@voiden/executors';
6
2
  export type { WebSocketRequest, GrpcRequest, RunResult as BaseRunResult, } from '@voiden/executors';
7
3
  export type CliReportEntry = {
8
4
  type: 'assertion';
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,OAAO,CAAC,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;CAC3B;AAID,YAAY,EACV,gBAAgB,EAChB,WAAW,EACX,SAAS,IAAI,aAAa,GAC3B,MAAM,mBAAmB,C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QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,GAAG,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC,CAAA;IACvI,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voiden/runner",
3
- "version": "2.2.0",
3
+ "version": "2.3.0-beta.2",
4
4
  "description": "CLI runner for .void files — execute REST, WebSocket, and gRPC requests headlessly",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -42,12 +42,14 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "@grpc/proto-loader": "^0.7.13",
45
- "@voiden/executors": "latest",
45
+ "@modelcontextprotocol/sdk": "^1.29.0",
46
+ "@voiden/executors": "0.1.4",
46
47
  "@voiden/sdk": "*",
47
48
  "chalk": "^5.3.0",
48
49
  "commander": "^12.0.0",
49
50
  "nodemailer": "^8.0.7",
50
- "yaml": "^2.4.2"
51
+ "yaml": "^2.4.2",
52
+ "zod": "^3.23.8"
51
53
  },
52
54
  "devDependencies": {
53
55
  "@types/node": "^20.14.10",
@@ -1,48 +0,0 @@
1
- /**
2
- * Shared "enable AI-agent integration" logic — registers @voiden/mcp-server
3
- * with Claude Code / Codex, and (for CLI-only users who don't have the
4
- * Voiden app's richer composed skill available) installs a standalone skill
5
- * describing the run/verify/write-back loop.
6
- *
7
- * Used by two callers:
8
- * - packages/voiden-runner's own CLI (`voiden-runner mcp install|uninstall|status`)
9
- * - apps/electron's Settings "Claude/Codex integration" toggle, which already
10
- * installs its own richer composed skill (skillsInstaller.ts) and only
11
- * needs the MCP *registration* half from here — it does not call
12
- * installRunnerSkill/uninstallRunnerSkill, to avoid writing a second,
13
- * more minimal skill file alongside its own.
14
- */
15
- export interface ServerCommand {
16
- command: string;
17
- args: string[];
18
- }
19
- export declare function registerClaudeMcpServer(projectPath: string, serverCommand?: ServerCommand): void;
20
- export declare function unregisterClaudeMcpServer(projectPath: string): void;
21
- export declare function isClaudeMcpRegistered(projectPath: string): boolean;
22
- export declare function installClaudeSkill(markdown: string): void;
23
- export declare function uninstallClaudeSkill(): void;
24
- export declare function isClaudeSkillInstalled(): boolean;
25
- export declare function upsertCodexMcpSection(projectPath: string, serverCommand?: ServerCommand): void;
26
- export declare function removeCodexMcpSection(): void;
27
- export declare function isCodexMcpRegistered(): boolean;
28
- export declare function installCodexSkill(markdown: string): void;
29
- export declare function uninstallCodexSkill(): void;
30
- export declare function isCodexSkillInstalled(): boolean;
31
- export interface McpTargets {
32
- claude?: boolean;
33
- codex?: boolean;
34
- }
35
- export declare function installMcpIntegration(projectPath: string, targets: McpTargets, skillMarkdown: string, serverCommand?: ServerCommand): string[];
36
- export declare function uninstallMcpIntegration(projectPath: string, targets: McpTargets): string[];
37
- export interface McpStatus {
38
- claude: {
39
- skillInstalled: boolean;
40
- serverRegistered: boolean;
41
- };
42
- codex: {
43
- skillInstalled: boolean;
44
- serverRegistered: boolean;
45
- };
46
- }
47
- export declare function getMcpStatus(projectPath: string): McpStatus;
48
- //# sourceMappingURL=mcpInstall.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcpInstall.d.ts","sourceRoot":"","sources":["../src/mcpInstall.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAYH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,EAAE,CAAA;CACf;AAwBD,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,CAShG;AAED,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAUnE;AAED,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CASlE;AAMD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAIzD;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAG3C;AAED,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAmBD,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,CAiB9F;AAED,wBAAgB,qBAAqB,IAAI,IAAI,CAK5C;AAED,wBAAgB,oBAAoB,IAAI,OAAO,CAK9C;AAMD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAIxD;AAED,wBAAgB,mBAAmB,IAAI,IAAI,CAG1C;AAED,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C;AAID,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,UAAU,EACnB,aAAa,EAAE,MAAM,EACrB,aAAa,CAAC,EAAE,aAAa,GAC5B,MAAM,EAAE,CAcV;AAED,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,MAAM,EAAE,CAc1F;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE;QAAE,cAAc,EAAE,OAAO,CAAC;QAAC,gBAAgB,EAAE,OAAO,CAAA;KAAE,CAAA;IAC9D,KAAK,EAAE;QAAE,cAAc,EAAE,OAAO,CAAC;QAAC,gBAAgB,EAAE,OAAO,CAAA;KAAE,CAAA;CAC9D;AAED,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAM3D"}
@@ -1,194 +0,0 @@
1
- /**
2
- * Shared "enable AI-agent integration" logic — registers @voiden/mcp-server
3
- * with Claude Code / Codex, and (for CLI-only users who don't have the
4
- * Voiden app's richer composed skill available) installs a standalone skill
5
- * describing the run/verify/write-back loop.
6
- *
7
- * Used by two callers:
8
- * - packages/voiden-runner's own CLI (`voiden-runner mcp install|uninstall|status`)
9
- * - apps/electron's Settings "Claude/Codex integration" toggle, which already
10
- * installs its own richer composed skill (skillsInstaller.ts) and only
11
- * needs the MCP *registration* half from here — it does not call
12
- * installRunnerSkill/uninstallRunnerSkill, to avoid writing a second,
13
- * more minimal skill file alongside its own.
14
- */
15
- import * as fs from 'fs';
16
- import * as path from 'path';
17
- import * as os from 'os';
18
- const SERVER_NAME = 'voiden-runner';
19
- // Standalone skill slug — deliberately different from the Voiden app's own
20
- // "voiden" skill directory, so a machine with both installed doesn't have
21
- // one silently overwrite the other's (differently-scoped) content.
22
- const SKILL_SLUG = 'voiden-runner';
23
- /**
24
- * Default launch command — requires @voiden/mcp-server to be published to
25
- * npm; until then, pass an explicit `serverCommand` override (e.g. `{command:
26
- * 'node', args: ['/abs/path/to/voiden-mcp-server/dist/index.js', projectPath]}`)
27
- * to test against a local build.
28
- */
29
- function defaultServerCommand(projectPath) {
30
- return {
31
- command: 'npx',
32
- args: ['-y', '@voiden/mcp-server', projectPath],
33
- };
34
- }
35
- // ─── Claude Code ────────────────────────────────────────────────────────────
36
- // Project-scoped .mcp.json — the documented, public schema Claude Code reads
37
- // from a project directory. (Claude Code's user-scope config is an opaque,
38
- // larger state file we deliberately don't hand-edit — see README.)
39
- function claudeMcpConfigPath(projectPath) {
40
- return path.join(projectPath, '.mcp.json');
41
- }
42
- export function registerClaudeMcpServer(projectPath, serverCommand) {
43
- const configPath = claudeMcpConfigPath(projectPath);
44
- let config = {};
45
- if (fs.existsSync(configPath)) {
46
- try {
47
- config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
48
- }
49
- catch {
50
- config = {};
51
- }
52
- }
53
- config.mcpServers = config.mcpServers ?? {};
54
- config.mcpServers[SERVER_NAME] = serverCommand ?? defaultServerCommand(projectPath);
55
- fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n', 'utf-8');
56
- }
57
- export function unregisterClaudeMcpServer(projectPath) {
58
- const configPath = claudeMcpConfigPath(projectPath);
59
- if (!fs.existsSync(configPath))
60
- return;
61
- try {
62
- const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
63
- if (config.mcpServers && SERVER_NAME in config.mcpServers) {
64
- delete config.mcpServers[SERVER_NAME];
65
- fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n', 'utf-8');
66
- }
67
- }
68
- catch { /* leave an unreadable file alone rather than clobber it */ }
69
- }
70
- export function isClaudeMcpRegistered(projectPath) {
71
- const configPath = claudeMcpConfigPath(projectPath);
72
- if (!fs.existsSync(configPath))
73
- return false;
74
- try {
75
- const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
76
- return Boolean(config?.mcpServers?.[SERVER_NAME]);
77
- }
78
- catch {
79
- return false;
80
- }
81
- }
82
- function claudeSkillDir() {
83
- return path.join(os.homedir(), '.claude', 'skills', SKILL_SLUG);
84
- }
85
- export function installClaudeSkill(markdown) {
86
- const dir = claudeSkillDir();
87
- fs.mkdirSync(dir, { recursive: true });
88
- fs.writeFileSync(path.join(dir, 'SKILL.md'), markdown, 'utf-8');
89
- }
90
- export function uninstallClaudeSkill() {
91
- const dir = claudeSkillDir();
92
- if (fs.existsSync(dir))
93
- fs.rmSync(dir, { recursive: true, force: true });
94
- }
95
- export function isClaudeSkillInstalled() {
96
- return fs.existsSync(path.join(claudeSkillDir(), 'SKILL.md'));
97
- }
98
- // ─── Codex CLI ──────────────────────────────────────────────────────────────
99
- // Codex reads MCP servers from ~/.codex/config.toml's [mcp_servers.<name>]
100
- // tables. There's no TOML dependency here — the section shape we write is
101
- // simple enough for a targeted regex replace/append, done as plain text.
102
- function codexConfigPath() {
103
- return path.join(os.homedir(), '.codex', 'config.toml');
104
- }
105
- function codexSectionRegex() {
106
- return new RegExp(`\\n?\\[mcp_servers\\.${SERVER_NAME}\\][^\\[]*`, 'm');
107
- }
108
- function toTomlStringArray(values) {
109
- return '[' + values.map(v => `"${v.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`).join(', ') + ']';
110
- }
111
- export function upsertCodexMcpSection(projectPath, serverCommand) {
112
- const configPath = codexConfigPath();
113
- fs.mkdirSync(path.dirname(configPath), { recursive: true });
114
- let content = fs.existsSync(configPath) ? fs.readFileSync(configPath, 'utf-8') : '';
115
- const { command, args } = serverCommand ?? defaultServerCommand(projectPath);
116
- const section = `[mcp_servers.${SERVER_NAME}]\n` +
117
- `command = "${command}"\n` +
118
- `args = ${toTomlStringArray(args)}\n`;
119
- if (codexSectionRegex().test(content)) {
120
- content = content.replace(codexSectionRegex(), '\n' + section);
121
- }
122
- else {
123
- content = content.trimEnd() + (content.trim() ? '\n\n' : '') + section;
124
- }
125
- fs.writeFileSync(configPath, content, 'utf-8');
126
- }
127
- export function removeCodexMcpSection() {
128
- const configPath = codexConfigPath();
129
- if (!fs.existsSync(configPath))
130
- return;
131
- const content = fs.readFileSync(configPath, 'utf-8').replace(codexSectionRegex(), '');
132
- fs.writeFileSync(configPath, content, 'utf-8');
133
- }
134
- export function isCodexMcpRegistered() {
135
- const configPath = codexConfigPath();
136
- if (!fs.existsSync(configPath))
137
- return false;
138
- const content = fs.readFileSync(configPath, 'utf-8');
139
- return content.includes(`[mcp_servers.${SERVER_NAME}]`);
140
- }
141
- function codexSkillDir() {
142
- return path.join(os.homedir(), '.codex', 'skills', SKILL_SLUG);
143
- }
144
- export function installCodexSkill(markdown) {
145
- const dir = codexSkillDir();
146
- fs.mkdirSync(dir, { recursive: true });
147
- fs.writeFileSync(path.join(dir, 'SKILL.md'), markdown, 'utf-8');
148
- }
149
- export function uninstallCodexSkill() {
150
- const dir = codexSkillDir();
151
- if (fs.existsSync(dir))
152
- fs.rmSync(dir, { recursive: true, force: true });
153
- }
154
- export function isCodexSkillInstalled() {
155
- return fs.existsSync(path.join(codexSkillDir(), 'SKILL.md'));
156
- }
157
- export function installMcpIntegration(projectPath, targets, skillMarkdown, serverCommand) {
158
- const resolved = path.resolve(projectPath);
159
- const installed = [];
160
- if (targets.claude) {
161
- registerClaudeMcpServer(resolved, serverCommand);
162
- installClaudeSkill(skillMarkdown);
163
- installed.push('claude');
164
- }
165
- if (targets.codex) {
166
- upsertCodexMcpSection(resolved, serverCommand);
167
- installCodexSkill(skillMarkdown);
168
- installed.push('codex');
169
- }
170
- return installed;
171
- }
172
- export function uninstallMcpIntegration(projectPath, targets) {
173
- const resolved = path.resolve(projectPath);
174
- const removed = [];
175
- if (targets.claude) {
176
- unregisterClaudeMcpServer(resolved);
177
- uninstallClaudeSkill();
178
- removed.push('claude');
179
- }
180
- if (targets.codex) {
181
- removeCodexMcpSection();
182
- uninstallCodexSkill();
183
- removed.push('codex');
184
- }
185
- return removed;
186
- }
187
- export function getMcpStatus(projectPath) {
188
- const resolved = path.resolve(projectPath);
189
- return {
190
- claude: { skillInstalled: isClaudeSkillInstalled(), serverRegistered: isClaudeMcpRegistered(resolved) },
191
- codex: { skillInstalled: isCodexSkillInstalled(), serverRegistered: isCodexMcpRegistered() },
192
- };
193
- }
194
- //# sourceMappingURL=mcpInstall.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcpInstall.js","sourceRoot":"","sources":["../src/mcpInstall.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AAExB,MAAM,WAAW,GAAG,eAAe,CAAA;AACnC,2EAA2E;AAC3E,0EAA0E;AAC1E,mEAAmE;AACnE,MAAM,UAAU,GAAG,eAAe,CAAA;AAOlC;;;;;GAKG;AACH,SAAS,oBAAoB,CAAC,WAAmB;IAC/C,OAAO;QACL,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,CAAC,IAAI,EAAE,oBAAoB,EAAE,WAAW,CAAC;KAChD,CAAA;AACH,CAAC;AAED,+EAA+E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from apps/ui/src/core/editors/voiden/markdownConverter.ts
5
- * - No TipTap/ProseMirror dependency
6
- * - No schema validation — trusts the YAML type field as-is
7
- */
8
- import type { Block } from './types.js';
9
- /**
10
- * Parse .void file content into an array of blocks.
11
- * Extracts all ```void ... ``` fenced code blocks from the markdown.
12
- */
13
- export declare function parseVoidFile(content: string): Block[];
14
- export interface VoidSection {
15
- /** Label from the request-separator block, if present */
16
- label?: string;
17
- blocks: Block[];
18
- }
19
- /**
20
- * Parse .void file content into sections split at request-separator blocks.
21
- * A file with no separators returns a single section.
22
- */
23
- export declare function parseVoidFileSections(content: string): VoidSection[];
24
- //# sourceMappingURL=parser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AA6CvC;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,EAAE,CActD;AAED,MAAM,WAAW,WAAW;IAC1B,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,KAAK,EAAE,CAAA;CAChB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,EAAE,CAiBpE"}
package/dist/parser.js DELETED
@@ -1,87 +0,0 @@
1
- /**
2
- * Parser: .void file content (markdown string) → Block[]
3
- *
4
- * Adapted from apps/ui/src/core/editors/voiden/markdownConverter.ts
5
- * - No TipTap/ProseMirror dependency
6
- * - No schema validation — trusts the YAML type field as-is
7
- */
8
- import YAML from 'yaml';
9
- /**
10
- * Restore %%EMPTY_LINE%% placeholders back to empty strings.
11
- * These appear in script/code node bodies when saved.
12
- */
13
- function restoreEmptyLineMarkers(value) {
14
- if (typeof value === 'string') {
15
- return value.replace(/%%EMPTY_LINE%%/g, '');
16
- }
17
- if (Array.isArray(value)) {
18
- return value.map(restoreEmptyLineMarkers);
19
- }
20
- if (value && typeof value === 'object') {
21
- const result = {};
22
- for (const [k, v] of Object.entries(value)) {
23
- result[k] = restoreEmptyLineMarkers(v);
24
- }
25
- return result;
26
- }
27
- return value;
28
- }
29
- /**
30
- * Parse a single void code block text (the YAML inside the fenced block).
31
- * Returns null if the block is malformed.
32
- */
33
- function parseVoidBlockText(text) {
34
- const lines = text.trim().split('\n');
35
- if (lines[0]?.trim() !== '---')
36
- return null;
37
- const headerEnd = lines.indexOf('---', 1);
38
- if (headerEnd === -1)
39
- return null;
40
- const yamlText = lines.slice(1, headerEnd).join('\n');
41
- try {
42
- let node = YAML.parse(yamlText);
43
- node = restoreEmptyLineMarkers(node);
44
- return node;
45
- }
46
- catch {
47
- return null;
48
- }
49
- }
50
- /**
51
- * Parse .void file content into an array of blocks.
52
- * Extracts all ```void ... ``` fenced code blocks from the markdown.
53
- */
54
- export function parseVoidFile(content) {
55
- const blocks = [];
56
- // Match ```void\n...\n``` fenced code blocks
57
- const regex = /^```void\n([\s\S]*?)^```/gm;
58
- let match;
59
- while ((match = regex.exec(content)) !== null) {
60
- const block = parseVoidBlockText(match[1]);
61
- if (block) {
62
- blocks.push(block);
63
- }
64
- }
65
- return blocks;
66
- }
67
- /**
68
- * Parse .void file content into sections split at request-separator blocks.
69
- * A file with no separators returns a single section.
70
- */
71
- export function parseVoidFileSections(content) {
72
- const allBlocks = parseVoidFile(content);
73
- const sections = [{ blocks: [] }];
74
- for (const block of allBlocks) {
75
- if (block.type === 'request-separator') {
76
- sections.push({
77
- label: block.attrs?.label,
78
- blocks: [],
79
- });
80
- }
81
- else {
82
- sections[sections.length - 1].blocks.push(block);
83
- }
84
- }
85
- return sections.filter(s => s.blocks.length > 0);
86
- }
87
- //# sourceMappingURL=parser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,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AC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;AAClD,CAAC"}
@@ -1,8 +0,0 @@
1
- /**
2
- * Standalone skill installed by `voiden-runner mcp install` for CLI-only
3
- * users (no Voiden app, so none of its richer composed .void-authoring
4
- * skill is available). Focused on the MCP tools this package ships —
5
- * list/run/verify/write-back — not on full block-authoring syntax.
6
- */
7
- export declare const RUNNER_SKILL_MARKDOWN = "---\nname: voiden-runner\ndescription: Run and verify .void API requests via the voiden-mcp-server MCP tools \u2014 list requests, execute them for real, read structured results, and record them back into the file.\n---\n\n# Voiden Runner \u2014 Running & Verifying .void Requests\n\n.void files describe HTTP/GraphQL/WebSocket/gRPC requests (see https://docs.voiden.md for the full authoring format, or the Voiden app's own \"voiden\" skill if it's installed). This skill covers a different, complementary job: **actually executing** those requests and checking the result, instead of only ever generating text that looks correct.\n\nA request block that merely looks well-formed can still be wrong (bad URL, wrong auth, malformed body). Don't stop at \"this looks right\" when you can check that it *is* right.\n\n## Tools\n\n| Tool | Use it to |\n|------|-----------|\n| `list_void_files` | See which `.void` files exist in the project |\n| `list_requests` | See what requests a file contains (label, request uid, method, URL) without running anything |\n| `run_request` | Actually execute a request (or a whole file) \u2014 makes a real network call and returns a structured result: `success`, `status`, `statusText`, `durationMs`, `body`, `error`, headers |\n| `write_result` | Record a `run_request` result back into the `.void` file, as a `response` block placed right after the request it belongs to |\n\n## Workflow\n\n1. Call `list_void_files` / `list_requests` to see what's actually in the project before assuming.\n2. Call `run_request` (with `sectionLabel` if you only want one request) to execute it for real.\n3. Read the result, don't just assume success:\n - `success: false` or a non-2xx `status` \u2014 read `error`/`body` for why, fix the request block, and re-run. A request that \"looks right\" but 404s or 401s is not done.\n - `success: true` \u2014 sanity-check the response `body` actually matches what the request was supposed to do.\n4. Optionally call `write_result` with the `requestUid` and the specific `results[i].result` object (not the whole `run_request` response) to persist what actually happened into the file.\n\n## Caveats\n\n- `run_request` makes a real call against whatever `BASE_URL`/auth/tokens are in scope for the target environment \u2014 treat it like running the request for real, not like generating text. Check which env/profile is active before running against anything that matters (e.g. don't hit `prod` by accident).\n- `write_result` has no file locking. Don't call it on a file that's open with unsaved edits elsewhere (e.g. in the Voiden app right now) \u2014 the next save there can overwrite it, or it can overwrite in-progress edits.\n- For CI/CD validation, prefer the plain `voiden-runner run --json` CLI command over this agent loop \u2014 it's deterministic and doesn't need an LLM in the loop. These tools are for interactive authoring/iteration, not as a CI gate.\n";
8
- //# sourceMappingURL=skillContent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"skillContent.d.ts","sourceRoot":"","sources":["../src/skillContent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,g4FAkCjC,CAAA"}
@@ -1,42 +0,0 @@
1
- /**
2
- * Standalone skill installed by `voiden-runner mcp install` for CLI-only
3
- * users (no Voiden app, so none of its richer composed .void-authoring
4
- * skill is available). Focused on the MCP tools this package ships —
5
- * list/run/verify/write-back — not on full block-authoring syntax.
6
- */
7
- export const RUNNER_SKILL_MARKDOWN = `---
8
- name: voiden-runner
9
- description: Run and verify .void API requests via the voiden-mcp-server MCP tools — list requests, execute them for real, read structured results, and record them back into the file.
10
- ---
11
-
12
- # Voiden Runner — Running & Verifying .void Requests
13
-
14
- .void files describe HTTP/GraphQL/WebSocket/gRPC requests (see https://docs.voiden.md for the full authoring format, or the Voiden app's own "voiden" skill if it's installed). This skill covers a different, complementary job: **actually executing** those requests and checking the result, instead of only ever generating text that looks correct.
15
-
16
- A request block that merely looks well-formed can still be wrong (bad URL, wrong auth, malformed body). Don't stop at "this looks right" when you can check that it *is* right.
17
-
18
- ## Tools
19
-
20
- | Tool | Use it to |
21
- |------|-----------|
22
- | \`list_void_files\` | See which \`.void\` files exist in the project |
23
- | \`list_requests\` | See what requests a file contains (label, request uid, method, URL) without running anything |
24
- | \`run_request\` | Actually execute a request (or a whole file) — makes a real network call and returns a structured result: \`success\`, \`status\`, \`statusText\`, \`durationMs\`, \`body\`, \`error\`, headers |
25
- | \`write_result\` | Record a \`run_request\` result back into the \`.void\` file, as a \`response\` block placed right after the request it belongs to |
26
-
27
- ## Workflow
28
-
29
- 1. Call \`list_void_files\` / \`list_requests\` to see what's actually in the project before assuming.
30
- 2. Call \`run_request\` (with \`sectionLabel\` if you only want one request) to execute it for real.
31
- 3. Read the result, don't just assume success:
32
- - \`success: false\` or a non-2xx \`status\` — read \`error\`/\`body\` for why, fix the request block, and re-run. A request that "looks right" but 404s or 401s is not done.
33
- - \`success: true\` — sanity-check the response \`body\` actually matches what the request was supposed to do.
34
- 4. Optionally call \`write_result\` with the \`requestUid\` and the specific \`results[i].result\` object (not the whole \`run_request\` response) to persist what actually happened into the file.
35
-
36
- ## Caveats
37
-
38
- - \`run_request\` makes a real call against whatever \`BASE_URL\`/auth/tokens are in scope for the target environment — treat it like running the request for real, not like generating text. Check which env/profile is active before running against anything that matters (e.g. don't hit \`prod\` by accident).
39
- - \`write_result\` has no file locking. Don't call it on a file that's open with unsaved edits elsewhere (e.g. in the Voiden app right now) — the next save there can overwrite it, or it can overwrite in-progress edits.
40
- - For CI/CD validation, prefer the plain \`voiden-runner run --json\` CLI command over this agent loop — it's deterministic and doesn't need an LLM in the loop. These tools are for interactive authoring/iteration, not as a CI gate.
41
- `;
42
- //# sourceMappingURL=skillContent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"skillContent.js","sourceRoot":"","sources":["../src/skillContent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCpC,CAAA"}