@babamba2/abap-mcp-adt-powerup 4.14.0 → 4.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -1
- package/dist/handlers/adobeform/high/handleDeleteAdobeForm.d.ts +50 -0
- package/dist/handlers/adobeform/high/handleDeleteAdobeForm.d.ts.map +1 -0
- package/dist/handlers/adobeform/high/handleDeleteAdobeForm.js +91 -0
- package/dist/handlers/adobeform/high/handleDeleteAdobeForm.js.map +1 -0
- package/dist/handlers/common/high/handleActivateObjects.d.ts.map +1 -1
- package/dist/handlers/common/high/handleActivateObjects.js +4 -1
- package/dist/handlers/common/high/handleActivateObjects.js.map +1 -1
- package/dist/handlers/include/high/handleUpdateInclude.d.ts +2 -0
- package/dist/handlers/include/high/handleUpdateInclude.d.ts.map +1 -1
- package/dist/handlers/include/high/handleUpdateInclude.js +7 -19
- package/dist/handlers/include/high/handleUpdateInclude.js.map +1 -1
- package/dist/handlers/system/high/handleRuntimeCallDispatch.d.ts +46 -0
- package/dist/handlers/system/high/handleRuntimeCallDispatch.d.ts.map +1 -0
- package/dist/handlers/system/readonly/handleGetJobUsage.d.ts +6 -3
- package/dist/handlers/system/readonly/handleGetJobUsage.d.ts.map +1 -1
- package/dist/handlers/system/readonly/handleGetJobUsage.js +12 -8
- package/dist/handlers/system/readonly/handleGetJobUsage.js.map +1 -1
- package/dist/handlers/system/readonly/handleGetSqlQuery.d.ts.map +1 -1
- package/dist/handlers/system/readonly/handleGetSqlQuery.js +7 -1
- package/dist/handlers/system/readonly/handleGetSqlQuery.js.map +1 -1
- package/dist/handlers/system/readonly/handleGetTcodeUsage.d.ts +6 -3
- package/dist/handlers/system/readonly/handleGetTcodeUsage.d.ts.map +1 -1
- package/dist/handlers/system/readonly/handleGetTcodeUsage.js +13 -12
- package/dist/handlers/system/readonly/handleGetTcodeUsage.js.map +1 -1
- package/dist/handlers/unit_test/high/handleRunUnitTest.d.ts +27 -0
- package/dist/handlers/unit_test/high/handleRunUnitTest.d.ts.map +1 -1
- package/dist/handlers/unit_test/high/handleRunUnitTest.js +81 -4
- package/dist/handlers/unit_test/high/handleRunUnitTest.js.map +1 -1
- package/dist/lib/handlers/base/BaseHandlerGroup.d.ts.map +1 -1
- package/dist/lib/handlers/base/BaseHandlerGroup.js +12 -7
- package/dist/lib/handlers/base/BaseHandlerGroup.js.map +1 -1
- package/dist/lib/handlers/groups/HighLevelHandlersGroup.d.ts.map +1 -1
- package/dist/lib/handlers/groups/HighLevelHandlersGroup.js +5 -0
- package/dist/lib/handlers/groups/HighLevelHandlersGroup.js.map +1 -1
- package/dist/lib/legacyTableRead.d.ts.map +1 -1
- package/dist/lib/legacyTableRead.js +4 -2
- package/dist/lib/legacyTableRead.js.map +1 -1
- package/dist/lib/policy/blocklist.d.ts +73 -0
- package/dist/lib/policy/blocklist.d.ts.map +1 -0
- package/dist/lib/smartForm.d.ts +114 -0
- package/dist/lib/smartForm.d.ts.map +1 -0
- package/dist/lib/smartFormContent.d.ts +2 -0
- package/dist/lib/smartFormContent.d.ts.map +1 -1
- package/dist/lib/smartFormContent.js +27 -0
- package/dist/lib/smartFormContent.js.map +1 -1
- package/dist/lib/sourceFileInput.d.ts +15 -0
- package/dist/lib/sourceFileInput.d.ts.map +1 -0
- package/dist/lib/sourceFileInput.js +63 -0
- package/dist/lib/sourceFileInput.js.map +1 -0
- package/dist/lib/sourcePatchInput.d.ts +160 -0
- package/dist/lib/sourcePatchInput.d.ts.map +1 -0
- package/dist/lib/sourcePatchInput.js +701 -0
- package/dist/lib/sourcePatchInput.js.map +1 -0
- package/dist/lib/sqlLineWrap.d.ts +17 -0
- package/dist/lib/sqlLineWrap.d.ts.map +1 -0
- package/dist/lib/sqlLineWrap.js +72 -0
- package/dist/lib/sqlLineWrap.js.map +1 -0
- package/dist/lib/wlUsageS4.d.ts +47 -0
- package/dist/lib/wlUsageS4.d.ts.map +1 -0
- package/dist/lib/wlUsageS4.js +132 -0
- package/dist/lib/wlUsageS4.js.map +1 -0
- package/dist/server/BaseMcpServer.d.ts.map +1 -1
- package/dist/server/BaseMcpServer.js +30 -15
- package/dist/server/BaseMcpServer.js.map +1 -1
- package/docs/user-guide/AVAILABLE_TOOLS.md +54 -5
- package/docs/user-guide/AVAILABLE_TOOLS_COMPACT.md +1 -1
- package/docs/user-guide/AVAILABLE_TOOLS_HIGH.md +21 -3
- package/docs/user-guide/AVAILABLE_TOOLS_LEGACY.md +59 -5
- package/docs/user-guide/AVAILABLE_TOOLS_LOW.md +1 -1
- package/docs/user-guide/AVAILABLE_TOOLS_READONLY.md +33 -2
- package/package.json +1 -1
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import type { HandlerContext } from './handlers/interfaces';
|
|
2
|
+
export declare const MAX_SOURCE_PATCHES = 50;
|
|
3
|
+
export interface SourcePatch {
|
|
4
|
+
old_string: string;
|
|
5
|
+
new_string: string;
|
|
6
|
+
replace_all?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface PatchedInfo {
|
|
9
|
+
count: number;
|
|
10
|
+
replacements: number;
|
|
11
|
+
bytes: number;
|
|
12
|
+
source_sha256: string;
|
|
13
|
+
}
|
|
14
|
+
type Version = 'active' | 'inactive';
|
|
15
|
+
type ReadFn = (ctx: HandlerContext, args: any, version: Version) => Promise<string | undefined>;
|
|
16
|
+
interface PatchTarget {
|
|
17
|
+
/** Argument that carries the full source for this tool. */
|
|
18
|
+
codeField: string;
|
|
19
|
+
/** Arguments that name the object (all required for the read). */
|
|
20
|
+
nameFields: string[];
|
|
21
|
+
/** Read one version; undefined when that version does not exist. */
|
|
22
|
+
read: ReadFn;
|
|
23
|
+
/** Argument that switches activation on (default `activate`). */
|
|
24
|
+
activateField?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Activation acts on this source part alone. Only then does "inactive text
|
|
27
|
+
* equals active text" prove that re-activating touches nobody's work — a
|
|
28
|
+
* class activation also activates its other parts (CCDEF / CCIMP / CCAU).
|
|
29
|
+
*/
|
|
30
|
+
singlePart?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Include: the same source URL UpdateInclude writes — under the function
|
|
34
|
+
* group for a function-group include (function_group, or main_program
|
|
35
|
+
* SAPL<group>), else /programs/includes — with an explicit version.
|
|
36
|
+
*/
|
|
37
|
+
export declare function includeSourceUrl(args: any, version: Version): string;
|
|
38
|
+
/** Tools that accept source_patches. */
|
|
39
|
+
export declare const SOURCE_PATCH_TOOLS: string[];
|
|
40
|
+
/** Supported only when the tool's schema really carries the source field. */
|
|
41
|
+
export declare function patchTargetOf(toolName: string, inputSchema: any): PatchTarget | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Schema with `source_patches` added and the source field no longer required
|
|
44
|
+
* (one of the inputs is checked at call time). Other tools pass unchanged.
|
|
45
|
+
*/
|
|
46
|
+
export declare function withSourcePatchesSchema(toolName: string, inputSchema: any): any;
|
|
47
|
+
/** Validate the raw argument; throws a short error naming the bad patch. */
|
|
48
|
+
export declare function parseSourcePatches(raw: unknown): SourcePatch[];
|
|
49
|
+
/**
|
|
50
|
+
* Apply patches in order. Returns the new text in the source's line-ending
|
|
51
|
+
* style. Throws (nothing applied) when a patch does not match as required.
|
|
52
|
+
*
|
|
53
|
+
* Uniform line endings: matching on text normalised to \n, the result is
|
|
54
|
+
* written back in the source's style. Mixed line endings: the patches are
|
|
55
|
+
* applied to the raw text as given (no line is rewritten); an old_string
|
|
56
|
+
* that does not match the raw text refuses the call.
|
|
57
|
+
*/
|
|
58
|
+
export declare function applySourcePatches(source: string, patches: SourcePatch[]): {
|
|
59
|
+
text: string;
|
|
60
|
+
replacements: number;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* ABAP source without comments and literal text — a character scanner, the
|
|
64
|
+
* same as the plugin hook's stripAbapNoise (ABAP mode): `*` in column 1 and
|
|
65
|
+
* `"` comment to the line end; '…' / `…` become '' / `` (doubled quote =
|
|
66
|
+
* escaped); a string template |…| keeps its delimiters and the CODE of its
|
|
67
|
+
* embedded expressions { … } (which may hold literals and templates of their
|
|
68
|
+
* own) and drops its text (\ escapes). '…', `…` and template text end at the
|
|
69
|
+
* line end. A quote inside one literal never opens another and never
|
|
70
|
+
* swallows the code after it.
|
|
71
|
+
*/
|
|
72
|
+
export declare function stripAbapComments(source: string): string;
|
|
73
|
+
/**
|
|
74
|
+
* A CLASS … IMPLEMENTATION without a CLASS … DEFINITION (not DEFERRED /
|
|
75
|
+
* LOAD) of that class in the same text — e.g. a test class split over two
|
|
76
|
+
* includes: its implementation alone carries no FOR TESTING but still runs
|
|
77
|
+
* under RunUnitTest. Expects comment- and literal-free text.
|
|
78
|
+
*/
|
|
79
|
+
export declare function hasOrphanClassImplementation(clean: string): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* True when the patched source is a read channel — the same rule the plugin
|
|
82
|
+
* hook applies to a full upload (block-forbidden-tables.mjs
|
|
83
|
+
* sourceIsReadChannel): a test-code tool, `FOR TESTING` in the source, or a
|
|
84
|
+
* class implementation whose definition is elsewhere (comments and literals
|
|
85
|
+
* ignored). Its test classes' messages come back to the agent through
|
|
86
|
+
* RunUnitTest, so a read there extracts rows.
|
|
87
|
+
*/
|
|
88
|
+
export declare function isReadChannel(toolName: string, source: string): boolean;
|
|
89
|
+
export declare const TEST_CODE_REFUSAL = "source_patches refused \u2014 this source contains test classes (FOR TESTING, or a class implementation whose definition is in another include); nothing uploaded. Send the full source_code so the blocklist hook can check it.";
|
|
90
|
+
/**
|
|
91
|
+
* Exactly "same as a full upload", with no blocklist profile on the server:
|
|
92
|
+
* the hook scans a full upload only when it is a read channel (test code),
|
|
93
|
+
* so a patch to test code is refused outright — before (the current text)
|
|
94
|
+
* or after (the patched text), so removing FOR TESTING by a patch is caught
|
|
95
|
+
* too. Business code passes, as a full upload of it does.
|
|
96
|
+
*/
|
|
97
|
+
export declare function assertNotTestCode(before: string, after: string, toolName?: string): void;
|
|
98
|
+
/**
|
|
99
|
+
* Newest saved version and whether it is an inactive one. `unsure` is set
|
|
100
|
+
* when an inactive read came back but it could not be proven that no real
|
|
101
|
+
* inactive version exists — hadInactive is then true (never activate).
|
|
102
|
+
*/
|
|
103
|
+
export declare function readNewestSource(t: PatchTarget, ctx: HandlerContext, args: any): Promise<{
|
|
104
|
+
text: string;
|
|
105
|
+
hadInactive: boolean;
|
|
106
|
+
unsure?: string;
|
|
107
|
+
}>;
|
|
108
|
+
/** Newest saved version: inactive when it exists, else active. */
|
|
109
|
+
export declare function readCurrentSource(t: PatchTarget, ctx: HandlerContext, args: any): Promise<string>;
|
|
110
|
+
/** What a failed patched call needs to put the object back (internal, never returned). */
|
|
111
|
+
export interface PatchRestore {
|
|
112
|
+
target: PatchTarget;
|
|
113
|
+
codeField: string;
|
|
114
|
+
before: string;
|
|
115
|
+
after: string;
|
|
116
|
+
hadInactive: boolean;
|
|
117
|
+
/** Why hadInactive is only assumed (see readNewestSource). */
|
|
118
|
+
unsure?: string;
|
|
119
|
+
}
|
|
120
|
+
export interface ResolvedPatch {
|
|
121
|
+
args: any;
|
|
122
|
+
patched?: PatchedInfo;
|
|
123
|
+
restore?: PatchRestore;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Replace `source_patches` by the tool's source argument. Calls without
|
|
127
|
+
* `source_patches` pass through unchanged. Throws a short error when the
|
|
128
|
+
* tool is unsupported, inputs are combined, a patch is malformed, the read
|
|
129
|
+
* fails or a patch does not match — the handler never runs then.
|
|
130
|
+
*/
|
|
131
|
+
export declare function resolveSourcePatchesArg(toolName: string, inputSchema: any, args: any, ctx: HandlerContext | (() => Promise<HandlerContext>)): Promise<ResolvedPatch>;
|
|
132
|
+
/**
|
|
133
|
+
* Same source as SAP stores it: line endings, trailing blanks per line and
|
|
134
|
+
* trailing empty lines do not count (SAP's line storage drops them).
|
|
135
|
+
*/
|
|
136
|
+
export declare function sameSource(a: string, b: string): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* A failed patched call must not leave the patched source behind (e.g. an
|
|
139
|
+
* include fails at activation after its upload: SAP keeps the broken text as
|
|
140
|
+
* the inactive version). When the newest saved source now equals the patched
|
|
141
|
+
* text, the pre-patch source is uploaded again with the same tool: activated
|
|
142
|
+
* when there was no inactive version before (active and inactive back to the
|
|
143
|
+
* old state), else saved as the previous inactive version. Returns the line
|
|
144
|
+
* to add to the error.
|
|
145
|
+
*/
|
|
146
|
+
export declare function restoreAfterFailedPatch(r: PatchRestore, args: any, ctx: HandlerContext, invoke: (args: any) => Promise<any>): Promise<string>;
|
|
147
|
+
/** Failure text plus the undo note; stale staged-source advice removed when the undo succeeded. */
|
|
148
|
+
export declare function withUndoNote(message: string, note: string): string;
|
|
149
|
+
/**
|
|
150
|
+
* Run a resolved call; when it was a patch and it fails (throws or returns
|
|
151
|
+
* isError), undo a saved patched source before reporting the failure.
|
|
152
|
+
*/
|
|
153
|
+
export declare function runWithPatchRestore(resolved: ResolvedPatch, ctx: HandlerContext, invoke: (args: any) => Promise<any>): Promise<any>;
|
|
154
|
+
/**
|
|
155
|
+
* Add `patched` to a successful handler result: into the JSON of the first
|
|
156
|
+
* text item when it is a JSON object, else as an extra text item.
|
|
157
|
+
*/
|
|
158
|
+
export declare function attachPatchedInfo<T>(result: T, patched?: PatchedInfo): T;
|
|
159
|
+
export {};
|
|
160
|
+
//# sourceMappingURL=sourcePatchInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sourcePatchInput.d.ts","sourceRoot":"","sources":["../../src/lib/sourcePatchInput.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG5D,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,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