arc-1 0.9.13 → 0.9.15
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/README.md +17 -4
- package/dist/adt/class-structure.d.ts +1 -1
- package/dist/adt/class-structure.js +1 -1
- package/dist/adt/client.d.ts +16 -3
- package/dist/adt/client.d.ts.map +1 -1
- package/dist/adt/client.js +40 -35
- package/dist/adt/client.js.map +1 -1
- package/dist/adt/ddic-xml.d.ts +9 -0
- package/dist/adt/ddic-xml.d.ts.map +1 -1
- package/dist/adt/ddic-xml.js +49 -53
- package/dist/adt/ddic-xml.js.map +1 -1
- package/dist/adt/devtools.d.ts.map +1 -1
- package/dist/adt/devtools.js +46 -15
- package/dist/adt/devtools.js.map +1 -1
- package/dist/adt/fm-signature.d.ts +1 -1
- package/dist/adt/fm-signature.js +1 -1
- package/dist/adt/rap-generate.js +1 -1
- package/dist/adt/rap-generate.js.map +1 -1
- package/dist/adt/rap-handlers.d.ts +1 -1
- package/dist/adt/rap-handlers.js +1 -1
- package/dist/adt/refactoring.d.ts.map +1 -1
- package/dist/adt/refactoring.js +11 -14
- package/dist/adt/refactoring.js.map +1 -1
- package/dist/adt/server-driven.d.ts +46 -2
- package/dist/adt/server-driven.d.ts.map +1 -1
- package/dist/adt/server-driven.js +13 -3
- package/dist/adt/server-driven.js.map +1 -1
- package/dist/adt/xml-parser.d.ts +8 -1
- package/dist/adt/xml-parser.d.ts.map +1 -1
- package/dist/adt/xml-parser.js +57 -49
- package/dist/adt/xml-parser.js.map +1 -1
- package/dist/authz/policy.d.ts +1 -1
- package/dist/authz/policy.js +1 -1
- package/dist/cache/cache.d.ts +1 -0
- package/dist/cache/cache.d.ts.map +1 -1
- package/dist/cache/cache.js.map +1 -1
- package/dist/cache/inactive-list-cache.d.ts +4 -4
- package/dist/cache/inactive-list-cache.d.ts.map +1 -1
- package/dist/cache/inactive-list-cache.js +19 -12
- package/dist/cache/inactive-list-cache.js.map +1 -1
- package/dist/cache/memory.d.ts +1 -0
- package/dist/cache/memory.d.ts.map +1 -1
- package/dist/cache/memory.js +3 -0
- package/dist/cache/memory.js.map +1 -1
- package/dist/cache/sqlite.d.ts +1 -0
- package/dist/cache/sqlite.d.ts.map +1 -1
- package/dist/cache/sqlite.js +3 -0
- package/dist/cache/sqlite.js.map +1 -1
- package/dist/cache/warmup.d.ts.map +1 -1
- package/dist/cache/warmup.js +85 -38
- package/dist/cache/warmup.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/dist/context/compressor.d.ts.map +1 -1
- package/dist/context/compressor.js +22 -13
- package/dist/context/compressor.js.map +1 -1
- package/dist/context/contract.d.ts.map +1 -1
- package/dist/context/contract.js +4 -3
- package/dist/context/contract.js.map +1 -1
- package/dist/context/deps.d.ts.map +1 -1
- package/dist/context/deps.js +3 -2
- package/dist/context/deps.js.map +1 -1
- package/dist/context/grep.d.ts +3 -1
- package/dist/context/grep.d.ts.map +1 -1
- package/dist/context/grep.js +83 -1
- package/dist/context/grep.js.map +1 -1
- package/dist/context/method-surgery.d.ts.map +1 -1
- package/dist/context/method-surgery.js +3 -2
- package/dist/context/method-surgery.js.map +1 -1
- package/dist/handlers/activate.d.ts +25 -0
- package/dist/handlers/activate.d.ts.map +1 -0
- package/dist/handlers/activate.js +334 -0
- package/dist/handlers/activate.js.map +1 -0
- package/dist/handlers/cache-security.d.ts +22 -0
- package/dist/handlers/cache-security.d.ts.map +1 -0
- package/dist/handlers/cache-security.js +51 -0
- package/dist/handlers/cache-security.js.map +1 -0
- package/dist/handlers/cds-hints.d.ts +26 -0
- package/dist/handlers/cds-hints.d.ts.map +1 -0
- package/dist/handlers/cds-hints.js +380 -0
- package/dist/handlers/cds-hints.js.map +1 -0
- package/dist/handlers/context.d.ts +10 -0
- package/dist/handlers/context.d.ts.map +1 -0
- package/dist/handlers/context.js +344 -0
- package/dist/handlers/context.js.map +1 -0
- package/dist/handlers/diagnose.d.ts +8 -0
- package/dist/handlers/diagnose.d.ts.map +1 -0
- package/dist/handlers/diagnose.js +274 -0
- package/dist/handlers/diagnose.js.map +1 -0
- package/dist/handlers/dispatch.d.ts +39 -0
- package/dist/handlers/dispatch.d.ts.map +1 -0
- package/dist/handlers/dispatch.js +640 -0
- package/dist/handlers/dispatch.js.map +1 -0
- package/dist/handlers/feature-cache.d.ts +26 -0
- package/dist/handlers/feature-cache.d.ts.map +1 -0
- package/dist/handlers/feature-cache.js +45 -0
- package/dist/handlers/feature-cache.js.map +1 -0
- package/dist/handlers/git.d.ts +9 -0
- package/dist/handlers/git.d.ts.map +1 -0
- package/dist/handlers/git.js +227 -0
- package/dist/handlers/git.js.map +1 -0
- package/dist/handlers/lint.d.ts +9 -0
- package/dist/handlers/lint.d.ts.map +1 -0
- package/dist/handlers/lint.js +82 -0
- package/dist/handlers/lint.js.map +1 -0
- package/dist/handlers/manage.d.ts +10 -0
- package/dist/handlers/manage.d.ts.map +1 -0
- package/dist/handlers/manage.js +375 -0
- package/dist/handlers/manage.js.map +1 -0
- package/dist/handlers/navigate.d.ts +8 -0
- package/dist/handlers/navigate.d.ts.map +1 -0
- package/dist/handlers/navigate.js +188 -0
- package/dist/handlers/navigate.js.map +1 -0
- package/dist/handlers/object-types.d.ts +103 -0
- package/dist/handlers/object-types.d.ts.map +1 -0
- package/dist/handlers/object-types.js +476 -0
- package/dist/handlers/object-types.js.map +1 -0
- package/dist/handlers/query.d.ts +7 -0
- package/dist/handlers/query.d.ts.map +1 -0
- package/dist/handlers/query.js +190 -0
- package/dist/handlers/query.js.map +1 -0
- package/dist/handlers/read.d.ts +18 -0
- package/dist/handlers/read.d.ts.map +1 -0
- package/dist/handlers/read.js +581 -0
- package/dist/handlers/read.js.map +1 -0
- package/dist/handlers/schemas.d.ts +28 -26
- package/dist/handlers/schemas.d.ts.map +1 -1
- package/dist/handlers/schemas.js +17 -153
- package/dist/handlers/schemas.js.map +1 -1
- package/dist/handlers/search.d.ts +24 -0
- package/dist/handlers/search.d.ts.map +1 -0
- package/dist/handlers/search.js +208 -0
- package/dist/handlers/search.js.map +1 -0
- package/dist/handlers/shared.d.ts +19 -0
- package/dist/handlers/shared.d.ts.map +1 -0
- package/dist/handlers/shared.js +23 -0
- package/dist/handlers/shared.js.map +1 -0
- package/dist/handlers/tool-registry.d.ts +44 -0
- package/dist/handlers/tool-registry.d.ts.map +1 -0
- package/dist/handlers/tool-registry.js +152 -0
- package/dist/handlers/tool-registry.js.map +1 -0
- package/dist/handlers/tools.d.ts +9 -0
- package/dist/handlers/tools.d.ts.map +1 -1
- package/dist/handlers/tools.js +40 -141
- package/dist/handlers/tools.js.map +1 -1
- package/dist/handlers/transport.d.ts +8 -0
- package/dist/handlers/transport.d.ts.map +1 -0
- package/dist/handlers/transport.js +281 -0
- package/dist/handlers/transport.js.map +1 -0
- package/dist/handlers/write/class-surgery.d.ts +18 -0
- package/dist/handlers/write/class-surgery.d.ts.map +1 -0
- package/dist/handlers/write/class-surgery.js +366 -0
- package/dist/handlers/write/class-surgery.js.map +1 -0
- package/dist/handlers/write/context.d.ts +43 -0
- package/dist/handlers/write/context.d.ts.map +1 -0
- package/dist/handlers/write/context.js +5 -0
- package/dist/handlers/write/context.js.map +1 -0
- package/dist/handlers/write/create.d.ts +8 -0
- package/dist/handlers/write/create.d.ts.map +1 -0
- package/dist/handlers/write/create.js +603 -0
- package/dist/handlers/write/create.js.map +1 -0
- package/dist/handlers/write/rap.d.ts +8 -0
- package/dist/handlers/write/rap.d.ts.map +1 -0
- package/dist/handlers/write/rap.js +235 -0
- package/dist/handlers/write/rap.js.map +1 -0
- package/dist/handlers/write/update-delete.d.ts +8 -0
- package/dist/handlers/write/update-delete.d.ts.map +1 -0
- package/dist/handlers/write/update-delete.js +182 -0
- package/dist/handlers/write/update-delete.js.map +1 -0
- package/dist/handlers/write-helpers.d.ts +155 -0
- package/dist/handlers/write-helpers.d.ts.map +1 -0
- package/dist/handlers/write-helpers.js +859 -0
- package/dist/handlers/write-helpers.js.map +1 -0
- package/dist/handlers/write.d.ts +16 -0
- package/dist/handlers/write.d.ts.map +1 -0
- package/dist/handlers/write.js +210 -0
- package/dist/handlers/write.js.map +1 -0
- package/dist/handlers/zod-errors.d.ts +1 -1
- package/dist/handlers/zod-errors.js +1 -1
- package/dist/lint/abaplint-config-cache.d.ts +5 -0
- package/dist/lint/abaplint-config-cache.d.ts.map +1 -0
- package/dist/lint/abaplint-config-cache.js +29 -0
- package/dist/lint/abaplint-config-cache.js.map +1 -0
- package/dist/lint/config-builder.d.ts.map +1 -1
- package/dist/lint/config-builder.js +3 -4
- package/dist/lint/config-builder.js.map +1 -1
- package/dist/lint/lint.d.ts +1 -1
- package/dist/lint/lint.d.ts.map +1 -1
- package/dist/lint/lint.js +3 -2
- package/dist/lint/lint.js.map +1 -1
- package/dist/server/config.d.ts.map +1 -1
- package/dist/server/config.js +22 -8
- package/dist/server/config.js.map +1 -1
- package/dist/server/mcp-rate-limit.d.ts +1 -1
- package/dist/server/mcp-rate-limit.js +1 -1
- package/dist/server/server.d.ts +1 -1
- package/dist/server/server.js +3 -2
- package/dist/server/server.js.map +1 -1
- package/package.json +15 -10
- package/dist/handlers/intent.d.ts +0 -144
- package/dist/handlers/intent.d.ts.map +0 -1
- package/dist/handlers/intent.js +0 -6782
- package/dist/handlers/intent.js.map +0 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Object-type normalization + ADT URL building (pure utilities, no project-internal imports).
|
|
3
|
+
*
|
|
4
|
+
* Slash-form alias maps, canonical-type normalization, the objectBasePath/URL builders,
|
|
5
|
+
* LLM arg-stripping, and class-include helpers.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SLASH_TYPE_MAP: Record<string, string>;
|
|
8
|
+
/**
|
|
9
|
+
* Citation guard companion for SLASH_TYPE_MAP. Keys MUST stay key-equal to
|
|
10
|
+
* SLASH_TYPE_MAP (enforced by tests/unit/handlers/slash-type-map.test.ts). Each
|
|
11
|
+
* value points at a research evidence file or a fixture that backs the slash code.
|
|
12
|
+
* Adding an entry without evidence is the anti-cargo-cult guard.
|
|
13
|
+
*/
|
|
14
|
+
export declare const SLASH_TYPE_EVIDENCE: Record<string, string>;
|
|
15
|
+
/**
|
|
16
|
+
* Set of canonical short types that MUST have a working `objectBasePath` case.
|
|
17
|
+
* Drives the exhaustiveness guard inside `objectBasePath` so a new canonical type
|
|
18
|
+
* added to SAPRead/SAPWrite enums without an URL builder fails loudly. The VIEW
|
|
19
|
+
* silent-fallthrough bug (research/abap-types/types/view.md) is exactly what this
|
|
20
|
+
* guard prevents from reoccurring.
|
|
21
|
+
*/
|
|
22
|
+
export declare const KNOWN_BASE_TYPES: Set<string>;
|
|
23
|
+
/** Normalize ADT type codes and aliases to ARC-1 canonical short types. */
|
|
24
|
+
export declare function normalizeObjectType(type: string): string;
|
|
25
|
+
/** SAPWrite-only normalizer: preserves TABL/DT and TABL/DS and remaps STRU/DS
|
|
26
|
+
* to TABL/DS. Every other tool keeps the global collapsing behaviour of
|
|
27
|
+
* `normalizeObjectType`. */
|
|
28
|
+
export declare function normalizeWriteObjectType(type: string): string;
|
|
29
|
+
/** Collapse TABL/DT and TABL/DS back to bare 'TABL' for downstream Set-membership
|
|
30
|
+
* checks (DDIC hints, RAP preflight, CDS dependency hints, cache invalidation)
|
|
31
|
+
* that only know about canonical types. The slash form survives at URL routing
|
|
32
|
+
* + XML envelope sites. */
|
|
33
|
+
export declare function canonicalTablType(type: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Strip GPT/OpenAI "overpopulation" pollution before Zod validation:
|
|
36
|
+
* - `null` values — OpenAI Structured Outputs / `strict` mode (the default for the
|
|
37
|
+
* Responses API) emulates an optional field as a `["type","null"]` union and emits
|
|
38
|
+
* `null` for every unused optional. `z.X().optional()` rejects `null`, so a strict
|
|
39
|
+
* caller otherwise cannot make a clean call (every unused optional becomes null →
|
|
40
|
+
* rejected). `null` is ALWAYS stripped (handlers treat null as omitted).
|
|
41
|
+
* - empty / whitespace-only strings — many callers serialize an omitted optional as
|
|
42
|
+
* `""`. On optional enums that hard-rejects; on optional numbers `z.coerce.number("")`
|
|
43
|
+
* silently becomes `0`. Stripped, EXCEPT for the EMPTY_STRING_MEANINGFUL_FIELDS above.
|
|
44
|
+
*
|
|
45
|
+
* Preserves real `false` and `0` — ONLY `null` and empty/whitespace strings are removed.
|
|
46
|
+
* Shallow at the top level, plus one level into each `objects[]` item (SAPWrite
|
|
47
|
+
* `batch_create` / SAPActivate batch). Deliberately does NOT recurse into leaf data
|
|
48
|
+
* arrays (`messages`/`fixedValues`/`parameters`/`where`) — those carry user data where
|
|
49
|
+
* an empty string or null may be meaningful. See issue #360.
|
|
50
|
+
*/
|
|
51
|
+
export declare function stripLlmEmptyValues(args: Record<string, unknown>): Record<string, unknown>;
|
|
52
|
+
/** Normalize type fields before schema validation so slash/case aliases are accepted.
|
|
53
|
+
* Also strips GPT/OpenAI pollution (null + empty strings) via stripLlmEmptyValues so the
|
|
54
|
+
* same normalization runs for every tool — standard, hyperfocused, and the CLI all route
|
|
55
|
+
* through handleToolCall, which calls this once before scope derivation + Zod (issue #360).
|
|
56
|
+
* Exported for unit tests (the include-drop + strip behavior). */
|
|
57
|
+
export declare function normalizeTypeArgsForValidation(toolName: string, args: Record<string, unknown>): Record<string, unknown>;
|
|
58
|
+
/**
|
|
59
|
+
* Base path for an object type. Returns path prefix without trailing name segment.
|
|
60
|
+
* Exported for tests (Plan A Task 4 — exhaustiveness guard regression test).
|
|
61
|
+
*/
|
|
62
|
+
export declare function objectBasePath(type: string): string;
|
|
63
|
+
/** Map object type + name to the ADT object URL used by CRUD/DevTools/etc. Name is URI-encoded. */
|
|
64
|
+
export declare function objectUrlForType(type: string, name: string): string;
|
|
65
|
+
/** Infer SAP object type from naming conventions. Returns empty string if type cannot be determined. */
|
|
66
|
+
export declare function inferObjectType(name: string): string;
|
|
67
|
+
/**
|
|
68
|
+
* Map object type + name to the ADT object URL WITHOUT encoding the name.
|
|
69
|
+
* Used for API release state where the full URI is encoded as a single path segment by the caller.
|
|
70
|
+
*/
|
|
71
|
+
export declare function objectUrlForTypeRaw(type: string, name: string): string;
|
|
72
|
+
/** Get the source URL for an object (appends /source/main) */
|
|
73
|
+
export declare function sourceUrlForType(type: string, name: string): string;
|
|
74
|
+
export type ClassWriteInclude = 'definitions' | 'implementations' | 'macros' | 'testclasses';
|
|
75
|
+
export declare const CLASS_WRITE_INCLUDES: readonly ClassWriteInclude[];
|
|
76
|
+
/** Get a CLAS include URL (definitions/implementations/macros/testclasses) */
|
|
77
|
+
export declare function classIncludeUrl(name: string, include: ClassWriteInclude): string;
|
|
78
|
+
export declare function normalizeClassWriteInclude(include: unknown): ClassWriteInclude | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Auto-detect which class include a method specifier targets, based on the
|
|
81
|
+
* local-class prefix on the LHS of `<localclass>~<method>`. Used by
|
|
82
|
+
* `edit_method` so callers can pass `lhc_project~approve_project` and have
|
|
83
|
+
* ARC-1 transparently route the read+write to `/includes/implementations`
|
|
84
|
+
* instead of `/source/main`.
|
|
85
|
+
*
|
|
86
|
+
* Prefix → include mapping (intentionally narrow; extend via explicit
|
|
87
|
+
* `include` parameter when a code-base uses other conventions):
|
|
88
|
+
* - `lhc_*` → implementations (RAP behavior pool handler classes)
|
|
89
|
+
* - `lcl_*` → implementations (local helper classes)
|
|
90
|
+
* - `ltc_*` → testclasses (ABAP Unit local test classes)
|
|
91
|
+
*
|
|
92
|
+
* Returns `undefined` for:
|
|
93
|
+
* - Specifiers with no `~` (route to MAIN)
|
|
94
|
+
* - Global-interface methods like `zif_order~create`, `if_oo_adt_classrun~main`
|
|
95
|
+
* (route to MAIN — the impl lives in a global class)
|
|
96
|
+
* - `lif_*` local interfaces (interfaces only declare methods — there's no
|
|
97
|
+
* impl in CCDEF; an `lhc_*`/`lcl_*` class implements them and the call
|
|
98
|
+
* site uses that class's prefix instead)
|
|
99
|
+
*/
|
|
100
|
+
export declare function detectLocalHandlerInclude(method: string): ClassWriteInclude | undefined;
|
|
101
|
+
/** Strip the leading "=== <include> ===\n" header that `client.getClass(name, include)` prepends. */
|
|
102
|
+
export declare function stripIncludeHeader(source: string): string;
|
|
103
|
+
//# sourceMappingURL=object-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object-types.d.ts","sourceRoot":"","sources":["../../src/handlers/object-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAyCjD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAuBtD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,aAqB3B,CAAC;AAEH,2EAA2E;AAC3E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIxD;AAcD;;6BAE6B;AAC7B,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO7D;AAED;;;4BAG4B;AAC5B,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAeD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiB1F;AAED;;;;mEAImE;AACnE,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA0FzB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA0GnD;AAED,mGAAmG;AACnG,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAInE;AAED,wGAAwG;AACxG,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMpD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAGtE;AAED,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,iBAAiB,GAAG,QAAQ,GAAG,aAAa,CAAC;AAC7F,eAAO,MAAM,oBAAoB,EAAE,SAAS,iBAAiB,EAK5D,CAAC;AAEF,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAEhF;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,iBAAiB,GAAG,SAAS,CAI1F;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAMvF;AAED,qGAAqG;AACrG,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEzD"}
|
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Object-type normalization + ADT URL building (pure utilities, no project-internal imports).
|
|
3
|
+
*
|
|
4
|
+
* Slash-form alias maps, canonical-type normalization, the objectBasePath/URL builders,
|
|
5
|
+
* LLM arg-stripping, and class-include helpers.
|
|
6
|
+
*/
|
|
7
|
+
// ─── Object URL Mapping ──────────────────────────────────────────────
|
|
8
|
+
// Every entry verified against either Eclipse ADT apidoc 3.58.1, live a4h S/4HANA
|
|
9
|
+
// 2023 + npl NW 7.50 ADT responses (captured 2026-05-08 — both systems agree), or
|
|
10
|
+
// abap-file-formats schemas. Per-entry evidence in research/abap-types/types/<x>.md.
|
|
11
|
+
// SLASH_TYPE_EVIDENCE below MUST stay key-equal (anti-cargo-cult guard, enforced by
|
|
12
|
+
// tests/unit/handlers/slash-type-map.test.ts — see issue #218 follow-up).
|
|
13
|
+
// Exported for tests only — the citation guard
|
|
14
|
+
// (tests/unit/handlers/slash-type-map.test.ts) needs to assert key-equality
|
|
15
|
+
// against SLASH_TYPE_EVIDENCE so a new entry without evidence fails CI.
|
|
16
|
+
// Production callers should keep using normalizeObjectType().
|
|
17
|
+
export const SLASH_TYPE_MAP = {
|
|
18
|
+
'PROG/P': 'PROG', // research/abap-types/types/prog.md
|
|
19
|
+
'PROG/I': 'INCL', // research/abap-types/types/incl.md
|
|
20
|
+
'CLAS/OC': 'CLAS', // research/abap-types/types/clas.md
|
|
21
|
+
// 'CLAS/LI' removed — invented; absent from Eclipse apidoc; no live ADT response
|
|
22
|
+
// emits it. Pass-through means schema validation rejects it loudly.
|
|
23
|
+
'INTF/OI': 'INTF', // research/abap-types/types/intf.md
|
|
24
|
+
// 'FUNC/FM' removed — invented; ADT emits FUGR/FF for function modules, not
|
|
25
|
+
// FUNC/FM. Function modules are LIMU FUNC under R3TR FUGR.
|
|
26
|
+
'FUGR/F': 'FUGR', // function group container — research/abap-types/types/fugr.md
|
|
27
|
+
// FUGR/FF is a function module (LIMU FUNC under FUGR), not the function group.
|
|
28
|
+
// Live a4h: GET .../groups/su_user/fmodules/bapi_user_getlist returns
|
|
29
|
+
// adtcore:type="FUGR/FF" with <adtcore:containerRef adtcore:type="FUGR/F"/>.
|
|
30
|
+
'FUGR/FF': 'FUNC', // research/abap-types/types/fugr.md + func.md
|
|
31
|
+
'DDLS/DF': 'DDLS', // research/abap-types/types/ddls.md
|
|
32
|
+
'DCLS/DL': 'DCLS', // research/abap-types/types/dcls.md
|
|
33
|
+
'BDEF/BDO': 'BDEF', // research/abap-types/types/bdef.md
|
|
34
|
+
'SRVD/SRV': 'SRVD', // research/abap-types/types/srvd.md
|
|
35
|
+
'SRVB/SVB': 'SRVB', // research/abap-types/types/srvb.md
|
|
36
|
+
'DDLX/EX': 'DDLX', // research/abap-types/types/ddlx.md (live a4h + npl 2026-05-08)
|
|
37
|
+
// DDIC TABL: ADT exposes /DT (transparent table) and /DS (DDIC structure)
|
|
38
|
+
// subtypes. Both share TADIR R3TR TABL (DD02L-TABCLASS = TRANSP vs INTTAB).
|
|
39
|
+
// ARC-1 collapses both into the canonical short type 'TABL' (Model B — see
|
|
40
|
+
// docs/plans/completed/collapse-stru-into-tabl.md).
|
|
41
|
+
'TABL/DT': 'TABL', // research/abap-types/types/tabl.md
|
|
42
|
+
'TABL/DS': 'TABL', // research/abap-types/types/tabl.md
|
|
43
|
+
// Legacy slash-form alias — ADT never actually returns this, but pre-Model-B
|
|
44
|
+
// ARC-1 prompts learned it from older docs. Kept so they normalize to TABL
|
|
45
|
+
// instead of producing a schema error. Bare 'STRU' is NOT aliased.
|
|
46
|
+
'STRU/DS': 'TABL', // research/abap-types/types/tabl.md (legacy alias)
|
|
47
|
+
'DOMA/DD': 'DOMA', // research/abap-types/types/doma.md
|
|
48
|
+
'DTEL/DE': 'DTEL', // research/abap-types/types/dtel.md
|
|
49
|
+
'MSAG/N': 'MSAG', // research/abap-types/types/msag.md
|
|
50
|
+
'DEVC/K': 'DEVC', // research/abap-types/types/devc.md
|
|
51
|
+
// TRAN/T (was TRAN/O — invented). Live a4h + npl 2026-05-08 both return
|
|
52
|
+
// adtcore:type="TRAN/T" for SE38, SU01, etc.
|
|
53
|
+
'TRAN/T': 'TRAN', // research/abap-types/types/tran.md
|
|
54
|
+
// VIEW/DV (was VIEW/V — invented). Live a4h + npl 2026-05-08 both return
|
|
55
|
+
// adtcore:type="VIEW/DV" for V_USR_NAME.
|
|
56
|
+
'VIEW/DV': 'VIEW', // research/abap-types/types/view.md
|
|
57
|
+
'SKTD/TYP': 'SKTD', // research/abap-types/types/sktd.md
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Citation guard companion for SLASH_TYPE_MAP. Keys MUST stay key-equal to
|
|
61
|
+
* SLASH_TYPE_MAP (enforced by tests/unit/handlers/slash-type-map.test.ts). Each
|
|
62
|
+
* value points at a research evidence file or a fixture that backs the slash code.
|
|
63
|
+
* Adding an entry without evidence is the anti-cargo-cult guard.
|
|
64
|
+
*/
|
|
65
|
+
export const SLASH_TYPE_EVIDENCE = {
|
|
66
|
+
'PROG/P': 'research/abap-types/types/prog.md',
|
|
67
|
+
'PROG/I': 'research/abap-types/types/incl.md',
|
|
68
|
+
'CLAS/OC': 'research/abap-types/types/clas.md',
|
|
69
|
+
'INTF/OI': 'research/abap-types/types/intf.md',
|
|
70
|
+
'FUGR/F': 'research/abap-types/types/fugr.md',
|
|
71
|
+
'FUGR/FF': 'research/abap-types/types/fugr.md',
|
|
72
|
+
'DDLS/DF': 'research/abap-types/types/ddls.md',
|
|
73
|
+
'DCLS/DL': 'research/abap-types/types/dcls.md',
|
|
74
|
+
'BDEF/BDO': 'research/abap-types/types/bdef.md',
|
|
75
|
+
'SRVD/SRV': 'research/abap-types/types/srvd.md',
|
|
76
|
+
'SRVB/SVB': 'research/abap-types/types/srvb.md',
|
|
77
|
+
'DDLX/EX': 'research/abap-types/types/ddlx.md',
|
|
78
|
+
'TABL/DT': 'research/abap-types/types/tabl.md',
|
|
79
|
+
'TABL/DS': 'research/abap-types/types/tabl.md',
|
|
80
|
+
'STRU/DS': 'research/abap-types/types/tabl.md',
|
|
81
|
+
'DOMA/DD': 'research/abap-types/types/doma.md',
|
|
82
|
+
'DTEL/DE': 'research/abap-types/types/dtel.md',
|
|
83
|
+
'MSAG/N': 'research/abap-types/types/msag.md',
|
|
84
|
+
'DEVC/K': 'research/abap-types/types/devc.md',
|
|
85
|
+
'TRAN/T': 'research/abap-types/types/tran.md',
|
|
86
|
+
'VIEW/DV': 'research/abap-types/types/view.md',
|
|
87
|
+
'SKTD/TYP': 'research/abap-types/types/sktd.md',
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Set of canonical short types that MUST have a working `objectBasePath` case.
|
|
91
|
+
* Drives the exhaustiveness guard inside `objectBasePath` so a new canonical type
|
|
92
|
+
* added to SAPRead/SAPWrite enums without an URL builder fails loudly. The VIEW
|
|
93
|
+
* silent-fallthrough bug (research/abap-types/types/view.md) is exactly what this
|
|
94
|
+
* guard prevents from reoccurring.
|
|
95
|
+
*/
|
|
96
|
+
export const KNOWN_BASE_TYPES = new Set([
|
|
97
|
+
'PROG',
|
|
98
|
+
'CLAS',
|
|
99
|
+
'INTF',
|
|
100
|
+
'INCL',
|
|
101
|
+
'FUGR',
|
|
102
|
+
'FUNC',
|
|
103
|
+
'DDLS',
|
|
104
|
+
'DCLS',
|
|
105
|
+
'BDEF',
|
|
106
|
+
'SRVD',
|
|
107
|
+
'SRVB',
|
|
108
|
+
'DDLX',
|
|
109
|
+
'TABL',
|
|
110
|
+
'DOMA',
|
|
111
|
+
'DTEL',
|
|
112
|
+
'MSAG',
|
|
113
|
+
'DEVC',
|
|
114
|
+
'TRAN',
|
|
115
|
+
'VIEW',
|
|
116
|
+
'SKTD',
|
|
117
|
+
]);
|
|
118
|
+
/** Normalize ADT type codes and aliases to ARC-1 canonical short types. */
|
|
119
|
+
export function normalizeObjectType(type) {
|
|
120
|
+
const normalized = String(type).trim().toUpperCase();
|
|
121
|
+
if (!normalized)
|
|
122
|
+
return '';
|
|
123
|
+
return SLASH_TYPE_MAP[normalized] ?? normalized;
|
|
124
|
+
}
|
|
125
|
+
/** TABL subtypes that SAPWrite preserves (instead of collapsing to bare 'TABL' via
|
|
126
|
+
* SLASH_TYPE_MAP) so the create path can route TABL/DT → /ddic/tables and
|
|
127
|
+
* TABL/DS → /ddic/structures. See docs/plans/completed/fix-tabl-ds-create-routing.md. */
|
|
128
|
+
const TABL_WRITE_SUBTYPES = new Set(['TABL/DT', 'TABL/DS']);
|
|
129
|
+
/** Legacy slash-form aliases SAPWrite remaps to a canonical subtype before
|
|
130
|
+
* SLASH_TYPE_MAP runs — otherwise STRU/DS would collapse to bare 'TABL' and
|
|
131
|
+
* route the structure create to /ddic/tables. */
|
|
132
|
+
const SAPWRITE_TABL_ALIAS = {
|
|
133
|
+
'STRU/DS': 'TABL/DS',
|
|
134
|
+
};
|
|
135
|
+
/** SAPWrite-only normalizer: preserves TABL/DT and TABL/DS and remaps STRU/DS
|
|
136
|
+
* to TABL/DS. Every other tool keeps the global collapsing behaviour of
|
|
137
|
+
* `normalizeObjectType`. */
|
|
138
|
+
export function normalizeWriteObjectType(type) {
|
|
139
|
+
const normalized = String(type).trim().toUpperCase();
|
|
140
|
+
if (!normalized)
|
|
141
|
+
return '';
|
|
142
|
+
const aliased = SAPWRITE_TABL_ALIAS[normalized];
|
|
143
|
+
if (aliased)
|
|
144
|
+
return aliased;
|
|
145
|
+
if (TABL_WRITE_SUBTYPES.has(normalized))
|
|
146
|
+
return normalized;
|
|
147
|
+
return SLASH_TYPE_MAP[normalized] ?? normalized;
|
|
148
|
+
}
|
|
149
|
+
/** Collapse TABL/DT and TABL/DS back to bare 'TABL' for downstream Set-membership
|
|
150
|
+
* checks (DDIC hints, RAP preflight, CDS dependency hints, cache invalidation)
|
|
151
|
+
* that only know about canonical types. The slash form survives at URL routing
|
|
152
|
+
* + XML envelope sites. */
|
|
153
|
+
export function canonicalTablType(type) {
|
|
154
|
+
return type === 'TABL/DT' || type === 'TABL/DS' ? 'TABL' : type;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Fields whose handler INTENTIONALLY treats an explicit empty string as a meaningful
|
|
158
|
+
* signal distinct from "omitted", so the pre-validation strip must keep an empty-STRING
|
|
159
|
+
* value (a `null` is still stripped — the handlers treat null as omitted):
|
|
160
|
+
* - `target` — SAPTransport create rejects a "provided but empty" target as a caller
|
|
161
|
+
* mistake (vs omitted → local); see `targetProvided` in handleSAPTransport.
|
|
162
|
+
* - `proposalUserContent` — SAPDiagnose apply_quickfix forwards an empty
|
|
163
|
+
* `<userContent></userContent>` verbatim.
|
|
164
|
+
* Keep this set minimal: it only needs entries where a handler distinguishes ""-present
|
|
165
|
+
* from absent. Empty strings on enums/numbers/everything-else are safe to strip.
|
|
166
|
+
*/
|
|
167
|
+
const EMPTY_STRING_MEANINGFUL_FIELDS = new Set(['target', 'proposalUserContent']);
|
|
168
|
+
/**
|
|
169
|
+
* Strip GPT/OpenAI "overpopulation" pollution before Zod validation:
|
|
170
|
+
* - `null` values — OpenAI Structured Outputs / `strict` mode (the default for the
|
|
171
|
+
* Responses API) emulates an optional field as a `["type","null"]` union and emits
|
|
172
|
+
* `null` for every unused optional. `z.X().optional()` rejects `null`, so a strict
|
|
173
|
+
* caller otherwise cannot make a clean call (every unused optional becomes null →
|
|
174
|
+
* rejected). `null` is ALWAYS stripped (handlers treat null as omitted).
|
|
175
|
+
* - empty / whitespace-only strings — many callers serialize an omitted optional as
|
|
176
|
+
* `""`. On optional enums that hard-rejects; on optional numbers `z.coerce.number("")`
|
|
177
|
+
* silently becomes `0`. Stripped, EXCEPT for the EMPTY_STRING_MEANINGFUL_FIELDS above.
|
|
178
|
+
*
|
|
179
|
+
* Preserves real `false` and `0` — ONLY `null` and empty/whitespace strings are removed.
|
|
180
|
+
* Shallow at the top level, plus one level into each `objects[]` item (SAPWrite
|
|
181
|
+
* `batch_create` / SAPActivate batch). Deliberately does NOT recurse into leaf data
|
|
182
|
+
* arrays (`messages`/`fixedValues`/`parameters`/`where`) — those carry user data where
|
|
183
|
+
* an empty string or null may be meaningful. See issue #360.
|
|
184
|
+
*/
|
|
185
|
+
export function stripLlmEmptyValues(args) {
|
|
186
|
+
const isStrippable = (key, v) => v === null || (typeof v === 'string' && v.trim() === '' && !EMPTY_STRING_MEANINGFUL_FIELDS.has(key));
|
|
187
|
+
const cleanShallow = (obj) => {
|
|
188
|
+
const out = {};
|
|
189
|
+
for (const [k, v] of Object.entries(obj)) {
|
|
190
|
+
if (!isStrippable(k, v))
|
|
191
|
+
out[k] = v;
|
|
192
|
+
}
|
|
193
|
+
return out;
|
|
194
|
+
};
|
|
195
|
+
const cleaned = cleanShallow(args);
|
|
196
|
+
if (Array.isArray(cleaned.objects)) {
|
|
197
|
+
cleaned.objects = cleaned.objects.map((o) => o && typeof o === 'object' && !Array.isArray(o) ? cleanShallow(o) : o);
|
|
198
|
+
}
|
|
199
|
+
return cleaned;
|
|
200
|
+
}
|
|
201
|
+
/** Normalize type fields before schema validation so slash/case aliases are accepted.
|
|
202
|
+
* Also strips GPT/OpenAI pollution (null + empty strings) via stripLlmEmptyValues so the
|
|
203
|
+
* same normalization runs for every tool — standard, hyperfocused, and the CLI all route
|
|
204
|
+
* through handleToolCall, which calls this once before scope derivation + Zod (issue #360).
|
|
205
|
+
* Exported for unit tests (the include-drop + strip behavior). */
|
|
206
|
+
export function normalizeTypeArgsForValidation(toolName, args) {
|
|
207
|
+
const cleaned = stripLlmEmptyValues(args);
|
|
208
|
+
switch (toolName) {
|
|
209
|
+
case 'SAPRead':
|
|
210
|
+
return {
|
|
211
|
+
...cleaned,
|
|
212
|
+
type: normalizeObjectType(String(cleaned.type ?? '')),
|
|
213
|
+
objectType: cleaned.objectType === undefined ? undefined : normalizeObjectType(String(cleaned.objectType ?? '')),
|
|
214
|
+
};
|
|
215
|
+
case 'SAPWrite': {
|
|
216
|
+
// SAPWrite preserves TABL/DT and TABL/DS so the create path can route by subtype.
|
|
217
|
+
const normType = cleaned.type === undefined ? undefined : normalizeWriteObjectType(String(cleaned.type ?? ''));
|
|
218
|
+
// Drop an inapplicable `include`: it is only meaningful for a CLAS local-include
|
|
219
|
+
// write (update/edit_method/edit_class_definition). GPT/OpenAI callers frequently
|
|
220
|
+
// attach include="definitions" to unrelated writes (DDLS/PROG/DTEL/delete/batch_create),
|
|
221
|
+
// which validateSapWriteInput would otherwise hard-reject even though the requested
|
|
222
|
+
// intent is valid. A garbage include VALUE on a real CLAS include path is still
|
|
223
|
+
// rejected by the z.enum check downstream (issue #360).
|
|
224
|
+
const action = String(cleaned.action ?? '');
|
|
225
|
+
const includeApplies = normType === 'CLAS' && (action === 'update' || action === 'edit_method' || action === 'edit_class_definition');
|
|
226
|
+
if (!includeApplies)
|
|
227
|
+
delete cleaned.include;
|
|
228
|
+
return {
|
|
229
|
+
...cleaned,
|
|
230
|
+
type: normType,
|
|
231
|
+
objects: Array.isArray(cleaned.objects)
|
|
232
|
+
? cleaned.objects.map((obj) => typeof obj === 'object' && obj !== null
|
|
233
|
+
? {
|
|
234
|
+
...obj,
|
|
235
|
+
type: normalizeWriteObjectType(String(obj.type ?? '')),
|
|
236
|
+
}
|
|
237
|
+
: obj)
|
|
238
|
+
: cleaned.objects,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
case 'SAPActivate':
|
|
242
|
+
return {
|
|
243
|
+
...cleaned,
|
|
244
|
+
type: cleaned.type === undefined ? undefined : normalizeObjectType(String(cleaned.type ?? '')),
|
|
245
|
+
objects: Array.isArray(cleaned.objects)
|
|
246
|
+
? cleaned.objects.map((obj) => typeof obj === 'object' && obj !== null
|
|
247
|
+
? {
|
|
248
|
+
...obj,
|
|
249
|
+
type: normalizeObjectType(String(obj.type ?? '')),
|
|
250
|
+
}
|
|
251
|
+
: obj)
|
|
252
|
+
: cleaned.objects,
|
|
253
|
+
};
|
|
254
|
+
case 'SAPSearch':
|
|
255
|
+
return {
|
|
256
|
+
...cleaned,
|
|
257
|
+
objectType: cleaned.objectType === undefined ? undefined : normalizeObjectType(String(cleaned.objectType ?? '')),
|
|
258
|
+
};
|
|
259
|
+
case 'SAPNavigate':
|
|
260
|
+
// Only normalize `type` (for URL building). `objectType` is passed to SAP's
|
|
261
|
+
// where-used scope API in slash format (e.g., CLAS/OC) — normalizing it would break the filter.
|
|
262
|
+
return {
|
|
263
|
+
...cleaned,
|
|
264
|
+
type: cleaned.type === undefined ? undefined : normalizeObjectType(String(cleaned.type ?? '')),
|
|
265
|
+
};
|
|
266
|
+
case 'SAPDiagnose':
|
|
267
|
+
return {
|
|
268
|
+
...cleaned,
|
|
269
|
+
type: cleaned.type === undefined ? undefined : normalizeObjectType(String(cleaned.type ?? '')),
|
|
270
|
+
};
|
|
271
|
+
case 'SAPContext':
|
|
272
|
+
return {
|
|
273
|
+
...cleaned,
|
|
274
|
+
type: cleaned.type === undefined ? undefined : normalizeObjectType(String(cleaned.type ?? '')),
|
|
275
|
+
};
|
|
276
|
+
case 'SAPTransport':
|
|
277
|
+
// Normalize `type` for SAPTransport actions that route through
|
|
278
|
+
// objectBasePath (e.g. when a future action accepts a slash-form
|
|
279
|
+
// workbench type). Codex review of PR #223 flagged this gap: without
|
|
280
|
+
// normalization, a caller passing `type: 'FUNC/FM'` would slip past the
|
|
281
|
+
// string-typed schema and hit the slash-form throw inside objectBasePath,
|
|
282
|
+
// which is correct as a last-resort fence but not as a friendly error.
|
|
283
|
+
return {
|
|
284
|
+
...cleaned,
|
|
285
|
+
type: cleaned.type === undefined ? undefined : normalizeObjectType(String(cleaned.type ?? '')),
|
|
286
|
+
};
|
|
287
|
+
default:
|
|
288
|
+
return cleaned;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Base path for an object type. Returns path prefix without trailing name segment.
|
|
293
|
+
* Exported for tests (Plan A Task 4 — exhaustiveness guard regression test).
|
|
294
|
+
*/
|
|
295
|
+
export function objectBasePath(type) {
|
|
296
|
+
switch (type) {
|
|
297
|
+
case 'PROG':
|
|
298
|
+
return '/sap/bc/adt/programs/programs/';
|
|
299
|
+
case 'CLAS':
|
|
300
|
+
return '/sap/bc/adt/oo/classes/';
|
|
301
|
+
case 'INTF':
|
|
302
|
+
return '/sap/bc/adt/oo/interfaces/';
|
|
303
|
+
case 'FUNC':
|
|
304
|
+
// Codex review of PR #223 follow-up: function modules cannot be
|
|
305
|
+
// addressed with a single base path — they live at
|
|
306
|
+
// /sap/bc/adt/functions/groups/{group}/fmodules/{fm} and require the
|
|
307
|
+
// parent function group. Returning the group prefix for FUNC was the
|
|
308
|
+
// pre-PR behaviour and silently mis-routed a real ADT search result
|
|
309
|
+
// `{ type: "FUGR/FF", name: "BAPI_USER_GETLIST" }` (which now
|
|
310
|
+
// canonicalises to FUNC) to /functions/groups/BAPI_USER_GETLIST. Throw
|
|
311
|
+
// so generic URL builders (SAPActivate / SAPDiagnose / SAPTransport via
|
|
312
|
+
// objectUrlForType) fail loudly. SAPRead and SAPNavigate handle FUNC
|
|
313
|
+
// through dedicated `case 'FUNC'` branches that take a `group` arg and
|
|
314
|
+
// build the correct URL via client.getFunction(group, name) — those
|
|
315
|
+
// paths do not call objectBasePath and remain unaffected.
|
|
316
|
+
throw new Error(`objectBasePath: type 'FUNC' (function module) cannot be resolved to a ` +
|
|
317
|
+
`single base path — it requires the parent function group via ` +
|
|
318
|
+
`client.getFunction(group, name) or an explicit /sap/bc/adt/functions/` +
|
|
319
|
+
`groups/{group}/fmodules/{name} URI. Caller must take the FUNC-aware ` +
|
|
320
|
+
`path or pass 'uri' directly. See PR #223 codex follow-up.`);
|
|
321
|
+
case 'INCL':
|
|
322
|
+
return '/sap/bc/adt/programs/includes/';
|
|
323
|
+
case 'FUGR':
|
|
324
|
+
return '/sap/bc/adt/functions/groups/';
|
|
325
|
+
case 'DDLS':
|
|
326
|
+
return '/sap/bc/adt/ddic/ddl/sources/';
|
|
327
|
+
case 'DCLS':
|
|
328
|
+
return '/sap/bc/adt/acm/dcl/sources/';
|
|
329
|
+
case 'BDEF':
|
|
330
|
+
return '/sap/bc/adt/bo/behaviordefinitions/';
|
|
331
|
+
case 'SRVD':
|
|
332
|
+
return '/sap/bc/adt/ddic/srvd/sources/';
|
|
333
|
+
case 'DDLX':
|
|
334
|
+
return '/sap/bc/adt/ddic/ddlx/sources/';
|
|
335
|
+
case 'SRVB':
|
|
336
|
+
return '/sap/bc/adt/businessservices/bindings/';
|
|
337
|
+
case 'TABL':
|
|
338
|
+
case 'TABL/DT':
|
|
339
|
+
// Bare TABL defaults to transparent table. For reads, callers should use
|
|
340
|
+
// AdtClient.resolveTablObjectUrl(name) which falls back to /structures/ on 404.
|
|
341
|
+
return '/sap/bc/adt/ddic/tables/';
|
|
342
|
+
case 'TABL/DS':
|
|
343
|
+
// DDIC structures only route through this collection; see follow-up to #285.
|
|
344
|
+
return '/sap/bc/adt/ddic/structures/';
|
|
345
|
+
case 'DOMA':
|
|
346
|
+
return '/sap/bc/adt/ddic/domains/';
|
|
347
|
+
case 'DTEL':
|
|
348
|
+
return '/sap/bc/adt/ddic/dataelements/';
|
|
349
|
+
case 'MSAG':
|
|
350
|
+
return '/sap/bc/adt/messageclass/';
|
|
351
|
+
case 'DEVC':
|
|
352
|
+
return '/sap/bc/adt/packages/';
|
|
353
|
+
case 'TRAN':
|
|
354
|
+
// VIT generic-object endpoint. The 'trant' infix is the ADT workbench type
|
|
355
|
+
// for transactions; live a4h + npl 2026-05-08 confirm GET with this prefix
|
|
356
|
+
// returns 200 for SE38/SU01.
|
|
357
|
+
return '/sap/bc/adt/vit/wb/object_type/trant/object_name/';
|
|
358
|
+
case 'VIEW':
|
|
359
|
+
// VIT generic-object endpoint for DDIC views. /sap/bc/adt/ddic/views/
|
|
360
|
+
// returns HTTP 500 on a4h + npl (verified 2026-05-08); only the VIT URL
|
|
361
|
+
// works. Without this case, VIEW reads silently fell through to
|
|
362
|
+
// /programs/programs/ — see research/abap-types/types/view.md.
|
|
363
|
+
return '/sap/bc/adt/vit/wb/object_type/viewdv/object_name/';
|
|
364
|
+
case 'SKTD':
|
|
365
|
+
return '/sap/bc/adt/documentation/ktd/documents/';
|
|
366
|
+
default:
|
|
367
|
+
// Exhaustiveness guard: canonical types in KNOWN_BASE_TYPES MUST have a
|
|
368
|
+
// switch case — that catches the silent-fallthrough bug class (VIEW pre-PR).
|
|
369
|
+
if (KNOWN_BASE_TYPES.has(type)) {
|
|
370
|
+
throw new Error(`objectBasePath: canonical type '${type}' is in KNOWN_BASE_TYPES but ` +
|
|
371
|
+
`has no switch case. Add a case here or remove it from KNOWN_BASE_TYPES. ` +
|
|
372
|
+
`See docs/plans/completed/audit-purge-invented-adt-types.md.`);
|
|
373
|
+
}
|
|
374
|
+
// Slash-form guard: a normalized slash code (e.g. 'FUNC/FM', 'CLAS/LI',
|
|
375
|
+
// 'VIEW/V', 'TRAN/O') must NEVER reach here. If it did, normalizeObjectType
|
|
376
|
+
// failed to map it and we'd silently route the request to the program
|
|
377
|
+
// endpoint. Tools like SAPNavigate/SAPActivate/SAPDiagnose/SAPTransport
|
|
378
|
+
// accept `type: string` (no enum), so the schema layer can't catch this
|
|
379
|
+
// for them — only this guard can. Throw with a hint pointing at the
|
|
380
|
+
// citation guard so the contributor adds the alias correctly. Codex
|
|
381
|
+
// review of PR #223 caught that the previous default-fallback could
|
|
382
|
+
// still silently route removed aliases via these non-enum tools.
|
|
383
|
+
if (type.includes('/')) {
|
|
384
|
+
throw new Error(`objectBasePath: refusing to build URL for slash-form type '${type}' — ` +
|
|
385
|
+
`this normally indicates an invented or unmapped ADT slash code. Add ` +
|
|
386
|
+
`it to SLASH_TYPE_MAP + SLASH_TYPE_EVIDENCE (with a research entry) ` +
|
|
387
|
+
`if it is real, or correct the caller. See ` +
|
|
388
|
+
`docs/plans/completed/audit-purge-invented-adt-types.md and ` +
|
|
389
|
+
`tests/unit/handlers/slash-type-map.test.ts.`);
|
|
390
|
+
}
|
|
391
|
+
// Unknown raw inputs (no slash, not canonical) fall through to the
|
|
392
|
+
// program path so legacy callers like inferObjectType keep working.
|
|
393
|
+
return '/sap/bc/adt/programs/programs/';
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
/** Map object type + name to the ADT object URL used by CRUD/DevTools/etc. Name is URI-encoded. */
|
|
397
|
+
export function objectUrlForType(type, name) {
|
|
398
|
+
// KTD endpoints require lowercase object names in the URL path (confirmed via Eclipse ADT trace).
|
|
399
|
+
const effectiveName = type === 'SKTD' ? name.toLowerCase() : name;
|
|
400
|
+
return `${objectBasePath(type)}${encodeURIComponent(effectiveName)}`;
|
|
401
|
+
}
|
|
402
|
+
/** Infer SAP object type from naming conventions. Returns empty string if type cannot be determined. */
|
|
403
|
+
export function inferObjectType(name) {
|
|
404
|
+
const upper = name.toUpperCase();
|
|
405
|
+
if (upper.startsWith('IF_') || upper.startsWith('ZIF_') || upper.startsWith('YIF_'))
|
|
406
|
+
return 'INTF';
|
|
407
|
+
if (upper.startsWith('CL_') || upper.startsWith('ZCL_') || upper.startsWith('YCL_'))
|
|
408
|
+
return 'CLAS';
|
|
409
|
+
if (upper.startsWith('CX_') || upper.startsWith('ZCX_') || upper.startsWith('YCX_'))
|
|
410
|
+
return 'CLAS';
|
|
411
|
+
return '';
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Map object type + name to the ADT object URL WITHOUT encoding the name.
|
|
415
|
+
* Used for API release state where the full URI is encoded as a single path segment by the caller.
|
|
416
|
+
*/
|
|
417
|
+
export function objectUrlForTypeRaw(type, name) {
|
|
418
|
+
const effectiveName = type === 'SKTD' ? name.toLowerCase() : name;
|
|
419
|
+
return `${objectBasePath(type)}${effectiveName}`;
|
|
420
|
+
}
|
|
421
|
+
/** Get the source URL for an object (appends /source/main) */
|
|
422
|
+
export function sourceUrlForType(type, name) {
|
|
423
|
+
return `${objectUrlForType(type, name)}/source/main`;
|
|
424
|
+
}
|
|
425
|
+
export const CLASS_WRITE_INCLUDES = [
|
|
426
|
+
'definitions',
|
|
427
|
+
'implementations',
|
|
428
|
+
'macros',
|
|
429
|
+
'testclasses',
|
|
430
|
+
];
|
|
431
|
+
/** Get a CLAS include URL (definitions/implementations/macros/testclasses) */
|
|
432
|
+
export function classIncludeUrl(name, include) {
|
|
433
|
+
return `/sap/bc/adt/oo/classes/${encodeURIComponent(name)}/includes/${include}`;
|
|
434
|
+
}
|
|
435
|
+
export function normalizeClassWriteInclude(include) {
|
|
436
|
+
if (typeof include !== 'string')
|
|
437
|
+
return undefined;
|
|
438
|
+
const normalized = include.toLowerCase();
|
|
439
|
+
return CLASS_WRITE_INCLUDES.includes(normalized) ? normalized : undefined;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Auto-detect which class include a method specifier targets, based on the
|
|
443
|
+
* local-class prefix on the LHS of `<localclass>~<method>`. Used by
|
|
444
|
+
* `edit_method` so callers can pass `lhc_project~approve_project` and have
|
|
445
|
+
* ARC-1 transparently route the read+write to `/includes/implementations`
|
|
446
|
+
* instead of `/source/main`.
|
|
447
|
+
*
|
|
448
|
+
* Prefix → include mapping (intentionally narrow; extend via explicit
|
|
449
|
+
* `include` parameter when a code-base uses other conventions):
|
|
450
|
+
* - `lhc_*` → implementations (RAP behavior pool handler classes)
|
|
451
|
+
* - `lcl_*` → implementations (local helper classes)
|
|
452
|
+
* - `ltc_*` → testclasses (ABAP Unit local test classes)
|
|
453
|
+
*
|
|
454
|
+
* Returns `undefined` for:
|
|
455
|
+
* - Specifiers with no `~` (route to MAIN)
|
|
456
|
+
* - Global-interface methods like `zif_order~create`, `if_oo_adt_classrun~main`
|
|
457
|
+
* (route to MAIN — the impl lives in a global class)
|
|
458
|
+
* - `lif_*` local interfaces (interfaces only declare methods — there's no
|
|
459
|
+
* impl in CCDEF; an `lhc_*`/`lcl_*` class implements them and the call
|
|
460
|
+
* site uses that class's prefix instead)
|
|
461
|
+
*/
|
|
462
|
+
export function detectLocalHandlerInclude(method) {
|
|
463
|
+
if (!method.includes('~'))
|
|
464
|
+
return undefined;
|
|
465
|
+
const lhs = method.slice(0, method.indexOf('~')).trim().toLowerCase();
|
|
466
|
+
if (/^(lhc|lcl)_/.test(lhs))
|
|
467
|
+
return 'implementations';
|
|
468
|
+
if (/^ltc_/.test(lhs))
|
|
469
|
+
return 'testclasses';
|
|
470
|
+
return undefined;
|
|
471
|
+
}
|
|
472
|
+
/** Strip the leading "=== <include> ===\n" header that `client.getClass(name, include)` prepends. */
|
|
473
|
+
export function stripIncludeHeader(source) {
|
|
474
|
+
return source.replace(/^=== \w+ ===\n/, '');
|
|
475
|
+
}
|
|
476
|
+
//# sourceMappingURL=object-types.js.map
|
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IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,iBAAiB,CAAC;IACtD,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,aAAa,CAAC;IAC5C,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,OAAO,MAAM,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SAPQuery handler — freestyle SQL execution with IN-list chunking + SQL literal parsing.
|
|
3
|
+
*/
|
|
4
|
+
import type { AdtClient } from '../adt/client.js';
|
|
5
|
+
import { type ToolResult } from './shared.js';
|
|
6
|
+
export declare function handleSAPQuery(client: AdtClient, args: Record<string, unknown>): Promise<ToolResult>;
|
|
7
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/handlers/query.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAsC,KAAK,UAAU,EAAc,MAAM,aAAa,CAAC;AAkK9F,wBAAsB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CA8C1G"}
|