eveapps-core 1.0.0
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/data/build_matrix.json +17 -0
- package/data/commands.json +8752 -0
- package/data/feature_graph.json +2446 -0
- package/data/registers.json +3312 -0
- package/data/samples.json +685 -0
- package/dist/context.d.ts +12 -0
- package/dist/context.js +33 -0
- package/dist/context.js.map +1 -0
- package/dist/data/build_matrix.json +17 -0
- package/dist/data/commands.json +8750 -0
- package/dist/data/data/build_matrix.json +17 -0
- package/dist/data/data/commands.json +8752 -0
- package/dist/data/data/feature_graph.json +2446 -0
- package/dist/data/data/registers.json +3312 -0
- package/dist/data/data/samples.json +685 -0
- package/dist/data/data/source_index.json +79 -0
- package/dist/data/feature_graph.json +2444 -0
- package/dist/data/registers.json +3312 -0
- package/dist/data/samples.json +685 -0
- package/dist/data/source_index.json +79 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/loadIndex.d.ts +14 -0
- package/dist/lib/loadIndex.js +27 -0
- package/dist/lib/loadIndex.js.map +1 -0
- package/dist/lib/normalize.d.ts +2 -0
- package/dist/lib/normalize.js +10 -0
- package/dist/lib/normalize.js.map +1 -0
- package/dist/lib/rank.d.ts +5 -0
- package/dist/lib/rank.js +38 -0
- package/dist/lib/rank.js.map +1 -0
- package/dist/lib/workspace.d.ts +4 -0
- package/dist/lib/workspace.js +5 -0
- package/dist/lib/workspace.js.map +1 -0
- package/dist/router/analyzeQuery.d.ts +9 -0
- package/dist/router/analyzeQuery.js +12 -0
- package/dist/router/analyzeQuery.js.map +1 -0
- package/dist/router/index.d.ts +5 -0
- package/dist/router/index.js +6 -0
- package/dist/router/index.js.map +1 -0
- package/dist/router/mergeResults.d.ts +2 -0
- package/dist/router/mergeResults.js +12 -0
- package/dist/router/mergeResults.js.map +1 -0
- package/dist/router/retrieveAnswer.d.ts +3 -0
- package/dist/router/retrieveAnswer.js +40 -0
- package/dist/router/retrieveAnswer.js.map +1 -0
- package/dist/router/routeQuery.d.ts +3 -0
- package/dist/router/routeQuery.js +33 -0
- package/dist/router/routeQuery.js.map +1 -0
- package/dist/router/types.d.ts +12 -0
- package/dist/router/types.js +2 -0
- package/dist/router/types.js.map +1 -0
- package/dist/search/searchCore.d.ts +3 -0
- package/dist/search/searchCore.js +64 -0
- package/dist/search/searchCore.js.map +1 -0
- package/dist/search/searchEveApps.d.ts +2 -0
- package/dist/search/searchEveApps.js +107 -0
- package/dist/search/searchEveApps.js.map +1 -0
- package/dist/search/searchSourceFiles.d.ts +6 -0
- package/dist/search/searchSourceFiles.js +49 -0
- package/dist/search/searchSourceFiles.js.map +1 -0
- package/dist/server.d.ts +1 -0
- package/dist/server.js +229 -0
- package/dist/server.js.map +1 -0
- package/dist/src/context.d.ts +12 -0
- package/dist/src/context.js +71 -0
- package/dist/src/context.js.map +1 -0
- package/dist/src/index.d.ts +10 -0
- package/dist/src/index.js +11 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lib/loadIndex.d.ts +14 -0
- package/dist/src/lib/loadIndex.js +27 -0
- package/dist/src/lib/loadIndex.js.map +1 -0
- package/dist/src/lib/normalize.d.ts +2 -0
- package/dist/src/lib/normalize.js +10 -0
- package/dist/src/lib/normalize.js.map +1 -0
- package/dist/src/lib/rank.d.ts +5 -0
- package/dist/src/lib/rank.js +38 -0
- package/dist/src/lib/rank.js.map +1 -0
- package/dist/src/lib/workspace.d.ts +4 -0
- package/dist/src/lib/workspace.js +5 -0
- package/dist/src/lib/workspace.js.map +1 -0
- package/dist/src/router/analyzeQuery.d.ts +9 -0
- package/dist/src/router/analyzeQuery.js +12 -0
- package/dist/src/router/analyzeQuery.js.map +1 -0
- package/dist/src/router/index.d.ts +5 -0
- package/dist/src/router/index.js +6 -0
- package/dist/src/router/index.js.map +1 -0
- package/dist/src/router/mergeResults.d.ts +2 -0
- package/dist/src/router/mergeResults.js +12 -0
- package/dist/src/router/mergeResults.js.map +1 -0
- package/dist/src/router/retrieveAnswer.d.ts +3 -0
- package/dist/src/router/retrieveAnswer.js +64 -0
- package/dist/src/router/retrieveAnswer.js.map +1 -0
- package/dist/src/router/routeQuery.d.ts +3 -0
- package/dist/src/router/routeQuery.js +33 -0
- package/dist/src/router/routeQuery.js.map +1 -0
- package/dist/src/router/types.d.ts +12 -0
- package/dist/src/router/types.js +2 -0
- package/dist/src/router/types.js.map +1 -0
- package/dist/src/search/searchCore.d.ts +3 -0
- package/dist/src/search/searchCore.js +64 -0
- package/dist/src/search/searchCore.js.map +1 -0
- package/dist/src/search/searchEveApps.d.ts +2 -0
- package/dist/src/search/searchEveApps.js +107 -0
- package/dist/src/search/searchEveApps.js.map +1 -0
- package/dist/src/search/searchSourceFiles.d.ts +6 -0
- package/dist/src/search/searchSourceFiles.js +49 -0
- package/dist/src/search/searchSourceFiles.js.map +1 -0
- package/dist/src/server.d.ts +1 -0
- package/dist/src/server.js +214 -0
- package/dist/src/server.js.map +1 -0
- package/dist/src/tools/explainEveSymbol.d.ts +56 -0
- package/dist/src/tools/explainEveSymbol.js +54 -0
- package/dist/src/tools/explainEveSymbol.js.map +1 -0
- package/dist/src/tools/findRelevantSample.d.ts +34 -0
- package/dist/src/tools/findRelevantSample.js +33 -0
- package/dist/src/tools/findRelevantSample.js.map +1 -0
- package/dist/src/tools/generateBuildCommand.d.ts +34 -0
- package/dist/src/tools/generateBuildCommand.js +54 -0
- package/dist/src/tools/generateBuildCommand.js.map +1 -0
- package/dist/src/tools/generateScreenScaffold.d.ts +32 -0
- package/dist/src/tools/generateScreenScaffold.js +73 -0
- package/dist/src/tools/generateScreenScaffold.js.map +1 -0
- package/dist/src/tools/traceFeatureToCommands.d.ts +36 -0
- package/dist/src/tools/traceFeatureToCommands.js +84 -0
- package/dist/src/tools/traceFeatureToCommands.js.map +1 -0
- package/dist/src/tools/validateBt820Code.d.ts +28 -0
- package/dist/src/tools/validateBt820Code.js +45 -0
- package/dist/src/tools/validateBt820Code.js.map +1 -0
- package/dist/src/types.d.ts +44 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/tools/explainEveSymbol.d.ts +56 -0
- package/dist/tools/explainEveSymbol.js +54 -0
- package/dist/tools/explainEveSymbol.js.map +1 -0
- package/dist/tools/findRelevantSample.d.ts +34 -0
- package/dist/tools/findRelevantSample.js +33 -0
- package/dist/tools/findRelevantSample.js.map +1 -0
- package/dist/tools/generateBuildCommand.d.ts +34 -0
- package/dist/tools/generateBuildCommand.js +54 -0
- package/dist/tools/generateBuildCommand.js.map +1 -0
- package/dist/tools/generateScreenScaffold.d.ts +32 -0
- package/dist/tools/generateScreenScaffold.js +73 -0
- package/dist/tools/generateScreenScaffold.js.map +1 -0
- package/dist/tools/readSourceFile.d.ts +15 -0
- package/dist/tools/readSourceFile.js +26 -0
- package/dist/tools/readSourceFile.js.map +1 -0
- package/dist/tools/traceFeatureToCommands.d.ts +36 -0
- package/dist/tools/traceFeatureToCommands.js +84 -0
- package/dist/tools/traceFeatureToCommands.js.map +1 -0
- package/dist/tools/validateBt820Code.d.ts +28 -0
- package/dist/tools/validateBt820Code.js +45 -0
- package/dist/tools/validateBt820Code.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types.d.ts +44 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +27 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const findRelevantSampleInput: z.ZodObject<{
|
|
3
|
+
query: z.ZodString;
|
|
4
|
+
platform: z.ZodOptional<z.ZodString>;
|
|
5
|
+
display: z.ZodOptional<z.ZodString>;
|
|
6
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
query: string;
|
|
9
|
+
limit: number;
|
|
10
|
+
display?: string | undefined;
|
|
11
|
+
platform?: string | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
query: string;
|
|
14
|
+
display?: string | undefined;
|
|
15
|
+
platform?: string | undefined;
|
|
16
|
+
limit?: number | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
export type FindRelevantSampleInput = z.infer<typeof findRelevantSampleInput>;
|
|
19
|
+
export declare function findRelevantSample(args: FindRelevantSampleInput): {
|
|
20
|
+
matches: {
|
|
21
|
+
sample_id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
path: string;
|
|
24
|
+
score: number;
|
|
25
|
+
summary: string;
|
|
26
|
+
commands: string[];
|
|
27
|
+
reason: string;
|
|
28
|
+
}[];
|
|
29
|
+
recommended_starting_point: string | null;
|
|
30
|
+
assumptions: {
|
|
31
|
+
platform: string | null;
|
|
32
|
+
display: string | null;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { loadFeatureGraph, loadSamples } from "../lib/loadIndex.js";
|
|
3
|
+
import { rankSamples } from "../lib/rank.js";
|
|
4
|
+
export const findRelevantSampleInput = z.object({
|
|
5
|
+
query: z.string().min(3),
|
|
6
|
+
platform: z.string().optional(),
|
|
7
|
+
display: z.string().optional(),
|
|
8
|
+
limit: z.number().int().min(1).max(10).default(3),
|
|
9
|
+
});
|
|
10
|
+
export function findRelevantSample(args) {
|
|
11
|
+
const samples = loadSamples();
|
|
12
|
+
const featureGraph = loadFeatureGraph();
|
|
13
|
+
const ranked = rankSamples(args.query, samples, featureGraph, args.platform)
|
|
14
|
+
.slice(0, args.limit)
|
|
15
|
+
.map(({ sample, score }) => ({
|
|
16
|
+
sample_id: sample.id,
|
|
17
|
+
name: sample.name,
|
|
18
|
+
path: sample.path,
|
|
19
|
+
score,
|
|
20
|
+
summary: sample.summary,
|
|
21
|
+
commands: sample.commands_used,
|
|
22
|
+
reason: `Matched query against sample summary/categories/commands${args.platform ? ` and preferred platform ${args.platform}` : ""}.`,
|
|
23
|
+
}));
|
|
24
|
+
return {
|
|
25
|
+
matches: ranked,
|
|
26
|
+
recommended_starting_point: ranked[0]?.sample_id ?? null,
|
|
27
|
+
assumptions: {
|
|
28
|
+
platform: args.platform ?? null,
|
|
29
|
+
display: args.display ?? null,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=findRelevantSample.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findRelevantSample.js","sourceRoot":"","sources":["../../../src/tools/findRelevantSample.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;CACpD,CAAC,CAAC;AAIH,MAAM,UAAU,kBAAkB,CAAC,IAA6B;IAC5D,MAAM,OAAO,GAAG,WAAW,EAAE,CAAC;IAC9B,MAAM,YAAY,GAAG,gBAAgB,EAAE,CAAC;IAExC,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC;SACvE,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC;SACpB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;QACzB,SAAS,EAAE,MAAM,CAAC,EAAE;QACpB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK;QACL,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,QAAQ,EAAE,MAAM,CAAC,aAAa;QAC9B,MAAM,EAAE,2DAA2D,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,2BAA2B,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG;KACxI,CAAC,CAAC,CAAC;IAER,OAAO;QACH,OAAO,EAAE,MAAM;QACf,0BAA0B,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,IAAI,IAAI;QACxD,WAAW,EAAE;YACT,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI;YAC/B,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,IAAI;SAChC;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const generateBuildCommandInput: z.ZodObject<{
|
|
3
|
+
platform: z.ZodString;
|
|
4
|
+
graphics: z.ZodString;
|
|
5
|
+
display: z.ZodString;
|
|
6
|
+
spi: z.ZodString;
|
|
7
|
+
toolchain: z.ZodDefault<z.ZodEnum<["cmake", "nmake"]>>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
graphics: string;
|
|
10
|
+
display: string;
|
|
11
|
+
platform: string;
|
|
12
|
+
spi: string;
|
|
13
|
+
toolchain: "cmake" | "nmake";
|
|
14
|
+
}, {
|
|
15
|
+
graphics: string;
|
|
16
|
+
display: string;
|
|
17
|
+
platform: string;
|
|
18
|
+
spi: string;
|
|
19
|
+
toolchain?: "cmake" | "nmake" | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
export type GenerateBuildCommandInput = z.infer<typeof generateBuildCommandInput>;
|
|
22
|
+
export declare function generateBuildCommand(args: GenerateBuildCommandInput): {
|
|
23
|
+
valid: boolean;
|
|
24
|
+
errors: string[];
|
|
25
|
+
suggested_fixes: string[];
|
|
26
|
+
command?: undefined;
|
|
27
|
+
notes?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
valid: boolean;
|
|
30
|
+
command: string;
|
|
31
|
+
notes: string[];
|
|
32
|
+
errors?: undefined;
|
|
33
|
+
suggested_fixes?: undefined;
|
|
34
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { loadBuildMatrix } from "../lib/loadIndex.js";
|
|
3
|
+
export const generateBuildCommandInput = z.object({
|
|
4
|
+
platform: z.string(),
|
|
5
|
+
graphics: z.string(),
|
|
6
|
+
display: z.string(),
|
|
7
|
+
spi: z.string(),
|
|
8
|
+
toolchain: z.enum(["cmake", "nmake"]).default("cmake"),
|
|
9
|
+
});
|
|
10
|
+
export function generateBuildCommand(args) {
|
|
11
|
+
const matrix = loadBuildMatrix();
|
|
12
|
+
const platformKey = args.platform.toLowerCase();
|
|
13
|
+
const graphicsKey = args.graphics.toLowerCase();
|
|
14
|
+
const displayKey = args.display.toLowerCase();
|
|
15
|
+
const spiKey = args.spi.toLowerCase();
|
|
16
|
+
const platform = matrix.platforms[platformKey];
|
|
17
|
+
const errors = [];
|
|
18
|
+
if (!platform) {
|
|
19
|
+
errors.push(`Unknown platform: ${args.platform}`);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
if (!platform.graphics.includes(graphicsKey)) {
|
|
23
|
+
errors.push(`Platform ${args.platform} does not support graphics ${args.graphics}`);
|
|
24
|
+
}
|
|
25
|
+
if (!platform.spi.includes(spiKey)) {
|
|
26
|
+
errors.push(`Platform ${args.platform} does not support SPI mode ${args.spi}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (!matrix.displays.includes(displayKey)) {
|
|
30
|
+
errors.push(`Unsupported display: ${args.display}`);
|
|
31
|
+
}
|
|
32
|
+
if (errors.length > 0) {
|
|
33
|
+
return {
|
|
34
|
+
valid: false,
|
|
35
|
+
errors,
|
|
36
|
+
suggested_fixes: [
|
|
37
|
+
"Check platform spelling in build_matrix.json",
|
|
38
|
+
"Use a display/SPI combination allowed by the repo",
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const command = args.toolchain === "cmake"
|
|
43
|
+
? `cd build && cmake -G "NMake Makefiles" -DEVE_APPS_PLATFORM=EVE_PLATFORM_${args.platform.toUpperCase()} -DEVE_APPS_GRAPHICS=EVE_GRAPHICS_${args.graphics.toUpperCase()} -DEVE_APPS_DISPLAY=EVE_DISPLAY_${args.display.toUpperCase()} -DEVE_APPS_SPI=EVE_SPI_${args.spi.toUpperCase()}`
|
|
44
|
+
: `nmake SampleApp`;
|
|
45
|
+
return {
|
|
46
|
+
valid: true,
|
|
47
|
+
command,
|
|
48
|
+
notes: [
|
|
49
|
+
"Generated from local build_matrix.json",
|
|
50
|
+
"Add board-specific prerequisites separately if needed",
|
|
51
|
+
],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=generateBuildCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateBuildCommand.js","sourceRoot":"","sources":["../../../src/tools/generateBuildCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,SAAS,EAAE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,OAAO,EAAE,CAAC,CAAC;IACxD,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpB,OAAO;YACH,KAAK,EAAE,KAAK;YACZ,MAAM;YACN,eAAe,EAAE;gBACb,8CAA8C;gBAC9C,mDAAmD;aACtD;SACJ,CAAC;IACN,CAAC;IAED,MAAM,OAAO,GACT,IAAI,CAAC,SAAS,KAAK,OAAO;QACtB,CAAC,CAAC,2EAA2E,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,qCAAqC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,mCAAmC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,2BAA2B,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE;QACxR,CAAC,CAAC,iBAAiB,CAAC;IAE5B,OAAO;QACH,KAAK,EAAE,IAAI;QACX,OAAO;QACP,KAAK,EAAE;YACH,wCAAwC;YACxC,uDAAuD;SAC1D;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const generateScreenScaffoldInput: z.ZodObject<{
|
|
3
|
+
screen_type: z.ZodString;
|
|
4
|
+
controls: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
5
|
+
touch: z.ZodDefault<z.ZodBoolean>;
|
|
6
|
+
platform: z.ZodOptional<z.ZodString>;
|
|
7
|
+
style: z.ZodDefault<z.ZodString>;
|
|
8
|
+
flash: z.ZodDefault<z.ZodBoolean>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
style: string;
|
|
11
|
+
touch: boolean;
|
|
12
|
+
flash: boolean;
|
|
13
|
+
screen_type: string;
|
|
14
|
+
controls: string[];
|
|
15
|
+
platform?: string | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
screen_type: string;
|
|
18
|
+
style?: string | undefined;
|
|
19
|
+
touch?: boolean | undefined;
|
|
20
|
+
flash?: boolean | undefined;
|
|
21
|
+
platform?: string | undefined;
|
|
22
|
+
controls?: string[] | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
export type GenerateScreenScaffoldInput = z.infer<typeof generateScreenScaffoldInput>;
|
|
25
|
+
export declare function generateScreenScaffold(args: GenerateScreenScaffoldInput): {
|
|
26
|
+
based_on_sample: string;
|
|
27
|
+
files: {
|
|
28
|
+
path: string;
|
|
29
|
+
content: string;
|
|
30
|
+
}[];
|
|
31
|
+
notes: string[];
|
|
32
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const generateScreenScaffoldInput = z.object({
|
|
3
|
+
screen_type: z.string(),
|
|
4
|
+
controls: z.array(z.string()).default([]),
|
|
5
|
+
touch: z.boolean().default(true),
|
|
6
|
+
platform: z.string().optional(),
|
|
7
|
+
style: z.string().default("repo-native-c"),
|
|
8
|
+
flash: z.boolean().default(false),
|
|
9
|
+
});
|
|
10
|
+
export function generateScreenScaffold(args) {
|
|
11
|
+
const functionName = `${args.screen_type.replace(/\s+/g, "_").toLowerCase()}_screen_draw`;
|
|
12
|
+
const includes = `#include "Common.h"
|
|
13
|
+
#include "EvePatch.h"${args.flash ? `
|
|
14
|
+
#include "FlashHelper.h"` : ""}`;
|
|
15
|
+
const displayMode = (() => {
|
|
16
|
+
const platform = args.platform?.toLowerCase() ?? "";
|
|
17
|
+
if (platform.includes("directvideo"))
|
|
18
|
+
return "MODE_DIRECTVIDEO";
|
|
19
|
+
if (platform.includes("video"))
|
|
20
|
+
return "MODE_VIDEO";
|
|
21
|
+
if (platform.includes("lvdsrx_sc"))
|
|
22
|
+
return "MODE_LVDSRX_SC";
|
|
23
|
+
if (platform.includes("lvdsrx"))
|
|
24
|
+
return "MODE_LVDSRX";
|
|
25
|
+
return "MODE_PICTURE";
|
|
26
|
+
})();
|
|
27
|
+
const content = `${includes}
|
|
28
|
+
|
|
29
|
+
void ${functionName}(EVE_HalContext* phost) {
|
|
30
|
+
/* Initialize display and load patch */
|
|
31
|
+
s_pHalContext = &s_halContext;
|
|
32
|
+
Gpu_Init(s_pHalContext);
|
|
33
|
+
Display_Config(s_pHalContext, YCBCR, ${displayMode});
|
|
34
|
+
|
|
35
|
+
if (EVE_Load_Patch(s_pHalContext, PATCH_BASE) != 0)
|
|
36
|
+
eve_printf_debug("load patch failed\n");
|
|
37
|
+
else
|
|
38
|
+
eve_printf_debug("load patch ok\n");
|
|
39
|
+
|
|
40
|
+
// read and store calibration settings for later use
|
|
41
|
+
EVE_Calibrate(s_pHalContext);
|
|
42
|
+
Calibration_Save(s_pHalContext);
|
|
43
|
+
|
|
44
|
+
EVE_Util_clearScreen(s_pHalContext);
|
|
45
|
+
|
|
46
|
+
/* Title */
|
|
47
|
+
EVE_CoCmd_text(phost, 40, 30, 30, 0, "${args.screen_type}");
|
|
48
|
+
|
|
49
|
+
/* Controls */
|
|
50
|
+
${args.controls.map((c, i) => `/* TODO: control ${i + 1}: ${c} */`).join("\n ")}
|
|
51
|
+
|
|
52
|
+
${args.touch ? "/* TODO: assign TAG values and handle touch routing */" : ""}
|
|
53
|
+
|
|
54
|
+
EVE_Util_clearScreen(s_pHalContext);
|
|
55
|
+
Gpu_Release(s_pHalContext);
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
return {
|
|
59
|
+
based_on_sample: "to-be-selected-by-findRelevantSample",
|
|
60
|
+
files: [
|
|
61
|
+
{
|
|
62
|
+
path: `generated/${functionName}.c`,
|
|
63
|
+
content,
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
notes: [
|
|
67
|
+
"Minimal scaffold only",
|
|
68
|
+
"You still need to add the proper frame begin/end flow",
|
|
69
|
+
"Use the nearest widget/touch sample as the implementation reference",
|
|
70
|
+
],
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=generateScreenScaffold.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateScreenScaffold.js","sourceR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C5D,IAAI,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAAE,OAAO,aAAa,CAAC;QACtD,OAAO,cAAc,CAAC;IAC1B,CAAC,CAAC,EAAE,CAAC;IAEL,MAAM,OAAO,GAAG,GAAG,QAAQ;;OAExB,YAAY;;;;2CAIwB,WAAW;;;;;;;;;;;;;;4CAcV,IAAI,CAAC,WAAW;;;MAGtD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,oBAAoB,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;;MAEhF,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,wDAAwD,CAAC,CAAC,CAAC,EAAE;;;;;CAK/E,CAAC;IAEE,OAAO;QACH,eAAe,EAAE,sCAAsC;QACvD,KAAK,EAAE;YACH;gBACI,IAAI,EAAE,aAAa,YAAY,IAAI;gBACnC,OAAO;aACV;SACJ;QACD,KAAK,EAAE;YACH,uBAAuB;YACvB,uDAAuD;YACvD,qEAAqE;SACxE;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const traceFeatureToCommandsInput: z.ZodObject<{
|
|
3
|
+
feature: z.ZodString;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
feature: string;
|
|
6
|
+
}, {
|
|
7
|
+
feature: string;
|
|
8
|
+
}>;
|
|
9
|
+
export type TraceFeatureToCommandsInput = z.infer<typeof traceFeatureToCommandsInput>;
|
|
10
|
+
type Command = {
|
|
11
|
+
name: string;
|
|
12
|
+
type?: string;
|
|
13
|
+
level?: string;
|
|
14
|
+
weight?: number;
|
|
15
|
+
};
|
|
16
|
+
export declare function traceFeatureToCommands(args: TraceFeatureToCommandsInput): {
|
|
17
|
+
message: string;
|
|
18
|
+
features_detected?: undefined;
|
|
19
|
+
top_commands?: undefined;
|
|
20
|
+
all_commands?: undefined;
|
|
21
|
+
related_samples?: undefined;
|
|
22
|
+
next_steps?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
features_detected: string[];
|
|
25
|
+
top_commands: {
|
|
26
|
+
name: string;
|
|
27
|
+
type: string | undefined;
|
|
28
|
+
level: string | undefined;
|
|
29
|
+
reason: string;
|
|
30
|
+
}[];
|
|
31
|
+
all_commands: Command[];
|
|
32
|
+
related_samples: string[];
|
|
33
|
+
next_steps: string[];
|
|
34
|
+
message?: undefined;
|
|
35
|
+
};
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { loadFeatureGraph } from "../lib/loadIndex.js";
|
|
3
|
+
export const traceFeatureToCommandsInput = z.object({
|
|
4
|
+
feature: z.string().min(2),
|
|
5
|
+
});
|
|
6
|
+
export function traceFeatureToCommands(args) {
|
|
7
|
+
const graph = loadFeatureGraph();
|
|
8
|
+
const input = args.feature.toLowerCase();
|
|
9
|
+
//callback
|
|
10
|
+
const matches = Object.entries(graph)
|
|
11
|
+
.filter(([feature, meta]) => {
|
|
12
|
+
return (input.includes(feature.toLowerCase()) ||
|
|
13
|
+
meta.keywords.some((k) => input.includes(k.toLowerCase())));
|
|
14
|
+
})
|
|
15
|
+
.map(([feature, meta]) => ({
|
|
16
|
+
feature,
|
|
17
|
+
commands: meta.commands,
|
|
18
|
+
samples: meta.samples,
|
|
19
|
+
}));
|
|
20
|
+
if (matches.length === 0) {
|
|
21
|
+
return {
|
|
22
|
+
message: "No matching feature found.",
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
// commands
|
|
26
|
+
const allCommands = matches.flatMap((m) => m.commands);
|
|
27
|
+
// remove duplicate and keep weight
|
|
28
|
+
const dedup = new Map();
|
|
29
|
+
for (const cmd of allCommands) {
|
|
30
|
+
const existing = dedup.get(cmd.name);
|
|
31
|
+
if (!existing || (cmd.weight ?? 0) > (existing.weight ?? 0)) {
|
|
32
|
+
dedup.set(cmd.name, cmd);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const uniqueCommands = Array.from(dedup.values());
|
|
36
|
+
// sort
|
|
37
|
+
const ranked = uniqueCommands.sort((a, b) => {
|
|
38
|
+
const wa = a.weight ?? 0;
|
|
39
|
+
const wb = b.weight ?? 0;
|
|
40
|
+
if (wb !== wa)
|
|
41
|
+
return wb - wa;
|
|
42
|
+
// high-level API
|
|
43
|
+
if (a.level === "high" && b.level !== "high")
|
|
44
|
+
return -1;
|
|
45
|
+
if (b.level === "high" && a.level !== "high")
|
|
46
|
+
return 1;
|
|
47
|
+
return 0;
|
|
48
|
+
});
|
|
49
|
+
// remove duplicate
|
|
50
|
+
const samples = [
|
|
51
|
+
...new Set(matches.flatMap((m) => m.samples)),
|
|
52
|
+
];
|
|
53
|
+
// explain
|
|
54
|
+
function explain(cmd) {
|
|
55
|
+
if (cmd.type === "coprocessor") {
|
|
56
|
+
return "High-level API, recommended for UI development";
|
|
57
|
+
}
|
|
58
|
+
if (cmd.type === "display_list") {
|
|
59
|
+
return "Low-level rendering command";
|
|
60
|
+
}
|
|
61
|
+
if (cmd.type === "hal") {
|
|
62
|
+
return "Hardware-level API";
|
|
63
|
+
}
|
|
64
|
+
return "Related command";
|
|
65
|
+
}
|
|
66
|
+
// output
|
|
67
|
+
return {
|
|
68
|
+
features_detected: matches.map((m) => m.feature),
|
|
69
|
+
top_commands: ranked.slice(0, 5).map((c) => ({
|
|
70
|
+
name: c.name,
|
|
71
|
+
type: c.type,
|
|
72
|
+
level: c.level,
|
|
73
|
+
reason: explain(c),
|
|
74
|
+
})),
|
|
75
|
+
all_commands: ranked, // context to AI
|
|
76
|
+
related_samples: samples.slice(0, 5),
|
|
77
|
+
next_steps: [
|
|
78
|
+
"Start with top_commands (prefer high-level APIs)",
|
|
79
|
+
"Refer to related_samples for working examples",
|
|
80
|
+
"Integrate commands into your rendering loop",
|
|
81
|
+
],
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=traceFeatureToCommands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traceFeatureToCommands.js","sourceRoot":"","sources":["../../../src/tools/traceFeatureToCommands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC7B,CAAC,CAAC;AAaH,MAAM,UAAU,sBAAsB,CAClC,IAAiC;IAEjC,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IAEzC,UAAU;IACV,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;SAChC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE;QACxB,OAAO,CACH,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YACrC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAS,EAAE,EAAE,CAC7B,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAClC,CACJ,CAAC;IACN,CAAC,CAAC;SACD,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QACvB,OAAO;QACP,QAAQ,EAAE,IAAI,CAAC,QAAqB;QACpC,OAAO,EAAE,IAAI,CAAC,OAAmB;KACpC,CAAC,CAAC,CAAC;IAER,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO;YACH,OAAO,EAAE,4B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|
4
|
+
platform: z.ZodOptional<z.ZodString>;
|
|
5
|
+
display: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
code: string;
|
|
8
|
+
display?: string | undefined;
|
|
9
|
+
platform?: string | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
code: string;
|
|
12
|
+
display?: string | undefined;
|
|
13
|
+
platform?: string | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
export type ValidateBt820CodeInput = z.infer<typeof validateBt820CodeInput>;
|
|
16
|
+
export declare function validateBt820Code(args: ValidateBt820CodeInput): {
|
|
17
|
+
issues: {
|
|
18
|
+
severity: "high" | "medium" | "low";
|
|
19
|
+
title: string;
|
|
20
|
+
detail: string;
|
|
21
|
+
suggestion: string;
|
|
22
|
+
}[];
|
|
23
|
+
summary: {
|
|
24
|
+
high: number;
|
|
25
|
+
medium: number;
|
|
26
|
+
low: number;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const validateBt820CodeInput = z.object({
|
|
3
|
+
code: z.string().min(1),
|
|
4
|
+
platform: z.string().optional(),
|
|
5
|
+
display: z.string().optional(),
|
|
6
|
+
});
|
|
7
|
+
export function validateBt820Code(args) {
|
|
8
|
+
const code = args.code;
|
|
9
|
+
const issues = [];
|
|
10
|
+
if (!/EVE_CoCmd_text|EVE_CoCmd_button|EVE_CoCmd_/m.test(code)) {
|
|
11
|
+
issues.push({
|
|
12
|
+
severity: "low",
|
|
13
|
+
title: "No obvious coprocessor commands detected",
|
|
14
|
+
detail: "The snippet does not appear to use known EVE command helpers.",
|
|
15
|
+
suggestion: "Check whether this is the intended rendering layer.",
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const tagMatches = [...code.matchAll(/\bTAG\s*\(\s*(\d+)\s*\)/g)].map((m) => m[1]);
|
|
19
|
+
const duplicates = tagMatches.filter((tag, i) => tagMatches.indexOf(tag) !== i);
|
|
20
|
+
if (duplicates.length > 0) {
|
|
21
|
+
issues.push({
|
|
22
|
+
severity: "medium",
|
|
23
|
+
title: "Duplicate touch tag values",
|
|
24
|
+
detail: `Repeated TAG ids found: ${[...new Set(duplicates)].join(", ")}`,
|
|
25
|
+
suggestion: "Assign unique TAG values to each interactive control.",
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
if (!/DISPLAY|swap|Swap|DL_DISPLAY/i.test(code)) {
|
|
29
|
+
issues.push({
|
|
30
|
+
severity: "medium",
|
|
31
|
+
title: "Possible incomplete frame/display-list sequence",
|
|
32
|
+
detail: "No obvious display termination or swap marker found.",
|
|
33
|
+
suggestion: "Verify the display-list end and frame swap sequence.",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
issues,
|
|
38
|
+
summary: {
|
|
39
|
+
high: issues.filter((i) => i.severity === "high").length,
|
|
40
|
+
medium: issues.filter((i) => i.severity === "medium").length,
|
|
41
|
+
low: issues.filter((i) => i.severity === "low").length,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=validateBt820Code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateBt820Code.js","sourceRoot":"","sources":["../../../src/tools/validateBt820Code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC;AAIH,MAAM,UAAU,iBAAiB,CAAC,IAA4B;IAC1D,MAAM,IAAI,G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AAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,MAAM;YACxD,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,MAAM;YAC5D,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,MAAM;SACzD;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface CommandIndexItem {
|
|
2
|
+
name: string;
|
|
3
|
+
category: string;
|
|
4
|
+
signature: string;
|
|
5
|
+
summary: string;
|
|
6
|
+
params?: Array<{
|
|
7
|
+
name: string;
|
|
8
|
+
type: string;
|
|
9
|
+
desc: string;
|
|
10
|
+
}>;
|
|
11
|
+
related_samples?: string[];
|
|
12
|
+
related_features?: string[];
|
|
13
|
+
source_file: string;
|
|
14
|
+
}
|
|
15
|
+
export interface SampleIndexItem {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
path: string;
|
|
19
|
+
categories: string[];
|
|
20
|
+
summary: string;
|
|
21
|
+
commands_used: string[];
|
|
22
|
+
platform_notes?: string[];
|
|
23
|
+
assets_required?: string[];
|
|
24
|
+
difficulty?: "beginner" | "intermediate" | "advanced";
|
|
25
|
+
keywords?: string[];
|
|
26
|
+
}
|
|
27
|
+
export type Command = {
|
|
28
|
+
name: string;
|
|
29
|
+
type: string;
|
|
30
|
+
level: string;
|
|
31
|
+
weight: number;
|
|
32
|
+
};
|
|
33
|
+
export interface FeatureGraphItem {
|
|
34
|
+
commands: Command[];
|
|
35
|
+
samples: string[];
|
|
36
|
+
keywords: string[];
|
|
37
|
+
}
|
|
38
|
+
export interface BuildMatrix {
|
|
39
|
+
platforms: Record<string, {
|
|
40
|
+
graphics: string[];
|
|
41
|
+
spi: string[];
|
|
42
|
+
}>;
|
|
43
|
+
displays: string[];
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const explainEveSymbolInput: z.ZodObject<{
|
|
3
|
+
symbol: z.ZodString;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
symbol: string;
|
|
6
|
+
}, {
|
|
7
|
+
symbol: string;
|
|
8
|
+
}>;
|
|
9
|
+
export type ExplainEveSymbolInput = z.infer<typeof explainEveSymbolInput>;
|
|
10
|
+
export declare function explainEveSymbol(args: ExplainEveSymbolInput): {
|
|
11
|
+
found: boolean;
|
|
12
|
+
symbol: string;
|
|
13
|
+
type: string;
|
|
14
|
+
signature: string;
|
|
15
|
+
summary: string;
|
|
16
|
+
parameters: {
|
|
17
|
+
name: string;
|
|
18
|
+
type: string;
|
|
19
|
+
desc: string;
|
|
20
|
+
}[];
|
|
21
|
+
related_samples: string[];
|
|
22
|
+
related_features: string[];
|
|
23
|
+
source_file: string;
|
|
24
|
+
usage_notes: string[];
|
|
25
|
+
common_mistakes: string[];
|
|
26
|
+
value?: undefined;
|
|
27
|
+
message?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
found: boolean;
|
|
30
|
+
symbol: string;
|
|
31
|
+
type: string;
|
|
32
|
+
value: string;
|
|
33
|
+
summary: string;
|
|
34
|
+
related_features: string[];
|
|
35
|
+
source_file: string;
|
|
36
|
+
usage_notes: string[];
|
|
37
|
+
signature?: undefined;
|
|
38
|
+
parameters?: undefined;
|
|
39
|
+
related_samples?: undefined;
|
|
40
|
+
common_mistakes?: undefined;
|
|
41
|
+
message?: undefined;
|
|
42
|
+
} | {
|
|
43
|
+
found: boolean;
|
|
44
|
+
symbol: string;
|
|
45
|
+
message: string;
|
|
46
|
+
type?: undefined;
|
|
47
|
+
signature?: undefined;
|
|
48
|
+
summary?: undefined;
|
|
49
|
+
parameters?: undefined;
|
|
50
|
+
related_samples?: undefined;
|
|
51
|
+
related_features?: undefined;
|
|
52
|
+
source_file?: undefined;
|
|
53
|
+
usage_notes?: undefined;
|
|
54
|
+
common_mistakes?: undefined;
|
|
55
|
+
value?: undefined;
|
|
56
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { loadCommands, loadRegisters } from "../lib/loadIndex.js";
|
|
3
|
+
export const explainEveSymbolInput = z.object({
|
|
4
|
+
symbol: z.string().min(2),
|
|
5
|
+
});
|
|
6
|
+
export function explainEveSymbol(args) {
|
|
7
|
+
const commands = loadCommands();
|
|
8
|
+
const registers = loadRegisters();
|
|
9
|
+
const symbol = args.symbol.trim();
|
|
10
|
+
const commandItem = commands.find((c) => c.name.toLowerCase() == symbol.toLowerCase());
|
|
11
|
+
if (commandItem) {
|
|
12
|
+
return {
|
|
13
|
+
found: true,
|
|
14
|
+
symbol: commandItem.name,
|
|
15
|
+
type: "command",
|
|
16
|
+
signature: commandItem.signature,
|
|
17
|
+
summary: commandItem.summary,
|
|
18
|
+
parameters: commandItem.params ?? [],
|
|
19
|
+
related_samples: commandItem.related_samples ?? [],
|
|
20
|
+
related_features: commandItem.related_features ?? [],
|
|
21
|
+
source_file: commandItem.source_file,
|
|
22
|
+
usage_notes: [
|
|
23
|
+
"Prefer verifying usage against the closest sample in the repository.",
|
|
24
|
+
"Check command ordering and display-list flow in surrounding code.",
|
|
25
|
+
],
|
|
26
|
+
common_mistakes: [
|
|
27
|
+
"Passing invalid coordinates or flags.",
|
|
28
|
+
"Using the command outside the expected rendering flow.",
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const registerItem = registers.find((r) => r.name.toLowerCase() === symbol.toLowerCase());
|
|
33
|
+
if (registerItem) {
|
|
34
|
+
return {
|
|
35
|
+
found: true,
|
|
36
|
+
symbol: registerItem.name,
|
|
37
|
+
type: registerItem.kind,
|
|
38
|
+
value: registerItem.value,
|
|
39
|
+
summary: registerItem.summary,
|
|
40
|
+
related_features: registerItem.related_features ?? [],
|
|
41
|
+
source_file: registerItem.source_file,
|
|
42
|
+
usage_notes: [
|
|
43
|
+
"Verify the exact semantics in the programming guide/datasheet.",
|
|
44
|
+
"Check whether this symbol is read-only, write-only, or bitfield-based.",
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
found: false,
|
|
50
|
+
symbol,
|
|
51
|
+
message: `No exact symbol match found for ${symbol}.`,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=explainEveSymbol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explainEveSymbol.js","sourceRoot":"","sources":["../../src/tools/explainEveSymbol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAElE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC5B,CAAC,CAAC;AAIH,MAAM,UAAU,gBAAgB,CAAC,IAA2B;IACxD,MAAM,QAAQ,GAAG,YAAY,EAAE,CAAC;IAChC,MAAM,SAAS,GAAG,aAAa,EAAE,CAAC;IAClC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAElC,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAC7B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,MAAM,CAAC,WAAW,EAAE,CACtD,CAAC;IAEF,IAAI,WAAW,EAAE,CAAC;QACd,OA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