@restforgejs/mcp-server 1.2.2 → 1.2.3

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.
@@ -4,30 +4,30 @@ import { execProcess } from '../../lib/exec.js';
4
4
  export function registerDesignerListPlugins(server) {
5
5
  server.registerTool('designer_list_plugins', {
6
6
  title: 'List Designer Plugins',
7
- description: `List the RESTForge Designer frontend plugins available in the current environment, by running restforge-designer plugins list. Each plugin defines a frontend tech stack / template the designer can generate against.
8
-
9
- USE WHEN:
10
- - The user asks which designer plugins are available, or wants the catalog of frontend templates
11
- - The user asks things like "plugin apa yang tersedia", "daftar plugin designer", "list frontend plugins", "what designer plugins do I have", "tampilkan plugin frontend", "which frontend templates can I use"
12
- - Before initialising a project or generating frontend code, to choose which plugin to target
13
- - The user mentions designer plugins generically and wants an overview
14
-
15
- DO NOT USE FOR:
16
- - Inspecting the metadata, schema, or fields of ONE specific plugin -> use 'designer_inspect_plugin'
17
- - Validating a UDF payload against a plugin -> use 'designer_validate_payload'
18
- - Previewing the files a payload would generate -> use 'designer_preview_files'
19
-
20
- This tool wraps the RESTForge Designer CLI command: restforge-designer plugins list [--plugins-dir=<pluginsDir>], run in the given cwd.
21
- The CLI prints a table of available plugins (auto-detected, or from --plugins-dir when supplied). It does not modify any file and does not require a license.
22
-
23
- Preconditions:
24
- - The 'restforge-designer' binary must be installed and reachable on PATH. This tool pre-checks that by running
25
- 'restforge-designer --version'; if the binary is missing, the response will surface that as a non-error precondition.
26
-
27
- PRESENTATION GUIDANCE:
28
- - Match the user's language. If the user writes in Indonesian, respond in Indonesian.
29
- - Never mention internal tool names in the reply to the user. Describe actions by what they do (e.g. "list the available plugins", "inspect a plugin", "generate the frontend code").
30
- - Speak in plain language. Summarise the plugins (names, count); do not paste raw CLI output unless the user explicitly asks.
7
+ description: `List the RESTForge Designer frontend plugins available in the current environment, by running restforge-designer plugins list. Each plugin defines a frontend tech stack / template the designer can generate against.
8
+
9
+ USE WHEN:
10
+ - The user asks which designer plugins are available, or wants the catalog of frontend templates
11
+ - The user asks things like "plugin apa yang tersedia", "daftar plugin designer", "list frontend plugins", "what designer plugins do I have", "tampilkan plugin frontend", "which frontend templates can I use"
12
+ - Before initialising a project or generating frontend code, to choose which plugin to target
13
+ - The user mentions designer plugins generically and wants an overview
14
+
15
+ DO NOT USE FOR:
16
+ - Inspecting the metadata, schema, or fields of ONE specific plugin -> use 'designer_inspect_plugin'
17
+ - Validating a UDF payload against a plugin -> use 'designer_validate_payload'
18
+ - Previewing the files a payload would generate -> use 'designer_preview_files'
19
+
20
+ This tool wraps the RESTForge Designer CLI command: restforge-designer plugins list [--plugins-dir=<pluginsDir>], run in the given cwd.
21
+ The CLI prints a table of available plugins (auto-detected, or from --plugins-dir when supplied). It does not modify any file and does not require a license.
22
+
23
+ Preconditions:
24
+ - The 'restforge-designer' binary must be installed and reachable on PATH. This tool pre-checks that by running
25
+ 'restforge-designer --version'; if the binary is missing, the response will surface that as a non-error precondition.
26
+
27
+ PRESENTATION GUIDANCE:
28
+ - Match the user's language. If the user writes in Indonesian, respond in Indonesian.
29
+ - Never mention internal tool names in the reply to the user. Describe actions by what they do (e.g. "list the available plugins", "inspect a plugin", "generate the frontend code").
30
+ - Speak in plain language. Summarise the plugins (names, count); do not paste raw CLI output unless the user explicitly asks.
31
31
  - When a precondition is not met, frame it as a question or next-step suggestion rather than an error.`,
32
32
  inputSchema: {
33
33
  cwd: z
@@ -58,16 +58,16 @@ PRESENTATION GUIDANCE:
58
58
  content: [
59
59
  {
60
60
  type: 'text',
61
- text: `Precondition not met: the RESTForge Designer command-line tool is not installed or not on PATH.
62
-
63
- Working directory: ${projectCwd}
64
- Plugins dir: ${pluginsDir ?? 'auto-detect'}
65
- Probe command: ${probe.command}
66
- Exit code: ${probe.exitCode}
67
-
68
- For the assistant:
69
- - The user needs to install RESTForge Designer (and ensure it is on the system PATH) before the available plugins can be listed.
70
- - When explaining to the user, say something like "the RESTForge Designer tool isn't installed or isn't on your PATH yet — please install it and try again". Do not mention internal tool names.
61
+ text: `Precondition not met: the RESTForge Designer command-line tool is not installed or not on PATH.
62
+
63
+ Working directory: ${projectCwd}
64
+ Plugins dir: ${pluginsDir ?? 'auto-detect'}
65
+ Probe command: ${probe.command}
66
+ Exit code: ${probe.exitCode}
67
+
68
+ For the assistant:
69
+ - The user needs to install RESTForge Designer (and ensure it is on the system PATH) before the available plugins can be listed.
70
+ - When explaining to the user, say something like "the RESTForge Designer tool isn't installed or isn't on your PATH yet — please install it and try again". Do not mention internal tool names.
71
71
  - Once it is installed, retry listing the plugins.`,
72
72
  },
73
73
  ],
@@ -89,18 +89,18 @@ For the assistant:
89
89
  content: [
90
90
  {
91
91
  type: 'text',
92
- text: `Listing Designer plugins did not complete — the command crashed or timed out.
93
-
94
- Working directory: ${projectCwd}
95
- Plugins dir: ${pluginsDir ?? 'auto-detect'}
96
- Command: ${result.command}
97
-
98
- --- stderr ---
99
- ${result.stderr}
100
- --- end stderr ---
101
-
102
- For the assistant:
103
- - The Designer CLI did not finish (likely a crash or timeout), so there is no plugin list to report.
92
+ text: `Listing Designer plugins did not complete — the command crashed or timed out.
93
+
94
+ Working directory: ${projectCwd}
95
+ Plugins dir: ${pluginsDir ?? 'auto-detect'}
96
+ Command: ${result.command}
97
+
98
+ --- stderr ---
99
+ ${result.stderr}
100
+ --- end stderr ---
101
+
102
+ For the assistant:
103
+ - The Designer CLI did not finish (likely a crash or timeout), so there is no plugin list to report.
104
104
  - Tell the user the list could not be retrieved and offer to retry. Do not mention internal tool names.`,
105
105
  },
106
106
  ],
@@ -116,22 +116,22 @@ For the assistant:
116
116
  content: [
117
117
  {
118
118
  type: 'text',
119
- text: `Listing Designer plugins ran.
120
-
121
- Working directory: ${projectCwd}
122
- Plugins dir: ${pluginsDir ?? 'auto-detect'}
123
- Command: ${result.command}
124
- Exit code: ${result.exitCode}
125
-
126
- --- stdout ---
127
- ${result.stdout}
128
- --- end stdout ---
129
- ${stderrBlock}
130
- For the assistant:
131
- - The Designer CLI ran to completion. Read the CLI output above and classify the result:
132
- (a) Positive result — the output is a table of available plugins. Summarise the plugins in plain language (names and how many) and, if the user is choosing one, suggest inspecting a specific plugin for its details.
133
- (b) Actionable negative verdict — no plugins were found, or the plugins directory override could not be resolved. These are legitimate results to RELAY to the user, not tool malfunctions. Explain the situation (e.g. the plugins folder is empty or the override path is wrong) and offer next steps.
134
- - A non-zero exit code here means the CLI reported a negative verdict (case b), NOT that the tool failed. Never tell the user "the tool failed" for case (b).
119
+ text: `Listing Designer plugins ran.
120
+
121
+ Working directory: ${projectCwd}
122
+ Plugins dir: ${pluginsDir ?? 'auto-detect'}
123
+ Command: ${result.command}
124
+ Exit code: ${result.exitCode}
125
+
126
+ --- stdout ---
127
+ ${result.stdout}
128
+ --- end stdout ---
129
+ ${stderrBlock}
130
+ For the assistant:
131
+ - The Designer CLI ran to completion. Read the CLI output above and classify the result:
132
+ (a) Positive result — the output is a table of available plugins. Summarise the plugins in plain language (names and how many) and, if the user is choosing one, suggest inspecting a specific plugin for its details.
133
+ (b) Actionable negative verdict — no plugins were found, or the plugins directory override could not be resolved. These are legitimate results to RELAY to the user, not tool malfunctions. Explain the situation (e.g. the plugins folder is empty or the override path is wrong) and offer next steps.
134
+ - A non-zero exit code here means the CLI reported a negative verdict (case b), NOT that the tool failed. Never tell the user "the tool failed" for case (b).
135
135
  - Do not paste the raw CLI output unless the user explicitly asks. Do not mention internal tool names. Match the user's language.`,
136
136
  },
137
137
  ],
@@ -4,31 +4,36 @@ import { execProcess } from '../../lib/exec.js';
4
4
  export function registerDesignerPreviewFiles(server) {
5
5
  server.registerTool('designer_preview_files', {
6
6
  title: 'Preview Designer Files',
7
- description: `Preview (dry-run) the frontend files that the RESTForge Designer would generate from a UI Definition File (UDF) payload, by running restforge-designer preview. This lists what would be produced WITHOUT writing anything to disk.
8
-
9
- USE WHEN:
10
- - The user asks which files would be generated, or wants a dry-run before generating frontend code
11
- - The user asks things like "file apa yang akan di-generate", "preview output frontend designer", "dry-run generate", "what files will the designer produce", "tunjukkan hasil generate tanpa menulis file", "preview the designer output"
12
- - Before actually generating the frontend code, to inspect the planned output and confirm it looks right
13
- - The user mentions a designer/frontend UDF payload and wants to see the resulting file layout first
14
-
15
- DO NOT USE FOR:
16
- - Validating that a UDF payload is structurally correct against the plugin schema -> use 'designer_validate_payload'
17
- - Actually generating and writing the frontend files (preview is read-only; the real generation tool writes files)
18
- - Listing the available designer plugins -> use 'designer_list_plugins'
19
- - Inspecting one plugin's metadata -> use 'designer_inspect_plugin'
20
-
21
- This tool wraps the RESTForge Designer CLI command: restforge-designer preview --payload=<payload> [--plugins-dir=<pluginsDir>], run in the given cwd.
22
- The CLI reads the UDF payload JSON, resolves the target plugin (auto-detected or from --plugins-dir), and prints the list of files it would generate. It does not modify any file and does not require a license.
23
-
24
- Preconditions:
25
- - The 'restforge-designer' binary must be installed and reachable on PATH. This tool pre-checks that by running
26
- 'restforge-designer --version'; if the binary is missing, the response will surface that as a non-error precondition.
27
-
28
- PRESENTATION GUIDANCE:
29
- - Match the user's language. If the user writes in Indonesian, respond in Indonesian.
30
- - Never mention internal tool names in the reply to the user. Describe actions by what they do (e.g. "preview the generated files", "validate the UI definition", "generate the frontend code").
31
- - Speak in plain language. Summarise the planned file list; do not paste raw CLI output unless the user explicitly asks.
7
+ description: `Preview (dry-run) the frontend files that the RESTForge Designer would generate from a UI Definition File (UDF) payload, by running restforge-designer preview. This lists what would be produced WITHOUT writing anything to disk.
8
+
9
+ USE WHEN:
10
+ - The user asks which files would be generated, or wants a dry-run before generating frontend code
11
+ - The user asks things like "file apa yang akan di-generate", "preview output frontend designer", "dry-run generate", "what files will the designer produce", "tunjukkan hasil generate tanpa menulis file", "preview the designer output"
12
+ - Before actually generating the frontend code, to inspect the planned output and confirm it looks right
13
+ - The user mentions a designer/frontend UDF payload and wants to see the resulting file layout first
14
+
15
+ DO NOT USE FOR:
16
+ - Validating that a UDF payload is structurally correct against the plugin schema -> use 'designer_validate_payload'
17
+ - Actually generating and writing the frontend files (preview is read-only; the real generation tool writes files)
18
+ - Listing the available designer plugins -> use 'designer_list_plugins'
19
+ - Inspecting one plugin's metadata -> use 'designer_inspect_plugin'
20
+
21
+ This tool wraps the RESTForge Designer CLI command: restforge-designer preview --payload=<payload> [--plugins-dir=<pluginsDir>], run in the given cwd.
22
+ The CLI reads the UDF payload JSON, resolves the target plugin (auto-detected or from --plugins-dir), and prints the list of files it would generate. It does not modify any file and does not require a license.
23
+
24
+ Cross-reference (grounding & on-ramp):
25
+ - To ground the UDF shape before previewing or editing it (valid field types, required appConfig fields, enums, limits), use 'designer_get_udf_catalog' — the authoritative source of UDF structure.
26
+ - If the UDF does not exist yet but a backend RDF does, the on-ramp is 'codegen_migrate_payload' (RDF -> split UDF set), then validate and preview that output.
27
+ - Canonical UDF flow: codegen_migrate_payload -> designer_get_udf_catalog -> designer_validate_payload -> designer_preview_files -> designer_generate.
28
+
29
+ Preconditions:
30
+ - The 'restforge-designer' binary must be installed and reachable on PATH. This tool pre-checks that by running
31
+ 'restforge-designer --version'; if the binary is missing, the response will surface that as a non-error precondition.
32
+
33
+ PRESENTATION GUIDANCE:
34
+ - Match the user's language. If the user writes in Indonesian, respond in Indonesian.
35
+ - Never mention internal tool names in the reply to the user. Describe actions by what they do (e.g. "preview the generated files", "validate the UI definition", "generate the frontend code").
36
+ - Speak in plain language. Summarise the planned file list; do not paste raw CLI output unless the user explicitly asks.
32
37
  - When a precondition is not met, frame it as a question or next-step suggestion rather than an error.`,
33
38
  inputSchema: {
34
39
  cwd: z
@@ -63,17 +68,17 @@ PRESENTATION GUIDANCE:
63
68
  content: [
64
69
  {
65
70
  type: 'text',
66
- text: `Precondition not met: the RESTForge Designer command-line tool is not installed or not on PATH.
67
-
68
- Working directory: ${projectCwd}
69
- Payload: ${payload}
70
- Plugins dir: ${pluginsDir ?? 'auto-detect'}
71
- Probe command: ${probe.command}
72
- Exit code: ${probe.exitCode}
73
-
74
- For the assistant:
75
- - The user needs to install RESTForge Designer (and ensure it is on the system PATH) before the generated files can be previewed.
76
- - When explaining to the user, say something like "the RESTForge Designer tool isn't installed or isn't on your PATH yet — please install it and try again". Do not mention internal tool names.
71
+ text: `Precondition not met: the RESTForge Designer command-line tool is not installed or not on PATH.
72
+
73
+ Working directory: ${projectCwd}
74
+ Payload: ${payload}
75
+ Plugins dir: ${pluginsDir ?? 'auto-detect'}
76
+ Probe command: ${probe.command}
77
+ Exit code: ${probe.exitCode}
78
+
79
+ For the assistant:
80
+ - The user needs to install RESTForge Designer (and ensure it is on the system PATH) before the generated files can be previewed.
81
+ - When explaining to the user, say something like "the RESTForge Designer tool isn't installed or isn't on your PATH yet — please install it and try again". Do not mention internal tool names.
77
82
  - Once it is installed, retry the preview.`,
78
83
  },
79
84
  ],
@@ -95,19 +100,19 @@ For the assistant:
95
100
  content: [
96
101
  {
97
102
  type: 'text',
98
- text: `Designer preview did not complete — the command crashed or timed out.
99
-
100
- Working directory: ${projectCwd}
101
- Payload: ${payload}
102
- Plugins dir: ${pluginsDir ?? 'auto-detect'}
103
- Command: ${result.command}
104
-
105
- --- stderr ---
106
- ${result.stderr}
107
- --- end stderr ---
108
-
109
- For the assistant:
110
- - The Designer CLI did not finish (likely a crash or timeout), so there is no preview to report.
103
+ text: `Designer preview did not complete — the command crashed or timed out.
104
+
105
+ Working directory: ${projectCwd}
106
+ Payload: ${payload}
107
+ Plugins dir: ${pluginsDir ?? 'auto-detect'}
108
+ Command: ${result.command}
109
+
110
+ --- stderr ---
111
+ ${result.stderr}
112
+ --- end stderr ---
113
+
114
+ For the assistant:
115
+ - The Designer CLI did not finish (likely a crash or timeout), so there is no preview to report.
111
116
  - Tell the user the preview could not be completed and offer to retry. Do not mention internal tool names.`,
112
117
  },
113
118
  ],
@@ -123,24 +128,24 @@ For the assistant:
123
128
  content: [
124
129
  {
125
130
  type: 'text',
126
- text: `Designer preview ran.
127
-
128
- Working directory: ${projectCwd}
129
- Payload: ${payload}
130
- Plugins dir: ${pluginsDir ?? 'auto-detect'}
131
- Command: ${result.command}
132
- Exit code: ${result.exitCode}
133
-
134
- --- stdout ---
135
- ${result.stdout}
136
- --- end stdout ---
137
- ${stderrBlock}
138
- For the assistant:
139
- - The Designer CLI ran to completion. Read the CLI output above and classify the result:
140
- (a) Positive result — the output lists the files that would be generated. Summarise the planned files in plain language (how many, what kinds) and offer the next step: generate the frontend code for real.
141
- (b) Actionable negative verdict — the payload is invalid, the payload file was not found, or the target plugin / plugins directory could not be resolved. These are legitimate results to RELAY to the user, not tool malfunctions. Summarise the concrete problem (which path or field is wrong) and offer to retry after the user fixes it; validating the payload first can help pinpoint structural errors.
142
- - A non-zero exit code here means the CLI reported a negative verdict (case b), NOT that the tool failed. Never tell the user "the tool failed" for case (b).
143
- - Soft note: if preview fails with an appConfig/plugin error (e.g. the plugin or app config "not found") while the SAME payload passes validation, the payload may rely on 'extends' / 'include' references that preview does not appear to merge the way validation does. As a possible workaround, suggest pointing the preview at a self-contained payload (inline appConfig and pages) or an already-merged file. This is a tentative hint, not a guaranteed rule — do not state it as certain or tie it to a specific version.
131
+ text: `Designer preview ran.
132
+
133
+ Working directory: ${projectCwd}
134
+ Payload: ${payload}
135
+ Plugins dir: ${pluginsDir ?? 'auto-detect'}
136
+ Command: ${result.command}
137
+ Exit code: ${result.exitCode}
138
+
139
+ --- stdout ---
140
+ ${result.stdout}
141
+ --- end stdout ---
142
+ ${stderrBlock}
143
+ For the assistant:
144
+ - The Designer CLI ran to completion. Read the CLI output above and classify the result:
145
+ (a) Positive result — the output lists the files that would be generated. Summarise the planned files in plain language (how many, what kinds) and offer the next step: generate the frontend code for real.
146
+ (b) Actionable negative verdict — the payload is invalid, the payload file was not found, or the target plugin / plugins directory could not be resolved. These are legitimate results to RELAY to the user, not tool malfunctions. Summarise the concrete problem (which path or field is wrong) and offer to retry after the user fixes it; validating the payload first can help pinpoint structural errors.
147
+ - A non-zero exit code here means the CLI reported a negative verdict (case b), NOT that the tool failed. Never tell the user "the tool failed" for case (b).
148
+ - Soft note: if preview fails with an appConfig/plugin error (e.g. the plugin or app config "not found") while the SAME payload passes validation, the payload may rely on 'extends' / 'include' references that preview does not appear to merge the way validation does. As a possible workaround, suggest pointing the preview at a self-contained payload (inline appConfig and pages) or an already-merged file. This is a tentative hint, not a guaranteed rule — do not state it as certain or tie it to a specific version.
144
149
  - Do not paste the raw CLI output unless the user explicitly asks. Do not mention internal tool names. Match the user's language.`,
145
150
  },
146
151
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"preview-files.js","sourceRoot":"","sources":["../../../src/tools/designer/preview-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,UAAU,4BAA4B,CAAC,MAAiB;IAC5D,MAAM,CAAC,YAAY,CACjB,wBAAwB,EACxB;QACE,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;uGAyBoF;QACjG,WAAW,EAAE;YACX,GAAG,EAAE,CAAC;iBACH,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CAAC,gEAAgE,CAAC;YAC7E,OAAO,EAAE,CAAC;iBACP,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CAAC,iEAAiE,CAAC;YAC9E,UAAU,EAAE,CAAC;iBACV,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,EAAE;iBACV,QAAQ,CAAC,mGAAmG,CAAC;SACjH;QACD,WAAW,EAAE;YACX,KAAK,EAAE,wBAAwB;YAC/B,YAAY,EAAE,IAAI;YAClB,cAAc,EAAE,IAAI;SACrB;KACF,EACD,KAAK,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAA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;;;EAGvB,MAAM,CAAC,MAAM;;;;;2GAK4F;qBAC9F;iBACF;gBACD,OAAO,EAAE,IAAI,EAAE,sCAAsC;aACtD,CAAC;QACJ,CAAC;QAED,+EAA+E;QAC/E,qFAAqF;QACrF,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM;YAC/B,CAAC,CAAC,qBAAqB,MAAM,CAAC,MAAM,wBAAwB;YAC5D,CAAC,CAAC,EAAE,CAAC;QACP,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;qBAEG,UAAU;WACpB,OAAO;eACH,UAAU,IAAI,aAAa;WAC/B,MAAM,CAAC,OAAO;aACZ,MAAM,CAAC,QAAQ;;;EAG1B,MAAM,CAAC,MAAM;;EAEb,WAAW;;;;;;;kIAOqH;iBACvH;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -4,31 +4,31 @@ import { execProcess } from '../../lib/exec.js';
4
4
  export function registerDesignerScaffoldPlugin(server) {
5
5
  server.registerTool('designer_scaffold_plugin', {
6
6
  title: 'Scaffold Designer Plugin',
7
- description: `Scaffold a new custom RESTForge Designer frontend plugin from a template, by running restforge-designer plugins scaffold. This WRITES a new plugin folder to disk that the user can then customise.
8
-
9
- USE WHEN:
10
- - The user asks to create a new custom designer/frontend plugin from scratch
11
- - The user asks things like "buat plugin custom baru", "scaffold folder plugin designer", "mulai plugin frontend dari template", "create a new designer plugin", "scaffold a frontend plugin", "bikin plugin frontend baru"
12
- - The user wants a starter plugin folder they can edit to build their own frontend generator template
13
- - The user names a new plugin id and wants the folder structure generated for it
14
-
15
- DO NOT USE FOR:
16
- - Generating a frontend application from a UDF payload -> use 'designer_generate'
17
- - Initialising a project from an existing plugin -> use 'designer_init_project'
18
- - Listing the available plugins -> use 'designer_list_plugins'
19
- - Inspecting one existing plugin's metadata -> use 'designer_inspect_plugin'
20
-
21
- This tool wraps the RESTForge Designer CLI command: restforge-designer plugins scaffold --id=<id> --output=<output> [--plugins-dir=<pluginsDir>], run in the given cwd.
22
- The CLI creates a new plugin folder named after the given id under the output directory. It does NOT require a license (scaffolding is license-free).
23
-
24
- Preconditions:
25
- - The 'restforge-designer' binary must be installed and reachable on PATH. This tool pre-checks that by running
26
- 'restforge-designer --version'; if the binary is missing, the response will surface that as a non-error precondition.
27
-
28
- PRESENTATION GUIDANCE:
29
- - Match the user's language. If the user writes in Indonesian, respond in Indonesian.
30
- - Never mention internal tool names in the reply to the user. Describe actions by what they do (e.g. "scaffold a new plugin", "list the available plugins", "generate the frontend code").
31
- - Speak in plain language. Confirm what was created and where; do not paste raw CLI output unless the user explicitly asks.
7
+ description: `Scaffold a new custom RESTForge Designer frontend plugin from a template, by running restforge-designer plugins scaffold. This WRITES a new plugin folder to disk that the user can then customise.
8
+
9
+ USE WHEN:
10
+ - The user asks to create a new custom designer/frontend plugin from scratch
11
+ - The user asks things like "buat plugin custom baru", "scaffold folder plugin designer", "mulai plugin frontend dari template", "create a new designer plugin", "scaffold a frontend plugin", "bikin plugin frontend baru"
12
+ - The user wants a starter plugin folder they can edit to build their own frontend generator template
13
+ - The user names a new plugin id and wants the folder structure generated for it
14
+
15
+ DO NOT USE FOR:
16
+ - Generating a frontend application from a UDF payload -> use 'designer_generate'
17
+ - Initialising a project from an existing plugin -> use 'designer_init_project'
18
+ - Listing the available plugins -> use 'designer_list_plugins'
19
+ - Inspecting one existing plugin's metadata -> use 'designer_inspect_plugin'
20
+
21
+ This tool wraps the RESTForge Designer CLI command: restforge-designer plugins scaffold --id=<id> --output=<output> [--plugins-dir=<pluginsDir>], run in the given cwd.
22
+ The CLI creates a new plugin folder named after the given id under the output directory. It does NOT require a license (scaffolding is license-free).
23
+
24
+ Preconditions:
25
+ - The 'restforge-designer' binary must be installed and reachable on PATH. This tool pre-checks that by running
26
+ 'restforge-designer --version'; if the binary is missing, the response will surface that as a non-error precondition.
27
+
28
+ PRESENTATION GUIDANCE:
29
+ - Match the user's language. If the user writes in Indonesian, respond in Indonesian.
30
+ - Never mention internal tool names in the reply to the user. Describe actions by what they do (e.g. "scaffold a new plugin", "list the available plugins", "generate the frontend code").
31
+ - Speak in plain language. Confirm what was created and where; do not paste raw CLI output unless the user explicitly asks.
32
32
  - When a precondition is not met, frame it as a question or next-step suggestion rather than an error.`,
33
33
  inputSchema: {
34
34
  cwd: z
@@ -67,18 +67,18 @@ PRESENTATION GUIDANCE:
67
67
  content: [
68
68
  {
69
69
  type: 'text',
70
- text: `Precondition not met: the RESTForge Designer command-line tool is not installed or not on PATH.
71
-
72
- Working directory: ${projectCwd}
73
- Plugin id: ${id}
74
- Output: ${output}
75
- Plugins dir: ${pluginsDir ?? 'auto-detect'}
76
- Probe command: ${probe.command}
77
- Exit code: ${probe.exitCode}
78
-
79
- For the assistant:
80
- - The user needs to install RESTForge Designer (and ensure it is on the system PATH) before a plugin can be scaffolded.
81
- - When explaining to the user, say something like "the RESTForge Designer tool isn't installed or isn't on your PATH yet — please install it and try again". Do not mention internal tool names.
70
+ text: `Precondition not met: the RESTForge Designer command-line tool is not installed or not on PATH.
71
+
72
+ Working directory: ${projectCwd}
73
+ Plugin id: ${id}
74
+ Output: ${output}
75
+ Plugins dir: ${pluginsDir ?? 'auto-detect'}
76
+ Probe command: ${probe.command}
77
+ Exit code: ${probe.exitCode}
78
+
79
+ For the assistant:
80
+ - The user needs to install RESTForge Designer (and ensure it is on the system PATH) before a plugin can be scaffolded.
81
+ - When explaining to the user, say something like "the RESTForge Designer tool isn't installed or isn't on your PATH yet — please install it and try again". Do not mention internal tool names.
82
82
  - Once it is installed, retry scaffolding the plugin.`,
83
83
  },
84
84
  ],
@@ -104,24 +104,24 @@ For the assistant:
104
104
  content: [
105
105
  {
106
106
  type: 'text',
107
- text: `Scaffolding the Designer plugin did not complete.
108
-
109
- Working directory: ${projectCwd}
110
- Plugin id: ${id}
111
- Output: ${output}
112
- Plugins dir: ${pluginsDir ?? 'auto-detect'}
113
- Command: ${result.command}
114
- Exit code: ${result.exitCode}
115
-
116
- --- stdout ---
117
- ${result.stdout}
118
- --- end stdout ---
119
- ${stderrBlock}
120
- For the assistant:
121
- - The scaffold did not finish successfully, so the plugin folder may not exist or may be partial. Read the CLI output above and explain the most likely cause to the user in plain language. Common causes:
122
- * The output directory already exists or is not writable — suggest a different output path or clearing the existing folder.
123
- * The plugin id is invalid (bad characters) — suggest a simpler id.
124
- * Exit code -1 — the command crashed or timed out; offer to retry.
107
+ text: `Scaffolding the Designer plugin did not complete.
108
+
109
+ Working directory: ${projectCwd}
110
+ Plugin id: ${id}
111
+ Output: ${output}
112
+ Plugins dir: ${pluginsDir ?? 'auto-detect'}
113
+ Command: ${result.command}
114
+ Exit code: ${result.exitCode}
115
+
116
+ --- stdout ---
117
+ ${result.stdout}
118
+ --- end stdout ---
119
+ ${stderrBlock}
120
+ For the assistant:
121
+ - The scaffold did not finish successfully, so the plugin folder may not exist or may be partial. Read the CLI output above and explain the most likely cause to the user in plain language. Common causes:
122
+ * The output directory already exists or is not writable — suggest a different output path or clearing the existing folder.
123
+ * The plugin id is invalid (bad characters) — suggest a simpler id.
124
+ * Exit code -1 — the command crashed or timed out; offer to retry.
125
125
  - Do not paste the raw CLI output unless the user explicitly asks. Do not mention internal tool names. Match the user's language.`,
126
126
  },
127
127
  ],
@@ -136,23 +136,23 @@ For the assistant:
136
136
  content: [
137
137
  {
138
138
  type: 'text',
139
- text: `Designer plugin scaffolded successfully.
140
-
141
- Working directory: ${projectCwd}
142
- Plugin id: ${id}
143
- Output: ${output}
144
- Plugins dir: ${pluginsDir ?? 'auto-detect'}
145
- Command: ${result.command}
146
- Exit code: ${result.exitCode}
147
-
148
- --- stdout ---
149
- ${result.stdout}
150
- --- end stdout ---
151
- ${stderrBlock}
152
- For the assistant:
153
- - Confirm to the user that the new plugin folder was created. Mention the plugin id and the output location in plain language.
154
- - The scaffold is a starting point: the user will edit the generated plugin files (templates, schema) to build their own frontend generator.
155
- - Suggest a sensible next step, e.g. inspecting or listing the plugins to confirm the new one is picked up, or authoring a UDF payload that targets it.
139
+ text: `Designer plugin scaffolded successfully.
140
+
141
+ Working directory: ${projectCwd}
142
+ Plugin id: ${id}
143
+ Output: ${output}
144
+ Plugins dir: ${pluginsDir ?? 'auto-detect'}
145
+ Command: ${result.command}
146
+ Exit code: ${result.exitCode}
147
+
148
+ --- stdout ---
149
+ ${result.stdout}
150
+ --- end stdout ---
151
+ ${stderrBlock}
152
+ For the assistant:
153
+ - Confirm to the user that the new plugin folder was created. Mention the plugin id and the output location in plain language.
154
+ - The scaffold is a starting point: the user will edit the generated plugin files (templates, schema) to build their own frontend generator.
155
+ - Suggest a sensible next step, e.g. inspecting or listing the plugins to confirm the new one is picked up, or authoring a UDF payload that targets it.
156
156
  - Do not paste the raw CLI output unless the user explicitly asks. Do not mention internal tool names. Match the user's language.`,
157
157
  },
158
158
  ],