/** * X++ Code Generation Tool * Generate X++ code templates for common patterns */ import type { CallToolRequest } from '@modelcontextprotocol/sdk/types.js'; /** * Every pattern this tool ACCEPTS. Exported because it is the only honest * answer to "does this call exist?" — the published wire schema advertises a * subset (the ListTools payload is re-sent on every request and has a budget), * so a catalog recipe or a doc that names a pattern must be checked against * THIS list, not against the schema. */ export declare const CODE_GEN_PATTERNS: readonly ['class', 'runnable', 'form-handler', 'data-entity', 'batch-job', 'table-extension', 'sysoperation', 'event-handler', 'security-privilege', 'menu-item', 'class-extension', 'ssrs-report-full', 'lookup-form', 'dialog-box', 'dimension-controller', 'number-seq-handler', 'display-menu-controller', 'data-entity-staging', 'service-class-ais', 'form-datasource-extension', 'form-control-extension', 'map-extension', 'business-event', 'custom-telemetry', 'feature-class', 'systest', 'composite-entity', 'custom-service', 'er-custom-function', 'report-dataset-extension', 'report-custom-design', 'report-menu-redirect']; /** * SysTest case for a target class — the red half of a red/green cycle. * * Every generated test FAILS on purpose (`this.fail(...)`): a test that passes * before the behaviour exists proves nothing, and the framework gives no other * signal that the developer has not written the assertion yet. * * Only API the platform actually has is emitted (read from SysTestCase / * SysTestAssert in ApplicationFoundation): * - the asserts come from SysTestAssert, which SysTestCase extends; * - an expected exception is DECLARED with parmExceptionExpected(true) before * the call — there is no assertExpectedException in X++; * - SysTestTarget's second argument is a utilElementType, not a method name * (xppc: "Cannot implicitly convert from type 'str' to type * 'Enumeration(utilElementType)'"); * - rollback is the framework default, so there is no attribute to add and no * cleanup to write. */ /** * Merges caller-supplied attributes into the generated class attribute block. * * Placement is not a style choice and it is not guessed. A census of the 488 * shipped test classes that mention SysTest (2026-09-02) puts SysTestTarget * (15/15), SysTestGranularity (135/136), SysTestCaseConfigurationKeyConstraint * (75/75), SysTestCaseUseSingleInstance (28/28) and SysTestCaseDataDependency * (7/7) on the CLASS, and SysTestMethod (331/331) plus SysTestCheckInTest * (1,616/1,621) on the METHOD. So `attributes` lands on the class, except * SysTestCheckInTest, which is routed to the methods where it belongs. * * The multi-attribute form is the stacked block shipped code uses — one per line * inside ONE pair of brackets, comma separated. Separate bracket pairs stacked on * a member are a compile error (validator ATTR003), so this never emits them. */ export declare function applySysTestAttributes(code: string, attributes: readonly string[]): string; /** * Rewrites the generated Arrange sections to build fixtures through ATL. * * ATL is the platform's own answer to "arrange", and the part nobody can guess is * the tree: `AtlDataRootNode` declares ONE accessor of its own and every module * arrives on an extension class in another package, which is why a model without * the reference fails on `data.invent()` rather than on the class. The node index * is generated from the AOT (scripts/oracles/atlNodes.ts), so the emitted line is * read, never composed. */ export declare function applyAtlArrange(code: string, targetTable: string | undefined): string; export declare function codeGenTool(request: CallToolRequest): Promise<{ isError?: undefined; content: { type: string; text: string; }[]; } | { content: { type: string; text: string; }[]; isError: boolean; }>; //# sourceMappingURL=codeGen.d.ts.map