@probelabs/probe 0.6.0-rc126 → 0.6.0-rc128
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 +1 -1
- package/build/agent/index.js +409 -22
- package/cjs/agent/ProbeAgent.cjs +519 -195
- package/cjs/index.cjs +519 -195
- package/package.json +2 -2
package/cjs/index.cjs
CHANGED
|
@@ -22326,37 +22326,15 @@ var require_dist_cjs36 = __commonJS({
|
|
|
22326
22326
|
|
|
22327
22327
|
// node_modules/@aws-sdk/middleware-websocket/dist-cjs/index.js
|
|
22328
22328
|
var require_dist_cjs37 = __commonJS({
|
|
22329
|
-
"node_modules/@aws-sdk/middleware-websocket/dist-cjs/index.js"(exports2
|
|
22329
|
+
"node_modules/@aws-sdk/middleware-websocket/dist-cjs/index.js"(exports2) {
|
|
22330
22330
|
"use strict";
|
|
22331
|
-
var
|
|
22332
|
-
var
|
|
22333
|
-
var
|
|
22334
|
-
var
|
|
22335
|
-
var
|
|
22336
|
-
var
|
|
22337
|
-
|
|
22338
|
-
__defProp2(target, name14, { get: all[name14], enumerable: true });
|
|
22339
|
-
};
|
|
22340
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
22341
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
22342
|
-
for (let key of __getOwnPropNames2(from))
|
|
22343
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
22344
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
22345
|
-
}
|
|
22346
|
-
return to;
|
|
22347
|
-
};
|
|
22348
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
22349
|
-
var index_exports2 = {};
|
|
22350
|
-
__export2(index_exports2, {
|
|
22351
|
-
WebSocketFetchHandler: () => WebSocketFetchHandler,
|
|
22352
|
-
eventStreamPayloadHandlerProvider: () => eventStreamPayloadHandlerProvider,
|
|
22353
|
-
getWebSocketPlugin: () => getWebSocketPlugin,
|
|
22354
|
-
resolveWebSocketConfig: () => resolveWebSocketConfig
|
|
22355
|
-
});
|
|
22356
|
-
module2.exports = __toCommonJS2(index_exports2);
|
|
22357
|
-
var import_eventstream_codec = require_dist_cjs33();
|
|
22358
|
-
var import_util_hex_encoding = require_dist_cjs17();
|
|
22359
|
-
var getEventSigningTransformStream = /* @__PURE__ */ __name((initialSignature, messageSigner, eventStreamCodec, systemClockOffsetProvider) => {
|
|
22331
|
+
var eventstreamCodec = require_dist_cjs33();
|
|
22332
|
+
var utilHexEncoding = require_dist_cjs17();
|
|
22333
|
+
var protocolHttp = require_dist_cjs2();
|
|
22334
|
+
var utilFormatUrl = require_dist_cjs34();
|
|
22335
|
+
var eventstreamSerdeBrowser = require_dist_cjs36();
|
|
22336
|
+
var fetchHttpHandler = require_dist_cjs16();
|
|
22337
|
+
var getEventSigningTransformStream = (initialSignature, messageSigner, eventStreamCodec, systemClockOffsetProvider) => {
|
|
22360
22338
|
let priorSignature = initialSignature;
|
|
22361
22339
|
const transformer = {
|
|
22362
22340
|
start() {
|
|
@@ -22367,25 +22345,22 @@ var require_dist_cjs37 = __commonJS({
|
|
|
22367
22345
|
const dateHeader = {
|
|
22368
22346
|
":date": { type: "timestamp", value: now }
|
|
22369
22347
|
};
|
|
22370
|
-
const signedMessage = await messageSigner.sign(
|
|
22371
|
-
{
|
|
22372
|
-
|
|
22373
|
-
|
|
22374
|
-
headers: dateHeader
|
|
22375
|
-
},
|
|
22376
|
-
priorSignature
|
|
22348
|
+
const signedMessage = await messageSigner.sign({
|
|
22349
|
+
message: {
|
|
22350
|
+
body: chunk,
|
|
22351
|
+
headers: dateHeader
|
|
22377
22352
|
},
|
|
22378
|
-
|
|
22379
|
-
|
|
22380
|
-
|
|
22381
|
-
);
|
|
22353
|
+
priorSignature
|
|
22354
|
+
}, {
|
|
22355
|
+
signingDate: now
|
|
22356
|
+
});
|
|
22382
22357
|
priorSignature = signedMessage.signature;
|
|
22383
22358
|
const serializedSigned = eventStreamCodec.encode({
|
|
22384
22359
|
headers: {
|
|
22385
22360
|
...dateHeader,
|
|
22386
22361
|
":chunk-signature": {
|
|
22387
22362
|
type: "binary",
|
|
22388
|
-
value:
|
|
22363
|
+
value: utilHexEncoding.fromHex(signedMessage.signature)
|
|
22389
22364
|
}
|
|
22390
22365
|
},
|
|
22391
22366
|
body: chunk
|
|
@@ -22397,17 +22372,14 @@ var require_dist_cjs37 = __commonJS({
|
|
|
22397
22372
|
}
|
|
22398
22373
|
};
|
|
22399
22374
|
return new TransformStream({ ...transformer });
|
|
22400
|
-
}
|
|
22375
|
+
};
|
|
22401
22376
|
var EventStreamPayloadHandler = class {
|
|
22402
|
-
static {
|
|
22403
|
-
__name(this, "EventStreamPayloadHandler");
|
|
22404
|
-
}
|
|
22405
22377
|
messageSigner;
|
|
22406
22378
|
eventStreamCodec;
|
|
22407
22379
|
systemClockOffsetProvider;
|
|
22408
22380
|
constructor(options) {
|
|
22409
22381
|
this.messageSigner = options.messageSigner;
|
|
22410
|
-
this.eventStreamCodec = new
|
|
22382
|
+
this.eventStreamCodec = new eventstreamCodec.EventStreamCodec(options.utf8Encoder, options.utf8Decoder);
|
|
22411
22383
|
this.systemClockOffsetProvider = async () => options.systemClockOffset ?? 0;
|
|
22412
22384
|
}
|
|
22413
22385
|
async handle(next, args, context = {}) {
|
|
@@ -22427,19 +22399,14 @@ var require_dist_cjs37 = __commonJS({
|
|
|
22427
22399
|
}
|
|
22428
22400
|
const match2 = (headers["authorization"] || "").match(/Signature=([\w]+)$/);
|
|
22429
22401
|
const priorSignature = (match2 || [])[1] || query2 && query2["X-Amz-Signature"] || "";
|
|
22430
|
-
const signingStream = getEventSigningTransformStream(
|
|
22431
|
-
priorSignature,
|
|
22432
|
-
await this.messageSigner(),
|
|
22433
|
-
this.eventStreamCodec,
|
|
22434
|
-
this.systemClockOffsetProvider
|
|
22435
|
-
);
|
|
22402
|
+
const signingStream = getEventSigningTransformStream(priorSignature, await this.messageSigner(), this.eventStreamCodec, this.systemClockOffsetProvider);
|
|
22436
22403
|
const signedPayload = payload2.pipeThrough(signingStream);
|
|
22437
22404
|
signedPayload.pipeThrough(placeHolderStream);
|
|
22438
22405
|
return result;
|
|
22439
22406
|
}
|
|
22440
22407
|
};
|
|
22441
|
-
var eventStreamPayloadHandlerProvider =
|
|
22442
|
-
var injectSessionIdMiddleware =
|
|
22408
|
+
var eventStreamPayloadHandlerProvider = (options) => new EventStreamPayloadHandler(options);
|
|
22409
|
+
var injectSessionIdMiddleware = () => (next) => async (args) => {
|
|
22443
22410
|
const requestParams = {
|
|
22444
22411
|
...args.input
|
|
22445
22412
|
};
|
|
@@ -22449,17 +22416,16 @@ var require_dist_cjs37 = __commonJS({
|
|
|
22449
22416
|
output.SessionId = requestParams.SessionId;
|
|
22450
22417
|
}
|
|
22451
22418
|
return response;
|
|
22452
|
-
}
|
|
22419
|
+
};
|
|
22453
22420
|
var injectSessionIdMiddlewareOptions = {
|
|
22454
22421
|
step: "initialize",
|
|
22455
22422
|
name: "injectSessionIdMiddleware",
|
|
22456
22423
|
tags: ["WEBSOCKET", "EVENT_STREAM"],
|
|
22457
22424
|
override: true
|
|
22458
22425
|
};
|
|
22459
|
-
var
|
|
22460
|
-
var websocketEndpointMiddleware = /* @__PURE__ */ __name((config, options) => (next) => (args) => {
|
|
22426
|
+
var websocketEndpointMiddleware = (config, options) => (next) => (args) => {
|
|
22461
22427
|
const { request } = args;
|
|
22462
|
-
if (
|
|
22428
|
+
if (protocolHttp.HttpRequest.isInstance(request) && config.requestHandler.metadata?.handlerProtocol?.toLowerCase().includes("websocket")) {
|
|
22463
22429
|
request.protocol = "wss:";
|
|
22464
22430
|
request.method = "GET";
|
|
22465
22431
|
request.path = `${request.path}-websocket`;
|
|
@@ -22478,7 +22444,7 @@ var require_dist_cjs37 = __commonJS({
|
|
|
22478
22444
|
request.headers = { host: headers.host ?? request.hostname };
|
|
22479
22445
|
}
|
|
22480
22446
|
return next(args);
|
|
22481
|
-
}
|
|
22447
|
+
};
|
|
22482
22448
|
var websocketEndpointMiddlewareOptions = {
|
|
22483
22449
|
name: "websocketEndpointMiddleware",
|
|
22484
22450
|
tags: ["WEBSOCKET", "EVENT_STREAM"],
|
|
@@ -22486,17 +22452,14 @@ var require_dist_cjs37 = __commonJS({
|
|
|
22486
22452
|
toMiddleware: "eventStreamHeaderMiddleware",
|
|
22487
22453
|
override: true
|
|
22488
22454
|
};
|
|
22489
|
-
var getWebSocketPlugin =
|
|
22490
|
-
applyToStack:
|
|
22455
|
+
var getWebSocketPlugin = (config, options) => ({
|
|
22456
|
+
applyToStack: (clientStack) => {
|
|
22491
22457
|
clientStack.addRelativeTo(websocketEndpointMiddleware(config, options), websocketEndpointMiddlewareOptions);
|
|
22492
22458
|
clientStack.add(injectSessionIdMiddleware(), injectSessionIdMiddlewareOptions);
|
|
22493
|
-
}, "applyToStack")
|
|
22494
|
-
}), "getWebSocketPlugin");
|
|
22495
|
-
var isWebSocketRequest = /* @__PURE__ */ __name((request) => request.protocol === "ws:" || request.protocol === "wss:", "isWebSocketRequest");
|
|
22496
|
-
var WebsocketSignatureV4 = class {
|
|
22497
|
-
static {
|
|
22498
|
-
__name(this, "WebsocketSignatureV4");
|
|
22499
22459
|
}
|
|
22460
|
+
});
|
|
22461
|
+
var isWebSocketRequest = (request) => request.protocol === "ws:" || request.protocol === "wss:";
|
|
22462
|
+
var WebsocketSignatureV4 = class {
|
|
22500
22463
|
signer;
|
|
22501
22464
|
constructor(options) {
|
|
22502
22465
|
this.signer = options.signer;
|
|
@@ -22505,19 +22468,12 @@ var require_dist_cjs37 = __commonJS({
|
|
|
22505
22468
|
return this.signer.presign(originalRequest, options);
|
|
22506
22469
|
}
|
|
22507
22470
|
async sign(toSign, options) {
|
|
22508
|
-
if (
|
|
22509
|
-
const signedRequest = await this.signer.presign(
|
|
22510
|
-
|
|
22511
|
-
|
|
22512
|
-
|
|
22513
|
-
|
|
22514
|
-
expiresIn: 60,
|
|
22515
|
-
// Not to sign headers. Transcribe-streaming WebSocket
|
|
22516
|
-
// request omits headers except for required 'host' header. If we sign
|
|
22517
|
-
// the other headers, the signature could be mismatch.
|
|
22518
|
-
unsignableHeaders: new Set(Object.keys(toSign.headers).filter((header) => header !== "host"))
|
|
22519
|
-
}
|
|
22520
|
-
);
|
|
22471
|
+
if (protocolHttp.HttpRequest.isInstance(toSign) && isWebSocketRequest(toSign)) {
|
|
22472
|
+
const signedRequest = await this.signer.presign({ ...toSign, body: "" }, {
|
|
22473
|
+
...options,
|
|
22474
|
+
expiresIn: 60,
|
|
22475
|
+
unsignableHeaders: new Set(Object.keys(toSign.headers).filter((header) => header !== "host"))
|
|
22476
|
+
});
|
|
22521
22477
|
return {
|
|
22522
22478
|
...signedRequest,
|
|
22523
22479
|
body: toSign.body
|
|
@@ -22527,27 +22483,21 @@ var require_dist_cjs37 = __commonJS({
|
|
|
22527
22483
|
}
|
|
22528
22484
|
}
|
|
22529
22485
|
};
|
|
22530
|
-
var resolveWebSocketConfig =
|
|
22486
|
+
var resolveWebSocketConfig = (input) => {
|
|
22531
22487
|
const { signer } = input;
|
|
22532
22488
|
return Object.assign(input, {
|
|
22533
|
-
signer:
|
|
22489
|
+
signer: async (authScheme) => {
|
|
22534
22490
|
const signerObj = await signer(authScheme);
|
|
22535
22491
|
if (validateSigner(signerObj)) {
|
|
22536
22492
|
return new WebsocketSignatureV4({ signer: signerObj });
|
|
22537
22493
|
}
|
|
22538
22494
|
throw new Error("Expected WebsocketSignatureV4 signer, please check the client constructor.");
|
|
22539
|
-
}
|
|
22495
|
+
}
|
|
22540
22496
|
});
|
|
22541
|
-
}
|
|
22542
|
-
var validateSigner =
|
|
22543
|
-
var import_util_format_url = require_dist_cjs34();
|
|
22544
|
-
var import_eventstream_serde_browser = require_dist_cjs36();
|
|
22545
|
-
var import_fetch_http_handler = require_dist_cjs16();
|
|
22497
|
+
};
|
|
22498
|
+
var validateSigner = (signer) => !!signer;
|
|
22546
22499
|
var DEFAULT_WS_CONNECTION_TIMEOUT_MS = 2e3;
|
|
22547
22500
|
var WebSocketFetchHandler = class _WebSocketFetchHandler {
|
|
22548
|
-
static {
|
|
22549
|
-
__name(this, "WebSocketFetchHandler");
|
|
22550
|
-
}
|
|
22551
22501
|
metadata = {
|
|
22552
22502
|
handlerProtocol: "websocket/h1.1"
|
|
22553
22503
|
};
|
|
@@ -22555,20 +22505,13 @@ var require_dist_cjs37 = __commonJS({
|
|
|
22555
22505
|
configPromise;
|
|
22556
22506
|
httpHandler;
|
|
22557
22507
|
sockets = {};
|
|
22558
|
-
|
|
22559
|
-
* @returns the input if it is an HttpHandler of any class,
|
|
22560
|
-
* or instantiates a new instance of this handler.
|
|
22561
|
-
*/
|
|
22562
|
-
static create(instanceOrOptions, httpHandler = new import_fetch_http_handler.FetchHttpHandler()) {
|
|
22508
|
+
static create(instanceOrOptions, httpHandler = new fetchHttpHandler.FetchHttpHandler()) {
|
|
22563
22509
|
if (typeof instanceOrOptions?.handle === "function") {
|
|
22564
22510
|
return instanceOrOptions;
|
|
22565
22511
|
}
|
|
22566
|
-
return new _WebSocketFetchHandler(
|
|
22567
|
-
instanceOrOptions,
|
|
22568
|
-
httpHandler
|
|
22569
|
-
);
|
|
22512
|
+
return new _WebSocketFetchHandler(instanceOrOptions, httpHandler);
|
|
22570
22513
|
}
|
|
22571
|
-
constructor(options, httpHandler = new
|
|
22514
|
+
constructor(options, httpHandler = new fetchHttpHandler.FetchHttpHandler()) {
|
|
22572
22515
|
this.httpHandler = httpHandler;
|
|
22573
22516
|
if (typeof options === "function") {
|
|
22574
22517
|
this.config = {};
|
|
@@ -22578,10 +22521,6 @@ var require_dist_cjs37 = __commonJS({
|
|
|
22578
22521
|
this.configPromise = Promise.resolve(this.config);
|
|
22579
22522
|
}
|
|
22580
22523
|
}
|
|
22581
|
-
/**
|
|
22582
|
-
* Destroys the WebSocketHandler.
|
|
22583
|
-
* Closes all sockets from the socket pool.
|
|
22584
|
-
*/
|
|
22585
22524
|
destroy() {
|
|
22586
22525
|
for (const [key, sockets] of Object.entries(this.sockets)) {
|
|
22587
22526
|
for (const socket of sockets) {
|
|
@@ -22594,7 +22533,7 @@ var require_dist_cjs37 = __commonJS({
|
|
|
22594
22533
|
if (!isWebSocketRequest(request)) {
|
|
22595
22534
|
return this.httpHandler.handle(request);
|
|
22596
22535
|
}
|
|
22597
|
-
const url =
|
|
22536
|
+
const url = utilFormatUrl.formatUrl(request);
|
|
22598
22537
|
const socket = new WebSocket(url);
|
|
22599
22538
|
if (!this.sockets[url]) {
|
|
22600
22539
|
this.sockets[url] = [];
|
|
@@ -22609,9 +22548,8 @@ var require_dist_cjs37 = __commonJS({
|
|
|
22609
22548
|
const asyncIterable = this.connect(socket, bodyStream);
|
|
22610
22549
|
const outputPayload = toReadableStream(asyncIterable);
|
|
22611
22550
|
return {
|
|
22612
|
-
response: new
|
|
22551
|
+
response: new protocolHttp.HttpResponse({
|
|
22613
22552
|
statusCode: 200,
|
|
22614
|
-
// indicates connection success
|
|
22615
22553
|
body: outputPayload
|
|
22616
22554
|
})
|
|
22617
22555
|
};
|
|
@@ -22625,13 +22563,8 @@ var require_dist_cjs37 = __commonJS({
|
|
|
22625
22563
|
httpHandlerConfigs() {
|
|
22626
22564
|
return this.config ?? {};
|
|
22627
22565
|
}
|
|
22628
|
-
/**
|
|
22629
|
-
* Removes all closing/closed sockets from the socket pool for URL.
|
|
22630
|
-
*/
|
|
22631
22566
|
removeNotUsableSockets(url) {
|
|
22632
|
-
this.sockets[url] = (this.sockets[url] ?? []).filter(
|
|
22633
|
-
(socket) => ![WebSocket.CLOSING, WebSocket.CLOSED].includes(socket.readyState)
|
|
22634
|
-
);
|
|
22567
|
+
this.sockets[url] = (this.sockets[url] ?? []).filter((socket) => ![WebSocket.CLOSING, WebSocket.CLOSED].includes(socket.readyState));
|
|
22635
22568
|
}
|
|
22636
22569
|
waitForReady(socket, connectionTimeout) {
|
|
22637
22570
|
return new Promise((resolve4, reject2) => {
|
|
@@ -22652,10 +22585,10 @@ var require_dist_cjs37 = __commonJS({
|
|
|
22652
22585
|
connect(socket, data2) {
|
|
22653
22586
|
let streamError = void 0;
|
|
22654
22587
|
let socketErrorOccurred = false;
|
|
22655
|
-
let reject2 =
|
|
22656
|
-
}
|
|
22657
|
-
let resolve4 =
|
|
22658
|
-
}
|
|
22588
|
+
let reject2 = () => {
|
|
22589
|
+
};
|
|
22590
|
+
let resolve4 = () => {
|
|
22591
|
+
};
|
|
22659
22592
|
socket.onmessage = (event) => {
|
|
22660
22593
|
resolve4({
|
|
22661
22594
|
done: false,
|
|
@@ -22669,28 +22602,28 @@ var require_dist_cjs37 = __commonJS({
|
|
|
22669
22602
|
};
|
|
22670
22603
|
socket.onclose = () => {
|
|
22671
22604
|
this.removeNotUsableSockets(socket.url);
|
|
22672
|
-
if (socketErrorOccurred)
|
|
22605
|
+
if (socketErrorOccurred)
|
|
22606
|
+
return;
|
|
22673
22607
|
if (streamError) {
|
|
22674
22608
|
reject2(streamError);
|
|
22675
22609
|
} else {
|
|
22676
22610
|
resolve4({
|
|
22677
22611
|
done: true,
|
|
22678
22612
|
value: void 0
|
|
22679
|
-
// unchecked because done=true.
|
|
22680
22613
|
});
|
|
22681
22614
|
}
|
|
22682
22615
|
};
|
|
22683
22616
|
const outputStream = {
|
|
22684
22617
|
[Symbol.asyncIterator]: () => ({
|
|
22685
|
-
next:
|
|
22618
|
+
next: () => {
|
|
22686
22619
|
return new Promise((_resolve, _reject) => {
|
|
22687
22620
|
resolve4 = _resolve;
|
|
22688
22621
|
reject2 = _reject;
|
|
22689
22622
|
});
|
|
22690
|
-
}
|
|
22623
|
+
}
|
|
22691
22624
|
})
|
|
22692
22625
|
};
|
|
22693
|
-
const send =
|
|
22626
|
+
const send = async () => {
|
|
22694
22627
|
try {
|
|
22695
22628
|
for await (const inputChunk of data2) {
|
|
22696
22629
|
socket.send(inputChunk);
|
|
@@ -22700,26 +22633,30 @@ var require_dist_cjs37 = __commonJS({
|
|
|
22700
22633
|
} finally {
|
|
22701
22634
|
socket.close(1e3);
|
|
22702
22635
|
}
|
|
22703
|
-
}
|
|
22636
|
+
};
|
|
22704
22637
|
send();
|
|
22705
22638
|
return outputStream;
|
|
22706
22639
|
}
|
|
22707
22640
|
};
|
|
22708
|
-
var getIterator =
|
|
22641
|
+
var getIterator = (stream2) => {
|
|
22709
22642
|
if (stream2[Symbol.asyncIterator]) {
|
|
22710
22643
|
return stream2;
|
|
22711
22644
|
}
|
|
22712
22645
|
if (isReadableStream(stream2)) {
|
|
22713
|
-
return
|
|
22646
|
+
return eventstreamSerdeBrowser.readableStreamtoIterable(stream2);
|
|
22714
22647
|
}
|
|
22715
22648
|
return {
|
|
22716
22649
|
[Symbol.asyncIterator]: async function* () {
|
|
22717
22650
|
yield stream2;
|
|
22718
22651
|
}
|
|
22719
22652
|
};
|
|
22720
|
-
}
|
|
22721
|
-
var toReadableStream =
|
|
22722
|
-
var isReadableStream =
|
|
22653
|
+
};
|
|
22654
|
+
var toReadableStream = (asyncIterable) => typeof ReadableStream === "function" ? eventstreamSerdeBrowser.iterableToReadableStream(asyncIterable) : asyncIterable;
|
|
22655
|
+
var isReadableStream = (payload2) => typeof ReadableStream === "function" && payload2 instanceof ReadableStream;
|
|
22656
|
+
exports2.WebSocketFetchHandler = WebSocketFetchHandler;
|
|
22657
|
+
exports2.eventStreamPayloadHandlerProvider = eventStreamPayloadHandlerProvider;
|
|
22658
|
+
exports2.getWebSocketPlugin = getWebSocketPlugin;
|
|
22659
|
+
exports2.resolveWebSocketConfig = resolveWebSocketConfig;
|
|
22723
22660
|
}
|
|
22724
22661
|
});
|
|
22725
22662
|
|
|
@@ -24340,7 +24277,7 @@ var require_package = __commonJS({
|
|
|
24340
24277
|
module2.exports = {
|
|
24341
24278
|
name: "@aws-sdk/client-bedrock-runtime",
|
|
24342
24279
|
description: "AWS SDK for JavaScript Bedrock Runtime Client for Node.js, Browser and React Native",
|
|
24343
|
-
version: "3.
|
|
24280
|
+
version: "3.908.0",
|
|
24344
24281
|
scripts: {
|
|
24345
24282
|
build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
24346
24283
|
"build:cjs": "node ../../scripts/compilation/inline client-bedrock-runtime",
|
|
@@ -24359,49 +24296,49 @@ var require_package = __commonJS({
|
|
|
24359
24296
|
dependencies: {
|
|
24360
24297
|
"@aws-crypto/sha256-browser": "5.2.0",
|
|
24361
24298
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
24362
|
-
"@aws-sdk/core": "3.
|
|
24363
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
24299
|
+
"@aws-sdk/core": "3.908.0",
|
|
24300
|
+
"@aws-sdk/credential-provider-node": "3.908.0",
|
|
24364
24301
|
"@aws-sdk/eventstream-handler-node": "3.901.0",
|
|
24365
24302
|
"@aws-sdk/middleware-eventstream": "3.901.0",
|
|
24366
24303
|
"@aws-sdk/middleware-host-header": "3.901.0",
|
|
24367
24304
|
"@aws-sdk/middleware-logger": "3.901.0",
|
|
24368
24305
|
"@aws-sdk/middleware-recursion-detection": "3.901.0",
|
|
24369
|
-
"@aws-sdk/middleware-user-agent": "3.
|
|
24370
|
-
"@aws-sdk/middleware-websocket": "3.
|
|
24306
|
+
"@aws-sdk/middleware-user-agent": "3.908.0",
|
|
24307
|
+
"@aws-sdk/middleware-websocket": "3.908.0",
|
|
24371
24308
|
"@aws-sdk/region-config-resolver": "3.901.0",
|
|
24372
|
-
"@aws-sdk/token-providers": "3.
|
|
24309
|
+
"@aws-sdk/token-providers": "3.908.0",
|
|
24373
24310
|
"@aws-sdk/types": "3.901.0",
|
|
24374
24311
|
"@aws-sdk/util-endpoints": "3.901.0",
|
|
24375
24312
|
"@aws-sdk/util-user-agent-browser": "3.907.0",
|
|
24376
|
-
"@aws-sdk/util-user-agent-node": "3.
|
|
24313
|
+
"@aws-sdk/util-user-agent-node": "3.908.0",
|
|
24377
24314
|
"@smithy/config-resolver": "^4.3.0",
|
|
24378
|
-
"@smithy/core": "^3.
|
|
24315
|
+
"@smithy/core": "^3.15.0",
|
|
24379
24316
|
"@smithy/eventstream-serde-browser": "^4.2.0",
|
|
24380
24317
|
"@smithy/eventstream-serde-config-resolver": "^4.3.0",
|
|
24381
24318
|
"@smithy/eventstream-serde-node": "^4.2.0",
|
|
24382
|
-
"@smithy/fetch-http-handler": "^5.3.
|
|
24319
|
+
"@smithy/fetch-http-handler": "^5.3.1",
|
|
24383
24320
|
"@smithy/hash-node": "^4.2.0",
|
|
24384
24321
|
"@smithy/invalid-dependency": "^4.2.0",
|
|
24385
24322
|
"@smithy/middleware-content-length": "^4.2.0",
|
|
24386
|
-
"@smithy/middleware-endpoint": "^4.3.
|
|
24387
|
-
"@smithy/middleware-retry": "^4.4.
|
|
24323
|
+
"@smithy/middleware-endpoint": "^4.3.1",
|
|
24324
|
+
"@smithy/middleware-retry": "^4.4.1",
|
|
24388
24325
|
"@smithy/middleware-serde": "^4.2.0",
|
|
24389
24326
|
"@smithy/middleware-stack": "^4.2.0",
|
|
24390
24327
|
"@smithy/node-config-provider": "^4.3.0",
|
|
24391
24328
|
"@smithy/node-http-handler": "^4.3.0",
|
|
24392
24329
|
"@smithy/protocol-http": "^5.3.0",
|
|
24393
|
-
"@smithy/smithy-client": "^4.7.
|
|
24330
|
+
"@smithy/smithy-client": "^4.7.1",
|
|
24394
24331
|
"@smithy/types": "^4.6.0",
|
|
24395
24332
|
"@smithy/url-parser": "^4.2.0",
|
|
24396
|
-
"@smithy/util-base64": "^4.
|
|
24333
|
+
"@smithy/util-base64": "^4.3.0",
|
|
24397
24334
|
"@smithy/util-body-length-browser": "^4.2.0",
|
|
24398
|
-
"@smithy/util-body-length-node": "^4.2.
|
|
24399
|
-
"@smithy/util-defaults-mode-browser": "^4.
|
|
24400
|
-
"@smithy/util-defaults-mode-node": "^4.2.
|
|
24335
|
+
"@smithy/util-body-length-node": "^4.2.1",
|
|
24336
|
+
"@smithy/util-defaults-mode-browser": "^4.3.0",
|
|
24337
|
+
"@smithy/util-defaults-mode-node": "^4.2.1",
|
|
24401
24338
|
"@smithy/util-endpoints": "^3.2.0",
|
|
24402
24339
|
"@smithy/util-middleware": "^4.2.0",
|
|
24403
24340
|
"@smithy/util-retry": "^4.2.0",
|
|
24404
|
-
"@smithy/util-stream": "^4.
|
|
24341
|
+
"@smithy/util-stream": "^4.5.0",
|
|
24405
24342
|
"@smithy/util-utf8": "^4.2.0",
|
|
24406
24343
|
"@smithy/uuid": "^1.1.0",
|
|
24407
24344
|
tslib: "^2.6.2"
|
|
@@ -25121,7 +25058,7 @@ var init_package = __esm({
|
|
|
25121
25058
|
"node_modules/@aws-sdk/nested-clients/package.json"() {
|
|
25122
25059
|
package_default = {
|
|
25123
25060
|
name: "@aws-sdk/nested-clients",
|
|
25124
|
-
version: "3.
|
|
25061
|
+
version: "3.908.0",
|
|
25125
25062
|
description: "Nested clients for AWS SDK packages.",
|
|
25126
25063
|
main: "./dist-cjs/index.js",
|
|
25127
25064
|
module: "./dist-es/index.js",
|
|
@@ -25150,37 +25087,37 @@ var init_package = __esm({
|
|
|
25150
25087
|
dependencies: {
|
|
25151
25088
|
"@aws-crypto/sha256-browser": "5.2.0",
|
|
25152
25089
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
25153
|
-
"@aws-sdk/core": "3.
|
|
25090
|
+
"@aws-sdk/core": "3.908.0",
|
|
25154
25091
|
"@aws-sdk/middleware-host-header": "3.901.0",
|
|
25155
25092
|
"@aws-sdk/middleware-logger": "3.901.0",
|
|
25156
25093
|
"@aws-sdk/middleware-recursion-detection": "3.901.0",
|
|
25157
|
-
"@aws-sdk/middleware-user-agent": "3.
|
|
25094
|
+
"@aws-sdk/middleware-user-agent": "3.908.0",
|
|
25158
25095
|
"@aws-sdk/region-config-resolver": "3.901.0",
|
|
25159
25096
|
"@aws-sdk/types": "3.901.0",
|
|
25160
25097
|
"@aws-sdk/util-endpoints": "3.901.0",
|
|
25161
25098
|
"@aws-sdk/util-user-agent-browser": "3.907.0",
|
|
25162
|
-
"@aws-sdk/util-user-agent-node": "3.
|
|
25099
|
+
"@aws-sdk/util-user-agent-node": "3.908.0",
|
|
25163
25100
|
"@smithy/config-resolver": "^4.3.0",
|
|
25164
|
-
"@smithy/core": "^3.
|
|
25165
|
-
"@smithy/fetch-http-handler": "^5.3.
|
|
25101
|
+
"@smithy/core": "^3.15.0",
|
|
25102
|
+
"@smithy/fetch-http-handler": "^5.3.1",
|
|
25166
25103
|
"@smithy/hash-node": "^4.2.0",
|
|
25167
25104
|
"@smithy/invalid-dependency": "^4.2.0",
|
|
25168
25105
|
"@smithy/middleware-content-length": "^4.2.0",
|
|
25169
|
-
"@smithy/middleware-endpoint": "^4.3.
|
|
25170
|
-
"@smithy/middleware-retry": "^4.4.
|
|
25106
|
+
"@smithy/middleware-endpoint": "^4.3.1",
|
|
25107
|
+
"@smithy/middleware-retry": "^4.4.1",
|
|
25171
25108
|
"@smithy/middleware-serde": "^4.2.0",
|
|
25172
25109
|
"@smithy/middleware-stack": "^4.2.0",
|
|
25173
25110
|
"@smithy/node-config-provider": "^4.3.0",
|
|
25174
25111
|
"@smithy/node-http-handler": "^4.3.0",
|
|
25175
25112
|
"@smithy/protocol-http": "^5.3.0",
|
|
25176
|
-
"@smithy/smithy-client": "^4.7.
|
|
25113
|
+
"@smithy/smithy-client": "^4.7.1",
|
|
25177
25114
|
"@smithy/types": "^4.6.0",
|
|
25178
25115
|
"@smithy/url-parser": "^4.2.0",
|
|
25179
|
-
"@smithy/util-base64": "^4.
|
|
25116
|
+
"@smithy/util-base64": "^4.3.0",
|
|
25180
25117
|
"@smithy/util-body-length-browser": "^4.2.0",
|
|
25181
|
-
"@smithy/util-body-length-node": "^4.2.
|
|
25182
|
-
"@smithy/util-defaults-mode-browser": "^4.
|
|
25183
|
-
"@smithy/util-defaults-mode-node": "^4.2.
|
|
25118
|
+
"@smithy/util-body-length-node": "^4.2.1",
|
|
25119
|
+
"@smithy/util-defaults-mode-browser": "^4.3.0",
|
|
25120
|
+
"@smithy/util-defaults-mode-node": "^4.2.1",
|
|
25184
25121
|
"@smithy/util-endpoints": "^3.2.0",
|
|
25185
25122
|
"@smithy/util-middleware": "^4.2.0",
|
|
25186
25123
|
"@smithy/util-retry": "^4.2.0",
|
|
@@ -26596,7 +26533,7 @@ var require_package2 = __commonJS({
|
|
|
26596
26533
|
module2.exports = {
|
|
26597
26534
|
name: "@aws-sdk/client-sso",
|
|
26598
26535
|
description: "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",
|
|
26599
|
-
version: "3.
|
|
26536
|
+
version: "3.908.0",
|
|
26600
26537
|
scripts: {
|
|
26601
26538
|
build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
26602
26539
|
"build:cjs": "node ../../scripts/compilation/inline client-sso",
|
|
@@ -26615,37 +26552,37 @@ var require_package2 = __commonJS({
|
|
|
26615
26552
|
dependencies: {
|
|
26616
26553
|
"@aws-crypto/sha256-browser": "5.2.0",
|
|
26617
26554
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
26618
|
-
"@aws-sdk/core": "3.
|
|
26555
|
+
"@aws-sdk/core": "3.908.0",
|
|
26619
26556
|
"@aws-sdk/middleware-host-header": "3.901.0",
|
|
26620
26557
|
"@aws-sdk/middleware-logger": "3.901.0",
|
|
26621
26558
|
"@aws-sdk/middleware-recursion-detection": "3.901.0",
|
|
26622
|
-
"@aws-sdk/middleware-user-agent": "3.
|
|
26559
|
+
"@aws-sdk/middleware-user-agent": "3.908.0",
|
|
26623
26560
|
"@aws-sdk/region-config-resolver": "3.901.0",
|
|
26624
26561
|
"@aws-sdk/types": "3.901.0",
|
|
26625
26562
|
"@aws-sdk/util-endpoints": "3.901.0",
|
|
26626
26563
|
"@aws-sdk/util-user-agent-browser": "3.907.0",
|
|
26627
|
-
"@aws-sdk/util-user-agent-node": "3.
|
|
26564
|
+
"@aws-sdk/util-user-agent-node": "3.908.0",
|
|
26628
26565
|
"@smithy/config-resolver": "^4.3.0",
|
|
26629
|
-
"@smithy/core": "^3.
|
|
26630
|
-
"@smithy/fetch-http-handler": "^5.3.
|
|
26566
|
+
"@smithy/core": "^3.15.0",
|
|
26567
|
+
"@smithy/fetch-http-handler": "^5.3.1",
|
|
26631
26568
|
"@smithy/hash-node": "^4.2.0",
|
|
26632
26569
|
"@smithy/invalid-dependency": "^4.2.0",
|
|
26633
26570
|
"@smithy/middleware-content-length": "^4.2.0",
|
|
26634
|
-
"@smithy/middleware-endpoint": "^4.3.
|
|
26635
|
-
"@smithy/middleware-retry": "^4.4.
|
|
26571
|
+
"@smithy/middleware-endpoint": "^4.3.1",
|
|
26572
|
+
"@smithy/middleware-retry": "^4.4.1",
|
|
26636
26573
|
"@smithy/middleware-serde": "^4.2.0",
|
|
26637
26574
|
"@smithy/middleware-stack": "^4.2.0",
|
|
26638
26575
|
"@smithy/node-config-provider": "^4.3.0",
|
|
26639
26576
|
"@smithy/node-http-handler": "^4.3.0",
|
|
26640
26577
|
"@smithy/protocol-http": "^5.3.0",
|
|
26641
|
-
"@smithy/smithy-client": "^4.7.
|
|
26578
|
+
"@smithy/smithy-client": "^4.7.1",
|
|
26642
26579
|
"@smithy/types": "^4.6.0",
|
|
26643
26580
|
"@smithy/url-parser": "^4.2.0",
|
|
26644
|
-
"@smithy/util-base64": "^4.
|
|
26581
|
+
"@smithy/util-base64": "^4.3.0",
|
|
26645
26582
|
"@smithy/util-body-length-browser": "^4.2.0",
|
|
26646
|
-
"@smithy/util-body-length-node": "^4.2.
|
|
26647
|
-
"@smithy/util-defaults-mode-browser": "^4.
|
|
26648
|
-
"@smithy/util-defaults-mode-node": "^4.2.
|
|
26583
|
+
"@smithy/util-body-length-node": "^4.2.1",
|
|
26584
|
+
"@smithy/util-defaults-mode-browser": "^4.3.0",
|
|
26585
|
+
"@smithy/util-defaults-mode-node": "^4.2.1",
|
|
26649
26586
|
"@smithy/util-endpoints": "^3.2.0",
|
|
26650
26587
|
"@smithy/util-middleware": "^4.2.0",
|
|
26651
26588
|
"@smithy/util-retry": "^4.2.0",
|
|
@@ -53934,7 +53871,6 @@ var init_parser2 = __esm({
|
|
|
53934
53871
|
this.linkStyleStatement = this.RULE("linkStyleStatement", () => {
|
|
53935
53872
|
this.CONSUME(LinkStyleKeyword);
|
|
53936
53873
|
this.SUBRULE(this.linkStyleIndexList);
|
|
53937
|
-
this.OPTION1(() => this.CONSUME1(Newline));
|
|
53938
53874
|
this.SUBRULE(this.linkStylePairs);
|
|
53939
53875
|
this.OPTION2(() => this.CONSUME2(Newline));
|
|
53940
53876
|
});
|
|
@@ -54398,7 +54334,7 @@ var init_semantics = __esm({
|
|
|
54398
54334
|
}
|
|
54399
54335
|
const fnTok = ch.fn?.[0];
|
|
54400
54336
|
if (!fnTok) {
|
|
54401
|
-
this.ctx.errors.push({ line: modeTok2?.startLine ?? 1, column: modeTok2?.startColumn ?? 1, severity: "error", code: "FL-CLICK-CALL-NAME-MISSING", message: "'click \u2026 call' requires a function name.", hint:
|
|
54337
|
+
this.ctx.errors.push({ line: modeTok2?.startLine ?? 1, column: modeTok2?.startColumn ?? 1, severity: "error", code: "FL-CLICK-CALL-NAME-MISSING", message: "'click \u2026 call' requires a function name.", hint: "Example: click A call doThing()" });
|
|
54402
54338
|
}
|
|
54403
54339
|
const tipTok = ch.tooltip?.[0];
|
|
54404
54340
|
if (tipTok) {
|
|
@@ -54455,7 +54391,7 @@ var init_semantics = __esm({
|
|
|
54455
54391
|
severity: "error",
|
|
54456
54392
|
code: "FL-CLICK-CALL-NAME-MISSING",
|
|
54457
54393
|
message: "'click \u2026 call' requires a function name.",
|
|
54458
|
-
hint:
|
|
54394
|
+
hint: "Example: click A call doThing()"
|
|
54459
54395
|
});
|
|
54460
54396
|
}
|
|
54461
54397
|
return;
|
|
@@ -54536,6 +54472,8 @@ var init_semantics = __esm({
|
|
|
54536
54472
|
const linksHere = Array.isArray(ctx.link) ? ctx.link.length : 0;
|
|
54537
54473
|
if (linksHere > 0)
|
|
54538
54474
|
this.edgeCount += linksHere;
|
|
54475
|
+
if (ctx.link)
|
|
54476
|
+
ctx.link.forEach((ln) => this.visit(ln));
|
|
54539
54477
|
}
|
|
54540
54478
|
// Edge attribute object statements must target a known edge id
|
|
54541
54479
|
// Edge attribute statements are parsed as nodeStatements with a typed attrObject and no links.
|
|
@@ -54595,7 +54533,7 @@ var init_semantics = __esm({
|
|
|
54595
54533
|
severity: "error",
|
|
54596
54534
|
code: "FL-TYPED-SHAPE-UNKNOWN",
|
|
54597
54535
|
message: `Unknown shape '${v3}' in '@{ shape: \u2026 }'.`,
|
|
54598
|
-
hint:
|
|
54536
|
+
hint: 'Use one of: rect, rounded, stadium, subroutine, circle, cylinder, diamond, trapezoid, parallelogram, hexagon, "lean-l", "lean-r", icon, image'
|
|
54599
54537
|
});
|
|
54600
54538
|
} else {
|
|
54601
54539
|
const supportedByCli = /* @__PURE__ */ new Set(["rect", "round", "rounded", "diamond", "circle", "cylinder", "stadium", "subroutine", "lean-l", "lean-r"]);
|
|
@@ -54797,8 +54735,8 @@ var init_semantics = __esm({
|
|
|
54797
54735
|
column: t3.startColumn ?? 1,
|
|
54798
54736
|
severity: "error",
|
|
54799
54737
|
code: "FL-LABEL-PARENS-UNQUOTED",
|
|
54800
|
-
message: "Parentheses inside an unquoted label are not supported by Mermaid.
|
|
54801
|
-
hint: '
|
|
54738
|
+
message: "Parentheses inside an unquoted label are not supported by Mermaid.",
|
|
54739
|
+
hint: 'Wrap the label in quotes, e.g., A["Mark (X)"] \u2014 or replace ( and ) with HTML entities: ( and )'
|
|
54802
54740
|
});
|
|
54803
54741
|
}
|
|
54804
54742
|
}
|
|
@@ -54846,6 +54784,29 @@ var init_semantics = __esm({
|
|
|
54846
54784
|
}
|
|
54847
54785
|
}
|
|
54848
54786
|
}
|
|
54787
|
+
// Validate link specifics that Mermaid CLI enforces but our grammar may parse loosely
|
|
54788
|
+
link(ctx) {
|
|
54789
|
+
const inline = ctx.linkTextInline?.[0];
|
|
54790
|
+
if (inline) {
|
|
54791
|
+
const ch = inline.children || {};
|
|
54792
|
+
const parts = [].concat(ch.Identifier || []).concat(ch.Text || []).concat(ch.NumberLiteral || []).concat(ch.Pipe || []);
|
|
54793
|
+
if (parts.length) {
|
|
54794
|
+
const raw = parts.map((t3) => String(t3.image || "")).join("").trim();
|
|
54795
|
+
if (raw === "x" || raw === "o") {
|
|
54796
|
+
const p3 = parts[0];
|
|
54797
|
+
this.ctx.errors.push({
|
|
54798
|
+
line: p3.startLine ?? 1,
|
|
54799
|
+
column: p3.startColumn ?? 1,
|
|
54800
|
+
severity: "error",
|
|
54801
|
+
code: "FL-LINK-UNSUPPORTED-MARKER",
|
|
54802
|
+
message: `Unsupported one-sided link marker '${raw}'. Use symmetric '${raw}--${raw}' or a plain arrow with a label.`,
|
|
54803
|
+
hint: raw === "x" ? "Example: A x--x B (or) A --> B and label it: A --|Skipped|--> B" : "Example: A o--o B (or) A --> B",
|
|
54804
|
+
length: p3.image?.length ?? 1
|
|
54805
|
+
});
|
|
54806
|
+
}
|
|
54807
|
+
}
|
|
54808
|
+
}
|
|
54809
|
+
}
|
|
54849
54810
|
checkBackticksInContent(contentNodes) {
|
|
54850
54811
|
if (!contentNodes)
|
|
54851
54812
|
return;
|
|
@@ -55197,6 +55158,31 @@ function mapFlowchartParserError(err, text) {
|
|
|
55197
55158
|
}
|
|
55198
55159
|
}
|
|
55199
55160
|
}
|
|
55161
|
+
if (isInRule(err, "linkStylePairs") && tokType === "Newline") {
|
|
55162
|
+
const nextLine = Math.min(allLines.length, line + 1);
|
|
55163
|
+
const nxt = allLines[nextLine - 1] || "";
|
|
55164
|
+
const first2 = (nxt.match(/\S/) || { index: 0 }).index || 0;
|
|
55165
|
+
return {
|
|
55166
|
+
line: nextLine,
|
|
55167
|
+
column: Math.max(1, first2 + 1),
|
|
55168
|
+
severity: "error",
|
|
55169
|
+
code: "FL-LINKSTYLE-MULTILINE",
|
|
55170
|
+
message: "'linkStyle' styles must be on the same line as the indices.",
|
|
55171
|
+
hint: "Example: linkStyle 0,1 stroke:#f00,stroke-width:2px",
|
|
55172
|
+
length: 1
|
|
55173
|
+
};
|
|
55174
|
+
}
|
|
55175
|
+
if ((isInRule(err, "linkStyleIndexList") || isInRule(err, "linkStyleStatement")) && tokType === "Colon") {
|
|
55176
|
+
return {
|
|
55177
|
+
line,
|
|
55178
|
+
column,
|
|
55179
|
+
severity: "error",
|
|
55180
|
+
code: "FL-LINKSTYLE-RANGE-NOT-SUPPORTED",
|
|
55181
|
+
message: "Ranges in 'linkStyle' indices are not supported. Use comma-separated indices.",
|
|
55182
|
+
hint: "Example: linkStyle 0,1 stroke:#f00,stroke-width:2px",
|
|
55183
|
+
length: len
|
|
55184
|
+
};
|
|
55185
|
+
}
|
|
55200
55186
|
if (tokType === "QuotedString") {
|
|
55201
55187
|
const context = err?.context;
|
|
55202
55188
|
const inLinkRule = context?.ruleStack?.includes("linkTextInline") || context?.ruleStack?.includes("link") || false;
|
|
@@ -55243,6 +55229,17 @@ function mapFlowchartParserError(err, text) {
|
|
|
55243
55229
|
}
|
|
55244
55230
|
if (isInRule(err, "nodeShape") && err.name === "MismatchedTokenException") {
|
|
55245
55231
|
if (expecting(err, "SquareClose")) {
|
|
55232
|
+
if (tokType === "RoundOpen" || tokType === "RoundClose") {
|
|
55233
|
+
return {
|
|
55234
|
+
line,
|
|
55235
|
+
column,
|
|
55236
|
+
severity: "error",
|
|
55237
|
+
code: "FL-LABEL-PARENS-UNQUOTED",
|
|
55238
|
+
message: "Parentheses inside an unquoted label are not supported by Mermaid.",
|
|
55239
|
+
hint: 'Wrap the label in quotes, e.g., A["Mark (X)"] \u2014 or replace ( and ) with HTML entities: ( and ).',
|
|
55240
|
+
length: len
|
|
55241
|
+
};
|
|
55242
|
+
}
|
|
55246
55243
|
if (tokType === "QuotedString") {
|
|
55247
55244
|
return {
|
|
55248
55245
|
line,
|
|
@@ -55738,6 +55735,32 @@ ${br.example}`,
|
|
|
55738
55735
|
break;
|
|
55739
55736
|
}
|
|
55740
55737
|
}
|
|
55738
|
+
if (blk.label === "box" && openIdx !== -1) {
|
|
55739
|
+
let endIdx = -1;
|
|
55740
|
+
for (let i3 = openIdx + 1; i3 < lines2.length; i3++) {
|
|
55741
|
+
const raw = lines2[i3] || "";
|
|
55742
|
+
const ind = raw.match(/^(\s*)/)?.[1] || "";
|
|
55743
|
+
if (/^\s*end\s*$/.test(raw) && ind.length <= openIndent.length) {
|
|
55744
|
+
endIdx = i3;
|
|
55745
|
+
break;
|
|
55746
|
+
}
|
|
55747
|
+
}
|
|
55748
|
+
if (endIdx !== -1) {
|
|
55749
|
+
const body = lines2.slice(openIdx + 1, endIdx).map((s3) => (s3 || "").trim());
|
|
55750
|
+
const hasMsgWithActivation = body.some((s3) => /->/.test(s3) && /[+-]/.test(s3));
|
|
55751
|
+
if (hasMsgWithActivation) {
|
|
55752
|
+
return {
|
|
55753
|
+
line: openIdx + 1,
|
|
55754
|
+
column: 1,
|
|
55755
|
+
severity: "error",
|
|
55756
|
+
code: "SE-BOX-EMPTY",
|
|
55757
|
+
message: "Box block has no participant/actor declarations. Use 'rect' to group messages visually.",
|
|
55758
|
+
hint: "Replace 'box' with 'rect' if you want to group messages:\nrect rgb(240, 240, 255)\n A->>B: Message\n Note over A: Info\nend",
|
|
55759
|
+
length: 3
|
|
55760
|
+
};
|
|
55761
|
+
}
|
|
55762
|
+
}
|
|
55763
|
+
}
|
|
55741
55764
|
let caretLine = line;
|
|
55742
55765
|
if (openIdx !== -1) {
|
|
55743
55766
|
caretLine = lines2.length;
|
|
@@ -57077,7 +57100,7 @@ var init_validate3 = __esm({
|
|
|
57077
57100
|
function tokenize4(text) {
|
|
57078
57101
|
return ClassLexer.tokenize(text);
|
|
57079
57102
|
}
|
|
57080
|
-
var Identifier3, NumberLiteral4, ClassDiagramKeyword, DirectionKw, Direction2, ClassKw, AsKw, NoteKw, ForKw, RelCompToAgg, RelAggToComp, RelCompBoth, RelAggBoth, LollipopLeft, LollipopRight, RelExtends, RelComposition, RelAggregation, RelDependency, RelRealization, RelAssociation, RelDependencyLeft, RelRealizationLeft, RelExtendsRight, InvalidRelArrow, LCurly, RCurly, LParen2, RParen2, Colon4, Comma3, Visibility, LTlt, GTgt, GenericAngle, QuotedString4, BacktickName, SquareOpen2, SquareClose2, Comment4, WhiteSpace4, Newline4, allTokens4, ClassLexer;
|
|
57103
|
+
var Identifier3, NumberLiteral4, ClassDiagramKeyword, DirectionKw, Direction2, TitleKw, NamespaceKw, ClassKw, InterfaceKw, AsKw, NoteKw, ForKw, RelCompToAgg, RelAggToComp, RelCompBoth, RelAggBoth, LollipopLeft, LollipopRight, RelExtends, RelComposition, RelAggregation, RelDependency, RelRealization, RelAssociation, RelDependencyLeft, RelRealizationLeft, RelExtendsRight, InvalidRelArrow, LCurly, RCurly, LParen2, RParen2, Colon4, Comma3, Visibility, LTlt, GTgt, GenericAngle, QuotedString4, BacktickName, SquareOpen2, SquareClose2, Comment4, WhiteSpace4, Newline4, allTokens4, ClassLexer;
|
|
57081
57104
|
var init_lexer5 = __esm({
|
|
57082
57105
|
"node_modules/@probelabs/maid/out/diagrams/class/lexer.js"() {
|
|
57083
57106
|
init_api5();
|
|
@@ -57086,7 +57109,10 @@ var init_lexer5 = __esm({
|
|
|
57086
57109
|
ClassDiagramKeyword = createToken({ name: "ClassDiagramKeyword", pattern: /classDiagram/, longer_alt: Identifier3 });
|
|
57087
57110
|
DirectionKw = createToken({ name: "DirectionKw", pattern: /direction/, longer_alt: Identifier3 });
|
|
57088
57111
|
Direction2 = createToken({ name: "Direction", pattern: /LR|RL|TB|BT|TD/, longer_alt: Identifier3 });
|
|
57112
|
+
TitleKw = createToken({ name: "TitleKw", pattern: /title/, longer_alt: Identifier3 });
|
|
57113
|
+
NamespaceKw = createToken({ name: "NamespaceKw", pattern: /namespace/, longer_alt: Identifier3 });
|
|
57089
57114
|
ClassKw = createToken({ name: "ClassKw", pattern: /class/, longer_alt: Identifier3 });
|
|
57115
|
+
InterfaceKw = createToken({ name: "InterfaceKw", pattern: /interface\b/, longer_alt: Identifier3 });
|
|
57090
57116
|
AsKw = createToken({ name: "AsKw", pattern: /as/, longer_alt: Identifier3 });
|
|
57091
57117
|
NoteKw = createToken({ name: "NoteKw", pattern: /note/, longer_alt: Identifier3 });
|
|
57092
57118
|
ForKw = createToken({ name: "ForKw", pattern: /for/, longer_alt: Identifier3 });
|
|
@@ -57129,6 +57155,9 @@ var init_lexer5 = __esm({
|
|
|
57129
57155
|
// Keywords
|
|
57130
57156
|
ClassDiagramKeyword,
|
|
57131
57157
|
DirectionKw,
|
|
57158
|
+
TitleKw,
|
|
57159
|
+
NamespaceKw,
|
|
57160
|
+
InterfaceKw,
|
|
57132
57161
|
ClassKw,
|
|
57133
57162
|
AsKw,
|
|
57134
57163
|
NoteKw,
|
|
@@ -57197,8 +57226,11 @@ var init_parser5 = __esm({
|
|
|
57197
57226
|
});
|
|
57198
57227
|
this.statement = this.RULE("statement", () => {
|
|
57199
57228
|
this.OR([
|
|
57229
|
+
{ ALT: () => this.SUBRULE(this.titleStmt) },
|
|
57200
57230
|
{ ALT: () => this.SUBRULE(this.directionStmt) },
|
|
57231
|
+
{ ALT: () => this.SUBRULE(this.namespaceStmt) },
|
|
57201
57232
|
{ ALT: () => this.SUBRULE(this.classLine) },
|
|
57233
|
+
{ ALT: () => this.SUBRULE(this.interfaceLine) },
|
|
57202
57234
|
{ ALT: () => this.SUBRULE(this.relationStmt) },
|
|
57203
57235
|
{ ALT: () => this.SUBRULE(this.noteStmt) },
|
|
57204
57236
|
{ ALT: () => this.SUBRULE(this.memberAssignStmt) },
|
|
@@ -57210,6 +57242,43 @@ var init_parser5 = __esm({
|
|
|
57210
57242
|
this.CONSUME(Direction2);
|
|
57211
57243
|
this.OPTION(() => this.CONSUME(Newline4));
|
|
57212
57244
|
});
|
|
57245
|
+
this.titleStmt = this.RULE("titleStmt", () => {
|
|
57246
|
+
this.CONSUME(TitleKw);
|
|
57247
|
+
this.OR([
|
|
57248
|
+
{ ALT: () => this.CONSUME(QuotedString4) },
|
|
57249
|
+
{
|
|
57250
|
+
ALT: () => {
|
|
57251
|
+
this.AT_LEAST_ONE(() => {
|
|
57252
|
+
this.OR2([
|
|
57253
|
+
{ ALT: () => this.CONSUME(Identifier3) },
|
|
57254
|
+
{ ALT: () => this.CONSUME(NumberLiteral4) }
|
|
57255
|
+
]);
|
|
57256
|
+
});
|
|
57257
|
+
}
|
|
57258
|
+
}
|
|
57259
|
+
]);
|
|
57260
|
+
this.OPTION(() => this.CONSUME(Newline4));
|
|
57261
|
+
});
|
|
57262
|
+
this.namespaceStmt = this.RULE("namespaceStmt", () => {
|
|
57263
|
+
this.CONSUME(NamespaceKw);
|
|
57264
|
+
this.OR([
|
|
57265
|
+
{ ALT: () => this.CONSUME(QuotedString4) },
|
|
57266
|
+
{ ALT: () => this.CONSUME(Identifier3) }
|
|
57267
|
+
]);
|
|
57268
|
+
this.CONSUME(LCurly);
|
|
57269
|
+
this.MANY(() => {
|
|
57270
|
+
this.OR2([
|
|
57271
|
+
{ ALT: () => this.CONSUME(Newline4) },
|
|
57272
|
+
{ ALT: () => this.SUBRULE(this.classLine) },
|
|
57273
|
+
{ ALT: () => this.SUBRULE(this.interfaceLine) },
|
|
57274
|
+
{ ALT: () => this.SUBRULE(this.relationStmt) },
|
|
57275
|
+
{ ALT: () => this.SUBRULE(this.noteStmt) },
|
|
57276
|
+
{ ALT: () => this.SUBRULE(this.memberAssignStmt) }
|
|
57277
|
+
]);
|
|
57278
|
+
});
|
|
57279
|
+
this.CONSUME(RCurly);
|
|
57280
|
+
this.OPTION(() => this.CONSUME2(Newline4));
|
|
57281
|
+
});
|
|
57213
57282
|
this.classLine = this.RULE("classLine", () => {
|
|
57214
57283
|
this.CONSUME(ClassKw);
|
|
57215
57284
|
this.SUBRULE(this.classRef);
|
|
@@ -57248,6 +57317,44 @@ var init_parser5 = __esm({
|
|
|
57248
57317
|
}
|
|
57249
57318
|
]);
|
|
57250
57319
|
});
|
|
57320
|
+
this.interfaceLine = this.RULE("interfaceLine", () => {
|
|
57321
|
+
this.CONSUME(InterfaceKw);
|
|
57322
|
+
this.SUBRULE(this.classRef);
|
|
57323
|
+
this.OR([
|
|
57324
|
+
{
|
|
57325
|
+
ALT: () => {
|
|
57326
|
+
this.CONSUME(LCurly);
|
|
57327
|
+
this.MANY(() => {
|
|
57328
|
+
this.OR2([
|
|
57329
|
+
{ ALT: () => this.CONSUME3(Newline4) },
|
|
57330
|
+
{ ALT: () => this.SUBRULE(this.memberLineStmt) }
|
|
57331
|
+
]);
|
|
57332
|
+
});
|
|
57333
|
+
this.CONSUME(RCurly);
|
|
57334
|
+
this.OPTION(() => this.CONSUME(Newline4));
|
|
57335
|
+
}
|
|
57336
|
+
},
|
|
57337
|
+
{
|
|
57338
|
+
ALT: () => {
|
|
57339
|
+
this.OPTION1(() => {
|
|
57340
|
+
this.CONSUME(SquareOpen2);
|
|
57341
|
+
this.CONSUME(QuotedString4);
|
|
57342
|
+
this.CONSUME(SquareClose2);
|
|
57343
|
+
});
|
|
57344
|
+
this.OPTION2(() => {
|
|
57345
|
+
this.CONSUME(LTlt);
|
|
57346
|
+
this.CONSUME2(Identifier3);
|
|
57347
|
+
this.CONSUME(GTgt);
|
|
57348
|
+
});
|
|
57349
|
+
this.OPTION3(() => {
|
|
57350
|
+
this.CONSUME(AsKw);
|
|
57351
|
+
this.CONSUME3(Identifier3);
|
|
57352
|
+
});
|
|
57353
|
+
this.OPTION4(() => this.CONSUME2(Newline4));
|
|
57354
|
+
}
|
|
57355
|
+
}
|
|
57356
|
+
]);
|
|
57357
|
+
});
|
|
57251
57358
|
this.memberAssignStmt = this.RULE("memberAssignStmt", () => {
|
|
57252
57359
|
this.SUBRULE(this.classRef);
|
|
57253
57360
|
this.CONSUME(Colon4);
|
|
@@ -57417,6 +57524,31 @@ function validateClass(text, _options = {}) {
|
|
|
57417
57524
|
length: b3.image?.length ?? 1
|
|
57418
57525
|
});
|
|
57419
57526
|
}
|
|
57527
|
+
if (a3.tokenType === NamespaceKw && b3.tokenType === QuotedString4) {
|
|
57528
|
+
errs.push({
|
|
57529
|
+
line: b3.startLine ?? 1,
|
|
57530
|
+
column: b3.startColumn ?? 1,
|
|
57531
|
+
severity: "error",
|
|
57532
|
+
code: "CL-NAMESPACE-NAME-QUOTED",
|
|
57533
|
+
message: "Quoted namespace names are not supported by mermaid.js. Use an unquoted identifier.",
|
|
57534
|
+
hint: 'Change: namespace "ProbeAgent Core" { ... } \u2192 namespace ProbeAgentCore { ... }',
|
|
57535
|
+
length: b3.image?.length ?? 1
|
|
57536
|
+
});
|
|
57537
|
+
}
|
|
57538
|
+
if (a3.tokenType === InterfaceKw) {
|
|
57539
|
+
const prevToken = i3 > 0 ? tokList[i3 - 1] : null;
|
|
57540
|
+
if (!prevToken || prevToken.tokenType !== LTlt) {
|
|
57541
|
+
errs.push({
|
|
57542
|
+
line: a3.startLine ?? 1,
|
|
57543
|
+
column: a3.startColumn ?? 1,
|
|
57544
|
+
severity: "error",
|
|
57545
|
+
code: "CL-INTERFACE-KEYWORD-UNSUPPORTED",
|
|
57546
|
+
message: 'The "interface" keyword is not supported by mermaid.js. Use the <<interface>> annotation instead.',
|
|
57547
|
+
hint: 'Auto-fix converts to "class". Then manually add: <<interface>> ClassName after the class definition',
|
|
57548
|
+
length: a3.image?.length ?? 9
|
|
57549
|
+
});
|
|
57550
|
+
}
|
|
57551
|
+
}
|
|
57420
57552
|
}
|
|
57421
57553
|
for (const tk of tokList) {
|
|
57422
57554
|
if (tk.tokenType === InvalidRelArrow) {
|
|
@@ -57473,10 +57605,13 @@ function validateClass(text, _options = {}) {
|
|
|
57473
57605
|
const has2 = (code, line) => (prev || []).some((e3) => e3.code === code && e3.line === line && e3.severity === "error");
|
|
57474
57606
|
const lines = src.split(/\r?\n/);
|
|
57475
57607
|
const classDeclOpen = [];
|
|
57608
|
+
const namespaceDeclOpen = [];
|
|
57476
57609
|
for (let i3 = 0; i3 < lines.length; i3++) {
|
|
57477
57610
|
const raw = lines[i3] || "";
|
|
57478
57611
|
if (/^\s*class\b.*\{\s*$/.test(raw))
|
|
57479
57612
|
classDeclOpen.push(i3 + 1);
|
|
57613
|
+
if (/^\s*namespace\b.*\{\s*$/.test(raw))
|
|
57614
|
+
namespaceDeclOpen.push(i3 + 1);
|
|
57480
57615
|
}
|
|
57481
57616
|
if (classDeclOpen.length > 0) {
|
|
57482
57617
|
const hasClose = lines.some((l3) => /\}/.test(l3));
|
|
@@ -57485,6 +57620,13 @@ function validateClass(text, _options = {}) {
|
|
|
57485
57620
|
errors.push({ line: Math.max(1, lines.length), column: 1, severity: "error", code: "CL-BLOCK-MISSING-RBRACE", message: "Missing '}' to close class block.", hint: "Close the block: class Foo { ... }" });
|
|
57486
57621
|
}
|
|
57487
57622
|
}
|
|
57623
|
+
if (namespaceDeclOpen.length > 0) {
|
|
57624
|
+
const hasClose = lines.some((l3) => /\}/.test(l3));
|
|
57625
|
+
if (!hasClose && !has2("CL-NAMESPACE-MISSING-RBRACE", Math.max(1, lines.length))) {
|
|
57626
|
+
const last2 = namespaceDeclOpen[namespaceDeclOpen.length - 1];
|
|
57627
|
+
errors.push({ line: Math.max(1, lines.length), column: 1, severity: "error", code: "CL-NAMESPACE-MISSING-RBRACE", message: "Missing '}' to close namespace block.", hint: 'Close the block: namespace "Name" { ... }' });
|
|
57628
|
+
}
|
|
57629
|
+
}
|
|
57488
57630
|
return errors;
|
|
57489
57631
|
}
|
|
57490
57632
|
});
|
|
@@ -58139,6 +58281,10 @@ function computeFixes(text, errors, level = "safe") {
|
|
|
58139
58281
|
edits.push(replaceRange(text, at(e3), e3.length ?? 2, "-->"));
|
|
58140
58282
|
continue;
|
|
58141
58283
|
}
|
|
58284
|
+
if (is("FL-LINK-UNSUPPORTED-MARKER", e3)) {
|
|
58285
|
+
edits.push(replaceRange(text, at(e3), e3.length ?? 1, ""));
|
|
58286
|
+
continue;
|
|
58287
|
+
}
|
|
58142
58288
|
if (is("FL-EDGE-LABEL-QUOTED", e3)) {
|
|
58143
58289
|
const lineText = lineTextAt(text, e3.line);
|
|
58144
58290
|
const col = Math.max(0, e3.column - 1);
|
|
@@ -58211,6 +58357,29 @@ function computeFixes(text, errors, level = "safe") {
|
|
|
58211
58357
|
}
|
|
58212
58358
|
continue;
|
|
58213
58359
|
}
|
|
58360
|
+
if (is("CL-NAMESPACE-NAME-QUOTED", e3)) {
|
|
58361
|
+
const lineText = lineTextAt(text, e3.line);
|
|
58362
|
+
const nsIdx = lineText.indexOf("namespace");
|
|
58363
|
+
const startSearch = nsIdx >= 0 ? nsIdx + 9 : 0;
|
|
58364
|
+
const q1 = lineText.indexOf('"', startSearch);
|
|
58365
|
+
if (q1 !== -1) {
|
|
58366
|
+
const q22 = lineText.indexOf('"', q1 + 1);
|
|
58367
|
+
if (q22 > q1) {
|
|
58368
|
+
const namespaceName = lineText.slice(q1 + 1, q22);
|
|
58369
|
+
const validIdentifier = namespaceName.replace(/[^A-Za-z0-9_]/g, "");
|
|
58370
|
+
edits.push(replaceRange(text, { line: e3.line, column: q1 + 1 }, q22 - q1 + 1, validIdentifier));
|
|
58371
|
+
}
|
|
58372
|
+
}
|
|
58373
|
+
continue;
|
|
58374
|
+
}
|
|
58375
|
+
if (is("CL-INTERFACE-KEYWORD-UNSUPPORTED", e3)) {
|
|
58376
|
+
const lineText = lineTextAt(text, e3.line);
|
|
58377
|
+
const ifIdx = lineText.indexOf("interface");
|
|
58378
|
+
if (ifIdx !== -1) {
|
|
58379
|
+
edits.push(replaceRange(text, { line: e3.line, column: ifIdx + 1 }, 9, "class"));
|
|
58380
|
+
}
|
|
58381
|
+
continue;
|
|
58382
|
+
}
|
|
58214
58383
|
if (is("FL-LABEL-ESCAPED-QUOTE", e3)) {
|
|
58215
58384
|
const lineText = lineTextAt(text, e3.line);
|
|
58216
58385
|
const caret0 = Math.max(0, e3.column - 1);
|
|
@@ -58358,6 +58527,42 @@ function computeFixes(text, errors, level = "safe") {
|
|
|
58358
58527
|
const msg = e3.message || "";
|
|
58359
58528
|
const lineText = lineTextAt(text, e3.line);
|
|
58360
58529
|
const caret0 = Math.max(0, e3.column - 1);
|
|
58530
|
+
{
|
|
58531
|
+
const openIdx = lineText.indexOf("([");
|
|
58532
|
+
if (openIdx !== -1) {
|
|
58533
|
+
const badClose = lineText.indexOf("})", openIdx + 2);
|
|
58534
|
+
if (badClose !== -1) {
|
|
58535
|
+
edits.push({ start: { line: e3.line, column: badClose + 1 }, end: { line: e3.line, column: badClose + 2 }, newText: "]" });
|
|
58536
|
+
patchedLines.add(e3.line);
|
|
58537
|
+
continue;
|
|
58538
|
+
}
|
|
58539
|
+
}
|
|
58540
|
+
}
|
|
58541
|
+
{
|
|
58542
|
+
const openIdx = lineText.indexOf("[(");
|
|
58543
|
+
if (openIdx !== -1) {
|
|
58544
|
+
const closePair = lineText.indexOf("))", openIdx + 2);
|
|
58545
|
+
if (closePair !== -1) {
|
|
58546
|
+
edits.push({ start: { line: e3.line, column: closePair + 2 }, end: { line: e3.line, column: closePair + 3 }, newText: "]" });
|
|
58547
|
+
patchedLines.add(e3.line);
|
|
58548
|
+
continue;
|
|
58549
|
+
}
|
|
58550
|
+
}
|
|
58551
|
+
}
|
|
58552
|
+
{
|
|
58553
|
+
const openPair = lineText.indexOf("([");
|
|
58554
|
+
if (openPair !== -1) {
|
|
58555
|
+
const badClose = lineText.indexOf("})", openPair + 2);
|
|
58556
|
+
if (badClose !== -1) {
|
|
58557
|
+
edits.push({ start: { line: e3.line, column: badClose + 1 }, end: { line: e3.line, column: badClose + 2 }, newText: "]" });
|
|
58558
|
+
continue;
|
|
58559
|
+
}
|
|
58560
|
+
}
|
|
58561
|
+
}
|
|
58562
|
+
if (/\(\[/.test(lineText) && lineText.indexOf("})", Math.max(0, caret0 - 1)) !== -1) {
|
|
58563
|
+
edits.push(replaceRange(text, at(e3), e3.length ?? 1, "]"));
|
|
58564
|
+
continue;
|
|
58565
|
+
}
|
|
58361
58566
|
if (msg.includes("opened '('") && msg.includes("closed with ']'")) {
|
|
58362
58567
|
const openIdx = lineText.lastIndexOf("(", caret0);
|
|
58363
58568
|
if (openIdx !== -1) {
|
|
@@ -58430,7 +58635,36 @@ function computeFixes(text, errors, level = "safe") {
|
|
|
58430
58635
|
const caret0 = Math.max(0, e3.column - 1);
|
|
58431
58636
|
const msg = e3.message || "";
|
|
58432
58637
|
const bracketMatch = msg.match(/Unclosed '(.+?)'/);
|
|
58433
|
-
const expectedOpener = bracketMatch ? bracketMatch[1] : null;
|
|
58638
|
+
const expectedOpener = bracketMatch ? (bracketMatch[1] || "").trim() : null;
|
|
58639
|
+
if (expectedOpener === "((") {
|
|
58640
|
+
if (level === "all") {
|
|
58641
|
+
const openIdx = lineText.lastIndexOf("((", caret0);
|
|
58642
|
+
if (openIdx !== -1) {
|
|
58643
|
+
const contentStart = openIdx + 2;
|
|
58644
|
+
const picks = [];
|
|
58645
|
+
const pushIdx2 = (i3) => {
|
|
58646
|
+
if (i3 >= 0)
|
|
58647
|
+
picks.push(i3);
|
|
58648
|
+
};
|
|
58649
|
+
pushIdx2(lineText.indexOf("-", contentStart));
|
|
58650
|
+
pushIdx2(lineText.indexOf("=", contentStart));
|
|
58651
|
+
pushIdx2(lineText.indexOf(".", contentStart));
|
|
58652
|
+
pushIdx2(lineText.indexOf("|", contentStart));
|
|
58653
|
+
let insertIdx = picks.length ? Math.min(...picks) : lineText.length;
|
|
58654
|
+
const before = lineText.slice(0, openIdx);
|
|
58655
|
+
const m3 = before.match(/([A-Za-z0-9_]+)\s*$/);
|
|
58656
|
+
const inferred = m3 ? m3[1] : "";
|
|
58657
|
+
if (inferred) {
|
|
58658
|
+
edits.push({ start: { line: e3.line, column: contentStart + 1 }, end: { line: e3.line, column: insertIdx + 1 }, newText: inferred + "))" });
|
|
58659
|
+
patchedLines.add(e3.line);
|
|
58660
|
+
continue;
|
|
58661
|
+
}
|
|
58662
|
+
patchedLines.add(e3.line);
|
|
58663
|
+
continue;
|
|
58664
|
+
}
|
|
58665
|
+
}
|
|
58666
|
+
continue;
|
|
58667
|
+
}
|
|
58434
58668
|
const bracketMap = {
|
|
58435
58669
|
"[": "]",
|
|
58436
58670
|
"{": "}",
|
|
@@ -58516,6 +58750,14 @@ function computeFixes(text, errors, level = "safe") {
|
|
|
58516
58750
|
patchedLines.add(e3.line);
|
|
58517
58751
|
continue;
|
|
58518
58752
|
}
|
|
58753
|
+
if (innerSeg.includes("(") || innerSeg.includes(")")) {
|
|
58754
|
+
const replaced = innerSeg.replace(/\(/g, "(").replace(/\)/g, ")");
|
|
58755
|
+
if (replaced !== innerSeg) {
|
|
58756
|
+
edits.push({ start: { line: e3.line, column: opened.idx + opened.len + 1 }, end: { line: e3.line, column: closerIdx + 1 }, newText: replaced });
|
|
58757
|
+
patchedLines.add(e3.line);
|
|
58758
|
+
continue;
|
|
58759
|
+
}
|
|
58760
|
+
}
|
|
58519
58761
|
}
|
|
58520
58762
|
}
|
|
58521
58763
|
if (patchedLines.has(e3.line)) {
|
|
@@ -58524,9 +58766,35 @@ function computeFixes(text, errors, level = "safe") {
|
|
|
58524
58766
|
let closer = "]";
|
|
58525
58767
|
if (opened)
|
|
58526
58768
|
closer = opened.close;
|
|
58527
|
-
|
|
58528
|
-
|
|
58529
|
-
|
|
58769
|
+
if (closer === "]") {
|
|
58770
|
+
const openIdxSq = lineText.lastIndexOf("[", caret0);
|
|
58771
|
+
if (openIdxSq !== -1) {
|
|
58772
|
+
const picks = [];
|
|
58773
|
+
const pushIdx2 = (i3) => {
|
|
58774
|
+
if (i3 >= 0)
|
|
58775
|
+
picks.push(i3);
|
|
58776
|
+
};
|
|
58777
|
+
pushIdx2(lineText.indexOf("-", openIdxSq + 1));
|
|
58778
|
+
pushIdx2(lineText.indexOf("=", openIdxSq + 1));
|
|
58779
|
+
pushIdx2(lineText.indexOf(".", openIdxSq + 1));
|
|
58780
|
+
pushIdx2(lineText.indexOf("|", openIdxSq + 1));
|
|
58781
|
+
let ins = picks.length ? Math.min(...picks) : lineText.length;
|
|
58782
|
+
let tl = ins - 1;
|
|
58783
|
+
while (tl >= 0 && /\s/.test(lineText[tl]))
|
|
58784
|
+
tl--;
|
|
58785
|
+
const startCol2 = tl + 1 + 1;
|
|
58786
|
+
const endCol2 = ins + 1;
|
|
58787
|
+
edits.push({ start: { line: e3.line, column: startCol2 }, end: { line: e3.line, column: endCol2 }, newText: closer });
|
|
58788
|
+
} else {
|
|
58789
|
+
const avail = lineText.slice(caret0);
|
|
58790
|
+
const replaceLen = Math.min(closer.length, Math.max(1, avail.length));
|
|
58791
|
+
edits.push({ start: { line: e3.line, column: caret0 + 1 }, end: { line: e3.line, column: caret0 + 1 + replaceLen }, newText: closer });
|
|
58792
|
+
}
|
|
58793
|
+
} else {
|
|
58794
|
+
const avail = lineText.slice(caret0);
|
|
58795
|
+
const replaceLen = Math.min(closer.length, Math.max(1, avail.length));
|
|
58796
|
+
edits.push({ start: { line: e3.line, column: caret0 + 1 }, end: { line: e3.line, column: caret0 + 1 + replaceLen }, newText: closer });
|
|
58797
|
+
}
|
|
58530
58798
|
}
|
|
58531
58799
|
continue;
|
|
58532
58800
|
}
|
|
@@ -58658,9 +58926,11 @@ function computeFixes(text, errors, level = "safe") {
|
|
|
58658
58926
|
if (core.length >= 2 && isSlashPair(left, right)) {
|
|
58659
58927
|
break;
|
|
58660
58928
|
}
|
|
58661
|
-
const
|
|
58662
|
-
|
|
58663
|
-
|
|
58929
|
+
const replaced = inner.replace(/\(/g, "(").replace(/\)/g, ")");
|
|
58930
|
+
if (replaced !== inner) {
|
|
58931
|
+
edits.push({ start: { line: e3.line, column: contentStart + 1 }, end: { line: e3.line, column: closeIdx + 1 }, newText: replaced });
|
|
58932
|
+
patchedLines.add(e3.line);
|
|
58933
|
+
}
|
|
58664
58934
|
break;
|
|
58665
58935
|
}
|
|
58666
58936
|
searchStart = openIdx + 1;
|
|
@@ -58817,14 +59087,33 @@ function computeFixes(text, errors, level = "safe") {
|
|
|
58817
59087
|
continue;
|
|
58818
59088
|
}
|
|
58819
59089
|
if (is("SE-BOX-EMPTY", e3)) {
|
|
58820
|
-
|
|
58821
|
-
|
|
58822
|
-
|
|
58823
|
-
|
|
58824
|
-
|
|
58825
|
-
|
|
58826
|
-
|
|
58827
|
-
|
|
59090
|
+
if (level === "all") {
|
|
59091
|
+
const lines = text.split(/\r?\n/);
|
|
59092
|
+
const boxIdx = Math.max(0, e3.line - 1);
|
|
59093
|
+
const boxLine = lines[boxIdx] || "";
|
|
59094
|
+
const openIndent = (boxLine.match(/^(\s*)/)?.[1] || "").length;
|
|
59095
|
+
let endIdx = -1;
|
|
59096
|
+
for (let i3 = boxIdx + 1; i3 < lines.length; i3++) {
|
|
59097
|
+
const raw = lines[i3] || "";
|
|
59098
|
+
const ind = (raw.match(/^(\s*)/)?.[1] || "").length;
|
|
59099
|
+
if (/^\s*end\s*$/.test(raw) && ind <= openIndent) {
|
|
59100
|
+
endIdx = i3;
|
|
59101
|
+
break;
|
|
59102
|
+
}
|
|
59103
|
+
}
|
|
59104
|
+
let hasMsgWithAct = false;
|
|
59105
|
+
if (endIdx !== -1) {
|
|
59106
|
+
const body = lines.slice(boxIdx + 1, endIdx).map((s3) => (s3 || "").trim());
|
|
59107
|
+
hasMsgWithAct = body.some((s3) => /->/.test(s3) && /[+-]/.test(s3));
|
|
59108
|
+
}
|
|
59109
|
+
if (!hasMsgWithAct) {
|
|
59110
|
+
const labelMatch = /^\s*box\s+(.+)$/.exec(boxLine);
|
|
59111
|
+
if (labelMatch) {
|
|
59112
|
+
const indent = boxLine.match(/^\s*/)?.[0] || "";
|
|
59113
|
+
const newLine = `${indent}rect rgb(240, 240, 255)`;
|
|
59114
|
+
edits.push({ start: { line: e3.line, column: 1 }, end: { line: e3.line, column: boxLine.length + 1 }, newText: newLine });
|
|
59115
|
+
}
|
|
59116
|
+
}
|
|
58828
59117
|
}
|
|
58829
59118
|
continue;
|
|
58830
59119
|
}
|
|
@@ -59100,6 +59389,41 @@ ${indent}${tail}` });
|
|
|
59100
59389
|
}
|
|
59101
59390
|
}
|
|
59102
59391
|
edits.push(insertAt(text, { line: insIdx + 1, column: 1 }, `${openIndent}}
|
|
59392
|
+
`));
|
|
59393
|
+
continue;
|
|
59394
|
+
}
|
|
59395
|
+
if (is("CL-NAMESPACE-MISSING-RBRACE", e3)) {
|
|
59396
|
+
const lines = text.split(/\r?\n/);
|
|
59397
|
+
const curIdx = Math.max(0, e3.line - 1);
|
|
59398
|
+
const openerRe = /^(\s*)namespace\b.*\{\s*$/;
|
|
59399
|
+
let openIdx = -1;
|
|
59400
|
+
let openIndent = "";
|
|
59401
|
+
for (let i3 = curIdx; i3 >= 0; i3--) {
|
|
59402
|
+
const m3 = openerRe.exec(lines[i3] || "");
|
|
59403
|
+
if (m3) {
|
|
59404
|
+
openIdx = i3;
|
|
59405
|
+
openIndent = m3[1] || "";
|
|
59406
|
+
break;
|
|
59407
|
+
}
|
|
59408
|
+
}
|
|
59409
|
+
if (openIdx === -1) {
|
|
59410
|
+
const indent = inferIndentFromLine(lines[curIdx] || "");
|
|
59411
|
+
edits.push(insertAt(text, { line: curIdx + 1, column: 1 }, `${indent}}
|
|
59412
|
+
`));
|
|
59413
|
+
continue;
|
|
59414
|
+
}
|
|
59415
|
+
let insIdx = lines.length;
|
|
59416
|
+
for (let i3 = openIdx + 1; i3 < lines.length; i3++) {
|
|
59417
|
+
const raw = lines[i3] || "";
|
|
59418
|
+
if (raw.trim() === "")
|
|
59419
|
+
continue;
|
|
59420
|
+
const ind = inferIndentFromLine(raw);
|
|
59421
|
+
if (ind.length <= openIndent.length) {
|
|
59422
|
+
insIdx = i3;
|
|
59423
|
+
break;
|
|
59424
|
+
}
|
|
59425
|
+
}
|
|
59426
|
+
edits.push(insertAt(text, { line: insIdx + 1, column: 1 }, `${openIndent}}
|
|
59103
59427
|
`));
|
|
59104
59428
|
continue;
|
|
59105
59429
|
}
|