arc-1 0.9.21 → 0.9.23
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/adt/client.d.ts +29 -2
- package/dist/adt/client.d.ts.map +1 -1
- package/dist/adt/client.js +59 -4
- package/dist/adt/client.js.map +1 -1
- package/dist/adt/config.d.ts +7 -0
- package/dist/adt/config.d.ts.map +1 -1
- package/dist/adt/config.js.map +1 -1
- package/dist/adt/crud.d.ts +8 -3
- package/dist/adt/crud.d.ts.map +1 -1
- package/dist/adt/crud.js +38 -8
- package/dist/adt/crud.js.map +1 -1
- package/dist/adt/ddic-xml.d.ts +11 -2
- package/dist/adt/ddic-xml.d.ts.map +1 -1
- package/dist/adt/ddic-xml.js +24 -7
- package/dist/adt/ddic-xml.js.map +1 -1
- package/dist/adt/diagnostics.d.ts +11 -0
- package/dist/adt/diagnostics.d.ts.map +1 -1
- package/dist/adt/diagnostics.js +25 -2
- package/dist/adt/diagnostics.js.map +1 -1
- package/dist/adt/errors.d.ts +1 -1
- package/dist/adt/errors.d.ts.map +1 -1
- package/dist/adt/errors.js +50 -0
- package/dist/adt/errors.js.map +1 -1
- package/dist/adt/features.d.ts +2 -2
- package/dist/adt/features.d.ts.map +1 -1
- package/dist/adt/features.js +4 -3
- package/dist/adt/features.js.map +1 -1
- package/dist/adt/fm-signature.d.ts +1 -1
- package/dist/adt/fm-signature.js +1 -1
- package/dist/adt/http.d.ts +6 -0
- package/dist/adt/http.d.ts.map +1 -1
- package/dist/adt/http.js +10 -0
- package/dist/adt/http.js.map +1 -1
- package/dist/adt/structure-hierarchy.d.ts +41 -0
- package/dist/adt/structure-hierarchy.d.ts.map +1 -0
- package/dist/adt/structure-hierarchy.js +194 -0
- package/dist/adt/structure-hierarchy.js.map +1 -0
- package/dist/adt/version-diff.d.ts +2 -0
- package/dist/adt/version-diff.d.ts.map +1 -1
- package/dist/adt/version-diff.js +3 -1
- package/dist/adt/version-diff.js.map +1 -1
- package/dist/authz/policy.d.ts.map +1 -1
- package/dist/authz/policy.js +1 -0
- package/dist/authz/policy.js.map +1 -1
- package/dist/cache/caching-layer.d.ts +17 -0
- package/dist/cache/caching-layer.d.ts.map +1 -1
- package/dist/cache/caching-layer.js +92 -0
- package/dist/cache/caching-layer.js.map +1 -1
- package/dist/cli.js +3 -4
- package/dist/cli.js.map +1 -1
- package/dist/handlers/activate.d.ts.map +1 -1
- package/dist/handlers/activate.js +65 -3
- package/dist/handlers/activate.js.map +1 -1
- package/dist/handlers/context.d.ts.map +1 -1
- package/dist/handlers/context.js +11 -1
- package/dist/handlers/context.js.map +1 -1
- package/dist/handlers/dispatch.js +1 -1
- package/dist/handlers/dispatch.js.map +1 -1
- package/dist/handlers/manage.d.ts.map +1 -1
- package/dist/handlers/manage.js +24 -4
- package/dist/handlers/manage.js.map +1 -1
- package/dist/handlers/object-types.d.ts +1 -1
- package/dist/handlers/object-types.js +54 -54
- package/dist/handlers/object-types.js.map +1 -1
- package/dist/handlers/read.d.ts.map +1 -1
- package/dist/handlers/read.js +19 -5
- package/dist/handlers/read.js.map +1 -1
- package/dist/handlers/schemas.d.ts +12 -3
- package/dist/handlers/schemas.d.ts.map +1 -1
- package/dist/handlers/schemas.js +12 -3
- package/dist/handlers/schemas.js.map +1 -1
- package/dist/handlers/tool-registry.d.ts +2 -2
- package/dist/handlers/tool-registry.d.ts.map +1 -1
- package/dist/handlers/tool-registry.js +4 -3
- package/dist/handlers/tool-registry.js.map +1 -1
- package/dist/handlers/tools.d.ts +4 -1
- package/dist/handlers/tools.d.ts.map +1 -1
- package/dist/handlers/tools.js +191 -272
- package/dist/handlers/tools.js.map +1 -1
- package/dist/handlers/write/create.d.ts.map +1 -1
- package/dist/handlers/write/create.js +30 -9
- package/dist/handlers/write/create.js.map +1 -1
- package/dist/handlers/write/rap.js +2 -2
- package/dist/handlers/write/rap.js.map +1 -1
- package/dist/handlers/write/update-delete.d.ts.map +1 -1
- package/dist/handlers/write/update-delete.js +5 -2
- package/dist/handlers/write/update-delete.js.map +1 -1
- package/dist/handlers/write-helpers.d.ts +20 -3
- package/dist/handlers/write-helpers.d.ts.map +1 -1
- package/dist/handlers/write-helpers.js +59 -4
- package/dist/handlers/write-helpers.js.map +1 -1
- package/dist/plugins/manifest-interpreter.js +1 -1
- package/dist/plugins/manifest-interpreter.js.map +1 -1
- package/dist/probe/catalog.js +2 -2
- package/dist/probe/catalog.js.map +1 -1
- package/dist/public/index.js +1 -1
- package/dist/public/index.js.map +1 -1
- package/dist/public/testing.js +1 -1
- package/dist/public/testing.js.map +1 -1
- package/dist/public/types.js +1 -1
- package/dist/public/types.js.map +1 -1
- package/dist/registry/tool-registry.js +1 -1
- package/dist/registry/tool-registry.js.map +1 -1
- package/dist/server/config.d.ts.map +1 -1
- package/dist/server/config.js +12 -0
- package/dist/server/config.js.map +1 -1
- package/dist/server/plugin-loader.js +1 -1
- package/dist/server/plugin-loader.js.map +1 -1
- package/dist/server/safe-http-client.js +1 -1
- package/dist/server/safe-http-client.js.map +1 -1
- package/dist/server/server.d.ts +22 -3
- package/dist/server/server.d.ts.map +1 -1
- package/dist/server/server.js +79 -11
- package/dist/server/server.js.map +1 -1
- package/dist/server/types.d.ts +4 -0
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/types.js +1 -0
- package/dist/server/types.js.map +1 -1
- package/dist/server/ui.js +1 -1
- package/dist/server/ui.js.map +1 -1
- package/package.json +4 -4
package/dist/handlers/tools.js
CHANGED
|
@@ -57,55 +57,37 @@ function isBtpMode(config) {
|
|
|
57
57
|
// ─── SAPRead Types ──────────────────────────────────────────────────
|
|
58
58
|
/** All SAPRead types available on on-premise */
|
|
59
59
|
/** SAPRead types available on BTP ABAP Environment (no PROG, INCL, VIEW, TEXT_ELEMENTS, VARIANTS) */
|
|
60
|
-
const SAPREAD_DESC_ONPREM = 'Read SAP ABAP objects
|
|
61
|
-
'
|
|
62
|
-
'
|
|
63
|
-
|
|
64
|
-
'Optional
|
|
65
|
-
|
|
60
|
+
const SAPREAD_DESC_ONPREM = 'Read SAP ABAP objects — exact raw source, a method body, grep output, inactive drafts, revision history, or metadata. For "what does this object do?", explanations, spec work, reviews, or pre-change orientation, prefer SAPContext first (intent-level context before raw source). ' +
|
|
61
|
+
'Types: PROG, CLAS, INTF, FUNC, FUGR (expand_includes=true for all include sources), INCL, DDLS, DCLS, DDLX, BDEF, SRVD, SRVB, SKTD/KTD (KTD aliases SKTD), TABL (covers both transparent tables AND DDIC structures — no separate STRU type), VIEW, DOMA, DTEL, TRAN, TABLE_CONTENTS (single-column filter), TABLE_QUERY (multi-column WHERE via the freestyle endpoint; gated by allowDataPreview; CDS views need SAP_BASIS 752+), DEVC, SOBJ (BOR — method param reads one method), SYSTEM, COMPONENTS, MSAG, TEXT_ELEMENTS, VARIANTS, BSP, BSP_DEPLOY, API_STATE (contract states C0-C4; objectType for non-class), INACTIVE_OBJECTS (no name; pending-activation list), AUTH, FEATURE_TOGGLE, ENHO, VERSIONS, VERSION_SOURCE. AUTH/FEATURE_TOGGLE/ENHO/VERSIONS/VERSION_SOURCE are on-prem only. ' +
|
|
62
|
+
'CLAS: to save tokens, prefer method="*" (all signatures), method="NAME" (one body, ~95% fewer tokens than the full class), or grep over reading the full source. Omit include for the full source, or include=definitions|implementations|macros|testclasses for a local section. Full per-type detail: docs_page SAPRead. ' +
|
|
63
|
+
'Optional grep: case-insensitive regex returning only matching source lines (+context, line numbers); for CLAS, matches are annotated with the owning class/method. ' +
|
|
64
|
+
'Optional version parameter (default "active"): "inactive" reads the user\'s draft, "auto" the developer view. Active reads note when an inactive draft exists.';
|
|
65
|
+
const SAPREAD_DESC_BTP = 'Read SAP ABAP objects (BTP ABAP Environment) — exact raw source, a method body, grep output, inactive drafts, or metadata. For "what does this object do?", explanations, spec work, reviews, or pre-change orientation, prefer SAPContext first (intent-level context before raw source). ' +
|
|
66
|
+
'Types: CLAS, INTF, FUNC (released/custom only), FUGR (released/custom only), DDLS (primary data model on BTP), DCLS, DDLX, BDEF, SRVD, SRVB, SKTD/KTD (KTD aliases SKTD), TABL (custom tables AND structures — no separate STRU type), DOMA, DTEL, TABLE_CONTENTS (custom tables + released CDS only; standard tables blocked), TABLE_QUERY (multi-column WHERE on custom tables + released CDS; needs SAP_BASIS 752+), DEVC, SYSTEM, COMPONENTS, MSAG (custom only), BSP, BSP_DEPLOY, API_STATE (contract states C0-C4; objectType for non-class), INACTIVE_OBJECTS (no name; pending-activation list). PROG/INCL/VIEW/TRAN/TEXT_ELEMENTS/VARIANTS and VERSIONS/VERSION_SOURCE are not available on BTP (use CLAS with IF_OO_ADT_CLASSRUN for console apps, DDLS for data models). ' +
|
|
67
|
+
'CLAS: to save tokens, prefer method="*" (all signatures), method="NAME" (one body, ~95% fewer tokens than the full class), or grep over reading the full source. Omit include for the full source, or include=definitions|implementations|macros|testclasses for a local section. Full per-type detail: docs_page SAPRead. ' +
|
|
68
|
+
'Optional grep: case-insensitive regex returning only matching source lines (+context, line numbers); for CLAS, matches are annotated with the owning class/method. ' +
|
|
69
|
+
'Optional version parameter (default "active"): "inactive" reads the user\'s draft, "auto" the developer view.';
|
|
66
70
|
// ─── SAPWrite Types ─────────────────────────────────────────────────
|
|
67
71
|
const SAPWRITE_DESC_ONPREM = 'Create or update ABAP source code and DDIC metadata. Handles lock/modify/unlock automatically. Supports PROG, CLAS, INTF, FUNC, FUGR, INCL, DDLS, DCLS, DDLX, BDEF, SRVD, SRVB, SKTD/KTD, TABL, TABL/DT, TABL/DS, DOMA, DTEL, MSAG. ' +
|
|
68
|
-
'Type codes are auto-normalized and case-insensitive (e.g., "CLAS/OC" → "CLAS"). ' +
|
|
69
|
-
'
|
|
70
|
-
'
|
|
71
|
-
'
|
|
72
|
-
'
|
|
73
|
-
'
|
|
74
|
-
'
|
|
75
|
-
'
|
|
76
|
-
'
|
|
77
|
-
'
|
|
78
|
-
'SKTD/KTD (Knowledge Transfer Documents, Markdown docs attached to a KTD-capable ABAP object; KTD is a friendly alias for SKTD): create requires refObjectType (parent ADT type+subtype, e.g., "DDLS/DF", "BDEF/BDO", "SRVD/SRV", "SRVB/SVB", "DEVC/K"). Do not use CLAS/OC, INTF/OI, or PROG/P; use ABAP Doc for code objects. A KTD inherits the name of the object it documents — so "name" MUST equal the parent object name (one KTD per object; refObjectName defaults to name and cannot differ). Update takes Markdown in "source"; delete uses the ADT deletion framework (two-step check/delete). Follow creates/updates with SAPActivate(type="SKTD", name="..."). ' +
|
|
79
|
-
'FUGR (function groups): create with package; serves as the parent container for FUNC. Delete the FUGR after deleting all its FMs. ' +
|
|
80
|
-
'FUNC (function modules): require "group" parameter — the parent FUGR must exist (create it first via SAPWrite type=FUGR). Pass structured `parameters` array to manage FM signatures (IMPORTING/EXPORTING/CHANGING/TABLES/EXCEPTIONS/RAISING). Example: parameters=[{kind:"importing",name:"IV_X",type:"STRING",byValue:true},{kind:"exporting",name:"EV_Y",type:"STRING",byValue:true},{kind:"raising",name:"CX_ROOT"}]. Use SAPRead(type=FUNC, includeSignature=true) to read parameters back as structured JSON. SAPGUI-style *"...IMPORTING..."* parameter comment blocks in source are stripped before PUT as defense-in-depth (SAP rejects them with FUNC_ADT028); a warning is appended in that case. ' +
|
|
81
|
-
'For edit_method: surgically replace a single method body in a CLAS without sending the full class source. ' +
|
|
82
|
-
'Provide just the new method implementation code in "source" — 95% fewer tokens than full-class updates. ' +
|
|
83
|
-
'For local handler classes inside a class include (RAP behavior pools, local helpers, test classes), pass the qualified specifier "lhc_project~approve_project" — ARC-1 routes the read+write to /includes/implementations automatically. ' +
|
|
84
|
-
'Auto-detection prefixes: lhc_*/lcl_* → implementations, ltc_* → testclasses. Override with include="definitions"|"implementations"|"macros"|"testclasses" for explicit control. ' +
|
|
85
|
-
'Global-interface methods like "zif_order~create" continue to use /source/main. ' +
|
|
86
|
-
'For batch_create: create and activate multiple objects in a single call — ideal for RAP stacks (TABL → DDLS → DCLS → BDEF → SRVD). Pass "objects" array with dependency order. ' +
|
|
87
|
-
'For scaffold_rap_handlers: derive missing RAP behavior handler signatures from an interface BDEF and optionally create missing lhc_* skeletons plus inject declarations and empty implementation stubs into an existing behavior pool class. ' +
|
|
88
|
-
'For generate_behavior_implementation: one-shot RAP behavior pool — auto-discover the bound BDEF via class metadata (rootEntityRef), scaffold every required handler (creating lhc_<alias> skeletons when missing), write under one lock, and (by default) activate. Reliable equivalent of Eclipse ADT\'s "Generate Behavior Implementation" Cmd+1 quickfix without the broken /sap/bc/adt/quickfixes/proposals/.../create_class_implementation server endpoint. ' +
|
|
89
|
-
'Server-driven objects (ABAP Platform 2025 / SAP_BASIS 8.16+, discovery-gated): DESD (CDS Logical External Schema), DTSC (CDS Static Cache), CSNM (CSN Model), EVTB (RAP Event Binding), EVTO (RAP Event Object), COTA (Communication Target). For these, create/update/delete operate on the generic AFF blue:blueSource object — pass the AFF JSON in "source" (e.g. {"formatVersion":"1","header":{...}}); create leaves the object inactive, so follow with SAPActivate. On pre-8.16 systems these types return a clean "requires SAP_BASIS 8.16+" error.';
|
|
72
|
+
'Type codes are auto-normalized and case-insensitive (e.g., "CLAS/OC" → "CLAS"). For delete, only type and name are required (plus optional transport). ' +
|
|
73
|
+
'Source objects (PROG/CLAS/INTF/DDLS/DCLS/DDLX/BDEF/SRVD/TABL/INCL) write via /source/main. CLAS update: pass include=definitions|implementations|macros|testclasses to write a local include; omit for source/main. ' +
|
|
74
|
+
'TABL create: "TABL"/"TABL/DT" → transparent table (16-char name); "TABL/DS" → structure (30-char, namespaces OK); update/delete/activate auto-discover the subtype. ' +
|
|
75
|
+
'Metadata-XML writes (not /source/main): DOMA/DTEL (dataType, length, fixedValues, typeKind, labels, searchHelp); MSAG (messages array of {number, shortText}); SRVB (serviceDefinition, odataVersion V2/V4, optional category 0=UI/1=Web API; bindingType like "ODataV4-UI" auto-normalized). ' +
|
|
76
|
+
'SKTD/KTD (Markdown docs on a KTD-capable object; KTD aliases SKTD): create needs refObjectType (parent type+subtype, e.g. "DDLS/DF"); "name" MUST equal the parent name; update takes Markdown in source; then SAPActivate(type="SKTD"). ' +
|
|
77
|
+
'FUNC: require "group" (parent FUGR must exist — create it first); pass structured `parameters` for the signature (read back via SAPRead includeSignature=true). ' +
|
|
78
|
+
'edit_method: replace one CLAS method body via source (95% fewer tokens than full-class). Local-class methods use the qualified specifier (e.g. "lhc_project~approve_project"); auto-routing: lhc_*/lcl_* → implementations, ltc_* → testclasses (override with include=); zif_*~* stays on /source/main. ' +
|
|
79
|
+
'batch_create: create+activate multiple objects in dependency order via the "objects" array (RAP stacks TABL→DDLS→DCLS→BDEF→SRVD). scaffold_rap_handlers / generate_behavior_implementation: derive RAP behavior-pool handlers from the BDEF (the latter auto-discovers the BDEF via rootEntityRef and activates by default). ' +
|
|
80
|
+
'Server-driven objects (SAP_BASIS 8.16+, discovery-gated): DESD, DTSC, CSNM, EVTB, EVTO, COTA — create/update/delete with AFF JSON in "source", then SAPActivate; pre-8.16 returns a clean "requires 8.16+" error. ' +
|
|
81
|
+
'Full per-type field reference: docs_page SAPWrite. ';
|
|
90
82
|
const SAPWRITE_DESC_BTP = 'Create or update ABAP source code and DDIC metadata (BTP ABAP Environment). Handles lock/modify/unlock automatically. Supports CLAS, INTF, DDLS, DCLS, DDLX, BDEF, SRVD, SRVB, SKTD/KTD, TABL, TABL/DT, TABL/DS, DOMA, DTEL, MSAG. ' +
|
|
91
|
-
'Type codes are auto-normalized
|
|
92
|
-
'
|
|
93
|
-
'
|
|
94
|
-
'
|
|
95
|
-
'
|
|
96
|
-
'
|
|
97
|
-
'
|
|
98
|
-
'
|
|
99
|
-
'bindingType accepts human-readable values like "ODataV4-UI" which are auto-normalized. ' +
|
|
100
|
-
'SKTD/KTD (Knowledge Transfer Documents, Markdown docs attached to a KTD-capable ABAP object; KTD is a friendly alias for SKTD): create requires refObjectType (parent ADT type+subtype, e.g., "DDLS/DF", "BDEF/BDO", "SRVD/SRV", "SRVB/SVB", "DEVC/K"). Do not use CLAS/OC, INTF/OI, or PROG/P; use ABAP Doc for code objects. A KTD inherits the name of the object it documents — so "name" MUST equal the parent object name (one KTD per object; refObjectName defaults to name and cannot differ). Update takes Markdown in "source"; delete uses the ADT deletion framework (two-step check/delete). Follow creates/updates with SAPActivate(type="SKTD", name="..."). ' +
|
|
101
|
-
'Must use ABAP Cloud language version (no classic statements). Only Z*/Y* namespace allowed on BTP. ' +
|
|
102
|
-
'For edit_method: surgically replace a single method body in a CLAS without sending the full class source. ' +
|
|
103
|
-
'For local handler classes inside a class include (RAP behavior pools, local helpers, test classes), pass the qualified specifier "lhc_project~approve_project" — ARC-1 routes the read+write to /includes/implementations automatically. ' +
|
|
104
|
-
'Auto-detection prefixes: lhc_*/lcl_* → implementations, ltc_* → testclasses. Override with include= for explicit control. ' +
|
|
105
|
-
'For batch_create: create and activate multiple objects in a single call — ideal for RAP stacks (TABL → DDLS → DCLS → BDEF → SRVD). ' +
|
|
106
|
-
'For scaffold_rap_handlers: derive missing RAP behavior handler signatures from an interface BDEF and optionally create missing lhc_* skeletons plus inject declarations and empty implementation stubs into an existing behavior pool class. ' +
|
|
107
|
-
'For generate_behavior_implementation: one-shot RAP behavior pool — auto-discover the bound BDEF via class metadata (rootEntityRef), scaffold every required handler (creating lhc_<alias> skeletons when missing), write under one lock, and (by default) activate. ' +
|
|
108
|
-
'Server-driven objects (8.16+ / ABAP Cloud, discovery-gated): DESD, DTSC, CSNM, EVTB, EVTO, COTA — create/update/delete operate on the generic AFF blue:blueSource object (pass AFF JSON in "source"); create leaves the object inactive, so follow with SAPActivate. Pre-8.16 systems return a clean "requires SAP_BASIS 8.16+" error.';
|
|
83
|
+
'Must use ABAP Cloud language version (no classic statements); only Z*/Y* namespace. Type codes are auto-normalized (e.g. "CLAS/OC" → "CLAS"). For delete, only type and name are required (plus optional transport). ' +
|
|
84
|
+
'Source objects (CLAS/INTF/DDLS/DCLS/DDLX/BDEF/SRVD/TABL) write via /source/main. CLAS update: pass include=definitions|implementations|macros|testclasses for a local include; omit for source/main. ' +
|
|
85
|
+
'Metadata-XML writes (not /source/main): DOMA/DTEL (dataType, length, fixedValues, typeKind, labels, searchHelp); MSAG (messages array of {number, shortText}); SRVB (serviceDefinition, odataVersion V2/V4, optional category 0=UI/1=Web API). ' +
|
|
86
|
+
'SKTD/KTD (Markdown docs on a KTD-capable object; KTD aliases SKTD): create needs refObjectType (e.g. "DDLS/DF"); "name" MUST equal the parent name; update takes Markdown in source; then SAPActivate(type="SKTD"). ' +
|
|
87
|
+
'edit_method: replace one CLAS method body via source. Local-class methods use the qualified specifier (e.g. "lhc_project~approve_project"); auto-routing lhc_*/lcl_* → implementations, ltc_* → testclasses (override with include=). ' +
|
|
88
|
+
'batch_create: create+activate multiple objects in dependency order (RAP stacks TABL→DDLS→DCLS→BDEF→SRVD). scaffold_rap_handlers / generate_behavior_implementation: derive RAP behavior-pool handlers from the BDEF (the latter auto-discovers via rootEntityRef and activates by default). ' +
|
|
89
|
+
'Server-driven objects (8.16+, discovery-gated): DESD, DTSC, CSNM, EVTB, EVTO, COTA — create/update/delete with AFF JSON in "source", then SAPActivate; pre-8.16 returns a clean "requires 8.16+" error. ' +
|
|
90
|
+
'Full per-type field reference: docs_page SAPWrite. ';
|
|
109
91
|
// Prepended to both SAPWrite descriptions. The schema lists every optional field for every
|
|
110
92
|
// object type/action, but each call uses only a small subset — GPT/OpenAI callers tend to
|
|
111
93
|
// fill the rest with empty/null/placeholder values. This steers the model to a minimal first
|
|
@@ -117,103 +99,65 @@ const SAPWRITE_MINIMAL_PAYLOAD_GUIDE = 'MINIMAL PAYLOAD — send ONLY the fields
|
|
|
117
99
|
"delete needs only {action, type, name}; DOMA/DTEL/MSAG/SRVB need {action, type, name} plus that type's own DDIC fields; FUNC also needs group. " +
|
|
118
100
|
'Do NOT send `include` unless type=CLAS, and do NOT send DDIC/metadata fields (dataType, length, decimals, signExists, lowercase, typeKind, domainName, odataVersion, category, version, labels, …) on a source-object or delete call. ';
|
|
119
101
|
// ─── SAPContext Types ───────────────────────────────────────────────
|
|
120
|
-
const SAPCONTEXT_DESC_ONPREM = 'Primary tool for understanding ABAP objects before specs, reviews, explanations, or changes
|
|
121
|
-
|
|
122
|
-
"
|
|
123
|
-
'- "
|
|
124
|
-
'- "What does <object> do?" / "Explain
|
|
125
|
-
'- "Find all callers of <object>" (cache
|
|
126
|
-
'
|
|
127
|
-
'
|
|
128
|
-
'
|
|
129
|
-
'
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
'-
|
|
133
|
-
|
|
134
|
-
'
|
|
135
|
-
'
|
|
136
|
-
'
|
|
137
|
-
'
|
|
138
|
-
'
|
|
139
|
-
const SAPCONTEXT_DESC_BTP = 'Primary tool for understanding ABAP objects before specs, reviews, explanations, or changes (BTP ABAP Environment). Use SAPContext instead of SAPRead when the user asks what a class, interface, or CDS view does. For action="deps" it returns intent/context first: the object KTD when available, then compressed dependency contracts. Use SAPRead later only for exact source, method bodies, grep, drafts, or metadata.\n\n' +
|
|
140
|
-
'Get compressed dependency context or CDS blast-radius impact for an ABAP / CDS object (BTP ABAP Environment).\n\n' +
|
|
141
|
-
"Decision rule — pick the action based on the user's question:\n" +
|
|
142
|
-
'- "What breaks if I change <CDS view>?" / "Who consumes <I_*>?" / "Impact analysis on <DDLS>" / "Blast radius" → action="impact"\n' +
|
|
143
|
-
'- "What does <object> do?" / "Explain <object>" / "Prepare a spec/change/review for <object>" / "Understand dependencies before editing <object>" / "What does X depend on?" → action="deps" (default)\n\n' +
|
|
144
|
-
'action="impact" (CDS blast-radius, DDLS only): ALWAYS use this for CDS change-impact questions. Returns upstream AST dependencies plus downstream where-used results classified into RAP-aware buckets: projectionViews, bdefs, serviceDefinitions, serviceBindings, accessControls (DCLS), metadataExtensions (DDLX), abapConsumers, documentation (SKTD), tables, other. Also emits additive sibling-consistency diagnostics (consistencyHints + siblingExtensionAnalysis) when sibling DDLS variants in the same package show asymmetric metadata-extension coverage. DO NOT replicate this with SAPQuery — the classifier already filters noise. Optional includeIndirect=true widens to transitive consumers. Optional siblingCheck=false disables sibling analysis; siblingMaxCandidates controls fan-out (default 4, hard cap 10).\n\n' +
|
|
145
|
-
'action="deps" (default): Returns the target object KTD first when one exists, then only the public API contracts (method signatures, interface definitions, type declarations) of all objects that the target depends on — NOT the full source code.\n\n' +
|
|
146
|
-
'What deps extracts per dependency:\n' +
|
|
147
|
-
'- Classes: CLASS DEFINITION with PUBLIC SECTION only (methods, types, constants).\n' +
|
|
148
|
-
'- Interfaces: Full interface definition (interfaces are already public contracts).\n' +
|
|
149
|
-
'- CDS views (DDLS): All data sources (tables, other CDS views), association targets, and compositions. ' +
|
|
150
|
-
"Each dependency's full source is included. Essential for CDS unit test generation.\n\n" +
|
|
151
|
-
'On BTP: released SAP objects (CL_ABAP_*, IF_ABAP_*) are included since they form the primary development API surface. ' +
|
|
152
|
-
'Custom objects (Z*, Y*) are also included.\n\n' +
|
|
153
|
-
'Use SAPContext BEFORE writing code that modifies or extends existing objects. Use SAPRead after SAPContext when you need exact source or method-level detail.';
|
|
102
|
+
const SAPCONTEXT_DESC_ONPREM = 'Primary tool for understanding ABAP/CDS objects before specs, reviews, explanations, or changes — use instead of SAPRead when the user asks what an object does. Returns intent first (the object KTD when available) then compressed dependency contracts. Use SAPRead after SAPContext for exact source/method bodies/grep/drafts.\n\n' +
|
|
103
|
+
"Decision rule — pick the action from the user's question:\n" +
|
|
104
|
+
'- "What breaks if I change <CDS>?" / "Who consumes <I_*>?" / "Blast radius" → action="impact" (DDLS only).\n' +
|
|
105
|
+
'- "Which includes/appends extend <TABL>?" → action="structure", type="TABL".\n' +
|
|
106
|
+
'- "What does <object> do?" / "Explain" / "deps before editing" → action="deps" (default).\n' +
|
|
107
|
+
'- "Find all callers of <object>" (needs cache warmup) → action="usages".\n\n' +
|
|
108
|
+
'impact (CDS blast-radius): upstream AST deps + downstream where-used, classified into RAP buckets (projectionViews, bdefs, serviceDefinitions, serviceBindings, accessControls, metadataExtensions, abapConsumers, documentation, tables, other) + sibling-consistency hints. Use this instead of text-scanning DDDDLSRC/ACMDCLSRC with SAPQuery (it filters the noise). Optional includeIndirect, siblingCheck, siblingMaxCandidates.\n' +
|
|
109
|
+
'deps (default): target KTD + the public API contracts of its dependencies (not full source) — one compact response vs N SAPRead calls (7-30x fewer tokens); SAP standard objects filtered out. For CDS, includes dependency DDL/field catalogs for cl_cds_test_environment.\n' +
|
|
110
|
+
'structure (TABL only): the DDIC include/append tree.\n\n' +
|
|
111
|
+
'Use SAPContext BEFORE editing existing objects. For non-CDS reverse-lookup use SAPNavigate(references); for CDS prefer impact. Full detail: docs_page SAPContext.';
|
|
112
|
+
const SAPCONTEXT_DESC_BTP = 'Primary tool for understanding ABAP/CDS objects before specs, reviews, explanations, or changes (BTP ABAP Environment) — use instead of SAPRead when the user asks what an object does. Returns intent first (object KTD when available) then compressed dependency contracts.\n\n' +
|
|
113
|
+
"Decision rule — pick the action from the user's question:\n" +
|
|
114
|
+
'- "What breaks if I change <CDS>?" / "Who consumes <I_*>?" / "Blast radius" → action="impact" (DDLS only).\n' +
|
|
115
|
+
'- "Which includes/appends extend <TABL>?" → action="structure", type="TABL".\n' +
|
|
116
|
+
'- "What does <object> do?" / "Explain" / "deps before editing" → action="deps" (default).\n\n' +
|
|
117
|
+
'impact (CDS blast-radius): upstream AST deps + downstream where-used classified into RAP buckets (projectionViews, bdefs, serviceDefinitions, serviceBindings, accessControls, metadataExtensions, abapConsumers, documentation, tables, other) + sibling-consistency hints; filters the noise that text-scanning with SAPQuery produces. Optional includeIndirect, siblingCheck, siblingMaxCandidates.\n' +
|
|
118
|
+
'deps (default): target KTD + the public API contracts of its dependencies (not full source). On BTP, released SAP objects (CL_ABAP_*/IF_ABAP_*) and custom Z/Y are included.\n' +
|
|
119
|
+
'structure (TABL only): the DDIC include/append tree.\n\n' +
|
|
120
|
+
'Use SAPContext BEFORE editing existing objects; SAPRead afterwards for exact source. Full detail: docs_page SAPContext.';
|
|
154
121
|
// ─── SAPQuery ───────────────────────────────────────────────────────
|
|
155
|
-
const SAPQUERY_DESC_ONPREM = 'Execute ABAP SQL queries against SAP tables. Returns
|
|
156
|
-
'
|
|
157
|
-
'
|
|
158
|
-
'If a table is not found, similar table names will be suggested automatically. ' +
|
|
159
|
-
'Note: Uses the ADT freestyle SQL endpoint (same family as ADT SQL Console in Eclipse). ABAP SQL language supports JOINs and subqueries, but this endpoint parser can reject valid-looking statements on some backend versions (for example grammar errors, single-SELECT enforcement). ARC-1 automatically chunks simple long literal IN lists; if parsing still fails, simplify to one SELECT and split multi-table logic into staged single-table queries (SAP Note 3605050).\n\n' +
|
|
160
|
-
'CDS impact analysis: DO NOT query DDDDLSRC, ACMDCLSRC, DDLXSRC_SRC, or SRVDSRC_SRC to find CDS consumers — those text scans produce noise (substring matches, package group nodes, generated patterns). Use SAPContext(action="impact", type="DDLS", name="...") instead — it uses SAP\'s where-used index and returns bucketed, filtered results (projection views, BDEFs, SRVDs, access controls, documentation, ABAP consumers).';
|
|
122
|
+
const SAPQUERY_DESC_ONPREM = 'Execute ABAP SQL queries against SAP tables. Returns columns + rows. Good for reverse-engineering metadata tables (DD02L, DD03L, TADIR, TFDIR, SWOTLV). Unknown tables get name suggestions. ' +
|
|
123
|
+
'Uses the ADT freestyle SQL endpoint; its parser can reject valid-looking statements on some releases — ARC-1 automatically chunks simple long literal IN lists; if parsing still fails, use one SELECT and stage multi-table logic (SAP Note 3605050). ' +
|
|
124
|
+
'To find CDS consumers do NOT text-scan DDDDLSRC/ACMDCLSRC/DDLXSRC_SRC — use SAPContext(action="impact", type="DDLS") (where-used index, filtered buckets).';
|
|
161
125
|
const SAPQUERY_DESC_BTP = 'Execute ABAP SQL queries (BTP ABAP Environment). Returns structured data with column names and rows. ' +
|
|
162
126
|
'IMPORTANT: On BTP, only custom Z/Y tables and released CDS entities can be queried. ' +
|
|
163
127
|
'SAP standard tables (MARA, VBAK, DD02L, DD03L, TADIR, etc.) are blocked. ' +
|
|
164
128
|
'Use released CDS views instead: I_LANGUAGE, I_COUNTRY, I_CURRENCY, I_UnitOfMeasure, etc. ' +
|
|
165
129
|
'If a table is not found, similar table names will be suggested automatically.';
|
|
166
130
|
// ─── SAPSearch ──────────────────────────────────────────────────────
|
|
167
|
-
const SAPSEARCH_DESC_ONPREM = 'Search for ABAP objects, exact object-directory entries, or source code.
|
|
168
|
-
'1. Object search (default):
|
|
169
|
-
'2. TADIR lookup (searchType="tadir_lookup"):
|
|
170
|
-
'3. Source code search (searchType="source_code"):
|
|
171
|
-
"Tips: BOR
|
|
131
|
+
const SAPSEARCH_DESC_ONPREM = 'Search for ABAP objects, exact object-directory entries, or source code. Modes:\n' +
|
|
132
|
+
'1. Object search (default): name pattern with wildcards (*); returns type, name, package, description, ADT URI.\n' +
|
|
133
|
+
'2. TADIR lookup (searchType="tadir_lookup"): exact cross-package lookup of one or more names (prefer over long SAPQuery TADIR IN-lists).\n' +
|
|
134
|
+
'3. Source code search (searchType="source_code"): full-text search across source (SAP_BASIS ≥ 7.51).\n' +
|
|
135
|
+
"Tips: BOR objects appear as SOBJ; the uri field feeds SAPNavigate, objectType feeds SAPRead/SAPWrite/SAPActivate. Searches object NAMES only — for field names use SAPRead(type='DDLS', include='elements') or SAPQuery on DD03L.";
|
|
172
136
|
const SAPSEARCH_DESC_BTP = 'Search for ABAP objects, exact object-directory entries, or source code (BTP ABAP Environment). Three modes:\n' +
|
|
173
137
|
'1. Object search (default): Search by name pattern with wildcards. Returns released SAP objects and custom Z/Y objects. Classic programs, includes, and DDIC views are not searchable on BTP.\n' +
|
|
174
138
|
'2. TADIR lookup (searchType="tadir_lookup"): Exact object lookup for one or more names via ADT repository quick search.\n' +
|
|
175
139
|
'3. Source code search (searchType="source_code"): Full-text search within ABAP source code.\n\n' +
|
|
176
140
|
"Tips: On BTP, focus on classes (CL_*), interfaces (IF_*), CDS views (I_*), and custom Z/Y objects.\n\nNote: Searches object names only (classes, CDS views, etc.) — field/column names are not searchable here. To find fields by name, use SAPRead(type='DDLS', include='elements') for CDS views.";
|
|
177
141
|
// ─── SAPTransport ───────────────────────────────────────────────────
|
|
178
|
-
const SAPTRANSPORT_DESC_ONPREM = 'Manage CTS transport requests (SE09/SE10
|
|
179
|
-
'
|
|
180
|
-
'
|
|
181
|
-
'
|
|
182
|
-
'
|
|
183
|
-
|
|
184
|
-
'
|
|
185
|
-
|
|
186
|
-
'
|
|
187
|
-
'
|
|
188
|
-
'release, delete, remove_object (remove an object, keep the request), reassign (change owner), release_recursive (release tasks first, then parent), ' +
|
|
189
|
-
'check (check if a package requires a transport — provide type, name, package), ' +
|
|
190
|
-
'history (find transports referencing an object — provide type, name; read-only, works without SAP_ALLOW_TRANSPORT_WRITES). ' +
|
|
191
|
-
'On BTP, transport release triggers a gCTS push to the software component Git repository. ' +
|
|
192
|
-
'Import into target systems is done via the Manage Software Components app or Cloud Transport Management Service (cTMS), not via this tool.';
|
|
142
|
+
const SAPTRANSPORT_DESC_ONPREM = 'Manage CTS transport requests (SE09/SE10). Actions: list (current user, modifiable), get (tasks + objects), ' +
|
|
143
|
+
'create (always a Workbench (K) request — the package/target sets target & layer, not the request category; optional explicit target), ' +
|
|
144
|
+
'release, delete, remove_object (keep the request), reassign (change owner), release_recursive (tasks then parent), ' +
|
|
145
|
+
'check (does a package need a transport — type, name, package), history (transports referencing an object — type, name; read-only, no write scope needed). ' +
|
|
146
|
+
'IDs look like A4HK900123. Status: D=modifiable, R=released.';
|
|
147
|
+
const SAPTRANSPORT_DESC_BTP = 'Manage transport requests (BTP ABAP Environment, SE09/SE10). Actions: list (current user, modifiable), get (tasks + objects), ' +
|
|
148
|
+
'create (always a Workbench (K) request — the package/target sets target & layer; optional explicit target), ' +
|
|
149
|
+
'release, delete, remove_object (keep the request), reassign (change owner), release_recursive (tasks then parent), ' +
|
|
150
|
+
'check (does a package need a transport — type, name, package), history (transports referencing an object — type, name; read-only). ' +
|
|
151
|
+
'On BTP, release triggers a gCTS push to the software-component Git repo; import is via Manage Software Components / cTMS, not this tool.';
|
|
193
152
|
// ─── SAPManage ──────────────────────────────────────────────────────
|
|
194
|
-
const SAPMANAGE_DESC_ONPREM = 'Probe and report SAP system capabilities. Use
|
|
195
|
-
'
|
|
153
|
+
const SAPMANAGE_DESC_ONPREM = 'Probe and report SAP system capabilities. Use BEFORE operations that depend on optional features ' +
|
|
154
|
+
'(abapGit, RAP/CDS, AMDP, HANA, UI5/Fiori, CTS transports, FLP). Also handles package (DEVC) lifecycle.\n\n' +
|
|
196
155
|
'Actions:\n' +
|
|
197
|
-
'- "features":
|
|
198
|
-
'
|
|
199
|
-
'-
|
|
200
|
-
'
|
|
201
|
-
'
|
|
202
|
-
'- "flp_list_catalogs": List FLP business catalogs.\n' +
|
|
203
|
-
'- "flp_list_groups": List FLP groups.\n' +
|
|
204
|
-
'- "flp_list_tiles": List tiles in a catalog (requires "catalogId").\n' +
|
|
205
|
-
'- "create_package": Create a package (DEVC) via ADT packages API.\n' +
|
|
206
|
-
'- "delete_package": Delete an existing package.\n' +
|
|
207
|
-
'- "flp_create_catalog": Create a business catalog (requires "domainId", "title").\n' +
|
|
208
|
-
'- "flp_create_group": Create a group (requires "groupId", "title").\n' +
|
|
209
|
-
'- "flp_create_tile": Create a tile in a catalog (requires "catalogId", "tile").\n' +
|
|
210
|
-
'- "flp_add_tile_to_group": Add a catalog tile to a group (requires "groupId", "catalogId", "tileInstanceId").\n' +
|
|
211
|
-
'- "flp_delete_catalog": Delete a business catalog (requires "catalogId").\n' +
|
|
212
|
-
'- "set_api_state": Release (or revoke) an object\'s API release contract for ABAP Cloud / Clean Core ' +
|
|
213
|
-
'(requires "objectUri", or "name" + "objectType"; "apiState" defaults to RELEASED, "contract" defaults to C1 — pass C0 for SRVD, C3 for classic views). The write counterpart of SAPRead(type="API_STATE").\n\n' +
|
|
214
|
-
'Returns JSON with features, each having: id, available (bool), mode, message, and probedAt timestamp. ' +
|
|
215
|
-
'Also returns systemType ("btp" or "onprem") for understanding available capabilities. ' +
|
|
216
|
-
'"available: false" means do NOT attempt operations that depend on it.';
|
|
156
|
+
'- "features": cached feature status (fast, no round-trip; id, available, mode, probedAt). "probe": re-probe now (feature probes + auth + discovery refresh). "cache_stats": object cache health.\n' +
|
|
157
|
+
'- "create_package" / "delete_package" / "change_package": DEVC lifecycle via ADT packages API.\n' +
|
|
158
|
+
'- FLP read: flp_list_catalogs, flp_list_groups, flp_list_tiles (catalogId). FLP write: flp_create_catalog, flp_create_group, flp_create_tile, flp_add_tile_to_group, flp_delete_catalog.\n' +
|
|
159
|
+
'- "set_api_state": release/revoke an object\'s API release contract (objectUri, or name+objectType; apiState defaults RELEASED, contract defaults C1 — C0 for SRVD, C3 for classic views). Write counterpart of SAPRead(type="API_STATE").\n\n' +
|
|
160
|
+
'Returns features + systemType ("onprem"/"btp"); "available: false" means do NOT attempt dependent operations.';
|
|
217
161
|
const SAPMANAGE_DESC_BTP = 'Probe and report SAP system capabilities (BTP ABAP Environment). ' +
|
|
218
162
|
'Returns feature status and system type. Also handles package (DEVC) lifecycle operations.\n\n' +
|
|
219
163
|
'Actions:\n' +
|
|
@@ -342,8 +286,8 @@ function buildSAPSearchTool(btp, textSearchAvailable) {
|
|
|
342
286
|
};
|
|
343
287
|
}
|
|
344
288
|
// ─── GPT/OpenAI strict-mode nullable helper (issue #360) ────────────
|
|
345
|
-
/** Add `null` to a property's `type` (string
|
|
346
|
-
* Outputs guide, null goes in `type`
|
|
289
|
+
/** Add `null` to a property's `type` (string -> ["string","null"]). Per OpenAI's Structured
|
|
290
|
+
* Outputs guide, null goes in `type` only, never into `enum`. */
|
|
347
291
|
function makeNullableType(def) {
|
|
348
292
|
const d = { ...def };
|
|
349
293
|
const t = d.type;
|
|
@@ -357,17 +301,15 @@ function makeNullableType(def) {
|
|
|
357
301
|
return d;
|
|
358
302
|
}
|
|
359
303
|
/**
|
|
360
|
-
* Recursively make every
|
|
304
|
+
* Recursively make every non-required property of a JSON-schema object nullable.
|
|
305
|
+
*
|
|
306
|
+
* This exists only for explicit OpenAI/Azure strict-mode compatibility (#360), where a strict
|
|
307
|
+
* function schema can force every optional field to be present and enum optionals then get
|
|
308
|
+
* fabricated values. Several MCP clients reject `type: ["x","null"]` unions, so the default
|
|
309
|
+
* visible schema stays plain for broad client compatibility (#520).
|
|
361
310
|
*
|
|
362
|
-
*
|
|
363
|
-
*
|
|
364
|
-
* it is FORCED to emit one of the values (the hallucinated typeKind=domain / odataVersion=V4
|
|
365
|
-
* seen on unrelated writes, issue #360). The OpenAI-documented fix is a union with null
|
|
366
|
-
* (`"type": ["string","null"]`) so the model can emit null = "not used"; ARC-1's runtime
|
|
367
|
-
* `stripLlmEmptyValues` then drops the nulls before Zod. Each object node's OWN `required`
|
|
368
|
-
* array decides what stays non-nullable, so it is correct at every nesting level (top level
|
|
369
|
-
* keeps `action`; batch `objects[]` items keep `type`/`name`; leaf arrays keep their keys).
|
|
370
|
-
* Pure — returns a copy, does not mutate the input.
|
|
311
|
+
* Pure — returns a copy and does not mutate the input. Each object node's own `required` array
|
|
312
|
+
* decides what stays non-nullable, so top-level `action` and batch-item `type`/`name` remain plain.
|
|
371
313
|
*/
|
|
372
314
|
function makeOptionalPropertiesNullable(node) {
|
|
373
315
|
if (Array.isArray(node))
|
|
@@ -393,7 +335,7 @@ function makeOptionalPropertiesNullable(node) {
|
|
|
393
335
|
return result;
|
|
394
336
|
}
|
|
395
337
|
// ─── Main Tool Definitions ──────────────────────────────────────────
|
|
396
|
-
export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures) {
|
|
338
|
+
export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures, options = {}) {
|
|
397
339
|
// Hyperfocused mode: single universal SAP tool (~200 tokens)
|
|
398
340
|
if (config.toolMode === 'hyperfocused') {
|
|
399
341
|
return [getHyperfocusedToolDefinition(config, resolvedFeatures)];
|
|
@@ -427,6 +369,14 @@ export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures
|
|
|
427
369
|
type: 'string',
|
|
428
370
|
description: 'action="diff" NEW side (default "inactive" = pending unactivated changes). Same values as from.',
|
|
429
371
|
},
|
|
372
|
+
fromLabel: {
|
|
373
|
+
type: 'string',
|
|
374
|
+
description: 'action="diff" optional display label for the OLD side in the summary and patch header, e.g. "DNT-6-6: Validate discounts (DS7K900123)". Does not affect source resolution.',
|
|
375
|
+
},
|
|
376
|
+
toLabel: {
|
|
377
|
+
type: 'string',
|
|
378
|
+
description: 'action="diff" optional display label for the NEW side in the summary and patch header, e.g. "active" or "inactive draft". Does not affect source resolution.',
|
|
379
|
+
},
|
|
430
380
|
include: {
|
|
431
381
|
type: 'string',
|
|
432
382
|
description: 'For CLAS: DO NOT use this to read the main class — omit include entirely to get the full class source (CLASS DEFINITION + CLASS IMPLEMENTATION). This parameter reads class-LOCAL auxiliary files only: definitions (local type definitions, NOT the main class definition), implementations (local helper class implementations), macros, testclasses (ABAP Unit). Comma-separated. Not all classes have these sections — missing ones return a note instead of an error. ' +
|
|
@@ -534,12 +484,12 @@ export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures
|
|
|
534
484
|
const pkgList = config.allowedPackages.join(', ');
|
|
535
485
|
sapWriteDesc += ` Write access is restricted to packages: ${pkgList}.`;
|
|
536
486
|
}
|
|
537
|
-
|
|
487
|
+
const sapWriteTool = {
|
|
538
488
|
name: 'SAPWrite',
|
|
539
489
|
description: sapWriteDesc,
|
|
540
|
-
//
|
|
541
|
-
//
|
|
542
|
-
inputSchema:
|
|
490
|
+
// Keep visible schemas on widely supported JSON Schema primitives. Runtime argument
|
|
491
|
+
// normalization still strips null-valued optionals from strict clients before Zod (#360).
|
|
492
|
+
inputSchema: {
|
|
543
493
|
type: 'object',
|
|
544
494
|
properties: {
|
|
545
495
|
action: {
|
|
@@ -558,7 +508,7 @@ export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures
|
|
|
558
508
|
'scaffold_rap_handlers',
|
|
559
509
|
'generate_behavior_implementation',
|
|
560
510
|
],
|
|
561
|
-
description:
|
|
511
|
+
description: 'Write action. create/update/delete: standard object writes. edit_method: replace one method body (type=CLAS, method, source). Class-section surgery (type=CLAS only): edit_class_definition without include= replaces the global DEFINITION block (refuses a diff that would leave the class non-activatable, e.g. a concrete method with no IMPL stub); with include= it whole-replaces a class-local include (CCDEF/CCIMP/macros/testclasses), auto-creating it. add_method inserts a METHODS clause + empty stub (visibility, abstract=true skips the stub); edit_method_signature replaces one METHODS clause (no IMPL change); delete_method removes the clause AND body — WARNING: destructive, discards the method body (to re-section a method use change_method_visibility, NOT delete+add); change_method_visibility moves a method between PUBLIC/PROTECTED/PRIVATE, preserves the body. add_method/edit_method_signature/delete_method/change_method_visibility act on /source/main only. batch_create: create+activate multiple objects (objects array). scaffold_rap_handlers / generate_behavior_implementation: derive RAP behavior-pool handlers from the BDEF (the latter the equivalent of Eclipse\'s "Generate Behavior Implementation").',
|
|
562
512
|
},
|
|
563
513
|
type: {
|
|
564
514
|
type: 'string',
|
|
@@ -573,16 +523,16 @@ export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures
|
|
|
573
523
|
},
|
|
574
524
|
source: {
|
|
575
525
|
type: 'string',
|
|
576
|
-
description: 'ABAP source code.
|
|
526
|
+
description: 'ABAP source code. create/update: full source body. edit_method: the new method body. edit_class_definition without include=: only the new global CLASS…DEFINITION…ENDCLASS block (no IMPLEMENTATION); with include=: the full replacement body of that include. edit_method_signature: only the new METHODS clause. Not used by add_method/delete_method/change_method_visibility (use `method`/`visibility`).',
|
|
577
527
|
},
|
|
578
528
|
include: {
|
|
579
529
|
type: 'string',
|
|
580
530
|
enum: CLASS_WRITE_INCLUDES,
|
|
581
|
-
description: 'CLAS-ONLY. Do NOT send
|
|
531
|
+
description: 'CLAS-ONLY. Do NOT send unless type=CLAS AND action is update / edit_method / edit_class_definition. OMIT it entirely for every other type and for delete / batch_create / add_method / edit_method_signature / delete_method / change_method_visibility (those use /source/main). Targets a class-local include: definitions (CCDEF), implementations (CCIMP), macros, testclasses. edit_method auto-detects it from the method specifier (lhc_*/lcl_* → implementations, ltc_* → testclasses), so you rarely pass it; use include=testclasses to create a new local test class. Whole-include writes auto-create a missing include and produce an inactive draft (read with SAPRead version="inactive" before activation).',
|
|
582
532
|
},
|
|
583
533
|
method: {
|
|
584
534
|
type: 'string',
|
|
585
|
-
description: '
|
|
535
|
+
description: 'edit_method/edit_method_signature/delete_method/change_method_visibility: the method NAME (e.g. "get_name", "zif_order~process", "lhc_project~approve_project"). add_method: the full METHODS clause as ABAP source. Local-class methods auto-route by prefix (lhc_*/lcl_* → implementations, ltc_* → testclasses); use the qualified <localclass>~<method> form when a bare name is ambiguous.',
|
|
586
536
|
},
|
|
587
537
|
visibility: {
|
|
588
538
|
type: 'string',
|
|
@@ -595,11 +545,11 @@ export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures
|
|
|
595
545
|
},
|
|
596
546
|
bdefName: {
|
|
597
547
|
type: 'string',
|
|
598
|
-
description:
|
|
548
|
+
description: 'For scaffold_rap_handlers: interface BDEF name whose actions/determinations/validations/authorizations define the required handlers (e.g. ZI_TRAVELREQ). For generate_behavior_implementation: optional override (default discovery reads the class rootEntityRef).',
|
|
599
549
|
},
|
|
600
550
|
autoApply: {
|
|
601
551
|
type: 'boolean',
|
|
602
|
-
description: 'For scaffold_rap_handlers:
|
|
552
|
+
description: 'For scaffold_rap_handlers: true inserts missing METHODS signatures + empty stubs and writes the class under one lock; false (default) returns a required-vs-missing report without modifying (preview, then re-run with autoApply=true). Not used by generate_behavior_implementation (use dryRun to preview there).',
|
|
603
553
|
},
|
|
604
554
|
targetAlias: {
|
|
605
555
|
type: 'string',
|
|
@@ -607,11 +557,11 @@ export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures
|
|
|
607
557
|
},
|
|
608
558
|
activate: {
|
|
609
559
|
type: 'boolean',
|
|
610
|
-
description: 'For generate_behavior_implementation:
|
|
560
|
+
description: 'For generate_behavior_implementation: true (default) activates the class after writing; false writes source only. The known "Local classes of CL_ABAP_BEHAVIOR_HANDLER…" stale-active activation failure does not throw — it returns activation.success=false with a recovery hint.',
|
|
611
561
|
},
|
|
612
562
|
activateAtEnd: {
|
|
613
563
|
type: 'boolean',
|
|
614
|
-
description: 'For
|
|
564
|
+
description: 'For batch_create only. false (default): per-object inline activation in order. true: write all inactive drafts then one terminal activateBatch so SAP resolves cross-references between siblings — use for interdependent RAP stacks (TABL→DDLS→DCLS→BDEF→SRVD). A write-phase failure still breaks the loop; the terminal activate runs over the already-written subset.',
|
|
615
565
|
},
|
|
616
566
|
dryRun: {
|
|
617
567
|
type: 'boolean',
|
|
@@ -693,7 +643,7 @@ export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures
|
|
|
693
643
|
},
|
|
694
644
|
parameters: {
|
|
695
645
|
type: 'array',
|
|
696
|
-
description: 'FUNC: structured signature parameters. ARC-1 builds the IMPORTING/EXPORTING/CHANGING/TABLES/EXCEPTIONS/RAISING clause
|
|
646
|
+
description: 'FUNC: structured signature parameters. ARC-1 builds the IMPORTING/EXPORTING/CHANGING/TABLES/EXCEPTIONS/RAISING clause and splices it into the FM body. When omitted, the supplied source is PUT verbatim.',
|
|
697
647
|
items: {
|
|
698
648
|
type: 'object',
|
|
699
649
|
properties: {
|
|
@@ -723,7 +673,7 @@ export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures
|
|
|
723
673
|
serviceDefinition: { type: 'string', description: 'SRVB: service definition name (SRVD) to bind to' },
|
|
724
674
|
bindingType: {
|
|
725
675
|
type: 'string',
|
|
726
|
-
description: 'SRVB: binding type —
|
|
676
|
+
description: 'SRVB: binding type — human-readable values like "ODataV4-UI", "OData V2 - Web API" are auto-normalized (sets odataVersion + category).',
|
|
727
677
|
},
|
|
728
678
|
odataVersion: {
|
|
729
679
|
type: 'string',
|
|
@@ -738,19 +688,19 @@ export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures
|
|
|
738
688
|
version: { type: 'string', description: 'SRVB: service version number (default: 0001)' },
|
|
739
689
|
lintBeforeWrite: {
|
|
740
690
|
type: 'boolean',
|
|
741
|
-
description: 'Override server lint-before-write
|
|
691
|
+
description: 'Override server lint-before-write for this call (false skips it). Lint covers PROG/CLAS/INTF/FUNC and DDLS; other types rely on RAP preflight.',
|
|
742
692
|
},
|
|
743
693
|
preflightBeforeWrite: {
|
|
744
694
|
type: 'boolean',
|
|
745
|
-
description: 'Enable/disable deterministic RAP preflight checks
|
|
695
|
+
description: 'Enable/disable deterministic RAP preflight checks (default true) — TABL/BDEF/DDLX static rules (curr/quan semantics, invalid BDEF enums, DDLX scope on 7.5x).',
|
|
746
696
|
},
|
|
747
697
|
checkBeforeWrite: {
|
|
748
698
|
type: 'boolean',
|
|
749
|
-
description: 'Override server check-before-write
|
|
699
|
+
description: 'Override server check-before-write (default off). When true, runs a SAP syntax check and appends diagnostics to the response — the write is NOT blocked. Off by default (adds a round-trip; intermediate refactor writes legitimately trip transient dependency errors). Activation remains the definitive check.',
|
|
750
700
|
},
|
|
751
701
|
refObjectType: {
|
|
752
702
|
type: 'string',
|
|
753
|
-
description: 'SKTD/KTD create: ADT type+subtype of the parent
|
|
703
|
+
description: 'SKTD/KTD create (required): ADT type+subtype of the documented parent (e.g. "DDLS/DF", "BDEF/BDO", "SRVD/SRV", "DEVC/K"). Not CLAS/INTF/PROG (use ABAP Doc for code).',
|
|
754
704
|
},
|
|
755
705
|
refObjectName: {
|
|
756
706
|
type: 'string',
|
|
@@ -781,92 +731,69 @@ export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures
|
|
|
781
731
|
type: 'string',
|
|
782
732
|
description: 'Object-specific transport request. Overrides top-level transport for this item.',
|
|
783
733
|
},
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
},
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
lowercase: { type: 'boolean', description: 'DOMA: lowercase allowed' },
|
|
734
|
+
// DDIC metadata fields (DOMA/DTEL/TTYP/MSAG/SRVB) mirror the top-level SAPWrite
|
|
735
|
+
// params 1:1 — descriptions omitted here to keep the tools/list payload small (#520).
|
|
736
|
+
dataType: { type: 'string' },
|
|
737
|
+
rowType: { type: 'string' },
|
|
738
|
+
rowTypeKind: { type: 'string', enum: ['builtin', 'structure'] },
|
|
739
|
+
length: { type: 'number' },
|
|
740
|
+
decimals: { type: 'number' },
|
|
741
|
+
outputLength: { type: 'number' },
|
|
742
|
+
conversionExit: { type: 'string' },
|
|
743
|
+
signExists: { type: 'boolean' },
|
|
744
|
+
lowercase: { type: 'boolean' },
|
|
796
745
|
fixedValues: {
|
|
797
746
|
type: 'array',
|
|
798
|
-
description: 'DOMA: fixed value ranges',
|
|
799
747
|
items: {
|
|
800
748
|
type: 'object',
|
|
801
|
-
properties: {
|
|
802
|
-
low: { type: 'string' },
|
|
803
|
-
high: { type: 'string' },
|
|
804
|
-
description: { type: 'string' },
|
|
805
|
-
},
|
|
749
|
+
properties: { low: { type: 'string' }, high: { type: 'string' }, description: { type: 'string' } },
|
|
806
750
|
required: ['low'],
|
|
807
751
|
},
|
|
808
752
|
},
|
|
809
|
-
valueTable: { type: 'string'
|
|
810
|
-
typeKind: { type: 'string', enum: ['domain', 'predefinedAbapType']
|
|
811
|
-
typeName: { type: 'string'
|
|
812
|
-
domainName: { type: 'string'
|
|
813
|
-
shortLabel: { type: 'string'
|
|
814
|
-
mediumLabel: { type: 'string'
|
|
815
|
-
longLabel: { type: 'string'
|
|
816
|
-
headingLabel: { type: 'string'
|
|
817
|
-
searchHelp: { type: 'string'
|
|
818
|
-
searchHelpParameter: { type: 'string'
|
|
819
|
-
setGetParameter: { type: 'string'
|
|
820
|
-
defaultComponentName: { type: 'string'
|
|
821
|
-
changeDocument: { type: 'boolean'
|
|
753
|
+
valueTable: { type: 'string' },
|
|
754
|
+
typeKind: { type: 'string', enum: ['domain', 'predefinedAbapType'] },
|
|
755
|
+
typeName: { type: 'string' },
|
|
756
|
+
domainName: { type: 'string' },
|
|
757
|
+
shortLabel: { type: 'string' },
|
|
758
|
+
mediumLabel: { type: 'string' },
|
|
759
|
+
longLabel: { type: 'string' },
|
|
760
|
+
headingLabel: { type: 'string' },
|
|
761
|
+
searchHelp: { type: 'string' },
|
|
762
|
+
searchHelpParameter: { type: 'string' },
|
|
763
|
+
setGetParameter: { type: 'string' },
|
|
764
|
+
defaultComponentName: { type: 'string' },
|
|
765
|
+
changeDocument: { type: 'boolean' },
|
|
822
766
|
messages: {
|
|
823
767
|
type: 'array',
|
|
824
|
-
description: 'MSAG: message entries',
|
|
825
768
|
items: {
|
|
826
769
|
type: 'object',
|
|
827
|
-
properties: {
|
|
828
|
-
number: { type: 'string', description: 'Message number (e.g., "001")' },
|
|
829
|
-
shortText: { type: 'string', description: 'Message short text' },
|
|
830
|
-
},
|
|
770
|
+
properties: { number: { type: 'string' }, shortText: { type: 'string' } },
|
|
831
771
|
required: ['number', 'shortText'],
|
|
832
772
|
},
|
|
833
773
|
},
|
|
834
|
-
serviceDefinition: { type: 'string'
|
|
835
|
-
bindingType: {
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
},
|
|
839
|
-
odataVersion: {
|
|
840
|
-
type: 'string',
|
|
841
|
-
enum: ['V2', 'V4'],
|
|
842
|
-
description: 'SRVB: OData protocol version (default: V2)',
|
|
843
|
-
},
|
|
844
|
-
category: {
|
|
845
|
-
type: 'string',
|
|
846
|
-
enum: ['0', '1'],
|
|
847
|
-
description: 'SRVB: binding category (0=UI, 1=Web API)',
|
|
848
|
-
},
|
|
849
|
-
version: { type: 'string', description: 'SRVB: service version number (default 0001)' },
|
|
774
|
+
serviceDefinition: { type: 'string' },
|
|
775
|
+
bindingType: { type: 'string' },
|
|
776
|
+
odataVersion: { type: 'string', enum: ['V2', 'V4'] },
|
|
777
|
+
category: { type: 'string', enum: ['0', '1'] },
|
|
778
|
+
version: { type: 'string' },
|
|
850
779
|
},
|
|
851
780
|
required: ['type', 'name'],
|
|
852
781
|
},
|
|
853
|
-
description: 'For batch_create: ordered list of objects to create
|
|
854
|
-
'Objects are created and activated in array order — put dependencies first (e.g., TABL before DDLS, BDEF after DDLS). ' +
|
|
855
|
-
'Each item may include package and transport; item-level values override top-level package/transport. ' +
|
|
856
|
-
'Example: [{type:"TABL",name:"ZTRAVEL",source:"..."},{type:"DDLS",name:"ZI_TRAVEL",source:"..."},{type:"BDEF",name:"ZI_TRAVEL",source:"..."},{type:"SRVD",name:"ZSD_TRAVEL",source:"..."}]',
|
|
782
|
+
description: 'For batch_create: ordered list of objects to create+activate (each needs type, name, and source if applicable). Created in array order — dependencies first (TABL before DDLS, BDEF after DDLS). Item-level package/transport override the top-level. Use activateAtEnd=true for interdependent stacks.',
|
|
857
783
|
},
|
|
858
784
|
},
|
|
859
785
|
required: ['action'],
|
|
860
|
-
}
|
|
861
|
-
}
|
|
786
|
+
},
|
|
787
|
+
};
|
|
788
|
+
if (options.nullableOptionals) {
|
|
789
|
+
sapWriteTool.inputSchema = makeOptionalPropertiesNullable(sapWriteTool.inputSchema);
|
|
790
|
+
}
|
|
791
|
+
tools.push(sapWriteTool);
|
|
862
792
|
tools.push({
|
|
863
793
|
name: 'SAPActivate',
|
|
864
|
-
description: 'Activate (publish) ABAP objects
|
|
865
|
-
'
|
|
866
|
-
'
|
|
867
|
-
'Batch activation is more efficient (one SAP round-trip) and works for ANY combination of objects, not just dependent ones. ' +
|
|
868
|
-
'It is required for RAP stacks where DDLS, BDEF, SRVD depend on each other, but equally useful for unrelated objects like multiple DTELs or DOMAs.\n' +
|
|
869
|
-
'For publish_srvb/unpublish_srvb: publish or unpublish an OData service binding (SRVB) — makes the OData service available for consumption.',
|
|
794
|
+
description: 'Activate (publish) ABAP objects, single or batch. Type codes auto-normalized (e.g. "CLAS/OC" → CLAS). ' +
|
|
795
|
+
'ALWAYS prefer batch activation for 2+ objects — pass an "objects" array of {type, name}: one round-trip, works for any mix (required for interdependent RAP stacks, useful for unrelated objects too). ' +
|
|
796
|
+
'publish_srvb/unpublish_srvb: publish or unpublish an OData service binding (SRVB).',
|
|
870
797
|
inputSchema: {
|
|
871
798
|
type: 'object',
|
|
872
799
|
properties: {
|
|
@@ -883,14 +810,11 @@ export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures
|
|
|
883
810
|
service_type: {
|
|
884
811
|
type: 'string',
|
|
885
812
|
enum: ['odatav2', 'odatav4'],
|
|
886
|
-
description: 'OData service type for publish/unpublish
|
|
887
|
-
'Auto-detected from SRVB metadata when omitted. Only needed if auto-detection fails.',
|
|
813
|
+
description: 'OData service type for publish/unpublish routing. Auto-detected from SRVB metadata when omitted.',
|
|
888
814
|
},
|
|
889
815
|
preaudit: {
|
|
890
816
|
type: 'boolean',
|
|
891
|
-
description: 'Request pre-activation audit
|
|
892
|
-
'When true, SAP checks for issues before activating and returns warnings/errors. ' +
|
|
893
|
-
'Set to false to skip pre-audit for faster activation when confident the code is correct.',
|
|
817
|
+
description: 'Request pre-activation audit (default true) — SAP returns warnings/errors before activating. false skips it for speed.',
|
|
894
818
|
},
|
|
895
819
|
objects: {
|
|
896
820
|
type: 'array',
|
|
@@ -902,8 +826,7 @@ export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures
|
|
|
902
826
|
},
|
|
903
827
|
required: ['type', 'name'],
|
|
904
828
|
},
|
|
905
|
-
description: 'Batch activation: array of
|
|
906
|
-
'Works for any mix of types — e.g., [{type:"DOMA",name:"Z_DOM"},{type:"DTEL",name:"Z_DEL"}] or RAP stacks like [{type:"DDLS",name:"ZI_TRAVEL"},{type:"BDEF",name:"ZI_TRAVEL"},{type:"SRVD",name:"ZSD_TRAVEL"}].',
|
|
829
|
+
description: 'Batch activation: array of {type, name} to activate in one call. Use whenever activating 2+ objects (any mix of types).',
|
|
907
830
|
},
|
|
908
831
|
},
|
|
909
832
|
},
|
|
@@ -912,8 +835,8 @@ export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures
|
|
|
912
835
|
tools.push({
|
|
913
836
|
name: 'SAPNavigate',
|
|
914
837
|
description: btp
|
|
915
|
-
? 'Navigate code (BTP ABAP Environment):
|
|
916
|
-
: 'Navigate code:
|
|
838
|
+
? 'Navigate code (BTP ABAP Environment): definitions, references (where-used), completion, class hierarchy. references uses the scope-based Where-Used API (line numbers, snippets, package); optional objectType filters by ADT slash type (e.g. CLAS/OC). type+name auto-normalized. Scope = released SAP + custom Z/Y. For CDS (DDLS), prefer SAPContext(action="impact") — the same where-used pre-classified into RAP buckets.'
|
|
839
|
+
: 'Navigate code: definitions, references (where-used), completion, class hierarchy. references uses the scope-based Where-Used API (line numbers, snippets, package); optional objectType filters by ADT slash type (e.g. CLAS/OC, PROG/P); pass type+name instead of uri. hierarchy returns superclass + interfaces + direct subclasses. For CDS (DDLS), prefer SAPContext(action="impact") — the same where-used pre-classified into RAP buckets, answering "what breaks if I change this view".',
|
|
917
840
|
inputSchema: {
|
|
918
841
|
type: 'object',
|
|
919
842
|
properties: {
|
|
@@ -959,16 +882,13 @@ export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures
|
|
|
959
882
|
}
|
|
960
883
|
tools.push({
|
|
961
884
|
name: 'SAPLint',
|
|
962
|
-
description: 'Run local abaplint rules on ABAP
|
|
963
|
-
'
|
|
964
|
-
'- "
|
|
965
|
-
'- "
|
|
966
|
-
'- "
|
|
967
|
-
'- "
|
|
968
|
-
'
|
|
969
|
-
'- "set_formatter_settings": Update the SAP system\'s global PrettyPrinter settings. Requires indentation (bool) and/or style (keywordUpper|keywordLower|keywordAuto|none). Blocked in read-only mode.\n\n' +
|
|
970
|
-
'For server-side checks (ATC, syntax check, unit tests), use SAPDiagnose instead.\n' +
|
|
971
|
-
'Note: lint/lint_and_fix/list_rules run locally; format/*_formatter_settings call the SAP system.',
|
|
885
|
+
description: 'Run local abaplint rules on ABAP/CDS source (auto-selects cloud or on-prem rules by system type). Actions:\n' +
|
|
886
|
+
'- "lint": check source (errors+warnings) for ABAP (PROG/CLAS/INTF/FUNC) and CDS (DDLS).\n' +
|
|
887
|
+
'- "lint_and_fix": lint + auto-fix fixable issues (keyword case, obsolete statements); returns fixed source.\n' +
|
|
888
|
+
'- "list_rules": list rules + current config (no source).\n' +
|
|
889
|
+
'- "format": pretty-print via SAP\'s ADT formatter (needs source).\n' +
|
|
890
|
+
'- "get_formatter_settings" / "set_formatter_settings": read/update the system\'s global PrettyPrinter (indentation bool, style keywordUpper|keywordLower|keywordAuto|none; set is blocked read-only).\n' +
|
|
891
|
+
'lint/lint_and_fix/list_rules run locally; format/*_formatter_settings call SAP. For ATC/syntax/unit tests use SAPDiagnose.',
|
|
972
892
|
inputSchema: {
|
|
973
893
|
type: 'object',
|
|
974
894
|
properties: {
|
|
@@ -1000,28 +920,23 @@ export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures
|
|
|
1000
920
|
},
|
|
1001
921
|
}, {
|
|
1002
922
|
name: 'SAPDiagnose',
|
|
1003
|
-
description: 'Run diagnostics on ABAP objects and analyze runtime errors
|
|
1004
|
-
'
|
|
1005
|
-
'- "
|
|
1006
|
-
'- "
|
|
1007
|
-
'- "
|
|
1008
|
-
'- "
|
|
1009
|
-
'- "
|
|
1010
|
-
'- "
|
|
1011
|
-
'- "
|
|
1012
|
-
'- "
|
|
1013
|
-
'- "
|
|
1014
|
-
'- "
|
|
1015
|
-
'- "
|
|
1016
|
-
'- "
|
|
1017
|
-
'- "
|
|
1018
|
-
'- "
|
|
1019
|
-
'
|
|
1020
|
-
'- "cds_sql": Show the native SQL a CDS view compiles to (ADT "Show SQL Create Statement"). Requires name (the CDS DDL source / DDLS, e.g. "I_CURRENCY"). Returns the CREATE VIEW statement(s) so you can see the joins/scans behind a slow entity. Read-only; may be unavailable on older releases (e.g. NW 7.50).\n' +
|
|
1021
|
-
'- "sql_trace_state": Read the current ST05 trace state (SQL/buffer/enqueue/RFC/HTTP/… on-off per app server + filters). Read-only.\n' +
|
|
1022
|
-
'- "set_sql_trace_state": Arm or disarm the ST05 SQL trace. Requires sqlOn (true=arm, false=disarm); optional user filters the trace to one SAP user. Workflow: arm → reproduce the slow request → sql_trace_directory for the record link. Needs SAP_ALLOW_WRITES (mutates server trace state).\n' +
|
|
1023
|
-
'- "sql_trace_directory": Return where the recorded SQL statements are read — SAP answers with the TMC "SQL Trace Analysis" deep-link (there is no ADT SQL-record API; open the URL in a browser, needs /sap/bc/stmc active). Read-only.\n\n' +
|
|
1024
|
-
'Quickfix workflow: run syntax/ATC first to identify issues and line positions, then call quickfix to retrieve SAP-verified proposals, then apply_quickfix to get exact text deltas, and finally write the updated source via SAPWrite.',
|
|
923
|
+
description: 'Run diagnostics on ABAP objects and analyze runtime errors. Actions:\n' +
|
|
924
|
+
'- "syntax": syntax-check (name+type; optional version; optional source = pre-write dry-run, nothing written).\n' +
|
|
925
|
+
'- "unittest": run ABAP Unit tests (name+type).\n' +
|
|
926
|
+
'- "atc": run ATC checks (name+type; optional variant).\n' +
|
|
927
|
+
'- "cds_testcases": SAP-suggested ABAP Unit test cases for a CDS entity (name; read-only; SAP_BASIS 8.16+).\n' +
|
|
928
|
+
'- "object_state": compare active and inactive source versions without fetching both (name+type; CLAS compares all includes). Returns ETags, hashes, divergence flags.\n' +
|
|
929
|
+
'- "quickfix": get quick-fix proposals at a position (name+type+source+line; optional column, sourceUri).\n' +
|
|
930
|
+
'- "apply_quickfix": apply one proposal, return text deltas, no write (name+type+source+line+proposalUri+proposalUserContent; pass proposalUserContent through exactly, may be empty).\n' +
|
|
931
|
+
'- "dumps": list/read ST22 short dumps (no id = list; id = read; includeFullText, sections).\n' +
|
|
932
|
+
'- "traces": list/analyze profiler traces (id+analysis: hitlist=hot spots, statements=call tree, dbAccesses=DB stats).\n' +
|
|
933
|
+
'- "trace_start": arm a profiler trace for the NEXT matching execution, then reproduce and read via "traces" (write scope; defaults: next HTTP request, SQL on; optional traceUser/processType/maxExecutions/expiresHours/sqlTrace/…).\n' +
|
|
934
|
+
'- "trace_requests": list armed trace requests. "trace_cancel": cancel one by id (write scope).\n' +
|
|
935
|
+
'- "system_messages": list SM02 messages. "gateway_errors": list /IWFND/ERROR_LOG (on-prem; detailUrl or id+errorType for detail).\n' +
|
|
936
|
+
'- "odata_perf": diagnose why an OData call is slow (url = host-relative path from the Network tab); returns the sap-statistics timing split (DB/ABAP/framework/auth) + a verdict. Read-only; needs allowDataPreview.\n' +
|
|
937
|
+
'- "cds_sql": show the native SQL a CDS view compiles to (name; read-only; may be absent on old releases).\n' +
|
|
938
|
+
'- "sql_trace_state" / "set_sql_trace_state" (sqlOn; needs SAP_ALLOW_WRITES) / "sql_trace_directory": ST05 SQL-trace control.\n' +
|
|
939
|
+
'Quickfix workflow: syntax/ATC → quickfix → apply_quickfix → write via SAPWrite. Full action reference: docs_page SAPDiagnose.',
|
|
1025
940
|
inputSchema: {
|
|
1026
941
|
type: 'object',
|
|
1027
942
|
properties: {
|
|
@@ -1056,7 +971,7 @@ export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures
|
|
|
1056
971
|
},
|
|
1057
972
|
url: {
|
|
1058
973
|
type: 'string',
|
|
1059
|
-
description: 'For
|
|
974
|
+
description: 'For odata_perf: the host-relative OData path to probe, from the Fiori app\'s Network tab (e.g. "/sap/opu/odata4/sap/.../Entity?$filter=…"). Must be a path on the connected system — absolute URLs are rejected.',
|
|
1060
975
|
},
|
|
1061
976
|
type: {
|
|
1062
977
|
type: 'string',
|
|
@@ -1201,17 +1116,17 @@ export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures
|
|
|
1201
1116
|
properties: {
|
|
1202
1117
|
action: {
|
|
1203
1118
|
type: 'string',
|
|
1204
|
-
enum: ['impact', 'deps', 'usages'],
|
|
1119
|
+
enum: ['impact', 'deps', 'usages', 'structure'],
|
|
1205
1120
|
description: 'Action:\n' +
|
|
1206
1121
|
'"impact" = CDS blast-radius analysis (DDLS only). USE THIS for any question like "what breaks if I change <view>", "who consumes <I_*>", "impact analysis on <CDS>", "downstream of <view>". Returns upstream AST dependencies + downstream where-used classified into RAP buckets (projectionViews, bdefs, serviceDefinitions, serviceBindings, accessControls, metadataExtensions, abapConsumers, documentation, tables, other), plus additive sibling-consistency diagnostics (consistencyHints + siblingExtensionAnalysis) when related DDLS siblings show asymmetric DDLX coverage. ALWAYS prefer over SAPQuery against DDDDLSRC/ACMDCLSRC/DDLXSRC_SRC/SRVDSRC_SRC (those text-scans produce noise this classifier filters out). Non-DDLS input returns a guardrail error.\n' +
|
|
1207
1122
|
'"deps" (default, can be omitted) = object understanding / forward dependency context — "what does <object> do?" or "what does <object> depend on?". Returns the object KTD when available plus public API contracts of dependencies.\n' +
|
|
1208
|
-
'"usages" = reverse dependency lookup — "who calls <object>?". Requires cache warmup (--cache-warmup). Only "name" is needed. For CDS entities prefer action="impact" instead
|
|
1123
|
+
'"usages" = reverse dependency lookup — "who calls <object>?". Requires cache warmup (--cache-warmup). Only "name" is needed. For CDS entities prefer action="impact" instead.\n' +
|
|
1124
|
+
'"structure" = TABL includes/appends.',
|
|
1209
1125
|
},
|
|
1210
1126
|
type: {
|
|
1211
1127
|
type: 'string',
|
|
1212
1128
|
enum: btp ? SAPCONTEXT_TYPES_BTP : SAPCONTEXT_TYPES_ONPREM,
|
|
1213
|
-
description: 'Object type.
|
|
1214
|
-
'Optional for action="impact" — defaults to DDLS (the only supported type for impact).',
|
|
1129
|
+
description: 'Object type. Optional for action="impact" (defaults to DDLS); required otherwise.',
|
|
1215
1130
|
},
|
|
1216
1131
|
name: {
|
|
1217
1132
|
type: 'string',
|
|
@@ -1289,7 +1204,11 @@ export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures
|
|
|
1289
1204
|
},
|
|
1290
1205
|
softwareComponent: {
|
|
1291
1206
|
type: 'string',
|
|
1292
|
-
description: 'Software component for create_package (default: LOCAL).',
|
|
1207
|
+
description: 'Software component for create_package (default: LOCAL on-prem, ZLOCAL on BTP).',
|
|
1208
|
+
},
|
|
1209
|
+
responsible: {
|
|
1210
|
+
type: 'string',
|
|
1211
|
+
description: 'BTP only: the internal ABAP user (XUBNAME, e.g. CB9980000000) for the new package person-responsible. Auto-resolved from prior object creates if omitted; the IAS email is rejected.',
|
|
1293
1212
|
},
|
|
1294
1213
|
transportLayer: {
|
|
1295
1214
|
type: 'string',
|
|
@@ -1348,11 +1267,11 @@ export function getToolDefinitions(config, textSearchAvailable, resolvedFeatures
|
|
|
1348
1267
|
},
|
|
1349
1268
|
title: {
|
|
1350
1269
|
type: 'string',
|
|
1351
|
-
description: 'Title for
|
|
1270
|
+
description: 'Title — required for flp_create_catalog and flp_create_group.',
|
|
1352
1271
|
},
|
|
1353
1272
|
domainId: {
|
|
1354
1273
|
type: 'string',
|
|
1355
|
-
description: 'Domain ID
|
|
1274
|
+
description: 'Domain ID — required for flp_create_catalog (e.g., ZARC1_SALES).',
|
|
1356
1275
|
},
|
|
1357
1276
|
tileInstanceId: {
|
|
1358
1277
|
type: 'string',
|