arc-1 0.9.5 → 0.9.7

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.
Files changed (107) hide show
  1. package/README.md +21 -3
  2. package/dist/adt/abapgit.d.ts +2 -1
  3. package/dist/adt/abapgit.d.ts.map +1 -1
  4. package/dist/adt/abapgit.js +2 -2
  5. package/dist/adt/abapgit.js.map +1 -1
  6. package/dist/adt/btp.d.ts.map +1 -1
  7. package/dist/adt/btp.js +7 -3
  8. package/dist/adt/btp.js.map +1 -1
  9. package/dist/adt/class-structure.d.ts +176 -0
  10. package/dist/adt/class-structure.d.ts.map +1 -0
  11. package/dist/adt/class-structure.js +317 -0
  12. package/dist/adt/class-structure.js.map +1 -0
  13. package/dist/adt/client.d.ts +150 -8
  14. package/dist/adt/client.d.ts.map +1 -1
  15. package/dist/adt/client.js +345 -12
  16. package/dist/adt/client.js.map +1 -1
  17. package/dist/adt/config.d.ts +7 -1
  18. package/dist/adt/config.d.ts.map +1 -1
  19. package/dist/adt/config.js.map +1 -1
  20. package/dist/adt/crud.d.ts +38 -0
  21. package/dist/adt/crud.d.ts.map +1 -1
  22. package/dist/adt/crud.js +73 -1
  23. package/dist/adt/crud.js.map +1 -1
  24. package/dist/adt/errors.d.ts +2 -2
  25. package/dist/adt/errors.d.ts.map +1 -1
  26. package/dist/adt/errors.js +50 -6
  27. package/dist/adt/errors.js.map +1 -1
  28. package/dist/adt/features.d.ts.map +1 -1
  29. package/dist/adt/features.js +27 -3
  30. package/dist/adt/features.js.map +1 -1
  31. package/dist/adt/gcts.d.ts +3 -2
  32. package/dist/adt/gcts.d.ts.map +1 -1
  33. package/dist/adt/gcts.js +4 -4
  34. package/dist/adt/gcts.js.map +1 -1
  35. package/dist/adt/http.d.ts +41 -0
  36. package/dist/adt/http.d.ts.map +1 -1
  37. package/dist/adt/http.js +132 -45
  38. package/dist/adt/http.js.map +1 -1
  39. package/dist/adt/package-hierarchy.d.ts +67 -0
  40. package/dist/adt/package-hierarchy.d.ts.map +1 -0
  41. package/dist/adt/package-hierarchy.js +100 -0
  42. package/dist/adt/package-hierarchy.js.map +1 -0
  43. package/dist/adt/release.d.ts +35 -0
  44. package/dist/adt/release.d.ts.map +1 -0
  45. package/dist/adt/release.js +48 -0
  46. package/dist/adt/release.js.map +1 -0
  47. package/dist/adt/safety.d.ts +39 -3
  48. package/dist/adt/safety.d.ts.map +1 -1
  49. package/dist/adt/safety.js +136 -15
  50. package/dist/adt/safety.js.map +1 -1
  51. package/dist/adt/types.d.ts +74 -0
  52. package/dist/adt/types.d.ts.map +1 -1
  53. package/dist/adt/xml-parser.d.ts +68 -1
  54. package/dist/adt/xml-parser.d.ts.map +1 -1
  55. package/dist/adt/xml-parser.js +263 -0
  56. package/dist/adt/xml-parser.js.map +1 -1
  57. package/dist/authz/policy.d.ts.map +1 -1
  58. package/dist/authz/policy.js +12 -0
  59. package/dist/authz/policy.js.map +1 -1
  60. package/dist/context/grep.d.ts +48 -0
  61. package/dist/context/grep.d.ts.map +1 -0
  62. package/dist/context/grep.js +146 -0
  63. package/dist/context/grep.js.map +1 -0
  64. package/dist/handlers/intent.d.ts +2 -1
  65. package/dist/handlers/intent.d.ts.map +1 -1
  66. package/dist/handlers/intent.js +614 -50
  67. package/dist/handlers/intent.js.map +1 -1
  68. package/dist/handlers/schemas.d.ts +52 -6
  69. package/dist/handlers/schemas.d.ts.map +1 -1
  70. package/dist/handlers/schemas.js +90 -9
  71. package/dist/handlers/schemas.js.map +1 -1
  72. package/dist/handlers/tools.d.ts.map +1 -1
  73. package/dist/handlers/tools.js +73 -12
  74. package/dist/handlers/tools.js.map +1 -1
  75. package/dist/lint/lint.d.ts.map +1 -1
  76. package/dist/lint/lint.js +6 -0
  77. package/dist/lint/lint.js.map +1 -1
  78. package/dist/lint/pre-write-hints.d.ts +45 -0
  79. package/dist/lint/pre-write-hints.d.ts.map +1 -0
  80. package/dist/lint/pre-write-hints.js +145 -0
  81. package/dist/lint/pre-write-hints.js.map +1 -0
  82. package/dist/server/audit.d.ts +27 -1
  83. package/dist/server/audit.d.ts.map +1 -1
  84. package/dist/server/audit.js.map +1 -1
  85. package/dist/server/auth-rate-limit.d.ts +78 -0
  86. package/dist/server/auth-rate-limit.d.ts.map +1 -0
  87. package/dist/server/auth-rate-limit.js +95 -0
  88. package/dist/server/auth-rate-limit.js.map +1 -0
  89. package/dist/server/config.d.ts.map +1 -1
  90. package/dist/server/config.js +32 -0
  91. package/dist/server/config.js.map +1 -1
  92. package/dist/server/http.d.ts.map +1 -1
  93. package/dist/server/http.js +73 -2
  94. package/dist/server/http.js.map +1 -1
  95. package/dist/server/mcp-rate-limit.d.ts +69 -0
  96. package/dist/server/mcp-rate-limit.d.ts.map +1 -0
  97. package/dist/server/mcp-rate-limit.js +92 -0
  98. package/dist/server/mcp-rate-limit.js.map +1 -0
  99. package/dist/server/server.d.ts +26 -6
  100. package/dist/server/server.d.ts.map +1 -1
  101. package/dist/server/server.js +87 -28
  102. package/dist/server/server.js.map +1 -1
  103. package/dist/server/types.d.ts +20 -1
  104. package/dist/server/types.d.ts.map +1 -1
  105. package/dist/server/types.js +2 -0
  106. package/dist/server/types.js.map +1 -1
  107. package/package.json +14 -12
