@adhisang/minecraft-modding-mcp 4.2.1 → 6.0.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 +69 -0
- package/README.md +5 -4
- package/dist/access-transformer-parser.d.ts +2 -1
- package/dist/access-transformer-parser.js +10 -1
- package/dist/access-widener-parser.d.ts +1 -0
- package/dist/access-widener-parser.js +6 -3
- package/dist/build-suggested-call.js +31 -10
- package/dist/cache-registry.d.ts +8 -0
- package/dist/cache-registry.js +50 -32
- package/dist/config.d.ts +1 -0
- package/dist/config.js +4 -0
- package/dist/decompiler/vineflower.js +8 -2
- package/dist/entry-tools/analyze-mod-service.d.ts +24 -24
- package/dist/entry-tools/analyze-mod-service.js +2 -1
- package/dist/entry-tools/analyze-symbol-service.d.ts +57 -22
- package/dist/entry-tools/analyze-symbol-service.js +139 -34
- package/dist/entry-tools/batch-class-members-service.d.ts +3 -1
- package/dist/entry-tools/batch-class-members-service.js +6 -6
- package/dist/entry-tools/batch-class-source-service.d.ts +3 -1
- package/dist/entry-tools/batch-class-source-service.js +5 -6
- package/dist/entry-tools/batch-mappings-service.d.ts +3 -1
- package/dist/entry-tools/batch-mappings-service.js +4 -5
- package/dist/entry-tools/batch-symbol-exists-service.d.ts +3 -1
- package/dist/entry-tools/batch-symbol-exists-service.js +4 -5
- package/dist/entry-tools/compare-minecraft-service.d.ts +10 -10
- package/dist/entry-tools/compare-minecraft-service.js +1 -1
- package/dist/entry-tools/entry-tool-schema.d.ts +1 -1
- package/dist/entry-tools/inspect-minecraft/handlers/artifact.js +1 -3
- package/dist/entry-tools/inspect-minecraft/handlers/class-members.js +4 -3
- package/dist/entry-tools/inspect-minecraft/handlers/class-overview.js +0 -5
- package/dist/entry-tools/inspect-minecraft/handlers/class-source.js +0 -1
- package/dist/entry-tools/inspect-minecraft/handlers/file.js +26 -2
- package/dist/entry-tools/inspect-minecraft/handlers/list-files.js +0 -1
- package/dist/entry-tools/inspect-minecraft/handlers/search.d.ts +8 -0
- package/dist/entry-tools/inspect-minecraft/handlers/search.js +13 -2
- package/dist/entry-tools/inspect-minecraft/handlers/versions.d.ts +1 -1
- package/dist/entry-tools/inspect-minecraft/handlers/versions.js +3 -2
- package/dist/entry-tools/inspect-minecraft/internal.d.ts +90 -89
- package/dist/entry-tools/inspect-minecraft/internal.js +32 -14
- package/dist/entry-tools/inspect-minecraft-service.d.ts +218 -218
- package/dist/entry-tools/inspect-minecraft-service.js +1 -1
- package/dist/entry-tools/manage-cache-service.d.ts +4 -4
- package/dist/entry-tools/response-contract.d.ts +3 -1
- package/dist/entry-tools/response-contract.js +3 -2
- package/dist/entry-tools/validate-project/cases/mixin.js +2 -1
- package/dist/entry-tools/validate-project/cases/project-summary.js +5 -3
- package/dist/entry-tools/validate-project-service.d.ts +42 -36
- package/dist/entry-tools/validate-project-service.js +3 -1
- package/dist/entry-tools/verify-mixin-target-service.d.ts +30 -0
- package/dist/entry-tools/verify-mixin-target-service.js +120 -29
- package/dist/error-mapping.d.ts +51 -0
- package/dist/error-mapping.js +157 -2
- package/dist/index.js +147 -76
- package/dist/java-process.js +1 -1
- package/dist/json-rpc-framing.d.ts +4 -0
- package/dist/json-rpc-framing.js +23 -1
- package/dist/mapping/internal-types.d.ts +24 -0
- package/dist/mapping/loaders/tiny-maven.js +46 -20
- package/dist/mapping/lookup.d.ts +13 -2
- package/dist/mapping/lookup.js +60 -2
- package/dist/mapping/types.d.ts +6 -0
- package/dist/mapping-service.d.ts +26 -2
- package/dist/mapping-service.js +212 -55
- package/dist/mcp-helpers.d.ts +1 -0
- package/dist/mcp-helpers.js +25 -3
- package/dist/minecraft-explorer-service.js +24 -11
- package/dist/mixin/access-validators.js +33 -1
- package/dist/mixin/annotation-validators.js +73 -9
- package/dist/mixin/parsed-validator.js +3 -2
- package/dist/mixin-parser.js +119 -7
- package/dist/mod-decompile-service.d.ts +2 -0
- package/dist/mod-decompile-service.js +21 -3
- package/dist/mod-remap-service.d.ts +20 -1
- package/dist/mod-remap-service.js +101 -45
- package/dist/mojang-tiny-mapping-service.js +5 -2
- package/dist/nbt/java-nbt-codec.js +46 -16
- package/dist/nbt/json-patch.js +51 -12
- package/dist/nbt/typed-json.d.ts +1 -0
- package/dist/nbt/typed-json.js +12 -2
- package/dist/nbt/types.d.ts +2 -2
- package/dist/observability.d.ts +6 -0
- package/dist/observability.js +10 -0
- package/dist/page-cursor.d.ts +17 -0
- package/dist/page-cursor.js +0 -0
- package/dist/path-converter.js +10 -3
- package/dist/registry-service.d.ts +2 -0
- package/dist/registry-service.js +41 -2
- package/dist/repo-downloader.js +4 -3
- package/dist/resources.js +45 -9
- package/dist/response-utils.d.ts +29 -4
- package/dist/response-utils.js +95 -5
- package/dist/source/access-validate.js +12 -2
- package/dist/source/artifact-resolver.js +2 -2
- package/dist/source/class-source/members-builder.d.ts +44 -1
- package/dist/source/class-source/members-builder.js +51 -4
- package/dist/source/class-source/snippet-builder.d.ts +13 -0
- package/dist/source/class-source/snippet-builder.js +54 -4
- package/dist/source/class-source-helpers.d.ts +4 -4
- package/dist/source/class-source-helpers.js +77 -20
- package/dist/source/class-source.d.ts +19 -0
- package/dist/source/class-source.js +144 -40
- package/dist/source/file-access.js +3 -2
- package/dist/source/indexer.js +29 -9
- package/dist/source/lifecycle/mapping-helpers.js +28 -3
- package/dist/source/lifecycle/runtime-check.js +20 -6
- package/dist/source/search.d.ts +1 -1
- package/dist/source/search.js +117 -30
- package/dist/source/validate-mixin/pipeline/resolve.js +23 -3
- package/dist/source/validate-mixin.d.ts +2 -1
- package/dist/source/validate-mixin.js +45 -4
- package/dist/source/workspace-target.js +17 -10
- package/dist/source-jar-reader.d.ts +54 -1
- package/dist/source-jar-reader.js +121 -10
- package/dist/source-resolver.js +2 -2
- package/dist/source-service.d.ts +28 -7
- package/dist/source-service.js +9 -1
- package/dist/stdio-supervisor.d.ts +2 -2
- package/dist/stdio-supervisor.js +29 -9
- package/dist/storage/db.js +24 -1
- package/dist/storage/files-repo.d.ts +15 -0
- package/dist/storage/files-repo.js +67 -37
- package/dist/storage/symbols-repo.d.ts +15 -0
- package/dist/storage/symbols-repo.js +53 -19
- package/dist/symbols/symbol-extractor.js +35 -6
- package/dist/text-truncate.d.ts +7 -0
- package/dist/text-truncate.js +21 -0
- package/dist/tiny-remapper-resolver.js +10 -0
- package/dist/tool-contract-manifest.js +2 -2
- package/dist/tool-execution-gate.js +12 -1
- package/dist/tool-guidance.d.ts +6 -2
- package/dist/tool-guidance.js +63 -13
- package/dist/tool-schemas.d.ts +561 -496
- package/dist/tool-schemas.js +175 -139
- package/dist/types.d.ts +1 -0
- package/dist/version-diff-service.js +5 -0
- package/dist/version-service.d.ts +3 -0
- package/dist/version-service.js +18 -2
- package/dist/warning-details.d.ts +30 -0
- package/dist/warning-details.js +80 -0
- package/dist/workspace-mapping-service.js +9 -0
- package/docs/README-ja.md +2 -2
- package/docs/examples.md +26 -2
- package/docs/tool-reference.md +22 -17
- package/package.json +1 -1
package/dist/error-mapping.d.ts
CHANGED
|
@@ -13,6 +13,31 @@ export type ExampleCall = {
|
|
|
13
13
|
params: Record<string, unknown>;
|
|
14
14
|
reason: string;
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Whether retrying the same call can help, and why if not:
|
|
18
|
+
* - `transient`: a temporary failure (network, rate limit, timeout); retrying
|
|
19
|
+
* the same call later may succeed.
|
|
20
|
+
* - `permanent`: the requested thing does not exist or cannot be produced;
|
|
21
|
+
* retrying the same call will keep failing.
|
|
22
|
+
* - `server`: a non-recoverable internal server fault (programming bug, DB
|
|
23
|
+
* corruption); retrying the identical call cannot help. Distinct from
|
|
24
|
+
* `permanent`, which is about an absent/unproducible target rather than a
|
|
25
|
+
* server defect. Treat like `permanent` for retry posture (do not retry).
|
|
26
|
+
* - `environment`: the server lacks a capability (Java, decompiler, remapper);
|
|
27
|
+
* retrying will not help until the environment is fixed.
|
|
28
|
+
* - `input`: the caller's input is wrong; fix the input, then retry.
|
|
29
|
+
*/
|
|
30
|
+
export type RetryClass = "transient" | "permanent" | "server" | "environment" | "input";
|
|
31
|
+
/**
|
|
32
|
+
* Where the failure originates, so an agent knows whether to fix its own
|
|
33
|
+
* request or stop retrying this tool:
|
|
34
|
+
* - `code_issue`: the caller's input is wrong or names something that does not
|
|
35
|
+
* exist; fix the request.
|
|
36
|
+
* - `tool_issue`: the tool could not produce a result for valid input (mapping
|
|
37
|
+
* gap, upstream fetch, internal limit).
|
|
38
|
+
* - `environment`: a server capability is missing (Java, decompiler, remapper).
|
|
39
|
+
*/
|
|
40
|
+
export type IssueOrigin = "code_issue" | "tool_issue" | "environment";
|
|
16
41
|
export type ProblemDetails = {
|
|
17
42
|
type: string;
|
|
18
43
|
title: string;
|
|
@@ -20,13 +45,39 @@ export type ProblemDetails = {
|
|
|
20
45
|
status: number;
|
|
21
46
|
code: string;
|
|
22
47
|
instance: string;
|
|
48
|
+
retryClass: RetryClass;
|
|
49
|
+
issueOrigin: IssueOrigin;
|
|
23
50
|
fieldErrors?: ProblemFieldError[];
|
|
24
51
|
hints?: string[];
|
|
25
52
|
suggestedCall?: SuggestedCall;
|
|
26
53
|
exampleCalls?: ExampleCall[];
|
|
27
54
|
failedStage?: string;
|
|
55
|
+
context?: Record<string, string | number | boolean>;
|
|
28
56
|
};
|
|
29
57
|
export declare function statusForErrorCode(code: string): number;
|
|
58
|
+
/**
|
|
59
|
+
* Single source of truth mapping an error code to its {@link RetryClass}. Used
|
|
60
|
+
* by every public problem builder so callers can branch on recovery strategy
|
|
61
|
+
* without parsing prose. Non-recoverable server faults (`ERR_INTERNAL`,
|
|
62
|
+
* `ERR_DB_FAILURE`) classify as `server`. Codes not explicitly classified
|
|
63
|
+
* (genuinely-transient failures such as `ERR_REPO_FETCH_FAILED` and unknown
|
|
64
|
+
* codes) default to `transient`: a temporary failure where one retry is
|
|
65
|
+
* reasonable.
|
|
66
|
+
*/
|
|
67
|
+
export declare function retryClassForErrorCode(code: string): RetryClass;
|
|
68
|
+
/**
|
|
69
|
+
* Single source of truth mapping an error code to its {@link IssueOrigin}.
|
|
70
|
+
* Environment failures reuse the retry classifier; the input-family above is
|
|
71
|
+
* `code_issue`; everything else is a `tool_issue` (valid input the tool could
|
|
72
|
+
* not satisfy).
|
|
73
|
+
*/
|
|
74
|
+
export declare function issueOriginForErrorCode(code: string): IssueOrigin;
|
|
75
|
+
/**
|
|
76
|
+
* Pick the allowlisted, primitive-valued fields out of an AppError's `details`
|
|
77
|
+
* so the public envelope can carry structured repair context without leaking
|
|
78
|
+
* paths, parser internals, or other sensitive data.
|
|
79
|
+
*/
|
|
80
|
+
export declare function extractAllowlistedContext(details: unknown): Record<string, string | number | boolean> | undefined;
|
|
30
81
|
/**
|
|
31
82
|
* Per-entry subset of `mapErrorToProblem` for batch tools. ZodErrors are not
|
|
32
83
|
* handled here (per-entry input has already cleared the batch tool's schema
|
package/dist/error-mapping.js
CHANGED
|
@@ -56,6 +56,153 @@ export function statusForErrorCode(code) {
|
|
|
56
56
|
}
|
|
57
57
|
return 500;
|
|
58
58
|
}
|
|
59
|
+
const RETRY_CLASS_INPUT = new Set([
|
|
60
|
+
ERROR_CODES.INVALID_INPUT,
|
|
61
|
+
ERROR_CODES.COORDINATE_PARSE_FAILED,
|
|
62
|
+
ERROR_CODES.INVALID_LINE_RANGE,
|
|
63
|
+
ERROR_CODES.NBT_PARSE_FAILED,
|
|
64
|
+
ERROR_CODES.NBT_INVALID_TYPED_JSON,
|
|
65
|
+
ERROR_CODES.JSON_PATCH_INVALID,
|
|
66
|
+
ERROR_CODES.JSON_PATCH_CONFLICT,
|
|
67
|
+
ERROR_CODES.NBT_ENCODE_FAILED,
|
|
68
|
+
ERROR_CODES.NBT_UNSUPPORTED_FEATURE,
|
|
69
|
+
ERROR_CODES.NAMESPACE_MISMATCH,
|
|
70
|
+
ERROR_CODES.CONTEXT_UNRESOLVED,
|
|
71
|
+
ERROR_CODES.MIXIN_PARSE_FAILED
|
|
72
|
+
]);
|
|
73
|
+
const RETRY_CLASS_PERMANENT = new Set([
|
|
74
|
+
ERROR_CODES.SOURCE_NOT_FOUND,
|
|
75
|
+
ERROR_CODES.FILE_NOT_FOUND,
|
|
76
|
+
ERROR_CODES.JAR_NOT_FOUND,
|
|
77
|
+
ERROR_CODES.VERSION_NOT_FOUND,
|
|
78
|
+
ERROR_CODES.CLASS_NOT_FOUND,
|
|
79
|
+
ERROR_CODES.MAPPING_NOT_APPLIED,
|
|
80
|
+
ERROR_CODES.MAPPING_UNAVAILABLE,
|
|
81
|
+
ERROR_CODES.DECOMPILE_DISABLED,
|
|
82
|
+
ERROR_CODES.REMAP_FAILED,
|
|
83
|
+
ERROR_CODES.WORKSPACE_VERSION_UNRESOLVED,
|
|
84
|
+
ERROR_CODES.DEPENDENCY_VERSION_UNRESOLVED,
|
|
85
|
+
ERROR_CODES.PROVENANCE_INCOMPLETE,
|
|
86
|
+
ERROR_CODES.BATCH_ABORTED
|
|
87
|
+
]);
|
|
88
|
+
const RETRY_CLASS_ENVIRONMENT = new Set([
|
|
89
|
+
ERROR_CODES.JAVA_UNAVAILABLE,
|
|
90
|
+
ERROR_CODES.DECOMPILER_UNAVAILABLE,
|
|
91
|
+
ERROR_CODES.DECOMPILER_FAILED,
|
|
92
|
+
ERROR_CODES.REMAPPER_UNAVAILABLE,
|
|
93
|
+
ERROR_CODES.REGISTRY_GENERATION_FAILED
|
|
94
|
+
]);
|
|
95
|
+
// Non-recoverable internal server faults: a deterministic defect where retrying
|
|
96
|
+
// the identical call cannot help. ERR_INTERNAL covers sanitized programming
|
|
97
|
+
// bugs / unexpected throws; ERR_DB_FAILURE covers SQLite integrity/migration
|
|
98
|
+
// failures (the open-failure path can be a transient file lock, but corruption
|
|
99
|
+
// and migration failures dominate, so it is classified server by default).
|
|
100
|
+
const RETRY_CLASS_SERVER = new Set([
|
|
101
|
+
ERROR_CODES.INTERNAL,
|
|
102
|
+
ERROR_CODES.DB_FAILURE
|
|
103
|
+
]);
|
|
104
|
+
/**
|
|
105
|
+
* Single source of truth mapping an error code to its {@link RetryClass}. Used
|
|
106
|
+
* by every public problem builder so callers can branch on recovery strategy
|
|
107
|
+
* without parsing prose. Non-recoverable server faults (`ERR_INTERNAL`,
|
|
108
|
+
* `ERR_DB_FAILURE`) classify as `server`. Codes not explicitly classified
|
|
109
|
+
* (genuinely-transient failures such as `ERR_REPO_FETCH_FAILED` and unknown
|
|
110
|
+
* codes) default to `transient`: a temporary failure where one retry is
|
|
111
|
+
* reasonable.
|
|
112
|
+
*/
|
|
113
|
+
export function retryClassForErrorCode(code) {
|
|
114
|
+
if (RETRY_CLASS_INPUT.has(code)) {
|
|
115
|
+
return "input";
|
|
116
|
+
}
|
|
117
|
+
if (RETRY_CLASS_PERMANENT.has(code)) {
|
|
118
|
+
return "permanent";
|
|
119
|
+
}
|
|
120
|
+
if (RETRY_CLASS_SERVER.has(code)) {
|
|
121
|
+
return "server";
|
|
122
|
+
}
|
|
123
|
+
if (RETRY_CLASS_ENVIRONMENT.has(code)) {
|
|
124
|
+
return "environment";
|
|
125
|
+
}
|
|
126
|
+
return "transient";
|
|
127
|
+
}
|
|
128
|
+
// "Your request is wrong or names something absent" — the caller can fix it.
|
|
129
|
+
const ISSUE_ORIGIN_CODE = new Set([
|
|
130
|
+
ERROR_CODES.INVALID_INPUT,
|
|
131
|
+
ERROR_CODES.COORDINATE_PARSE_FAILED,
|
|
132
|
+
ERROR_CODES.INVALID_LINE_RANGE,
|
|
133
|
+
ERROR_CODES.NBT_PARSE_FAILED,
|
|
134
|
+
ERROR_CODES.NBT_INVALID_TYPED_JSON,
|
|
135
|
+
ERROR_CODES.JSON_PATCH_INVALID,
|
|
136
|
+
ERROR_CODES.JSON_PATCH_CONFLICT,
|
|
137
|
+
ERROR_CODES.NBT_ENCODE_FAILED,
|
|
138
|
+
ERROR_CODES.NBT_UNSUPPORTED_FEATURE,
|
|
139
|
+
ERROR_CODES.NAMESPACE_MISMATCH,
|
|
140
|
+
ERROR_CODES.CONTEXT_UNRESOLVED,
|
|
141
|
+
ERROR_CODES.MIXIN_PARSE_FAILED,
|
|
142
|
+
ERROR_CODES.CLASS_NOT_FOUND,
|
|
143
|
+
ERROR_CODES.SOURCE_NOT_FOUND,
|
|
144
|
+
ERROR_CODES.FILE_NOT_FOUND,
|
|
145
|
+
ERROR_CODES.JAR_NOT_FOUND,
|
|
146
|
+
ERROR_CODES.VERSION_NOT_FOUND,
|
|
147
|
+
ERROR_CODES.WORKSPACE_VERSION_UNRESOLVED,
|
|
148
|
+
ERROR_CODES.DEPENDENCY_VERSION_UNRESOLVED
|
|
149
|
+
]);
|
|
150
|
+
/**
|
|
151
|
+
* Single source of truth mapping an error code to its {@link IssueOrigin}.
|
|
152
|
+
* Environment failures reuse the retry classifier; the input-family above is
|
|
153
|
+
* `code_issue`; everything else is a `tool_issue` (valid input the tool could
|
|
154
|
+
* not satisfy).
|
|
155
|
+
*/
|
|
156
|
+
export function issueOriginForErrorCode(code) {
|
|
157
|
+
if (RETRY_CLASS_ENVIRONMENT.has(code)) {
|
|
158
|
+
return "environment";
|
|
159
|
+
}
|
|
160
|
+
if (ISSUE_ORIGIN_CODE.has(code)) {
|
|
161
|
+
return "code_issue";
|
|
162
|
+
}
|
|
163
|
+
return "tool_issue";
|
|
164
|
+
}
|
|
165
|
+
// Non-sensitive AppError.details fields that are safe to echo to callers as
|
|
166
|
+
// machine-readable repair context. Filesystem paths and free-form text are
|
|
167
|
+
// intentionally excluded.
|
|
168
|
+
const CONTEXT_ALLOWLIST = new Set([
|
|
169
|
+
"queryLength",
|
|
170
|
+
"maxLength",
|
|
171
|
+
"artifactId",
|
|
172
|
+
"registry",
|
|
173
|
+
"registryName",
|
|
174
|
+
"stage",
|
|
175
|
+
"version",
|
|
176
|
+
"mapping",
|
|
177
|
+
"namespace",
|
|
178
|
+
"kind",
|
|
179
|
+
"owner",
|
|
180
|
+
"limit",
|
|
181
|
+
"count",
|
|
182
|
+
"maxMembers",
|
|
183
|
+
"candidateCount",
|
|
184
|
+
"candidatesSeen",
|
|
185
|
+
"ambiguous"
|
|
186
|
+
]);
|
|
187
|
+
/**
|
|
188
|
+
* Pick the allowlisted, primitive-valued fields out of an AppError's `details`
|
|
189
|
+
* so the public envelope can carry structured repair context without leaking
|
|
190
|
+
* paths, parser internals, or other sensitive data.
|
|
191
|
+
*/
|
|
192
|
+
export function extractAllowlistedContext(details) {
|
|
193
|
+
if (typeof details !== "object" || details == null) {
|
|
194
|
+
return undefined;
|
|
195
|
+
}
|
|
196
|
+
const record = details;
|
|
197
|
+
const out = {};
|
|
198
|
+
for (const key of CONTEXT_ALLOWLIST) {
|
|
199
|
+
const value = record[key];
|
|
200
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
201
|
+
out[key] = value;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return Object.keys(out).length > 0 ? out : undefined;
|
|
205
|
+
}
|
|
59
206
|
function extractFieldErrors(details) {
|
|
60
207
|
if (typeof details !== "object" || details == null)
|
|
61
208
|
return undefined;
|
|
@@ -95,6 +242,7 @@ export function errorToBatchEntryProblem(caughtError, instance, options) {
|
|
|
95
242
|
if (isAppError(caughtError)) {
|
|
96
243
|
const baseHints = extractHints(caughtError.details);
|
|
97
244
|
const fieldErrors = extractFieldErrors(caughtError.details);
|
|
245
|
+
const context = extractAllowlistedContext(caughtError.details);
|
|
98
246
|
return {
|
|
99
247
|
type: `https://minecraft-modding-mcp.dev/problems/${caughtError.code.toLowerCase()}`,
|
|
100
248
|
title: "Tool execution error",
|
|
@@ -102,9 +250,12 @@ export function errorToBatchEntryProblem(caughtError, instance, options) {
|
|
|
102
250
|
status: statusForErrorCode(caughtError.code),
|
|
103
251
|
code: caughtError.code,
|
|
104
252
|
instance,
|
|
253
|
+
retryClass: retryClassForErrorCode(caughtError.code),
|
|
254
|
+
issueOrigin: issueOriginForErrorCode(caughtError.code),
|
|
105
255
|
...(fieldErrors ? { fieldErrors } : {}),
|
|
106
256
|
...(baseHints ? { hints: baseHints } : {}),
|
|
107
|
-
...(options?.suggestedCall ? { suggestedCall: options.suggestedCall } : {})
|
|
257
|
+
...(options?.suggestedCall ? { suggestedCall: options.suggestedCall } : {}),
|
|
258
|
+
...(context ? { context } : {})
|
|
108
259
|
};
|
|
109
260
|
}
|
|
110
261
|
// Generic-error sanitization: fixed public detail, raw message logged
|
|
@@ -123,6 +274,8 @@ export function errorToBatchEntryProblem(caughtError, instance, options) {
|
|
|
123
274
|
status: 500,
|
|
124
275
|
code: ERROR_CODES.INTERNAL,
|
|
125
276
|
instance,
|
|
277
|
+
retryClass: retryClassForErrorCode(ERROR_CODES.INTERNAL),
|
|
278
|
+
issueOrigin: issueOriginForErrorCode(ERROR_CODES.INTERNAL),
|
|
126
279
|
...(options?.suggestedCall ? { suggestedCall: options.suggestedCall } : {})
|
|
127
280
|
};
|
|
128
281
|
}
|
|
@@ -133,7 +286,9 @@ export function buildBatchAbortedProblem(instance) {
|
|
|
133
286
|
detail: "Earlier entry failed and failFast=true.",
|
|
134
287
|
status: 412,
|
|
135
288
|
code: ERROR_CODES.BATCH_ABORTED,
|
|
136
|
-
instance
|
|
289
|
+
instance,
|
|
290
|
+
retryClass: retryClassForErrorCode(ERROR_CODES.BATCH_ABORTED),
|
|
291
|
+
issueOrigin: issueOriginForErrorCode(ERROR_CODES.BATCH_ABORTED)
|
|
137
292
|
};
|
|
138
293
|
}
|
|
139
294
|
//# sourceMappingURL=error-mapping.js.map
|