arc-1 0.9.13 → 0.9.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -4
- package/dist/adt/class-structure.d.ts +1 -1
- package/dist/adt/class-structure.js +1 -1
- package/dist/adt/client.d.ts +16 -3
- package/dist/adt/client.d.ts.map +1 -1
- package/dist/adt/client.js +40 -35
- package/dist/adt/client.js.map +1 -1
- package/dist/adt/ddic-xml.d.ts +9 -0
- package/dist/adt/ddic-xml.d.ts.map +1 -1
- package/dist/adt/ddic-xml.js +49 -53
- package/dist/adt/ddic-xml.js.map +1 -1
- package/dist/adt/devtools.d.ts.map +1 -1
- package/dist/adt/devtools.js +46 -15
- package/dist/adt/devtools.js.map +1 -1
- package/dist/adt/fm-signature.d.ts +1 -1
- package/dist/adt/fm-signature.js +1 -1
- package/dist/adt/rap-generate.js +1 -1
- package/dist/adt/rap-generate.js.map +1 -1
- package/dist/adt/rap-handlers.d.ts +1 -1
- package/dist/adt/rap-handlers.js +1 -1
- package/dist/adt/refactoring.d.ts.map +1 -1
- package/dist/adt/refactoring.js +11 -14
- package/dist/adt/refactoring.js.map +1 -1
- package/dist/adt/server-driven.d.ts +46 -2
- package/dist/adt/server-driven.d.ts.map +1 -1
- package/dist/adt/server-driven.js +13 -3
- package/dist/adt/server-driven.js.map +1 -1
- package/dist/adt/xml-parser.d.ts +8 -1
- package/dist/adt/xml-parser.d.ts.map +1 -1
- package/dist/adt/xml-parser.js +57 -49
- package/dist/adt/xml-parser.js.map +1 -1
- package/dist/authz/policy.d.ts +1 -1
- package/dist/authz/policy.js +1 -1
- package/dist/cache/cache.d.ts +1 -0
- package/dist/cache/cache.d.ts.map +1 -1
- package/dist/cache/cache.js.map +1 -1
- package/dist/cache/inactive-list-cache.d.ts +4 -4
- package/dist/cache/inactive-list-cache.d.ts.map +1 -1
- package/dist/cache/inactive-list-cache.js +19 -12
- package/dist/cache/inactive-list-cache.js.map +1 -1
- package/dist/cache/memory.d.ts +1 -0
- package/dist/cache/memory.d.ts.map +1 -1
- package/dist/cache/memory.js +3 -0
- package/dist/cache/memory.js.map +1 -1
- package/dist/cache/sqlite.d.ts +1 -0
- package/dist/cache/sqlite.d.ts.map +1 -1
- package/dist/cache/sqlite.js +3 -0
- package/dist/cache/sqlite.js.map +1 -1
- package/dist/cache/warmup.d.ts.map +1 -1
- package/dist/cache/warmup.js +85 -38
- package/dist/cache/warmup.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/dist/context/compressor.d.ts.map +1 -1
- package/dist/context/compressor.js +22 -13
- package/dist/context/compressor.js.map +1 -1
- package/dist/context/contract.d.ts.map +1 -1
- package/dist/context/contract.js +4 -3
- package/dist/context/contract.js.map +1 -1
- package/dist/context/deps.d.ts.map +1 -1
- package/dist/context/deps.js +3 -2
- package/dist/context/deps.js.map +1 -1
- package/dist/context/grep.d.ts +3 -1
- package/dist/context/grep.d.ts.map +1 -1
- package/dist/context/grep.js +83 -1
- package/dist/context/grep.js.map +1 -1
- package/dist/context/method-surgery.d.ts.map +1 -1
- package/dist/context/method-surgery.js +3 -2
- package/dist/context/method-surgery.js.map +1 -1
- package/dist/handlers/activate.d.ts +25 -0
- package/dist/handlers/activate.d.ts.map +1 -0
- package/dist/handlers/activate.js +334 -0
- package/dist/handlers/activate.js.map +1 -0
- package/dist/handlers/cache-security.d.ts +22 -0
- package/dist/handlers/cache-security.d.ts.map +1 -0
- package/dist/handlers/cache-security.js +51 -0
- package/dist/handlers/cache-security.js.map +1 -0
- package/dist/handlers/cds-hints.d.ts +26 -0
- package/dist/handlers/cds-hints.d.ts.map +1 -0
- package/dist/handlers/cds-hints.js +380 -0
- package/dist/handlers/cds-hints.js.map +1 -0
- package/dist/handlers/context.d.ts +10 -0
- package/dist/handlers/context.d.ts.map +1 -0
- package/dist/handlers/context.js +344 -0
- package/dist/handlers/context.js.map +1 -0
- package/dist/handlers/diagnose.d.ts +8 -0
- package/dist/handlers/diagnose.d.ts.map +1 -0
- package/dist/handlers/diagnose.js +274 -0
- package/dist/handlers/diagnose.js.map +1 -0
- package/dist/handlers/dispatch.d.ts +39 -0
- package/dist/handlers/dispatch.d.ts.map +1 -0
- package/dist/handlers/dispatch.js +640 -0
- package/dist/handlers/dispatch.js.map +1 -0
- package/dist/handlers/feature-cache.d.ts +26 -0
- package/dist/handlers/feature-cache.d.ts.map +1 -0
- package/dist/handlers/feature-cache.js +45 -0
- package/dist/handlers/feature-cache.js.map +1 -0
- package/dist/handlers/git.d.ts +9 -0
- package/dist/handlers/git.d.ts.map +1 -0
- package/dist/handlers/git.js +227 -0
- package/dist/handlers/git.js.map +1 -0
- package/dist/handlers/lint.d.ts +9 -0
- package/dist/handlers/lint.d.ts.map +1 -0
- package/dist/handlers/lint.js +82 -0
- package/dist/handlers/lint.js.map +1 -0
- package/dist/handlers/manage.d.ts +10 -0
- package/dist/handlers/manage.d.ts.map +1 -0
- package/dist/handlers/manage.js +375 -0
- package/dist/handlers/manage.js.map +1 -0
- package/dist/handlers/navigate.d.ts +8 -0
- package/dist/handlers/navigate.d.ts.map +1 -0
- package/dist/handlers/navigate.js +188 -0
- package/dist/handlers/navigate.js.map +1 -0
- package/dist/handlers/object-types.d.ts +103 -0
- package/dist/handlers/object-types.d.ts.map +1 -0
- package/dist/handlers/object-types.js +476 -0
- package/dist/handlers/object-types.js.map +1 -0
- package/dist/handlers/query.d.ts +7 -0
- package/dist/handlers/query.d.ts.map +1 -0
- package/dist/handlers/query.js +190 -0
- package/dist/handlers/query.js.map +1 -0
- package/dist/handlers/read.d.ts +18 -0
- package/dist/handlers/read.d.ts.map +1 -0
- package/dist/handlers/read.js +581 -0
- package/dist/handlers/read.js.map +1 -0
- package/dist/handlers/schemas.d.ts +28 -26
- package/dist/handlers/schemas.d.ts.map +1 -1
- package/dist/handlers/schemas.js +17 -153
- package/dist/handlers/schemas.js.map +1 -1
- package/dist/handlers/search.d.ts +24 -0
- package/dist/handlers/search.d.ts.map +1 -0
- package/dist/handlers/search.js +208 -0
- package/dist/handlers/search.js.map +1 -0
- package/dist/handlers/shared.d.ts +19 -0
- package/dist/handlers/shared.d.ts.map +1 -0
- package/dist/handlers/shared.js +23 -0
- package/dist/handlers/shared.js.map +1 -0
- package/dist/handlers/tool-registry.d.ts +44 -0
- package/dist/handlers/tool-registry.d.ts.map +1 -0
- package/dist/handlers/tool-registry.js +152 -0
- package/dist/handlers/tool-registry.js.map +1 -0
- package/dist/handlers/tools.d.ts +9 -0
- package/dist/handlers/tools.d.ts.map +1 -1
- package/dist/handlers/tools.js +40 -141
- package/dist/handlers/tools.js.map +1 -1
- package/dist/handlers/transport.d.ts +8 -0
- package/dist/handlers/transport.d.ts.map +1 -0
- package/dist/handlers/transport.js +281 -0
- package/dist/handlers/transport.js.map +1 -0
- package/dist/handlers/write/class-surgery.d.ts +18 -0
- package/dist/handlers/write/class-surgery.d.ts.map +1 -0
- package/dist/handlers/write/class-surgery.js +366 -0
- package/dist/handlers/write/class-surgery.js.map +1 -0
- package/dist/handlers/write/context.d.ts +43 -0
- package/dist/handlers/write/context.d.ts.map +1 -0
- package/dist/handlers/write/context.js +5 -0
- package/dist/handlers/write/context.js.map +1 -0
- package/dist/handlers/write/create.d.ts +8 -0
- package/dist/handlers/write/create.d.ts.map +1 -0
- package/dist/handlers/write/create.js +603 -0
- package/dist/handlers/write/create.js.map +1 -0
- package/dist/handlers/write/rap.d.ts +8 -0
- package/dist/handlers/write/rap.d.ts.map +1 -0
- package/dist/handlers/write/rap.js +235 -0
- package/dist/handlers/write/rap.js.map +1 -0
- package/dist/handlers/write/update-delete.d.ts +8 -0
- package/dist/handlers/write/update-delete.d.ts.map +1 -0
- package/dist/handlers/write/update-delete.js +182 -0
- package/dist/handlers/write/update-delete.js.map +1 -0
- package/dist/handlers/write-helpers.d.ts +155 -0
- package/dist/handlers/write-helpers.d.ts.map +1 -0
- package/dist/handlers/write-helpers.js +859 -0
- package/dist/handlers/write-helpers.js.map +1 -0
- package/dist/handlers/write.d.ts +16 -0
- package/dist/handlers/write.d.ts.map +1 -0
- package/dist/handlers/write.js +210 -0
- package/dist/handlers/write.js.map +1 -0
- package/dist/handlers/zod-errors.d.ts +1 -1
- package/dist/handlers/zod-errors.js +1 -1
- package/dist/lint/abaplint-config-cache.d.ts +5 -0
- package/dist/lint/abaplint-config-cache.d.ts.map +1 -0
- package/dist/lint/abaplint-config-cache.js +29 -0
- package/dist/lint/abaplint-config-cache.js.map +1 -0
- package/dist/lint/config-builder.d.ts.map +1 -1
- package/dist/lint/config-builder.js +3 -4
- package/dist/lint/config-builder.js.map +1 -1
- package/dist/lint/lint.d.ts +1 -1
- package/dist/lint/lint.d.ts.map +1 -1
- package/dist/lint/lint.js +3 -2
- package/dist/lint/lint.js.map +1 -1
- package/dist/server/config.d.ts.map +1 -1
- package/dist/server/config.js +22 -8
- package/dist/server/config.js.map +1 -1
- package/dist/server/mcp-rate-limit.d.ts +1 -1
- package/dist/server/mcp-rate-limit.js +1 -1
- package/dist/server/server.d.ts +1 -1
- package/dist/server/server.js +3 -2
- package/dist/server/server.js.map +1 -1
- package/package.json +15 -10
- package/dist/handlers/intent.d.ts +0 -144
- package/dist/handlers/intent.d.ts.map +0 -1
- package/dist/handlers/intent.js +0 -6782
- package/dist/handlers/intent.js.map +0 -1
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SAPWrite actions — class-section surgery (issue #303).
|
|
3
|
+
*
|
|
4
|
+
* These actions share a common shape: fetch objectstructure → optional diff/refuse → splice into
|
|
5
|
+
* /source/main (or /includes/<inc> when include= is set) → PUT under lock → no auto-activate.
|
|
6
|
+
* Pre-write lint runs on the SPLICED FULL source (not the partial input fragment) because a raw
|
|
7
|
+
* DEFINITION block alone fails abaplint with "Expected CLASSIMPLEMENTATION" (verified live on a4h);
|
|
8
|
+
* lint is skipped for include= writes (same precedent as the `update include=` path).
|
|
9
|
+
*/
|
|
10
|
+
import { diffMethodSets, extractMethodNameFromClause, findSectionAnchor, insertMethodPair, moveMethodDefinition, removeMethodPair, spliceClassDefinition, spliceMethodSignature, } from '../../adt/class-structure.js';
|
|
11
|
+
import { safeUpdateSource } from '../../adt/crud.js';
|
|
12
|
+
import { mapSapReleaseToAbaplintVersion } from '../../adt/features.js';
|
|
13
|
+
import { spliceMethod } from '../../context/method-surgery.js';
|
|
14
|
+
import { cachedFeatures } from '../feature-cache.js';
|
|
15
|
+
import { CLASS_WRITE_INCLUDES, classIncludeUrl, detectLocalHandlerInclude, stripIncludeHeader, } from '../object-types.js';
|
|
16
|
+
import { resolveVersionAndDraftInfo } from '../read.js';
|
|
17
|
+
import { errorResult, textResult } from '../shared.js';
|
|
18
|
+
import { runPreWriteLint, runPreWriteSyntaxCheck } from '../write-helpers.js';
|
|
19
|
+
export async function writeActionEditMethod(ctx) {
|
|
20
|
+
const { client, args, config, cachingLayer, cacheSecurity, type, name, source, include, transport, lintOverride, checkOverride, objectUrl, srcUrl, invalidateWrittenObject, enforcePackageForExistingObject, } = ctx;
|
|
21
|
+
const method = String(args.method ?? '');
|
|
22
|
+
if (!method)
|
|
23
|
+
return errorResult('"method" is required for edit_method action.');
|
|
24
|
+
if (!source)
|
|
25
|
+
return errorResult('"source" (new method body) is required for edit_method action.');
|
|
26
|
+
if (type !== 'CLAS')
|
|
27
|
+
return errorResult('edit_method is only supported for type=CLAS.');
|
|
28
|
+
await enforcePackageForExistingObject();
|
|
29
|
+
// ── Resolve which class section the method body lives in ──
|
|
30
|
+
// Order:
|
|
31
|
+
// 1. Explicit `include` parameter wins (must be a valid CLAS include).
|
|
32
|
+
// If the user passed something but normalization rejected it,
|
|
33
|
+
// report it the same way `case 'update'` does.
|
|
34
|
+
// 2. Auto-detect from local-class prefix in `method` specifier
|
|
35
|
+
// (lhc_*/lcl_* → implementations, ltc_* → testclasses). This is
|
|
36
|
+
// transparent to RAP-skill callers passing `lhc_project~approve_project`.
|
|
37
|
+
// 3. Fall through to MAIN (existing behavior — covers global classes
|
|
38
|
+
// and `zif_order~create` style interface methods).
|
|
39
|
+
if (args.include !== undefined && !include) {
|
|
40
|
+
return errorResult(`Invalid CLAS include "${String(args.include)}". Valid values: ${CLASS_WRITE_INCLUDES.join(', ')}.`);
|
|
41
|
+
}
|
|
42
|
+
const detectedInclude = include ? undefined : detectLocalHandlerInclude(method);
|
|
43
|
+
const resolvedInclude = include ?? detectedInclude;
|
|
44
|
+
// Fetch the source that contains the method.
|
|
45
|
+
// Note: include reads bypass the source cache because the cache key is
|
|
46
|
+
// `(type, name, active|inactive)` and does not differentiate by include.
|
|
47
|
+
// Mixing MAIN and CCIMP bytes under the same key would silently corrupt
|
|
48
|
+
// subsequent reads. Future enhancement: extend cache key with include.
|
|
49
|
+
let currentSource;
|
|
50
|
+
if (resolvedInclude) {
|
|
51
|
+
// **Draft-aware include reads (PR-D review fix, P1).**
|
|
52
|
+
// After `SAPWrite update include=...` or `scaffold_rap_handlers`, the
|
|
53
|
+
// edited CCDEF/CCIMP lives as an inactive draft; the active include
|
|
54
|
+
// is often still the empty placeholder. Reading "active" here would
|
|
55
|
+
// splice against stale content (and frequently "method not found").
|
|
56
|
+
// Use the standard inactive-list lookup to pick the right version —
|
|
57
|
+
// same auto-resolution semantics SAPRead exposes via `version='auto'`.
|
|
58
|
+
const { effectiveVersion } = await resolveVersionAndDraftInfo(client, cachingLayer, 'CLAS', name, 'auto', cacheSecurity);
|
|
59
|
+
const fetched = await client.getClass(name, resolvedInclude, { version: effectiveVersion });
|
|
60
|
+
currentSource = stripIncludeHeader(fetched.source);
|
|
61
|
+
// If the include itself has no draft (only MAIN does), SAP returns the
|
|
62
|
+
// active include body for `?version=inactive`. That's correct — we
|
|
63
|
+
// splice whatever the editor would see. If the include source isn't
|
|
64
|
+
// available at all (response contains the "not available" placeholder
|
|
65
|
+
// injected by client.getClass on 404), splice will surface a clean
|
|
66
|
+
// "method not found" with the include name.
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
currentSource = cachingLayer
|
|
70
|
+
? (await cachingLayer.getSource('CLAS', name, (ifNoneMatch) => client.getClass(name, undefined, { ifNoneMatch })))
|
|
71
|
+
.source
|
|
72
|
+
: (await client.getClass(name)).source;
|
|
73
|
+
}
|
|
74
|
+
// Use detected ABAP version from probe if available
|
|
75
|
+
const abaplintVer = cachedFeatures?.abapRelease
|
|
76
|
+
? mapSapReleaseToAbaplintVersion(cachedFeatures.abapRelease)
|
|
77
|
+
: undefined;
|
|
78
|
+
// Splice in the new method body
|
|
79
|
+
const spliced = spliceMethod(currentSource, name, method, source, abaplintVer);
|
|
80
|
+
if (!spliced.success) {
|
|
81
|
+
// Augment the error with which include was searched, so the LLM can
|
|
82
|
+
// either correct the method specifier or override include= explicitly.
|
|
83
|
+
const where = resolvedInclude ? `include "${resolvedInclude}"` : 'main source';
|
|
84
|
+
const baseError = spliced.error ?? `Failed to splice method "${method}" in ${name}.`;
|
|
85
|
+
const hint = detectedInclude ? ` (auto-routed via "${method}" prefix; pass include= explicitly to override).` : '';
|
|
86
|
+
return errorResult(`${baseError} Searched ${where} of ${name}.${hint}`);
|
|
87
|
+
}
|
|
88
|
+
// Pre-write lint + server-side syntax check on the spliced source.
|
|
89
|
+
//
|
|
90
|
+
// Skip BOTH for include= writes. abaplint cannot parse a CCIMP/CCDEF
|
|
91
|
+
// fragment as a complete class (the DEFINITION/IMPLEMENTATION halves
|
|
92
|
+
// live in different files), so it would block legitimate writes with
|
|
93
|
+
// "Expected CLASSDEFINITION" errors. The existing `case 'update'` include=
|
|
94
|
+
// path also bypasses these checks for the same reason — keep parity.
|
|
95
|
+
// The full-class activation pass after the write is the authoritative
|
|
96
|
+
// syntax check.
|
|
97
|
+
let lintWarnings = { blocked: false };
|
|
98
|
+
let checkNotes = '';
|
|
99
|
+
if (!resolvedInclude) {
|
|
100
|
+
lintWarnings = runPreWriteLint(spliced.newSource, type, name, config, lintOverride);
|
|
101
|
+
if (lintWarnings.blocked)
|
|
102
|
+
return lintWarnings.result;
|
|
103
|
+
checkNotes = await runPreWriteSyntaxCheck(client, type, spliced.newSource, objectUrl, config, checkOverride);
|
|
104
|
+
}
|
|
105
|
+
// Write the full source back (existing lock/modify/unlock flow).
|
|
106
|
+
// For include writes, the parent class lock auto-applies; the include URL
|
|
107
|
+
// takes the body. See `compare/eclipse-adt/api/05-lock-create-update-transport.md`.
|
|
108
|
+
const writeUrl = resolvedInclude ? classIncludeUrl(name, resolvedInclude) : srcUrl;
|
|
109
|
+
await safeUpdateSource(client.http, client.safety, objectUrl, writeUrl, spliced.newSource, transport, cachedFeatures?.abapRelease);
|
|
110
|
+
invalidateWrittenObject(type, name);
|
|
111
|
+
const where = resolvedInclude ? ` (include: ${resolvedInclude})` : '';
|
|
112
|
+
const msg = `Successfully updated method "${method}" in ${type} ${name}${where}.`;
|
|
113
|
+
const extras = [lintWarnings.warnings, checkNotes].filter(Boolean).join('\n\n');
|
|
114
|
+
return extras ? textResult(`${msg}\n\n${extras}`) : textResult(msg);
|
|
115
|
+
}
|
|
116
|
+
export async function writeActionEditClassDefinition(ctx) {
|
|
117
|
+
const { client, args, config, type, name, source, hasSource, include, includeProvided, transport, lintOverride, objectUrl, srcUrl, invalidateWrittenObject, enforcePackageForExistingObject, fetchClassStructureAndMain, } = ctx;
|
|
118
|
+
if (type !== 'CLAS')
|
|
119
|
+
return errorResult('edit_class_definition is only supported for type=CLAS.');
|
|
120
|
+
if (!hasSource)
|
|
121
|
+
return errorResult('"source" (new CLASS DEFINITION block) is required for edit_class_definition.');
|
|
122
|
+
if (includeProvided && !include) {
|
|
123
|
+
return errorResult(`Invalid CLAS include "${String(args.include)}". Valid values: ${CLASS_WRITE_INCLUDES.join(', ')}.`);
|
|
124
|
+
}
|
|
125
|
+
await enforcePackageForExistingObject();
|
|
126
|
+
const writeUrl = include ? classIncludeUrl(name, include) : srcUrl;
|
|
127
|
+
let spliced;
|
|
128
|
+
if (include) {
|
|
129
|
+
// include= path: whole-replace the local include (CCDEF/CCIMP/macros/
|
|
130
|
+
// testclasses). The structure-based diff/refuse doesn't apply — the
|
|
131
|
+
// /objectstructure endpoint reports the GLOBAL class, not the local
|
|
132
|
+
// include's split DEFINITION/IMPLEMENTATION halves. SAP activation is the
|
|
133
|
+
// validator here (same precedent as `update include=`). No structure or
|
|
134
|
+
// source fetch is needed: the caller's `source` IS the new include body.
|
|
135
|
+
spliced = source.endsWith('\n') ? source : `${source}\n`;
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
// MAIN path: fetch structure + source at the same effective version so
|
|
139
|
+
// the spliced line ranges align with the bytes being edited.
|
|
140
|
+
const { structure, main } = await fetchClassStructureAndMain(name);
|
|
141
|
+
// Refuse-policy: compute the method-set diff against the NEW DEFINITION.
|
|
142
|
+
const diff = diffMethodSets(structure, source);
|
|
143
|
+
const missingImpls = [];
|
|
144
|
+
const orphanImpls = [];
|
|
145
|
+
for (const add of diff.added) {
|
|
146
|
+
// Exempt declarations that never have a METHOD…ENDMETHOD body.
|
|
147
|
+
if (add.isAbstract || add.isEvent || add.isInterface || add.isAlias)
|
|
148
|
+
continue;
|
|
149
|
+
// Does IMPLEMENTATION already have a METHOD <name> header? Match the
|
|
150
|
+
// method name followed by a word-boundary so AMDP / event-handler /
|
|
151
|
+
// multi-line headers (`METHOD x BY DATABASE PROCEDURE…`, `METHOD x FOR
|
|
152
|
+
// EVENT…`, `METHOD x\n IMPORTING…`) are recognized — NOT only the bare
|
|
153
|
+
// `METHOD x.` form. \b after the name prevents matching a longer name
|
|
154
|
+
// with the same prefix (METHOD x_helper for added X).
|
|
155
|
+
const re = new RegExp(`^\\s*METHOD\\s+${add.name}\\b`, 'im');
|
|
156
|
+
if (!re.test(main))
|
|
157
|
+
missingImpls.push(add.name);
|
|
158
|
+
}
|
|
159
|
+
for (const rem of diff.removed) {
|
|
160
|
+
if (rem.implementation) {
|
|
161
|
+
// Was concrete, still has impl range — caller didn't remove the body.
|
|
162
|
+
orphanImpls.push(rem.name);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (missingImpls.length > 0 || orphanImpls.length > 0) {
|
|
166
|
+
const parts = [];
|
|
167
|
+
if (missingImpls.length > 0) {
|
|
168
|
+
parts.push(`Cannot apply edit_class_definition: the new DEFINITION declares method(s) ${missingImpls.join(', ')} but the existing IMPLEMENTATION block has no matching METHOD…ENDMETHOD body. Either include a METHOD <name>. ENDMETHOD. block per added method in your new source, or use SAPWrite(action="add_method", name="${name}", method="<METHODS clause>") to insert each one atomically.`);
|
|
169
|
+
}
|
|
170
|
+
if (orphanImpls.length > 0) {
|
|
171
|
+
parts.push(`Cannot apply edit_class_definition: the new DEFINITION removes method(s) ${orphanImpls.join(', ')} but the existing IMPLEMENTATION block still has METHOD…ENDMETHOD bodies for them (orphan implementation). Either remove those METHOD blocks in your edit, or use SAPWrite(action="delete_method", name="${name}", method="<name>") to drop each one atomically.`);
|
|
172
|
+
}
|
|
173
|
+
return errorResult(parts.join('\n\n'));
|
|
174
|
+
}
|
|
175
|
+
spliced = spliceClassDefinition(main, structure, source);
|
|
176
|
+
}
|
|
177
|
+
// Pre-write lint on the spliced full source (MAIN path only — include=
|
|
178
|
+
// fragments can't be lint-parsed standalone).
|
|
179
|
+
if (!include) {
|
|
180
|
+
const lintWarnings = runPreWriteLint(spliced, type, name, config, lintOverride);
|
|
181
|
+
if (lintWarnings.blocked)
|
|
182
|
+
return lintWarnings.result;
|
|
183
|
+
}
|
|
184
|
+
await safeUpdateSource(client.http, client.safety, objectUrl, writeUrl, spliced, transport, cachedFeatures?.abapRelease);
|
|
185
|
+
invalidateWrittenObject(type, name);
|
|
186
|
+
const whereLabel = include ? ` (include: ${include})` : '';
|
|
187
|
+
return textResult(`Successfully updated DEFINITION of ${type} ${name}${whereLabel}. Active version unchanged until activation; read with SAPRead(version="inactive") to verify, then SAPActivate.`);
|
|
188
|
+
}
|
|
189
|
+
export async function writeActionEditMethodSignature(ctx) {
|
|
190
|
+
const { client, args, type, name, source, hasSource, includeProvided, transport, objectUrl, srcUrl, invalidateWrittenObject, enforcePackageForExistingObject, fetchClassStructureAndMain, } = ctx;
|
|
191
|
+
if (type !== 'CLAS')
|
|
192
|
+
return errorResult('edit_method_signature is only supported for type=CLAS.');
|
|
193
|
+
const methodSpecifier = String(args.method ?? '').trim();
|
|
194
|
+
if (!methodSpecifier) {
|
|
195
|
+
return errorResult('"method" (the method NAME to re-sign) is required for edit_method_signature.');
|
|
196
|
+
}
|
|
197
|
+
if (!hasSource) {
|
|
198
|
+
return errorResult('"source" (the new METHODS clause) is required for edit_method_signature.');
|
|
199
|
+
}
|
|
200
|
+
// MAIN-only action: include= is rejected at the schema layer (this action is
|
|
201
|
+
// not in SAPWRITE_INCLUDE_AWARE_ACTIONS). Defensive guard for direct CLI calls
|
|
202
|
+
// that bypass Zod.
|
|
203
|
+
if (includeProvided) {
|
|
204
|
+
return errorResult('edit_method_signature targets the global class DEFINITION (/source/main). For local-class (CCDEF) signatures, use edit_class_definition with include=definitions.');
|
|
205
|
+
}
|
|
206
|
+
await enforcePackageForExistingObject();
|
|
207
|
+
const { structure, main } = await fetchClassStructureAndMain(name);
|
|
208
|
+
const upperName = methodSpecifier.toUpperCase();
|
|
209
|
+
const method = structure.methods.find((m) => m.name === upperName);
|
|
210
|
+
if (!method) {
|
|
211
|
+
const available = structure.methods.map((m) => m.name).join(', ');
|
|
212
|
+
const hint = methodSpecifier.includes('~')
|
|
213
|
+
? ' Interface-qualified names (e.g. "zif_x~m") are not addressable here — objectstructure lists the implementing method under its bare name; for interface/local-handler bodies use edit_method.'
|
|
214
|
+
: '';
|
|
215
|
+
return errorResult(`Method "${methodSpecifier}" not found in CLAS ${name}. Available methods: ${available || '(none)'}.${hint}`);
|
|
216
|
+
}
|
|
217
|
+
const spliced = spliceMethodSignature(main, method, source);
|
|
218
|
+
// No pre-write lint: edit_method_signature changes ONLY the declaration; the
|
|
219
|
+
// method body still references the old signature until the caller follows up
|
|
220
|
+
// with edit_method. Linting the spliced full source here would flag legitimate
|
|
221
|
+
// in-progress renames (e.g. "param `name` not declared"). SAP activation is the
|
|
222
|
+
// authoritative check — same rationale as the include= lint skip on edit_method.
|
|
223
|
+
await safeUpdateSource(client.http, client.safety, objectUrl, srcUrl, spliced, transport, cachedFeatures?.abapRelease);
|
|
224
|
+
invalidateWrittenObject(type, name);
|
|
225
|
+
return textResult(`Successfully updated signature of method "${method.name}" in ${type} ${name}. Active version unchanged until activation; if the body still references the old signature, follow up with edit_method, then SAPActivate.`);
|
|
226
|
+
}
|
|
227
|
+
export async function writeActionAddMethod(ctx) {
|
|
228
|
+
const { client, args, config, type, name, includeProvided, transport, lintOverride, objectUrl, srcUrl, invalidateWrittenObject, enforcePackageForExistingObject, fetchClassStructureAndMain, } = ctx;
|
|
229
|
+
if (type !== 'CLAS')
|
|
230
|
+
return errorResult('add_method is only supported for type=CLAS.');
|
|
231
|
+
const clause = String(args.method ?? '');
|
|
232
|
+
if (!clause.trim()) {
|
|
233
|
+
return errorResult('"method" (the full METHODS clause, e.g. "METHODS greet IMPORTING who TYPE string.") is required for add_method.');
|
|
234
|
+
}
|
|
235
|
+
const methodName = extractMethodNameFromClause(clause);
|
|
236
|
+
if (!methodName) {
|
|
237
|
+
return errorResult('Could not extract method name from the METHODS clause. Provide a clause starting with "METHODS <name>" or "CLASS-METHODS <name>".');
|
|
238
|
+
}
|
|
239
|
+
// Interface-qualified names (lhc_x~y, zif_x~m) can't be added to a global
|
|
240
|
+
// class's DEFINITION/IMPLEMENTATION — `~` is interface-method scope and would
|
|
241
|
+
// produce invalid ABAP in the METHOD stub. Reject with a clear pointer.
|
|
242
|
+
if (methodName.includes('~')) {
|
|
243
|
+
return errorResult(`add_method cannot add the interface-qualified method "${methodName}" to a global class. Implement the interface via "INTERFACES <name>." in the DEFINITION (use edit_class_definition), then provide the body with edit_method.`);
|
|
244
|
+
}
|
|
245
|
+
const visibility = args.visibility ?? 'public';
|
|
246
|
+
const isAbstract = args.abstract === true;
|
|
247
|
+
// MAIN-only action: include= is rejected at the schema layer (not in
|
|
248
|
+
// SAPWRITE_INCLUDE_AWARE_ACTIONS). Defensive guard for direct CLI calls.
|
|
249
|
+
if (includeProvided) {
|
|
250
|
+
return errorResult('add_method targets the global class DEFINITION (/source/main). For local-class (CCDEF) method additions, use edit_class_definition with include=definitions.');
|
|
251
|
+
}
|
|
252
|
+
await enforcePackageForExistingObject();
|
|
253
|
+
const { structure, main } = await fetchClassStructureAndMain(name);
|
|
254
|
+
// Refuse if method already exists (would silently duplicate).
|
|
255
|
+
if (structure.methods.some((m) => m.name === methodName)) {
|
|
256
|
+
return errorResult(`Method "${methodName}" already exists in CLAS ${name}. Use SAPWrite(action="edit_method_signature", method="${methodName}", source="<new METHODS clause>") to change its signature.`);
|
|
257
|
+
}
|
|
258
|
+
// A concrete (non-abstract) method needs an IMPLEMENTATION block to receive
|
|
259
|
+
// its METHOD…ENDMETHOD stub. A purely-abstract class has no IMPLEMENTATION
|
|
260
|
+
// half, so inserting a concrete declaration there would leave it unimplemented.
|
|
261
|
+
if (!isAbstract && !structure.classImplementationBlock) {
|
|
262
|
+
return errorResult(`CLAS ${name} has no IMPLEMENTATION block (purely abstract class). Pass abstract=true to add an abstract method, or add the IMPLEMENTATION half first via edit_class_definition.`);
|
|
263
|
+
}
|
|
264
|
+
// Refuse with hint if the target visibility section header is missing.
|
|
265
|
+
const anchor = findSectionAnchor(main, structure, visibility);
|
|
266
|
+
if (!anchor) {
|
|
267
|
+
return errorResult(`No ${visibility.toUpperCase()} SECTION exists in CLAS ${name}. Use SAPWrite(action="edit_class_definition") to add the section header first, then re-run add_method.`);
|
|
268
|
+
}
|
|
269
|
+
const spliced = insertMethodPair(main, structure, {
|
|
270
|
+
decl: clause,
|
|
271
|
+
visibility,
|
|
272
|
+
methodName,
|
|
273
|
+
isAbstract,
|
|
274
|
+
});
|
|
275
|
+
const lintWarnings = runPreWriteLint(spliced, type, name, config, lintOverride);
|
|
276
|
+
if (lintWarnings.blocked)
|
|
277
|
+
return lintWarnings.result;
|
|
278
|
+
await safeUpdateSource(client.http, client.safety, objectUrl, srcUrl, spliced, transport, cachedFeatures?.abapRelease);
|
|
279
|
+
invalidateWrittenObject(type, name);
|
|
280
|
+
const stubNote = isAbstract ? ' (abstract — no IMPL stub inserted)' : '';
|
|
281
|
+
return textResult(`Successfully added method "${methodName}" (${visibility}) to ${type} ${name}${stubNote}. Active version unchanged until activation; SAPActivate next.`);
|
|
282
|
+
}
|
|
283
|
+
export async function writeActionDeleteMethod(ctx) {
|
|
284
|
+
const { client, args, config, type, name, includeProvided, transport, lintOverride, objectUrl, srcUrl, invalidateWrittenObject, enforcePackageForExistingObject, fetchClassStructureAndMain, } = ctx;
|
|
285
|
+
if (type !== 'CLAS')
|
|
286
|
+
return errorResult('delete_method is only supported for type=CLAS.');
|
|
287
|
+
const methodSpecifier = String(args.method ?? '').trim();
|
|
288
|
+
if (!methodSpecifier) {
|
|
289
|
+
return errorResult('"method" (the method NAME to delete) is required for delete_method.');
|
|
290
|
+
}
|
|
291
|
+
// MAIN-only action: include= is rejected at the schema layer (not in
|
|
292
|
+
// SAPWRITE_INCLUDE_AWARE_ACTIONS). Defensive guard for direct CLI calls.
|
|
293
|
+
if (includeProvided) {
|
|
294
|
+
return errorResult('delete_method targets the global class DEFINITION (/source/main). For local-class (CCDEF/CCIMP) method removal, use edit_class_definition with include=...');
|
|
295
|
+
}
|
|
296
|
+
await enforcePackageForExistingObject();
|
|
297
|
+
const { structure, main } = await fetchClassStructureAndMain(name);
|
|
298
|
+
const upperName = methodSpecifier.toUpperCase();
|
|
299
|
+
const method = structure.methods.find((m) => m.name === upperName);
|
|
300
|
+
if (!method) {
|
|
301
|
+
const available = structure.methods.map((m) => m.name).join(', ');
|
|
302
|
+
const hint = methodSpecifier.includes('~')
|
|
303
|
+
? ' Interface-qualified names (e.g. "zif_x~m") are not addressable here; objectstructure lists methods under their bare names.'
|
|
304
|
+
: '';
|
|
305
|
+
return errorResult(`Method "${methodSpecifier}" not found in CLAS ${name}. Available methods: ${available || '(none)'}.${hint}`);
|
|
306
|
+
}
|
|
307
|
+
const spliced = removeMethodPair(main, method);
|
|
308
|
+
const lintWarnings = runPreWriteLint(spliced, type, name, config, lintOverride);
|
|
309
|
+
if (lintWarnings.blocked)
|
|
310
|
+
return lintWarnings.result;
|
|
311
|
+
await safeUpdateSource(client.http, client.safety, objectUrl, srcUrl, spliced, transport, cachedFeatures?.abapRelease);
|
|
312
|
+
invalidateWrittenObject(type, name);
|
|
313
|
+
const where = method.implementation ? ' (DEFINITION + IMPLEMENTATION)' : ' (DEFINITION only — was ABSTRACT)';
|
|
314
|
+
return textResult(`Successfully deleted method "${method.name}" from ${type} ${name}${where}. Active version unchanged until activation; SAPActivate next.`);
|
|
315
|
+
}
|
|
316
|
+
export async function writeActionChangeMethodVisibility(ctx) {
|
|
317
|
+
const { client, args, config, type, name, includeProvided, transport, lintOverride, objectUrl, srcUrl, invalidateWrittenObject, enforcePackageForExistingObject, fetchClassStructureAndMain, } = ctx;
|
|
318
|
+
// Body-preserving visibility move (issue #303 follow-up). Moves the METHODS
|
|
319
|
+
// clause from its current section to the target section; the IMPLEMENTATION
|
|
320
|
+
// block is never touched, so the method body survives. This is the safe
|
|
321
|
+
// alternative to delete_method + add_method (which discards the body).
|
|
322
|
+
if (type !== 'CLAS')
|
|
323
|
+
return errorResult('change_method_visibility is only supported for type=CLAS.');
|
|
324
|
+
const methodSpecifier = String(args.method ?? '').trim();
|
|
325
|
+
if (!methodSpecifier) {
|
|
326
|
+
return errorResult('"method" (the method NAME to move) is required for change_method_visibility.');
|
|
327
|
+
}
|
|
328
|
+
const target = args.visibility;
|
|
329
|
+
if (!target) {
|
|
330
|
+
return errorResult('"visibility" (target section: public, protected, or private) is required for change_method_visibility.');
|
|
331
|
+
}
|
|
332
|
+
// MAIN-only action: include= is rejected at the schema layer (not in
|
|
333
|
+
// SAPWRITE_INCLUDE_AWARE_ACTIONS). Defensive guard for direct CLI calls.
|
|
334
|
+
if (includeProvided) {
|
|
335
|
+
return errorResult('change_method_visibility targets the global class DEFINITION (/source/main). For local-class (CCDEF) methods, use edit_class_definition with include=definitions.');
|
|
336
|
+
}
|
|
337
|
+
await enforcePackageForExistingObject();
|
|
338
|
+
const { structure, main } = await fetchClassStructureAndMain(name);
|
|
339
|
+
const upperName = methodSpecifier.toUpperCase();
|
|
340
|
+
const method = structure.methods.find((m) => m.name === upperName);
|
|
341
|
+
if (!method) {
|
|
342
|
+
const available = structure.methods.map((m) => m.name).join(', ');
|
|
343
|
+
const hint = methodSpecifier.includes('~')
|
|
344
|
+
? ' Interface-qualified names (e.g. "zif_x~m") are not addressable here; objectstructure lists methods under their bare names.'
|
|
345
|
+
: '';
|
|
346
|
+
return errorResult(`Method "${methodSpecifier}" not found in CLAS ${name}. Available methods: ${available || '(none)'}.${hint}`);
|
|
347
|
+
}
|
|
348
|
+
// Idempotent: already in the requested section → no write.
|
|
349
|
+
if (method.visibility === target) {
|
|
350
|
+
return textResult(`Method "${method.name}" is already in the ${target.toUpperCase()} SECTION of ${type} ${name}. No change made.`);
|
|
351
|
+
}
|
|
352
|
+
// The target section header must already exist (same constraint as add_method).
|
|
353
|
+
const anchor = findSectionAnchor(main, structure, target);
|
|
354
|
+
if (!anchor) {
|
|
355
|
+
return errorResult(`No ${target.toUpperCase()} SECTION exists in CLAS ${name}. Use SAPWrite(action="edit_class_definition") to add the section header first, then re-run change_method_visibility.`);
|
|
356
|
+
}
|
|
357
|
+
// DEFINITION-only move — IMPLEMENTATION (the method body) is preserved verbatim.
|
|
358
|
+
const spliced = moveMethodDefinition(main, method, anchor.afterLine);
|
|
359
|
+
const lintWarnings = runPreWriteLint(spliced, type, name, config, lintOverride);
|
|
360
|
+
if (lintWarnings.blocked)
|
|
361
|
+
return lintWarnings.result;
|
|
362
|
+
await safeUpdateSource(client.http, client.safety, objectUrl, srcUrl, spliced, transport, cachedFeatures?.abapRelease);
|
|
363
|
+
invalidateWrittenObject(type, name);
|
|
364
|
+
return textResult(`Successfully moved method "${method.name}" from ${method.visibility.toUpperCase()} to ${target.toUpperCase()} SECTION of ${type} ${name} (IMPLEMENTATION preserved). Active version unchanged until activation; SAPActivate next.`);
|
|
365
|
+
}
|
|
366
|
+
//# sourceMappingURL=class-surgery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class-surgery.js","sourceRoot":"","sources":["../../../src/handlers/write/class-surgery.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,cAAc,EACd,2BAA2B,EAC3B,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EACL,oBAAoB,EAEpB,eAAe,EACf,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,WAAW,EAAmB,UAAU,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAG9E,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,GAAoB;IAC9D,MAAM,EACJ,MAAM,EACN,IAAI,EACJ,MAAM,EACN,YAAY,EACZ,aAAa,EACb,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,OAAO,EACP,SAAS,EACT,YAAY,EACZ,aAAa,EACb,SAAS,EACT,MAAM,EACN,uBAAuB,EACvB,+BAA+B,GAChC,GAAG,GAAG,CAAC;IACR,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,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B,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,MAAM,EACb,SAAS,EACT,MAAM,EACN,OAAO,EACP,SAAS,EACT,cAAc,EAAE,WAAW,CAC5B,CAAC;IACF,uBAAuB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACpC,OAAO,UAAU,CACf,8BAA8B,MAAM,CAAC,IAAI,UAAU,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,OAAO,MAAM,CAAC,WAAW,EAAE,eAAe,IAAI,IAAI,IAAI,2FAA2F,CACpO,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared context for the per-action SAPWrite handlers.
|
|
3
|
+
*/
|
|
4
|
+
import type { AdtClient } from '../../adt/client.js';
|
|
5
|
+
import type { ClassStructure } from '../../adt/types.js';
|
|
6
|
+
import type { CachingLayer } from '../../cache/caching-layer.js';
|
|
7
|
+
import type { ServerConfig } from '../../server/types.js';
|
|
8
|
+
import type { CacheSecurityContext } from '../cache-security.js';
|
|
9
|
+
import type { ClassWriteInclude } from '../object-types.js';
|
|
10
|
+
import type { SourceVersion } from '../read.js';
|
|
11
|
+
/**
|
|
12
|
+
* Built once by handleSAPWrite after its prologue and passed to each writeAction*. Fields are
|
|
13
|
+
* `readonly`: the action handlers consume the resolved request, they never re-resolve it — and the
|
|
14
|
+
* three closures capture the prologue's locals, so reassigning a field here would silently desync
|
|
15
|
+
* them (e.g. invalidateWrittenObject would key the cache off the old name).
|
|
16
|
+
*/
|
|
17
|
+
export interface SapWriteContext {
|
|
18
|
+
readonly client: AdtClient;
|
|
19
|
+
readonly args: Record<string, unknown>;
|
|
20
|
+
readonly config: ServerConfig;
|
|
21
|
+
readonly cachingLayer: CachingLayer | undefined;
|
|
22
|
+
readonly cacheSecurity: CacheSecurityContext;
|
|
23
|
+
readonly type: string;
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly source: string;
|
|
26
|
+
readonly hasSource: boolean;
|
|
27
|
+
readonly include: ClassWriteInclude | undefined;
|
|
28
|
+
readonly includeProvided: boolean;
|
|
29
|
+
readonly transport: string | undefined;
|
|
30
|
+
readonly lintOverride: boolean | undefined;
|
|
31
|
+
readonly preflightOverride: boolean | undefined;
|
|
32
|
+
readonly checkOverride: boolean | undefined;
|
|
33
|
+
readonly objectUrl: string;
|
|
34
|
+
readonly srcUrl: string;
|
|
35
|
+
readonly invalidateWrittenObject: (objType?: string, objName?: string) => void;
|
|
36
|
+
readonly enforcePackageForExistingObject: () => Promise<string | undefined>;
|
|
37
|
+
readonly fetchClassStructureAndMain: (clsName: string) => Promise<{
|
|
38
|
+
structure: ClassStructure;
|
|
39
|
+
main: string;
|
|
40
|
+
effectiveVersion: SourceVersion;
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/handlers/write/context.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,QAAQ,CAAC,MAA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-0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SAPWrite actions — create + batch_create.
|
|
3
|
+
*/
|
|
4
|
+
import { type ToolResult } from '../shared.js';
|
|
5
|
+
import type { SapWriteContext } from './context.js';
|
|
6
|
+
export declare function writeActionCreate(ctx: SapWriteContext): Promise<ToolResult>;
|
|
7
|
+
export declare function writeActionBatchCreate(ctx: SapWriteContext): Promise<ToolResult>;
|
|
8
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/handlers/write/create.ts"],"names":[],"mappings":"AAAA;;GAEG;AAkCH,OAAO,EAAe,KAAK,UAAU,EAAc,MAAM,cAAc,CAAC;AAgBxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAkBpD,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,CAiTjF;AAED,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,CAqatF"}
|