@@ -0,0 +1,317 @@
1
+ /**
2
+ * Pure splice + diff helpers for class-section surgery (issue #303).
3
+ *
4
+ * All functions operate on `(source, structure)` and return new source. No HTTP,
5
+ * no lock, no I/O. The handler in `src/handlers/intent.ts` wires lock → splice →
6
+ * PUT /source/main → unlock around these.
7
+ *
8
+ * Line-range semantics (matches `LineRange` in `src/adt/types.ts`):
9
+ * - `sr`/`er` are 1-indexed rows. `sc`/`ec` are 0-indexed columns.
10
+ * - The `er` row is INCLUSIVE (the end token lives on that line).
11
+ * - The `ec` column is the column AFTER the end token (half-open [sc, ec)).
12
+ *
13
+ * Splice strategy:
14
+ * - Whole-line splices for class-level and method-level blocks (we never need
15
+ * sub-line precision; ABAP statements occupy whole lines).
16
+ * - When inserting/removing one METHOD pair, we must process IMPL ranges BEFORE
17
+ * DEFINITION ranges (they're at larger line numbers) so DEFINITION ranges
18
+ * stay valid even after the IMPL splice shifts later content.
19
+ *
20
+ * Line-ending handling: source from SAP is CRLF. Helpers detect the prevailing
21
+ * convention and re-emit it, so the PUT-back round-trips byte-for-byte (modulo
22
+ * the intended change).
23
+ */
24
+ // ─── Line-ending helpers ───────────────────────────────────────────────
25
+ /**
26
+ * Detect the prevailing line terminator in `source`. Defaults to CRLF when the
27
+ * source has no terminator (an unusual single-line PROG would be the only case
28
+ * — and a fresh write should match SAP's CRLF anyway).
29
+ */
30
+ function detectEol(source) {
31
+ return source.includes('\r\n') ? '\r\n' : '\n';
32
+ }
33
+ function splitLines(source) {
34
+ return source.split(/\r?\n/);
35
+ }
36
+ function joinLines(lines, eol) {
37
+ return lines.join(eol);
38
+ }
39
+ // ─── Whole-line splice primitives ──────────────────────────────────────
40
+ /**
41
+ * Replace whole lines `[sr..er]` (1-indexed, INCLUSIVE) with `replacement`.
42
+ * The replacement is line-split and reflowed with `source`'s prevailing EOL.
43
+ */
44
+ export function spliceLines(source, sr, er, replacement) {
45
+ const eol = detectEol(source);
46
+ const lines = splitLines(source);
47
+ if (sr < 1 || er < sr || er > lines.length) {
48
+ throw new RangeError(`spliceLines: invalid range sr=${sr} er=${er} (have ${lines.length} lines)`);
49
+ }
50
+ const before = lines.slice(0, sr - 1);
51
+ const after = lines.slice(er);
52
+ // Empty replacement means DELETE the range — splice in zero lines, not [''].
53
+ // (splitLines('') returns [''] which would leave a stray blank line behind.)
54
+ const replLines = replacement === '' ? [] : splitLines(replacement.replace(/\r?\n$/, ''));
55
+ return joinLines([...before, ...replLines, ...after], eol);
56
+ }
57
+ /**
58
+ * Insert `text` BEFORE line `lineNo` (1-indexed). When `lineNo === lines.length + 1`,
59
+ * appends at end. The inserted text gets `source`'s prevailing EOL.
60
+ */
61
+ export function insertBeforeLine(source, lineNo, text) {
62
+ const eol = detectEol(source);
63
+ const lines = splitLines(source);
64
+ if (lineNo < 1 || lineNo > lines.length + 1) {
65
+ throw new RangeError(`insertBeforeLine: invalid lineNo=${lineNo} (have ${lines.length} lines)`);
66
+ }
67
+ const before = lines.slice(0, lineNo - 1);
68
+ const after = lines.slice(lineNo - 1);
69
+ const insertLines = splitLines(text.replace(/\r?\n$/, ''));
70
+ return joinLines([...before, ...insertLines, ...after], eol);
71
+ }
72
+ // ─── Splice helpers backed by ClassStructure ───────────────────────────
73
+ /**
74
+ * Replace the class-level DEFINITION block lines with `newDefBlock`. Does NOT
75
+ * touch the IMPLEMENTATION block — callers run diff-then-refuse before this
76
+ * helper to ensure the result is activatable.
77
+ */
78
+ export function spliceClassDefinition(source, structure, newDefBlock) {
79
+ const r = structure.classDefinitionBlock;
80
+ return spliceLines(source, r.sr, r.er, newDefBlock);
81
+ }
82
+ /**
83
+ * Replace a single method's signature lines (the METHODS clause in DEFINITION)
84
+ * with `newSig`. Touches DEFINITION only — IMPLEMENTATION block is untouched,
85
+ * so any body incompatibility surfaces at SAP activation, not before. Mirrors
86
+ * `edit_method`'s contract.
87
+ */
88
+ export function spliceMethodSignature(source, method, newSig) {
89
+ if (!method.definition) {
90
+ throw new Error(`spliceMethodSignature: method ${method.name} has no definition range`);
91
+ }
92
+ const r = method.definition;
93
+ return spliceLines(source, r.sr, r.er, newSig);
94
+ }
95
+ /**
96
+ * Insert a METHODS declaration in the target visibility section AND (unless
97
+ * `isAbstract`) an empty `METHOD <name>. ENDMETHOD.` stub at the end of the
98
+ * IMPLEMENTATION block. Returns the new source (both halves spliced atomically).
99
+ *
100
+ * Anchor strategy:
101
+ * 1. PRIMARY — locate the LAST existing method in `visibility` per
102
+ * `structure.methods` and insert AFTER its `definition.er` row.
103
+ * 2. FALLBACK — when the section has zero existing methods, regex-scan the
104
+ * DEFINITION block source for `^\s*(PUBLIC|PROTECTED|PRIVATE)\s+SECTION\s*\.\s*$`
105
+ * and insert AFTER that line.
106
+ * 3. THROW — if neither anchor exists (section header missing), the caller
107
+ * MUST refuse the write and route the user to `edit_class_definition`.
108
+ *
109
+ * IMPL stub goes at end of `classImplementationBlock` (just before the trailing
110
+ * ENDCLASS of the IMPLEMENTATION block). When the class has no IMPLEMENTATION
111
+ * block at all (rare, all-abstract), only the DEFINITION is touched.
112
+ */
113
+ export function insertMethodPair(source, structure, opts) {
114
+ const anchor = findSectionAnchor(source, structure, opts.visibility);
115
+ if (anchor === null) {
116
+ throw new Error(`insertMethodPair: no ${opts.visibility.toUpperCase()} SECTION found in class ${structure.className}`);
117
+ }
118
+ // Stage 1: insert METHODS clause in DEFINITION.
119
+ let next = insertBeforeLine(source, anchor.afterLine + 1, opts.decl);
120
+ // Stage 2: insert IMPL stub (unless abstract). All IMPL line numbers shift by
121
+ // the count of inserted decl lines, so we adjust the end-of-impl-block anchor.
122
+ // insertedCount must match what insertBeforeLine ACTUALLY inserted — it strips
123
+ // a single trailing newline before splitting (line 76), so we strip here too.
124
+ // Without this, a caller-supplied `decl` with a trailing "\n" over-counts by one
125
+ // and the stub lands AFTER the IMPLEMENTATION's ENDCLASS (invalid ABAP).
126
+ if (!opts.isAbstract && structure.classImplementationBlock) {
127
+ const insertedCount = splitLines(opts.decl.replace(/\r?\n$/, '')).length;
128
+ const newImplEndLine = structure.classImplementationBlock.er + insertedCount;
129
+ const indent = opts.implIndent ?? ' ';
130
+ const stub = `${indent}METHOD ${opts.methodName.toLowerCase()}.\n${indent}ENDMETHOD.`;
131
+ next = insertBeforeLine(next, newImplEndLine, stub);
132
+ }
133
+ return next;
134
+ }
135
+ // ─── removeMethodPair: atomic DEFINITION + IMPLEMENTATION delete ──────
136
+ /**
137
+ * Remove a method from both DEFINITION and IMPLEMENTATION blocks. Removes in
138
+ * descending line-order (IMPL first, then DEF) so the earlier range stays valid
139
+ * after the later range is removed. ABSTRACT methods (no `implementation`
140
+ * range) only have their DEFINITION line range removed.
141
+ */
142
+ export function removeMethodPair(source, method) {
143
+ let next = source;
144
+ if (method.implementation) {
145
+ next = spliceLines(next, method.implementation.sr, method.implementation.er, '');
146
+ }
147
+ next = spliceLines(next, method.definition.sr, method.definition.er, '');
148
+ return next;
149
+ }
150
+ // ─── moveMethodDefinition: DEFINITION-only section move ────────────────
151
+ /**
152
+ * Move a method's METHODS clause from its current visibility section to a new
153
+ * location in the DEFINITION block, leaving the IMPLEMENTATION block UNTOUCHED.
154
+ *
155
+ * This is the body-preserving primitive behind `change_method_visibility`
156
+ * (issue #303 follow-up). Contrast with `delete_method` + `add_method`, which
157
+ * discards the method body and recreates an empty stub.
158
+ *
159
+ * Single-pass line walk over the ORIGINAL source: the method's `definition`
160
+ * lines are captured, every other line is re-emitted in order, and the captured
161
+ * clause is re-inserted immediately AFTER `targetAfterLine`. Because both the
162
+ * skip-range and the anchor are expressed in original 1-indexed line numbers,
163
+ * the walk is correct whether the target section sits above or below the
164
+ * method's current position — no index-shift arithmetic between a remove and an
165
+ * insert.
166
+ *
167
+ * `targetAfterLine` (1-indexed) is the line to insert AFTER — typically from
168
+ * `findSectionAnchor(source, structure, targetVisibility)`. It MUST lie outside
169
+ * the moved method's `definition` range; the caller guarantees this by only
170
+ * moving between DIFFERENT sections (a method's clause and the target-section
171
+ * anchor never overlap). A `targetAfterLine` inside the range is a caller bug
172
+ * and throws.
173
+ *
174
+ * IMPLEMENTATION is never read or written here — the METHOD…ENDMETHOD body is
175
+ * preserved verbatim. The clause keeps its original indentation.
176
+ */
177
+ export function moveMethodDefinition(source, method, targetAfterLine) {
178
+ if (!method.definition) {
179
+ throw new Error(`moveMethodDefinition: method ${method.name} has no definition range`);
180
+ }
181
+ const { sr, er } = method.definition;
182
+ if (targetAfterLine >= sr && targetAfterLine <= er) {
183
+ throw new RangeError(`moveMethodDefinition: targetAfterLine ${targetAfterLine} is inside the moved method's definition range [${sr}, ${er}]`);
184
+ }
185
+ const eol = detectEol(source);
186
+ const lines = splitLines(source);
187
+ const clause = lines.slice(sr - 1, er);
188
+ const out = [];
189
+ for (let i = 0; i < lines.length; i++) {
190
+ const lineNo = i + 1;
191
+ if (lineNo >= sr && lineNo <= er)
192
+ continue; // drop the moved clause from its old spot
193
+ out.push(lines[i]);
194
+ if (lineNo === targetAfterLine)
195
+ out.push(...clause); // re-insert after the anchor
196
+ }
197
+ return joinLines(out, eol);
198
+ }
199
+ // ─── findSectionAnchor ────────────────────────────────────────────────
200
+ /**
201
+ * Locate the insertion point for a new METHODS clause in the target visibility
202
+ * section. See `insertMethodPair` jsdoc for the two-step strategy.
203
+ *
204
+ * Returns `{ afterLine }` (1-indexed; the new clause goes on the line AFTER
205
+ * this row). Returns `null` if the section header doesn't exist in DEFINITION.
206
+ */
207
+ export function findSectionAnchor(source, structure, visibility) {
208
+ // Step 1: anchor after the LAST existing method in the target section.
209
+ const methods = structure.methods.filter((m) => m.visibility === visibility && m.definition);
210
+ if (methods.length > 0) {
211
+ const lastEr = Math.max(...methods.map((m) => m.definition.er));
212
+ return { afterLine: lastEr };
213
+ }
214
+ // Step 2: anchor immediately after the SECTION header line within the
215
+ // class-level DEFINITION block. Strip a trailing ABAP line comment (`"…`)
216
+ // before matching, so a header like ` PUBLIC SECTION. " public API` (very
217
+ // common in class templates) is still recognized. The `\.` requires the
218
+ // period after SECTION but no `$` anchor, tolerating trailing tokens.
219
+ const defBlock = structure.classDefinitionBlock;
220
+ const lines = splitLines(source);
221
+ const sectionRe = new RegExp(`^\\s*${visibility.toUpperCase()}\\s+SECTION\\s*\\.`, 'i');
222
+ for (let i = defBlock.sr - 1; i < Math.min(defBlock.er, lines.length); i++) {
223
+ const stripped = lines[i].replace(/"[^\n]*$/, '');
224
+ if (sectionRe.test(stripped))
225
+ return { afterLine: i + 1 };
226
+ }
227
+ return null;
228
+ }
229
+ /**
230
+ * Diff the method set declared in a NEW DEFINITION block against the current
231
+ * `structure.methods`. Uses abaplint's `Structures.ClassDefinition` AST to
232
+ * enumerate METHODS/CLASS-METHODS/EVENTS/INTERFACES/ALIASES declarations.
233
+ *
234
+ * Returns added/removed by name (UPPERCASE). The handler's refuse-policy then
235
+ * exempts ABSTRACT METHODS, EVENTS, INTERFACES, ALIASES from the symmetry
236
+ * check — only concrete methods that need a METHOD…ENDMETHOD block in IMPL.
237
+ */
238
+ export function diffMethodSets(structure, newDefBlock) {
239
+ const oldNames = new Set(structure.methods.map((m) => m.name));
240
+ const declared = parseDefinitionBlockDeclarations(newDefBlock);
241
+ const declaredNames = new Set(declared.map((d) => d.name));
242
+ const added = declared.filter((d) => !oldNames.has(d.name));
243
+ const removed = structure.methods.filter((m) => !declaredNames.has(m.name));
244
+ return { added, removed };
245
+ }
246
+ // ─── DEFINITION-block declaration parser (abaplint primary, regex fallback) ─
247
+ /**
248
+ * Enumerate METHODS / CLASS-METHODS / EVENTS / INTERFACES / ALIASES
249
+ * declarations in a NEW DEFINITION block string. Returns UPPERCASE names with
250
+ * the abstract/event/interface/alias flags.
251
+ *
252
+ * Implementation: regex-scan with leading-comment stripping. We deliberately
253
+ * avoid abaplint here — the fragment is a partial CLASS DEFINITION block and
254
+ * abaplint requires a synthetic IMPLEMENTATION shell wrapper to parse it,
255
+ * which obscures errors and adds complexity for no benefit. The regex handles
256
+ * single-line and multi-line METHODS clauses (REDEFINITION, ABSTRACT keyword
257
+ * detection, multi-line IMPORTING/EXPORTING tails) reliably for issue #303's
258
+ * symmetry-check use case. Edge cases (e.g. METHODS keyword inside a string
259
+ * literal) cannot occur in a valid DEFINITION block — there are no executable
260
+ * statements there.
261
+ */
262
+ export function parseDefinitionBlockDeclarations(defBlock) {
263
+ return parseWithRegex(defBlock);
264
+ }
265
+ function parseWithRegex(defBlock) {
266
+ const out = [];
267
+ // Strip block + line comments before scanning so commented-out METHODS don't count.
268
+ const stripped = defBlock.replace(/^\s*\*.*$/gm, '').replace(/"[^\n]*$/gm, '');
269
+ // METHODS / CLASS-METHODS <name> — multi-line clauses span until the period.
270
+ // We only need the NAME, so the regex looks at the start of each clause.
271
+ const methodRe = /^\s*(CLASS-METHODS|METHODS)\s+([A-Z_][A-Z0-9_]*)([^.]*)\./gim;
272
+ for (const m of stripped.matchAll(methodRe)) {
273
+ const name = m[2].toUpperCase();
274
+ const tail = m[3] ?? '';
275
+ const isAbstract = /\bABSTRACT\b/i.test(tail);
276
+ out.push({ name, isAbstract, isEvent: false, isInterface: false, isAlias: false });
277
+ }
278
+ const eventRe = /^\s*(CLASS-EVENTS|EVENTS)\s+([A-Z_][A-Z0-9_]*)/gim;
279
+ for (const m of stripped.matchAll(eventRe)) {
280
+ out.push({ name: m[2].toUpperCase(), isAbstract: false, isEvent: true, isInterface: false, isAlias: false });
281
+ }
282
+ const ifaceRe = /^\s*INTERFACES\s+([A-Z_][A-Z0-9_]*)/gim;
283
+ for (const m of stripped.matchAll(ifaceRe)) {
284
+ out.push({ name: m[1].toUpperCase(), isAbstract: false, isEvent: false, isInterface: true, isAlias: false });
285
+ }
286
+ const aliasRe = /^\s*ALIASES\s+([A-Z_][A-Z0-9_]*)/gim;
287
+ for (const m of stripped.matchAll(aliasRe)) {
288
+ out.push({ name: m[1].toUpperCase(), isAbstract: false, isEvent: false, isInterface: false, isAlias: true });
289
+ }
290
+ return out;
291
+ }
292
+ // ─── extractMethodNameFromClause ───────────────────────────────────────
293
+ /**
294
+ * Pull the method name out of a `METHODS x ...` or `CLASS-METHODS x ...` clause.
295
+ * Returns UPPERCASE name, or `null` if the clause doesn't start with a recognised
296
+ * keyword. Used by `add_method` to derive the IMPL stub name when the caller
297
+ * doesn't pass `methodName` explicitly.
298
+ *
299
+ * Comments and leading whitespace are skipped. Multi-line clauses are handled
300
+ * (the name is on the first non-comment line).
301
+ */
302
+ export function extractMethodNameFromClause(clause) {
303
+ // Strip leading line comments (`*…` whole-line + `"…` trailing).
304
+ const lines = clause.split(/\r?\n/);
305
+ for (const raw of lines) {
306
+ const line = raw.replace(/"[^\n]*$/, '').trim();
307
+ if (!line || line.startsWith('*'))
308
+ continue;
309
+ const m = line.match(/^(?:CLASS-METHODS|METHODS)\s+([A-Z_][A-Z0-9_~]*)/i);
310
+ if (m)
311
+ return m[1].toUpperCase();
312
+ // First non-comment line that isn't a METHODS keyword — bail.
313
+ return null;
314
+ }
315
+ return null;
316
+ }
317
+ //# sourceMappingURL=class-structure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"class-structure.js","sourceRoot":"","sources":["../../src/adt/class-structure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,0EAA0E;AAE1E;;;;GAIG;AACH,SAAS,SAAS,CAAC,MAAc;IAC/B,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CAAC;AAED,SAAS,UAAU,CAAC,MAAc;IAChC,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,SAAS,CAAC,KAAe,EAAE,GAAkB;IACpD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC;AAED,0EAA0E;AAE1E;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,MAAc,EAAE,EAAU,EAAE,EAAU,EAAE,WAAmB;IACrF,MAAM,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IAC9B,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IACjC,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QAC3C,MAAM,IAAI,UAAU,CAAC,iCAAiC,EAAE,OAAO,EAAE,UAAU,KAAK,CAAC,MAAM,SAAS,CAAC,CAAC;IACpG,CAAC;IACD,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC9B,6EAA6E;IAC7E,6EAA6E;IAC7E,M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AAE,CAAC;QACxB,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAChD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,SAAS;QAC5C,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;QAC1E,IAAI,CAAC;YAAE,OAAO,CAAC,CAAC,CAAC,CAAE,CAAC,WAAW,EAAE,CAAC;QAClC,8DAA8D;QAC9D,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -17,8 +17,9 @@
17
17
  */
18
18
  import type { AdtClientConfig } from './config.js';
19
19
  import { AdtHttpClient } from './http.js';
20
+ import { type PackageHierarchyResolver } from './package-hierarchy.js';
20
21
  import { type SafetyConfig } from './safety.js';
21
- import type { AdtObjectLookupResult, AdtSearchResult, ApiReleaseStateInfo, AuthorizationFieldInfo, BspAppInfo, BspFileNode, ClassMetadata, DataElementInfo, DomainInfo, EnhancementImplementationInfo, FeatureToggleInfo, InactiveObject, MessageClassInfo, RevisionListResult, SourceSearchResult, StructuredClassResponse, TransactionInfo } from './types.js';
22
+ import type { AdtObjectLookupResult, AdtSearchResult, ApiReleaseStateInfo, AuthorizationFieldInfo, BspAppInfo, BspFileNode, ClassMetadata, ClassStructure, DataElementInfo, DomainInfo, EnhancementImplementationInfo, FeatureToggleInfo, InactiveObject, MessageClassInfo, RevisionListResult, SourceSearchResult, StructuredClassResponse, TransactionInfo } from './types.js';
22
23
  export interface SourceReadResult {
23
24
  source: string;
24
25
  etag?: string;
@@ -30,14 +31,41 @@ export interface SourceReadOptions {
30
31
  version?: 'active' | 'inactive';
31
32
  accept?: string;
32
33
  }
34
+ /** Coerce a caller-supplied row limit into a safe positive integer in [1, MAX_TABLE_QUERY_ROWS].
35
+ * NaN / non-finite / non-positive / undefined fall back to the default (prevents `rowNumber=NaN`
36
+ * and unbounded result buffering). */
37
+ export declare function clampPreviewRows(requested: number | undefined, fallback?: number): number;
38
+ /**
39
+ * Build a safe SELECT statement from structured parameters.
40
+ * All identifiers are uppercased, stripped to word-chars + namespace slash, and rejected if empty.
41
+ * String values are single-quote escaped (doubled single quotes).
42
+ * IN/NOT IN values are strictly parsed as quoted literal lists (no subqueries).
43
+ * Raises if the table, any column, or any where-field is empty after sanitization.
44
+ * ORDER BY is intentionally omitted: the ADT freestyle endpoint rejects it on NW 7.50/7.51.
45
+ */
46
+ export declare function buildTableQuerySql(tableName: string, columns?: string[], where?: Array<{
47
+ field: string;
48
+ op: string;
49
+ value?: string;
50
+ }>): string;
33
51
  export declare class AdtClient {
34
52
  readonly http: AdtHttpClient;
35
53
  readonly safety: SafetyConfig;
36
54
  /** The configured SAP username (from --user / SAP_USER) */
37
55
  readonly username: string;
38
- /** Per-client cache of resolved TABL URLs (transparent table at /tables/, structure at /structures/).
39
- * Populated by getTabl() so subsequent write/activate paths skip the 404 retry. */
56
+ /** Per-client cache of resolved TABL URLs for **reads** (transparent table at
57
+ * /tables/, structure at /structures/). Populated by getTabl() via the
58
+ * /tables/→/structures/ 404 fallback. */
40
59
  private readonly tablUrlCache;
60
+ /** Per-client cache of resolved TABL URLs for **writes / activates / deletes**.
61
+ * Populated by `resolveTablObjectUrlForWrite()` after asking SAP for the
62
+ * actual `adtcore:type` (TABL/DT vs TABL/DS). Separate from `tablUrlCache`
63
+ * so the two contracts don't contaminate each other. See issue #285. */
64
+ private readonly tablWriteUrlCache;
65
+ /** Lazily-instantiated DEVCLASS hierarchy resolver — only built when a subtree
66
+ * allowedPackages rule is hit. Shared across `withSafety()` clones because the
67
+ * hierarchy is a property of the SAP system, not of the current safety scope. */
68
+ private packageHierarchyResolverHolder;
41
69
  constructor(options?: Partial<AdtClientConfig>);
42
70
  /**
43
71
  * Create a lightweight copy of this client with a different safety config.
@@ -45,15 +73,47 @@ export declare class AdtClient {
45
73
  * Used for per-request safety derived from JWT scopes.
46
74
  */
47
75
  withSafety(safety: SafetyConfig): AdtClient;
76
+ /**
77
+ * Lazily build (and return) the DEVCLASS hierarchy resolver. The resolver
78
+ * powers `ZFOO/**` subtree rules in `allowedPackages`; reads/writes that
79
+ * don't trigger a subtree rule never instantiate it (zero cost).
80
+ *
81
+ * Shared across `withSafety()` clones — the hierarchy is per-SAP-system, not
82
+ * per-safety-scope. Cache invalidation is exposed via `invalidatePackageHierarchy()`.
83
+ */
84
+ getPackageHierarchyResolver(): PackageHierarchyResolver;
85
+ /** Invalidate the resolver cache. Called after admin actions that change the
86
+ * hierarchy (create_package / change_package / delete_package). */
87
+ invalidatePackageHierarchy(root?: string): void;
48
88
  private fetchSource;
49
89
  /** Get program source code */
50
90
  getProgram(name: string, opts?: SourceReadOptions): Promise<SourceReadResult>;
51
91
  /** Get class source code (main include by default) */
52
92
  getClass(name: string, include?: string, opts?: SourceReadOptions): Promise<SourceReadResult>;
93
+ /**
94
+ * Get the RAW source of a single class include (no `=== inc ===` wrapper that
95
+ * `getClass(name, include)` adds), so line numbers stay accurate for grep.
96
+ */
97
+ getClassInclude(name: string, include: string, opts?: SourceReadOptions): Promise<SourceReadResult>;
53
98
  /** Get class metadata (description, language, category, etc.) from the object endpoint */
54
99
  getClassMetadata(name: string): Promise<ClassMetadata>;
55
100
  /** Get structured class response with metadata + decomposed includes */
56
101
  getClassStructured(name: string): Promise<StructuredClassResponse>;
102
+ /**
103
+ * Get the class structure map (line ranges for DEFINITION / IMPLEMENTATION
104
+ * blocks, per-method/attribute ranges) from `/sap/bc/adt/oo/classes/{name}/objectstructure`.
105
+ *
106
+ * The endpoint is read-only — the response carries `#start=L,C;end=L,C`
107
+ * coordinates that `class-section surgery` actions (`edit_class_definition`,
108
+ * `add_method`, `edit_method_signature`, `delete_method`) use to splice into
109
+ * `/source/main` without re-sending the full class. Issue #303.
110
+ *
111
+ * Cross-release: works on both NW 7.50 SP02 (split CLAS/OO + CLAS/OM elements
112
+ * merged by name) and S/4HANA 2023 kernel 7.58+ (single CLAS/OM per method).
113
+ * MIME negotiation is delegated to the discovery cache in http.ts — v1+xml on
114
+ * 7.50, v2+xml on 7.58+.
115
+ */
116
+ getClassStructure(name: string, version?: 'active' | 'inactive'): Promise<ClassStructure>;
57
117
  /** Get interface source code */
58
118
  getInterface(name: string, opts?: SourceReadOptions): Promise<SourceReadResult>;
59
119
  /** Get function module source code */
@@ -109,12 +169,37 @@ export declare class AdtClient {
109
169
  * Tries /tables/ first, falls back to /structures/ on 404. Caches the resolved
110
170
  * URL on the client for subsequent write/activate operations. */
111
171
  getTabl(name: string, opts?: SourceReadOptions): Promise<SourceReadResult>;
112
- /** Resolve the canonical ADT URL for a TABL name (transparent table or structure).
113
- * Returns the cached URL if a previous getTabl() resolved it; otherwise probes
114
- * /tables/ first and /structures/ on 404. Result is cached per client.
115
- * Used by write/activate/delete paths where the URL must match the object's
116
- * actual location (transparent vs structure). */
172
+ /** Resolve the canonical ADT URL for a TABL name (transparent table or structure)
173
+ * for the **read** path. Probes /tables/ first and falls back to /structures/ on
174
+ * 404. The source body is identical either way, so the fallback is safe for reads.
175
+ * Result is cached per client.
176
+ *
177
+ * Do NOT use this for writes/activates — on NW 7.50 the /tables/ endpoint is
178
+ * absent entirely, so transparent tables (TABL/DT) fall through to /structures/
179
+ * and a PUT there silently sets DD02L-TABCLASS=INTTAB (corruption). Use
180
+ * `resolveTablObjectUrlForWrite()` instead. See issue #285. */
117
181
  resolveTablObjectUrl(name: string): Promise<string>;
182
+ /** Resolve the canonical ADT URL for a TABL name on the **write/activate/delete**
183
+ * path. Unlike `resolveTablObjectUrl()`, this never falls back blindly to
184
+ * /structures/ — it asks SAP what the object actually is (via repository search)
185
+ * and refuses transparent-table writes on systems where /sap/bc/adt/ddic/tables/
186
+ * is absent (NW 7.50 ships /ddic/structures/ only; the table editor was added
187
+ * in NW 7.52). Returning /structures/ for a TABL/DT object would let a PUT
188
+ * silently flip DD02L-TABCLASS to INTTAB on the inactive draft (issue #285).
189
+ *
190
+ * Resolution order:
191
+ * 1. Search returns `TABL/DT` → require /tables/ availability, return /tables/<n>
192
+ * or throw AdtSafetyError with SE11 hint.
193
+ * 2. Search returns `TABL/DS` → return /structures/<n> (always allowed).
194
+ * 3. Search returns nothing (or a different type) → fall through to the
195
+ * read-path resolver. The caller is creating something new or the object
196
+ * was just renamed; subsequent ADT calls will surface the real error.
197
+ *
198
+ * Caches separately from the read resolver so the two contracts don't
199
+ * contaminate each other. */
200
+ resolveTablObjectUrlForWrite(name: string, options?: {
201
+ tablesEndpointAvailable?: boolean;
202
+ }): Promise<string>;
118
203
  /** Get domain metadata (type, length, value table, fixed values) */
119
204
  getDomain(name: string): Promise<DomainInfo>;
120
205
  /** Get data element metadata (domain, labels, search help) */
@@ -214,6 +299,36 @@ export declare class AdtClient {
214
299
  description: string;
215
300
  uri: string;
216
301
  }>>;
302
+ /**
303
+ * Direct sub-packages of `packageName` — names only, uppercased, deduplicated.
304
+ *
305
+ * Uses ADT's `POST /sap/bc/adt/repository/nodestructure` with
306
+ * `parent_type=DEVC/K`, which is the canonical primitive for "direct
307
+ * children of package X" — returning exactly the set of DEVCLASS rows
308
+ * whose `TDEVC.PARENTCL = packageName`. Verified live against S/4HANA
309
+ * 2023 to match `SELECT devclass FROM tdevc WHERE parentcl = ?` for
310
+ * a range of roots, including namespace packages (`/AIF/MAIN`) and
311
+ * deep subtrees (5 levels under `SABP_TOOLS`).
312
+ *
313
+ * NOTE: the previous implementation used
314
+ * `informationsystem/search?packageName=X&objectType=DEVC/K`, which
315
+ * silently ignores `packageName` and returns ~1000 unrelated packages.
316
+ * That bug caused `allowedPackages` `X/**` rules to silently over-grant
317
+ * writes to unrelated packages. See
318
+ * `docs/research/package-subtree-endpoints.md` for the comparative analysis.
319
+ *
320
+ * Backs the `allowedPackages` subtree-rule (`ZFOO/**`) safety gate, so any
321
+ * failure (network, 4xx/5xx, parse) is surfaced as an exception, NEVER as
322
+ * an empty list. An empty list always means "SAP returned no children" —
323
+ * `nodestructure` responds with HTTP 200 and an empty (or absent) body
324
+ * for an unknown `parent_name`.
325
+ *
326
+ * `maxResults` is preserved for API compatibility and applied as a
327
+ * defense-in-depth post-filter on the parsed result. `nodestructure`
328
+ * itself does not honour a maxResults parameter on the SAP side and
329
+ * returns the full child set in one round-trip.
330
+ */
331
+ getSubpackages(packageName: string, maxResults?: number): Promise<string[]>;
217
332
  /** Get table contents via data preview */
218
333
  getTableContents(tableName: string, maxRows?: number, sqlFilter?: string): Promise<{
219
334
  columns: string[];
@@ -224,6 +339,25 @@ export declare class AdtClient {
224
339
  columns: string[];
225
340
  rows: Record<string, string>[];
226
341
  }>;
342
+ /**
343
+ * Query a table or CDS view with structured parameters.
344
+ * Builds the SELECT server-side from structured params. IN/NOT IN values are strictly
345
+ * parsed as quoted literal lists (no subqueries). Uses the freestyle endpoint so
346
+ * multi-column WHERE and CDS views work on all SAP releases.
347
+ * Gated by allowDataPreview (not allowFreeSQL).
348
+ */
349
+ runTableQuery(tableName: string, opts?: {
350
+ columns?: string[];
351
+ where?: Array<{
352
+ field: string;
353
+ op: string;
354
+ value?: string;
355
+ }>;
356
+ maxRows?: number;
357
+ }): Promise<{
358
+ columns: string[];
359
+ rows: Record<string, string>[];
360
+ }>;
227
361
  /** Get system info as structured JSON (user, system details from discovery XML) */
228
362
  getSystemInfo(): Promise<string>;
229
363
  /** Get installed SAP components */
@@ -250,6 +384,14 @@ export declare class AdtClient {
250
384
  * Resolve the ABAP package of an existing object by fetching its metadata.
251
385
  * Returns the package name (e.g., "$TMP", "ZPACKAGE") or empty string if not found.
252
386
  * Used by SAPWrite to enforce allowedPackages on update/delete/edit_method.
387
+ *
388
+ * Top-level objects (CLAS, INTF, PROG, TABL, DDLS, ...) expose
389
+ * `<adtcore:packageRef adtcore:name="…"/>` directly. Contained objects
390
+ * (notably FUNC, which lives inside a FUGR) instead expose the package via
391
+ * `<adtcore:containerRef … adtcore:packageName="…"/>` since their own
392
+ * `packageRef` would just point at the parent — the `containerRef` already
393
+ * surfaces the package as a denormalised attribute. Both shapes resolve
394
+ * to the same package; we accept either.
253
395
  */
254
396
  resolveObjectPackage(objectUrl: string): Promise<string>;
255
397
  }
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/adt/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGnD,OAAO,EAAE,aAAa,EAAsB,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAiC,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAE/E,OAAO,KAAK,EACV,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,UAAU,EACV,WAAW,EACX,aAAa,EACb,eAAe,EACf,UAAU,EACV,6BAA6B,EAC7B,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EAChB,MAAM,YAAY,CAAC;AAwBpB,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA4ED,qBAAa,SAAS;IACpB,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;wFACoF;IACpF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6B;gBAE9C,OAAO,GAAE,OAAO,CAAC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