@react-spa-scaffold/mcp 1.2.0 → 1.2.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.
- package/dist/constants.d.ts +35 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +35 -0
- package/dist/constants.js.map +1 -0
- package/dist/features/definitions/theming.d.ts.map +1 -1
- package/dist/features/definitions/theming.js +2 -1
- package/dist/features/definitions/theming.js.map +1 -1
- package/dist/features/types.d.ts +14 -19
- package/dist/features/types.d.ts.map +1 -1
- package/dist/features/types.js +4 -21
- package/dist/features/types.js.map +1 -1
- package/dist/features/types.test.d.ts +5 -0
- package/dist/features/types.test.d.ts.map +1 -0
- package/dist/features/types.test.js +32 -0
- package/dist/features/types.test.js.map +1 -0
- package/dist/resources/docs.d.ts +2 -8
- package/dist/resources/docs.d.ts.map +1 -1
- package/dist/resources/docs.js +27 -49
- package/dist/resources/docs.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +3 -2
- package/dist/server.js.map +1 -1
- package/dist/tools/get-example.d.ts +4 -15
- package/dist/tools/get-example.d.ts.map +1 -1
- package/dist/tools/get-example.js +3 -11
- package/dist/tools/get-example.js.map +1 -1
- package/dist/tools/get-features.d.ts +15 -9
- package/dist/tools/get-features.d.ts.map +1 -1
- package/dist/tools/get-features.js +12 -0
- package/dist/tools/get-features.js.map +1 -1
- package/dist/tools/get-file.d.ts +23 -0
- package/dist/tools/get-file.d.ts.map +1 -0
- package/dist/tools/get-file.js +53 -0
- package/dist/tools/get-file.js.map +1 -0
- package/dist/tools/get-file.test.d.ts +5 -0
- package/dist/tools/get-file.test.d.ts.map +1 -0
- package/dist/tools/get-file.test.js +63 -0
- package/dist/tools/get-file.test.js.map +1 -0
- package/dist/tools/get-scaffold.d.ts +8 -29
- package/dist/tools/get-scaffold.d.ts.map +1 -1
- package/dist/tools/get-scaffold.js +18 -24
- package/dist/tools/get-scaffold.js.map +1 -1
- package/dist/tools/get-scaffold.test.js +19 -16
- package/dist/tools/get-scaffold.test.js.map +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/registry.d.ts +4 -0
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +33 -15
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/types.d.ts +24 -6
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js +3 -0
- package/dist/tools/types.js.map +1 -1
- package/dist/utils/cache.d.ts +9 -5
- package/dist/utils/cache.d.ts.map +1 -1
- package/dist/utils/cache.js +21 -5
- package/dist/utils/cache.js.map +1 -1
- package/dist/utils/docs.d.ts +1 -3
- package/dist/utils/docs.d.ts.map +1 -1
- package/dist/utils/docs.js +3 -8
- package/dist/utils/docs.js.map +1 -1
- package/dist/utils/examples/index.d.ts +1 -1
- package/dist/utils/examples/index.d.ts.map +1 -1
- package/dist/utils/examples/index.js +6 -10
- package/dist/utils/examples/index.js.map +1 -1
- package/dist/utils/examples/patterns.test.d.ts +6 -0
- package/dist/utils/examples/patterns.test.d.ts.map +1 -0
- package/dist/utils/examples/patterns.test.js +75 -0
- package/dist/utils/examples/patterns.test.js.map +1 -0
- package/dist/utils/paths.d.ts +9 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +19 -1
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/paths.test.js +22 -1
- package/dist/utils/paths.test.js.map +1 -1
- package/dist/utils/scaffold/claude-md/index.d.ts +7 -0
- package/dist/utils/scaffold/claude-md/index.d.ts.map +1 -0
- package/dist/utils/scaffold/claude-md/index.js +23 -0
- package/dist/utils/scaffold/claude-md/index.js.map +1 -0
- package/dist/utils/scaffold/claude-md/sections.d.ts +16 -0
- package/dist/utils/scaffold/claude-md/sections.d.ts.map +1 -0
- package/dist/utils/scaffold/claude-md/sections.js +269 -0
- package/dist/utils/scaffold/claude-md/sections.js.map +1 -0
- package/dist/utils/scaffold/commands.d.ts +2 -6
- package/dist/utils/scaffold/commands.d.ts.map +1 -1
- package/dist/utils/scaffold/commands.js +9 -12
- package/dist/utils/scaffold/commands.js.map +1 -1
- package/dist/utils/scaffold/compute.d.ts +5 -8
- package/dist/utils/scaffold/compute.d.ts.map +1 -1
- package/dist/utils/scaffold/compute.js +26 -41
- package/dist/utils/scaffold/compute.js.map +1 -1
- package/dist/utils/scaffold/dependencies.d.ts +10 -17
- package/dist/utils/scaffold/dependencies.d.ts.map +1 -1
- package/dist/utils/scaffold/dependencies.js +28 -34
- package/dist/utils/scaffold/dependencies.js.map +1 -1
- package/dist/utils/scaffold/generators.d.ts +3 -11
- package/dist/utils/scaffold/generators.d.ts.map +1 -1
- package/dist/utils/scaffold/generators.js +20 -288
- package/dist/utils/scaffold/generators.js.map +1 -1
- package/dist/utils/scaffold/index.d.ts +2 -3
- package/dist/utils/scaffold/index.d.ts.map +1 -1
- package/dist/utils/scaffold/index.js +1 -3
- package/dist/utils/scaffold/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared constants for type-safe string values throughout the MCP server.
|
|
3
|
+
*/
|
|
4
|
+
/** Feature IDs - use instead of raw strings for feature checks. */
|
|
5
|
+
export declare const FEATURE: {
|
|
6
|
+
readonly CORE: "core";
|
|
7
|
+
readonly MOBILE: "mobile";
|
|
8
|
+
readonly ROUTING: "routing";
|
|
9
|
+
readonly UI: "ui";
|
|
10
|
+
readonly FORMS: "forms";
|
|
11
|
+
readonly STATE: "state";
|
|
12
|
+
readonly API: "api";
|
|
13
|
+
readonly I18N: "i18n";
|
|
14
|
+
readonly TESTING: "testing";
|
|
15
|
+
readonly PERFORMANCE: "performance";
|
|
16
|
+
readonly DEVTOOLS: "devtools";
|
|
17
|
+
readonly CI: "ci";
|
|
18
|
+
readonly OBSERVABILITY: "observability";
|
|
19
|
+
readonly THEMING: "theming";
|
|
20
|
+
};
|
|
21
|
+
/** Script names for setup commands. */
|
|
22
|
+
export declare const SCRIPT: {
|
|
23
|
+
readonly PREPARE: "prepare";
|
|
24
|
+
readonly I18N_EXTRACT: "i18n:extract";
|
|
25
|
+
};
|
|
26
|
+
/** Documentation resource URIs. */
|
|
27
|
+
export declare const DOCS_URI: {
|
|
28
|
+
readonly CONVENTIONS: "docs://conventions";
|
|
29
|
+
readonly ARCHITECTURE: "docs://architecture";
|
|
30
|
+
readonly TESTING: "docs://testing";
|
|
31
|
+
readonly I18N: "docs://i18n";
|
|
32
|
+
readonly API: "docs://api";
|
|
33
|
+
readonly CLAUDE: "docs://claude";
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,mEAAmE;AACnE,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;CAeV,CAAC;AAEX,uCAAuC;AACvC,eAAO,MAAM,MAAM;;;CAGT,CAAC;AAEX,mCAAmC;AACnC,eAAO,MAAM,QAAQ;;;;;;;CAOX,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared constants for type-safe string values throughout the MCP server.
|
|
3
|
+
*/
|
|
4
|
+
/** Feature IDs - use instead of raw strings for feature checks. */
|
|
5
|
+
export const FEATURE = {
|
|
6
|
+
CORE: 'core',
|
|
7
|
+
MOBILE: 'mobile',
|
|
8
|
+
ROUTING: 'routing',
|
|
9
|
+
UI: 'ui',
|
|
10
|
+
FORMS: 'forms',
|
|
11
|
+
STATE: 'state',
|
|
12
|
+
API: 'api',
|
|
13
|
+
I18N: 'i18n',
|
|
14
|
+
TESTING: 'testing',
|
|
15
|
+
PERFORMANCE: 'performance',
|
|
16
|
+
DEVTOOLS: 'devtools',
|
|
17
|
+
CI: 'ci',
|
|
18
|
+
OBSERVABILITY: 'observability',
|
|
19
|
+
THEMING: 'theming',
|
|
20
|
+
};
|
|
21
|
+
/** Script names for setup commands. */
|
|
22
|
+
export const SCRIPT = {
|
|
23
|
+
PREPARE: 'prepare',
|
|
24
|
+
I18N_EXTRACT: 'i18n:extract',
|
|
25
|
+
};
|
|
26
|
+
/** Documentation resource URIs. */
|
|
27
|
+
export const DOCS_URI = {
|
|
28
|
+
CONVENTIONS: 'docs://conventions',
|
|
29
|
+
ARCHITECTURE: 'docs://architecture',
|
|
30
|
+
TESTING: 'docs://testing',
|
|
31
|
+
I18N: 'docs://i18n',
|
|
32
|
+
API: 'docs://api',
|
|
33
|
+
CLAUDE: 'docs://claude',
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,mEAAmE;AACnE,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,EAAE,EAAE,IAAI;IACR,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,aAAa;IAC1B,QAAQ,EAAE,UAAU;IACpB,EAAE,EAAE,IAAI;IACR,aAAa,EAAE,eAAe;IAC9B,OAAO,EAAE,SAAS;CACV,CAAC;AAEX,uCAAuC;AACvC,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,cAAc;CACpB,CAAC;AAEX,mCAAmC;AACnC,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,WAAW,EAAE,oBAAoB;IACjC,YAAY,EAAE,qBAAqB;IACnC,OAAO,EAAE,gBAAgB;IACzB,IAAI,EAAE,aAAa;IACnB,GAAG,EAAE,YAAY;IACjB,MAAM,EAAE,eAAe;CACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theming.d.ts","sourceRoot":"","sources":["../../../src/features/definitions/theming.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,eAAO,MAAM,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"theming.d.ts","sourceRoot":"","sources":["../../../src/features/definitions/theming.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,eAAO,MAAM,OAAO,EAAE,OAyBrB,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export const theming = {
|
|
2
2
|
name: 'Theming',
|
|
3
|
-
description: 'Light/dark/system theme toggle with CSS variables
|
|
3
|
+
description: 'Light/dark/system theme toggle with CSS variables',
|
|
4
4
|
required: false,
|
|
5
|
+
requires: ['state'], // Needs Zustand for persistence
|
|
5
6
|
includes: [
|
|
6
7
|
'Light/dark/system theme modes',
|
|
7
8
|
'useThemeEffect hook (applies .dark class to document)',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theming.js","sourceRoot":"","sources":["../../../src/features/definitions/theming.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAY;IAC9B,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"theming.js","sourceRoot":"","sources":["../../../src/features/definitions/theming.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAY;IAC9B,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,mDAAmD;IAChE,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,gCAAgC;IACrD,QAAQ,EAAE;QACR,+BAA+B;QAC/B,uDAAuD;QACvD,uBAAuB;QACvB,oDAAoD;QACpD,0CAA0C;QAC1C,mCAAmC;KACpC;IACD,KAAK,EAAE;QACL,6BAA6B;QAC7B,mDAAmD;QACnD,4CAA4C;KAC7C;IACD,SAAS,EAAE;QACT,kCAAkC;QAClC,wDAAwD;QACxD,yBAAyB;KAC1B;IACD,QAAQ,EAAE,CAAC,cAAc,EAAE,aAAa,CAAC;IACzC,OAAO,EAAE,EAAE;CACZ,CAAC"}
|
package/dist/features/types.d.ts
CHANGED
|
@@ -1,32 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Type definitions for feature modules
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
export
|
|
9
|
-
/** Type
|
|
10
|
-
export type FeatureId = (typeof FEATURE_IDS)[number];
|
|
11
|
-
/** Type guard to check if a string is a valid FeatureId */
|
|
4
|
+
import { FEATURE } from '../constants.js';
|
|
5
|
+
/** All valid feature IDs derived from FEATURE constant (single source of truth). */
|
|
6
|
+
export declare const FEATURE_IDS: readonly FeatureId[];
|
|
7
|
+
/** Type-safe feature identifier. */
|
|
8
|
+
export type FeatureId = (typeof FEATURE)[keyof typeof FEATURE];
|
|
9
|
+
/** Type guard to check if a string is a valid FeatureId. */
|
|
12
10
|
export declare function isFeatureId(value: string): value is FeatureId;
|
|
13
11
|
export interface Feature {
|
|
14
12
|
name: string;
|
|
15
13
|
description: string;
|
|
16
14
|
required: boolean;
|
|
17
15
|
includes: string[];
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*/
|
|
16
|
+
/** Other features this feature depends on (auto-included when this feature is selected). */
|
|
17
|
+
requires?: FeatureId[];
|
|
18
|
+
/** Dependency package names - versions resolved from package.json at runtime. */
|
|
22
19
|
dependencyNames?: string[];
|
|
23
20
|
devDependencyNames?: string[];
|
|
24
21
|
files: string[];
|
|
25
|
-
/**
|
|
26
|
-
* Test files associated with this feature.
|
|
27
|
-
* Only included in scaffold when the 'testing' feature is also selected.
|
|
28
|
-
* This keeps feature source files separate from test infrastructure concerns.
|
|
29
|
-
*/
|
|
22
|
+
/** Test files - only included when 'testing' feature is also selected. */
|
|
30
23
|
testFiles?: string[];
|
|
31
24
|
patterns: string[];
|
|
32
25
|
scripts?: Record<string, string>;
|
|
@@ -47,12 +40,14 @@ export interface ScaffoldResult {
|
|
|
47
40
|
engines: Record<string, string>;
|
|
48
41
|
};
|
|
49
42
|
structure: string[];
|
|
50
|
-
|
|
43
|
+
/** Config file paths (use get_file to fetch content) */
|
|
44
|
+
configFiles: string[];
|
|
51
45
|
setupCommands: string[];
|
|
52
46
|
claudeMd: string;
|
|
53
47
|
viteEnvDts: string;
|
|
54
48
|
envTs: string;
|
|
55
49
|
routesTs?: string;
|
|
56
|
-
|
|
50
|
+
/** Documentation file paths (use get_file to fetch content) */
|
|
51
|
+
docs: string[];
|
|
57
52
|
}
|
|
58
53
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/features/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/features/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,oFAAoF;AACpF,eAAO,MAAM,WAAW,EAA6B,SAAS,SAAS,EAAE,CAAC;AAE1E,oCAAoC;AACpC,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;AAE/D,4DAA4D;AAC5D,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,SAAS,CAE7D;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,M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E,CAAC;CAChB"}
|
package/dist/features/types.js
CHANGED
|
@@ -1,27 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Type definitions for feature modules
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
export const FEATURE_IDS = [
|
|
9
|
-
'core',
|
|
10
|
-
'mobile',
|
|
11
|
-
'routing',
|
|
12
|
-
'ui',
|
|
13
|
-
'forms',
|
|
14
|
-
'state',
|
|
15
|
-
'api',
|
|
16
|
-
'i18n',
|
|
17
|
-
'testing',
|
|
18
|
-
'performance',
|
|
19
|
-
'devtools',
|
|
20
|
-
'ci',
|
|
21
|
-
'observability',
|
|
22
|
-
'theming',
|
|
23
|
-
];
|
|
24
|
-
/** Type guard to check if a string is a valid FeatureId */
|
|
4
|
+
import { FEATURE } from '../constants.js';
|
|
5
|
+
/** All valid feature IDs derived from FEATURE constant (single source of truth). */
|
|
6
|
+
export const FEATURE_IDS = Object.values(FEATURE);
|
|
7
|
+
/** Type guard to check if a string is a valid FeatureId. */
|
|
25
8
|
export function isFeatureId(value) {
|
|
26
9
|
return FEATURE_IDS.includes(value);
|
|
27
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/features/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/features/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,oFAAoF;AACpF,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAyB,CAAC;AAK1E,4DAA4D;AAC5D,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAQ,WAAiC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.test.d.ts","sourceRoot":"","sources":["../../src/features/types.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for feature type definitions.
|
|
3
|
+
*/
|
|
4
|
+
import { describe, it, expect } from 'vitest';
|
|
5
|
+
import { FEATURE } from '../constants.js';
|
|
6
|
+
import { FEATURE_IDS, isFeatureId } from './types.js';
|
|
7
|
+
describe('FEATURE_IDS', () => {
|
|
8
|
+
it('is derived from FEATURE constant', () => {
|
|
9
|
+
expect(FEATURE_IDS).toEqual(Object.values(FEATURE));
|
|
10
|
+
});
|
|
11
|
+
it('contains expected features', () => {
|
|
12
|
+
expect(FEATURE_IDS).toContain('core');
|
|
13
|
+
expect(FEATURE_IDS).toContain('routing');
|
|
14
|
+
expect(FEATURE_IDS).toContain('testing');
|
|
15
|
+
});
|
|
16
|
+
it('has 14 features', () => {
|
|
17
|
+
expect(FEATURE_IDS).toHaveLength(14);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
describe('isFeatureId', () => {
|
|
21
|
+
it('returns true for valid feature IDs', () => {
|
|
22
|
+
expect(isFeatureId('core')).toBe(true);
|
|
23
|
+
expect(isFeatureId('routing')).toBe(true);
|
|
24
|
+
expect(isFeatureId('theming')).toBe(true);
|
|
25
|
+
});
|
|
26
|
+
it('returns false for invalid feature IDs', () => {
|
|
27
|
+
expect(isFeatureId('invalid')).toBe(false);
|
|
28
|
+
expect(isFeatureId('')).toBe(false);
|
|
29
|
+
expect(isFeatureId('CORE')).toBe(false);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=types.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.test.js","sourceRoot":"","sources":["../../src/features/types.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM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C,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3C,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/resources/docs.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Documentation resources
|
|
3
|
-
*
|
|
4
|
-
* Reads actual documentation files from the react-spa-scaffold repository
|
|
5
|
-
* to ensure MCP resources stay in sync with the real docs.
|
|
6
|
-
* Uses in-memory caching to avoid repeated disk reads.
|
|
2
|
+
* Documentation resources - reads docs from react-spa-scaffold repository.
|
|
7
3
|
*/
|
|
8
4
|
/**
|
|
9
5
|
* Get list of all available documentation resources
|
|
@@ -14,9 +10,7 @@ export declare function getDocumentationResources(): {
|
|
|
14
10
|
description: string;
|
|
15
11
|
mimeType: string;
|
|
16
12
|
}[];
|
|
17
|
-
/**
|
|
18
|
-
* Read documentation content for a resource URI (cached)
|
|
19
|
-
*/
|
|
13
|
+
/** Read documentation content for a resource URI (cached, parallel). */
|
|
20
14
|
export declare function readDocumentation(uri: string): Promise<string | null>;
|
|
21
15
|
/**
|
|
22
16
|
* Check if a URI is a valid documentation resource
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/resources/docs.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/resources/docs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAkDH;;GAEG;AACH,wBAAgB,yBAAyB;;;;;IAOxC;AAED,wEAAwE;AACxE,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAiB3E;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAE/C"}
|
package/dist/resources/docs.js
CHANGED
|
@@ -1,47 +1,39 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Documentation resources
|
|
3
|
-
*
|
|
4
|
-
* Reads actual documentation files from the react-spa-scaffold repository
|
|
5
|
-
* to ensure MCP resources stay in sync with the real docs.
|
|
6
|
-
* Uses in-memory caching to avoid repeated disk reads.
|
|
2
|
+
* Documentation resources - reads docs from react-spa-scaffold repository.
|
|
7
3
|
*/
|
|
8
4
|
import { readFile } from 'fs/promises';
|
|
5
|
+
import { DOCS_URI } from '../constants.js';
|
|
6
|
+
import { createCache } from '../utils/cache.js';
|
|
9
7
|
import { resolveTemplatePath } from '../utils/paths.js';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Documentation file mapping
|
|
14
|
-
*
|
|
15
|
-
* Maps resource URIs to actual files in the repository.
|
|
16
|
-
* Add new entries here to expose additional documentation.
|
|
17
|
-
*/
|
|
8
|
+
const docsCache = createCache();
|
|
9
|
+
/** Documentation file mapping - maps URIs to repository files. */
|
|
18
10
|
const DOCS_MAP = {
|
|
19
|
-
|
|
11
|
+
[DOCS_URI.CONVENTIONS]: {
|
|
20
12
|
files: ['docs/CODING_STANDARDS.md', 'docs/COMPONENT_GUIDELINES.md'],
|
|
21
13
|
name: 'Coding Conventions',
|
|
22
|
-
description: 'Coding standards, naming conventions, and component patterns
|
|
14
|
+
description: 'Coding standards, naming conventions, and component patterns',
|
|
23
15
|
},
|
|
24
|
-
|
|
16
|
+
[DOCS_URI.ARCHITECTURE]: {
|
|
25
17
|
files: ['docs/ARCHITECTURE.md'],
|
|
26
18
|
name: 'Architecture Overview',
|
|
27
|
-
description: 'Technology stack, data flow, and architectural decisions
|
|
19
|
+
description: 'Technology stack, data flow, and architectural decisions',
|
|
28
20
|
},
|
|
29
|
-
|
|
21
|
+
[DOCS_URI.TESTING]: {
|
|
30
22
|
files: ['docs/TESTING.md', 'docs/E2E_TESTING.md'],
|
|
31
23
|
name: 'Testing Guide',
|
|
32
24
|
description: 'Unit testing with Vitest and E2E testing with Playwright',
|
|
33
25
|
},
|
|
34
|
-
|
|
26
|
+
[DOCS_URI.I18N]: {
|
|
35
27
|
files: ['docs/INTERNATIONALIZATION.md'],
|
|
36
28
|
name: 'Internationalization',
|
|
37
29
|
description: 'LinguiJS setup, Trans component usage, and translation workflow',
|
|
38
30
|
},
|
|
39
|
-
|
|
31
|
+
[DOCS_URI.API]: {
|
|
40
32
|
files: ['docs/API_REFERENCE.md'],
|
|
41
33
|
name: 'API Reference',
|
|
42
34
|
description: 'API client utilities, hooks, and data fetching patterns',
|
|
43
35
|
},
|
|
44
|
-
|
|
36
|
+
[DOCS_URI.CLAUDE]: {
|
|
45
37
|
files: ['CLAUDE.md'],
|
|
46
38
|
name: 'Claude AI Guidance',
|
|
47
39
|
description: 'AI assistant instructions and project-specific guidance',
|
|
@@ -58,37 +50,23 @@ export function getDocumentationResources() {
|
|
|
58
50
|
mimeType: 'text/markdown',
|
|
59
51
|
}));
|
|
60
52
|
}
|
|
61
|
-
/**
|
|
62
|
-
* Read documentation content for a resource URI (cached)
|
|
63
|
-
*/
|
|
53
|
+
/** Read documentation content for a resource URI (cached, parallel). */
|
|
64
54
|
export async function readDocumentation(uri) {
|
|
65
55
|
const doc = DOCS_MAP[uri];
|
|
66
|
-
if (!doc)
|
|
56
|
+
if (!doc)
|
|
67
57
|
return null;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
catch {
|
|
81
|
-
// File might not exist
|
|
82
|
-
contents.push(`<!-- File not found: ${file} -->\n`);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
// Join multiple files with a separator
|
|
86
|
-
const result = contents.length > 1 ? contents.join('\n\n---\n\n') : contents[0] || null;
|
|
87
|
-
// Cache the result
|
|
88
|
-
if (result) {
|
|
89
|
-
cache.set(uri, result);
|
|
90
|
-
}
|
|
91
|
-
return result;
|
|
58
|
+
return docsCache.getOrSet(uri, async () => {
|
|
59
|
+
const contents = await Promise.all(doc.files.map(async (file) => {
|
|
60
|
+
const fullPath = resolveTemplatePath(file);
|
|
61
|
+
try {
|
|
62
|
+
return await readFile(fullPath, 'utf-8');
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return `<!-- File not found: ${file} -->\n`;
|
|
66
|
+
}
|
|
67
|
+
}));
|
|
68
|
+
return contents.length > 1 ? contents.join('\n\n---\n\n') : (contents[0] ?? '');
|
|
69
|
+
});
|
|
92
70
|
}
|
|
93
71
|
/**
|
|
94
72
|
* Check if a URI is a valid documentation resource
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../../src/resources/docs.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../../src/resources/docs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,SAAS,GAAG,WAAW,EAAU,CAAC;AAQxC,kEAAkE;AAClE,MAAM,QAAQ,GAA8B;IAC1C,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;QACtB,KAAK,EAAE,CAAC,0BAA0B,EAAE,8BAA8B,CAAC;QACnE,IAAI,EAAE,oBAAoB;QAC1B,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,OAAO,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,IAAI,EAAE;QACxC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAChC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YAC3B,MAAM,QAAQ,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;YAC3C,IAAI,CAAC;gBACH,OAAO,MAAM,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC3C,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,wBAAwB,IAAI,QAAQ,CAAC;YAC9C,CAAC;QACH,CAAC,CAAC,CACH,CAAC;QACF,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAClF,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAAW;IACjD,OAAO,GAAG,IAAI,QAAQ,CAAC;AACzB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC"}
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AA0CnE,6CAA6C;AAC7C,wBAAgB,YAAY,IAAI,MAAM,CA0DrC"}
|
package/dist/server.js
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
5
5
|
import { CallToolRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
6
|
-
|
|
7
|
-
import {
|
|
6
|
+
// Direct imports - flattened for faster startup
|
|
7
|
+
import { TOOL_REGISTRY, getToolDefinitions } from './tools/registry.js';
|
|
8
|
+
import { getDocumentationResources, readDocumentation, isValidDocumentationUri } from './resources/docs.js';
|
|
8
9
|
import { VERSION } from './version.js';
|
|
9
10
|
function jsonResponse(data) {
|
|
10
11
|
return {
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC;AAE5C,gDAAgD;AAChD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC5G,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,SAAS,YAA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IAAI,KAAK,CAAC,4BAA4B,GAAG,EAAE,CAAC,CAAC;QACrD,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,eAAe,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;SAC9D,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* that matches react-spa-scaffold conventions.
|
|
7
7
|
*/
|
|
8
8
|
import { z } from 'zod';
|
|
9
|
+
import type { ToolDefinition } from './types.js';
|
|
10
|
+
/** Zod schema for get_example input - single source of truth. */
|
|
9
11
|
export declare const getExampleSchema: z.ZodObject<{
|
|
10
12
|
pattern: z.ZodEnum<{
|
|
11
13
|
[x: string]: string;
|
|
@@ -31,19 +33,6 @@ export declare function getExample(input: GetExampleInput): Promise<{
|
|
|
31
33
|
error?: undefined;
|
|
32
34
|
hint?: undefined;
|
|
33
35
|
}>;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
description: string;
|
|
37
|
-
inputSchema: {
|
|
38
|
-
type: "object";
|
|
39
|
-
properties: {
|
|
40
|
-
pattern: {
|
|
41
|
-
type: "string";
|
|
42
|
-
description: string;
|
|
43
|
-
enum: [string, ...string[]];
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
required: string[];
|
|
47
|
-
};
|
|
48
|
-
};
|
|
36
|
+
/** Tool definition derived from Zod schema (Zod v4 native). */
|
|
37
|
+
export declare const getExampleToolDefinition: ToolDefinition;
|
|
49
38
|
//# sourceMappingURL=get-example.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-example.d.ts","sourceRoot":"","sources":["../../src/tools/get-example.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"get-example.d.ts","sourceRoot":"","sources":["../../src/tools/get-example.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAIjD,iEAAiE;AACjE,eAAO,MAAM,gBAAgB;;;;iBAI3B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE/D,wBAAsB,UAAU,CAAC,KAAK,EAAE,eAAe;;;;;;;;;;;;;;;;;;GAoBtD;AAwBD,+DAA+D;AAC/D,eAAO,MAAM,wBAAwB,EAAE,cA0BtC,CAAC"}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
import { getCodeExample, getAvailablePatterns } from '../utils/index.js';
|
|
10
10
|
const AVAILABLE_PATTERNS = getAvailablePatterns();
|
|
11
|
+
/** Zod schema for get_example input - single source of truth. */
|
|
11
12
|
export const getExampleSchema = z.object({
|
|
12
13
|
pattern: z.enum(AVAILABLE_PATTERNS, {
|
|
13
14
|
error: `Invalid pattern. Available: ${AVAILABLE_PATTERNS.join(', ')}`,
|
|
@@ -51,6 +52,7 @@ function generateUsageHint(pattern) {
|
|
|
51
52
|
};
|
|
52
53
|
return hints[pattern] || 'Follow the file path shown in the example';
|
|
53
54
|
}
|
|
55
|
+
/** Tool definition derived from Zod schema (Zod v4 native). */
|
|
54
56
|
export const getExampleToolDefinition = {
|
|
55
57
|
name: 'get_example',
|
|
56
58
|
description: `Get real code example for a specific pattern type.
|
|
@@ -76,16 +78,6 @@ Each example includes:
|
|
|
76
78
|
- Actual working code
|
|
77
79
|
- Key points explaining the pattern
|
|
78
80
|
- File path where it should be placed`,
|
|
79
|
-
inputSchema:
|
|
80
|
-
type: 'object',
|
|
81
|
-
properties: {
|
|
82
|
-
pattern: {
|
|
83
|
-
type: 'string',
|
|
84
|
-
description: 'Pattern type to get example for',
|
|
85
|
-
enum: AVAILABLE_PATTERNS,
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
required: ['pattern'],
|
|
89
|
-
},
|
|
81
|
+
inputSchema: z.toJSONSchema(getExampleSchema),
|
|
90
82
|
};
|
|
91
83
|
//# sourceMappingURL=get-example.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-example.js","sourceRoot":"","sources":["../../src/tools/get-example.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"get-example.js","sourceRoot":"","sources":["../../src/tools/get-example.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGzE,MAAM,kBAAkB,GAAG,oBAAoB,EAA2B,CAAC;AAE3E,iEAAiE;AACjE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,kBAAkB,EAAE;QAClC,KAAK,EAAE,+BAA+B,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;KACtE,CAAC;CACH,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,KAAsB;IACrD,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAE1B,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;IAE9C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;YACL,KAAK,EAAE,uCAAuC,OAAO,EAAE;YACvD,IAAI,EAAE,gEAAgE;SACvE,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC;KAClC,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAe;IACxC,MAAM,KAAK,GAA2B;QACpC,cAAc,EAAE,sDAAsD;QACtE,kBAAkB,EAAE,oEAAoE;QACxF,kBAAkB,EAAE,iCAAiC;QACrD,YAAY,EAAE,2CAA2C;QACzD,YAAY,EAAE,mDAAmD;QACjE,WAAW,EAAE,0DAA0D;QACvE,aAAa,EAAE,uCAAuC;QACtD,eAAe,EAAE,8CAA8C;QAC/D,gBAAgB,EAAE,+CAA+C;QACjE,kBAAkB,EAAE,wDAAwD;QAC5E,gBAAgB,EAAE,4EAA4E;QAC9F,WAAW,EAAE,uDAAuD;QACpE,YAAY,EAAE,4DAA4D;QAC1E,aAAa,EAAE,8BAA8B;QAC7C,YAAY,EAAE,+BAA+B;KAC9C,CAAC;IAEF,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,2CAA2C,CAAC;AACvE,CAAC;AAED,+DAA+D;AAC/D,MAAM,CAAC,MAAM,wBAAwB,GAAmB;IACtD,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;sCAsBuB;IACpC,WAAW,EAAE,CAAC,CAAC,YAAY,CAAC,gBAAgB,CAAkC;CAC/E,CAAC"}
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* AI agents use this to understand what features are available
|
|
6
6
|
* and present options to users.
|
|
7
7
|
*/
|
|
8
|
+
import type { ToolDefinition } from './types.js';
|
|
9
|
+
/** Feature summary returned by get_features tool. */
|
|
8
10
|
export interface FeatureSummary {
|
|
9
11
|
id: string;
|
|
10
12
|
name: string;
|
|
@@ -12,14 +14,18 @@ export interface FeatureSummary {
|
|
|
12
14
|
required: boolean;
|
|
13
15
|
includes: string[];
|
|
14
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Lists all available features for scaffolding.
|
|
19
|
+
*
|
|
20
|
+
* @returns Array of feature summaries with id, name, description, required flag, and includes
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const features = getFeatures();
|
|
25
|
+
* // [{ id: 'core', name: 'Core', required: true, ... }, ...]
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
15
28
|
export declare function getFeatures(): FeatureSummary[];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
description: string;
|
|
19
|
-
inputSchema: {
|
|
20
|
-
type: "object";
|
|
21
|
-
properties: {};
|
|
22
|
-
required: string[];
|
|
23
|
-
};
|
|
24
|
-
};
|
|
29
|
+
/** Tool definition for get_features - no input required. */
|
|
30
|
+
export declare const getFeaturesToolDefinition: ToolDefinition;
|
|
25
31
|
//# sourceMappingURL=get-features.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-features.d.ts","sourceRoot":"","sources":["../../src/tools/get-features.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"get-features.d.ts","sourceRoot":"","sources":["../../src/tools/get-features.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,IAAI,cAAc,EAAE,CAW9C;AAED,4DAA4D;AAC5D,eAAO,MAAM,yBAAyB,EAAE,cAuBvC,CAAC"}
|
|
@@ -6,6 +6,17 @@
|
|
|
6
6
|
* and present options to users.
|
|
7
7
|
*/
|
|
8
8
|
import { FEATURES, FEATURE_IDS } from '../features/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Lists all available features for scaffolding.
|
|
11
|
+
*
|
|
12
|
+
* @returns Array of feature summaries with id, name, description, required flag, and includes
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const features = getFeatures();
|
|
17
|
+
* // [{ id: 'core', name: 'Core', required: true, ... }, ...]
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
9
20
|
export function getFeatures() {
|
|
10
21
|
return FEATURE_IDS.map((id) => {
|
|
11
22
|
const feature = FEATURES[id];
|
|
@@ -18,6 +29,7 @@ export function getFeatures() {
|
|
|
18
29
|
};
|
|
19
30
|
});
|
|
20
31
|
}
|
|
32
|
+
/** Tool definition for get_features - no input required. */
|
|
21
33
|
export const getFeaturesToolDefinition = {
|
|
22
34
|
name: 'get_features',
|
|
23
35
|
description: `List all available feature modules for react-spa-scaffold project scaffolding.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-features.js","sourceRoot":"","sources":["../../src/tools/get-features.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"get-features.js","sourceRoot":"","sources":["../../src/tools/get-features.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAY7D;;;;;;;;;;GAUG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAkB,EAAE;QAC5C,MAAM,OAAO,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC7B,OAAO;YACL,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC;YACd,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;SAC3B,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,4DAA4D;AAC5D,MAAM,CAAC,MAAM,yBAAyB,GAAmB;IACvD,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE;;;;;;;;;;;;;;;uEAewD;IACrE,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;KACb;CACF,CAAC"}
|