@opensumi/ide-extension 3.7.2-next-1740450374.0 → 3.7.2-next-1741226843.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.
Files changed (40) hide show
  1. package/lib/browser/sumi/main.thread.chat-agents.js +1 -1
  2. package/lib/browser/sumi/main.thread.chat-agents.js.map +1 -1
  3. package/lib/browser/sumi-browser/index.d.ts +1 -1
  4. package/lib/browser/sumi-browser/index.d.ts.map +1 -1
  5. package/lib/browser/vscode/api/main.thread.doc.d.ts +0 -1
  6. package/lib/browser/vscode/api/main.thread.doc.d.ts.map +1 -1
  7. package/lib/browser/vscode/api/main.thread.doc.js +6 -9
  8. package/lib/browser/vscode/api/main.thread.doc.js.map +1 -1
  9. package/lib/browser/vscode/api/main.thread.language.d.ts +1 -2
  10. package/lib/browser/vscode/api/main.thread.language.d.ts.map +1 -1
  11. package/lib/browser/vscode/api/main.thread.language.js +0 -10
  12. package/lib/browser/vscode/api/main.thread.language.js.map +1 -1
  13. package/lib/common/vscode/ext-types.d.ts +0 -9
  14. package/lib/common/vscode/ext-types.d.ts.map +1 -1
  15. package/lib/common/vscode/ext-types.js +1 -14
  16. package/lib/common/vscode/ext-types.js.map +1 -1
  17. package/lib/common/vscode/languages.d.ts +1 -7
  18. package/lib/common/vscode/languages.d.ts.map +1 -1
  19. package/lib/common/vscode/languages.js.map +1 -1
  20. package/lib/hosted/api/vscode/ext.host.api.impl.d.ts +0 -2
  21. package/lib/hosted/api/vscode/ext.host.api.impl.d.ts.map +1 -1
  22. package/lib/hosted/api/vscode/ext.host.api.impl.js +0 -2
  23. package/lib/hosted/api/vscode/ext.host.api.impl.js.map +1 -1
  24. package/lib/hosted/api/vscode/ext.host.language.d.ts +5 -8
  25. package/lib/hosted/api/vscode/ext.host.language.d.ts.map +1 -1
  26. package/lib/hosted/api/vscode/ext.host.language.js +2 -19
  27. package/lib/hosted/api/vscode/ext.host.language.js.map +1 -1
  28. package/lib/hosted/api/vscode/ext.host.statusbar.d.ts +2 -2
  29. package/lib/hosted/api/vscode/ext.host.statusbar.d.ts.map +1 -1
  30. package/lib/hosted/api/vscode/ext.host.statusbar.js.map +1 -1
  31. package/lib/hosted/api/worker/worker.host.api.impl.d.ts +0 -2
  32. package/lib/hosted/api/worker/worker.host.api.impl.d.ts.map +1 -1
  33. package/lib/hosted/api/worker/worker.host.api.impl.js +0 -2
  34. package/lib/hosted/api/worker/worker.host.api.impl.js.map +1 -1
  35. package/lib/worker-host.js +58 -403
  36. package/package.json +35 -35
  37. package/lib/hosted/api/vscode/language/inlineEdit.d.ts +0 -15
  38. package/lib/hosted/api/vscode/language/inlineEdit.d.ts.map +0 -1
  39. package/lib/hosted/api/vscode/language/inlineEdit.js +0 -103
  40. package/lib/hosted/api/vscode/language/inlineEdit.js.map +0 -1
@@ -27809,7 +27809,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
27809
27809
  exports.StatusBarAlignment = exports.DocumentLink = exports.MultiDocumentHighlight = exports.WorkspaceEdit = exports.SnippetTextEdit = exports.WorkspaceEditType = exports.Selection = exports.CodeAction = exports.CodeActionTriggerKind = exports.CodeActionKind = exports.DiagnosticTag = exports.DiagnosticSeverity = exports.ColorPresentation = exports.DocumentHighlight = exports.DocumentHighlightKind = exports.Color = exports.FoldingRangeKind = exports.FoldingRange = exports.DecorationRangeBehavior = exports.SyntaxTokenType = exports.FileDecoration = exports.ThemeColor = exports.TextEditorLineNumbersStyle = exports.ConfigurationTarget = exports.CompletionList = exports.CompletionItem = exports.MarkdownString = exports.CompletionItemTag = exports.CompletionItemKind = exports.CompletionTriggerKind = exports.TextEdit = exports.SnippetString = exports.Hover = exports.Disposable = exports.DiagnosticRelatedInformation = exports.Location = exports.RelativePattern = exports.EndOfLine = exports.Diagnostic = exports.Position = exports.CodeLens = exports.InputBoxValidationSeverity = exports.LanguageStatusSeverity = exports.Range = exports.IndentAction = exports.ProgressLocation = exports.QuickPickItemKind = exports.FileType = exports.Uri = exports.TextEditorRevealType = void 0;
27810
27810
  exports.ExtensionMode = exports.SymbolTag = exports.ColorThemeKind = exports.ColorTheme = exports.CommentThreadCollapsibleState = exports.CommentMode = exports.UIKind = exports.TerminalShellExecutionCommandLineConfidence = exports.TerminalExitReason = exports.TaskRevealKind = exports.TerminalProfile = exports.TerminalLink = exports.TaskPanelKind = exports.ExtensionKind = exports.Task = exports.CustomExecution = exports.CustomExecution2 = exports.TaskScope = exports.ShellQuoting = exports.ShellExecution = exports.ProcessExecution = exports.TaskGroup = exports.TextDocumentChangeReason = exports.TextDocumentSaveReason = exports.QuickInputButtons = exports.DebugConfigurationProviderTriggerKind = exports.DebugConsoleMode = exports.FunctionBreakpoint = exports.SourceBreakpoint = exports.Breakpoint = exports.SelectionRange = exports.DebugAdapterInlineImplementation = exports.DebugAdapterNamedPipeServer = exports.DebugAdapterServer = exports.DebugAdapterExecutable = exports.ColorInformation = exports.SourceControlInputBoxValidationType = exports.OutputChannelLogLevel = exports.LogLevel = exports.TreeItem2 = exports.TreeItem = exports.ThemeIcon = exports.TreeItemCollapsibleState = exports.SignatureHelp = exports.SignatureInformation = exports.ParameterInformation = exports.SignatureHelpTriggerKind = exports.DocumentSymbol = exports.SymbolKind = exports.SymbolInformation = void 0;
27811
27811
  exports.NotebookData = exports.NotebookCellData = exports.NotebookRange = exports.InteractiveWindowInput = exports.TerminalEditorTabInput = exports.NotebookDiffEditorTabInput = exports.NotebookEditorTabInput = exports.WebviewEditorTabInput = exports.CustomEditorTabInput = exports.TextMergeTabInput = exports.TextDiffTabInput = exports.TextTabInput = exports.ChatMessage = exports.ChatMessageRole = exports.InlineSuggestionList = exports.InlineSuggestion = exports.DataTransfer = exports.DataTransferItem = exports.InlineCompletionTriggerKind = exports.TestTag = exports.DeclarationCoverage = exports.BranchCoverage = exports.StatementCoverage = exports.FileCoverage = exports.TestCoverageCount = exports.TestMessageStackFrame = exports.TestMessage = exports.TestRunRequest = exports.TestRunProfileKind = exports.TestResultState = exports.InlayHintLabelPart = exports.InlayHint = exports.InlayHintKind = exports.InlineValueContext = exports.InlineValueEvaluatableExpression = exports.InlineValueVariableLookup = exports.InlineValueText = exports.CancellationError = exports.TimelineItem = exports.EvaluatableExpression = exports.SemanticTokensEdits = exports.SemanticTokensEdit = exports.SemanticTokens = exports.SemanticTokensBuilder = exports.SemanticTokensLegend = exports.ViewColumn = exports.TypeHierarchyItem = exports.CallHierarchyOutgoingCall = exports.CallHierarchyIncomingCall = exports.CallHierarchyItem = void 0;
27812
- exports.InlineEditTriggerKind = exports.InlineEdit = exports.NotebookVariablesRequestKind = exports.NotebookKernelSourceAction = exports.NotebookRendererScript = exports.NotebookControllerAffinity2 = exports.NotebookControllerAffinity = exports.NotebookCellStatusBarItem = exports.NotebookEditorRevealType = exports.NotebookCellStatusBarAlignment = exports.NotebookCellExecutionState = exports.NotebookCellKind = exports.NotebookCellOutput = exports.NotebookCellOutputItem = void 0;
27812
+ exports.NotebookVariablesRequestKind = exports.NotebookKernelSourceAction = exports.NotebookRendererScript = exports.NotebookControllerAffinity2 = exports.NotebookControllerAffinity = exports.NotebookCellStatusBarItem = exports.NotebookEditorRevealType = exports.NotebookCellStatusBarAlignment = exports.NotebookCellExecutionState = exports.NotebookCellKind = exports.NotebookCellOutput = exports.NotebookCellOutputItem = void 0;
27813
27813
  exports.validateTestCoverageCount = validateTestCoverageCount;
27814
27814
  const tslib_1 = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.mjs");
27815
27815
  const ide_core_common_1 = __webpack_require__(/*! @opensumi/ide-core-common */ "../core-common/lib/index.js");
@@ -31046,19 +31046,6 @@ var NotebookVariablesRequestKind;
31046
31046
  NotebookVariablesRequestKind[NotebookVariablesRequestKind["Named"] = 1] = "Named";
31047
31047
  NotebookVariablesRequestKind[NotebookVariablesRequestKind["Indexed"] = 2] = "Indexed";
31048
31048
  })(NotebookVariablesRequestKind || (exports.NotebookVariablesRequestKind = NotebookVariablesRequestKind = {}));
31049
- // #region InlineEdit
31050
- class InlineEdit {
31051
- constructor(text, range) {
31052
- this.text = text;
31053
- this.range = range;
31054
- }
31055
- }
31056
- exports.InlineEdit = InlineEdit;
31057
- var InlineEditTriggerKind;
31058
- (function (InlineEditTriggerKind) {
31059
- InlineEditTriggerKind[InlineEditTriggerKind["Invoke"] = 0] = "Invoke";
31060
- InlineEditTriggerKind[InlineEditTriggerKind["Automatic"] = 1] = "Automatic";
31061
- })(InlineEditTriggerKind || (exports.InlineEditTriggerKind = InlineEditTriggerKind = {}));
31062
31049
  // #endregion
31063
31050
 
31064
31051
 
@@ -39136,7 +39123,6 @@ const implementation_1 = __webpack_require__(/*! ./language/implementation */ ".
39136
39123
  const inlay_hints_1 = __webpack_require__(/*! ./language/inlay-hints */ "./src/hosted/api/vscode/language/inlay-hints.ts");
39137
39124
  const inline_values_1 = __webpack_require__(/*! ./language/inline-values */ "./src/hosted/api/vscode/language/inline-values.ts");
39138
39125
  const inlineCompletion_1 = __webpack_require__(/*! ./language/inlineCompletion */ "./src/hosted/api/vscode/language/inlineCompletion.ts");
39139
- const inlineEdit_1 = __webpack_require__(/*! ./language/inlineEdit */ "./src/hosted/api/vscode/language/inlineEdit.ts");
39140
39126
  const lens_1 = __webpack_require__(/*! ./language/lens */ "./src/hosted/api/vscode/language/lens.ts");
39141
39127
  const link_provider_1 = __webpack_require__(/*! ./language/link-provider */ "./src/hosted/api/vscode/language/link-provider.ts");
39142
39128
  const linked_editing_range_1 = __webpack_require__(/*! ./language/linked-editing-range */ "./src/hosted/api/vscode/language/linked-editing-range.ts");
@@ -39167,9 +39153,6 @@ function createLanguagesApiFactory(extHostLanguages, extHostNotebook, extension)
39167
39153
  registerInlineCompletionItemProvider(selector, provider, metadata) {
39168
39154
  return extHostLanguages.registerInlineCompletionsProvider(extension, selector, provider, metadata);
39169
39155
  },
39170
- registerInlineEditProvider(selector, provider) {
39171
- return extHostLanguages.registerInlineEditProvider(extension, selector, provider);
39172
- },
39173
39156
  registerDefinitionProvider(selector, provider) {
39174
39157
  return extHostLanguages.registerDefinitionProvider(selector, provider, extension);
39175
39158
  },
@@ -39420,6 +39403,8 @@ class ExtHostLanguages {
39420
39403
  this.proxy.$registerCompletionSupport(callId, this.transformDocumentSelector(selector), triggerCharacters, completion_1.CompletionAdapter.hasResolveSupport(provider));
39421
39404
  return this.createDisposable(callId);
39422
39405
  }
39406
+ // ### Completion end
39407
+ // ### Inline Completion begin
39423
39408
  registerInlineCompletionsProvider(extension, selector, provider, metadata) {
39424
39409
  var _a;
39425
39410
  const adapter = new inlineCompletion_1.InlineCompletionAdapter(extension, this.documents, provider, this.commands.converter);
@@ -39427,21 +39412,6 @@ class ExtHostLanguages {
39427
39412
  this.proxy.$registerInlineCompletionsSupport(callId, this.transformDocumentSelector(selector), true, vscode_1.ExtensionIdentifier.toKey(extension.identifier.value), ((_a = metadata === null || metadata === void 0 ? void 0 : metadata.yieldTo) === null || _a === void 0 ? void 0 : _a.map((extId) => vscode_1.ExtensionIdentifier.toKey(extId))) || []);
39428
39413
  return this.createDisposable(callId);
39429
39414
  }
39430
- registerInlineEditProvider(extension, selector, provider) {
39431
- const adapter = new inlineEdit_1.InlineEditAdapter(extension, this.documents, provider, this.commands.converter);
39432
- const callId = this.addNewAdapter(adapter, extension);
39433
- this.proxy.$registerInlineEditProvider(callId, this.transformDocumentSelector(selector), extension.identifier, provider.displayName || extension.name);
39434
- return this.createDisposable(callId);
39435
- }
39436
- $provideInlineEdit(handle, resource, context, token) {
39437
- return this.withAdapter(handle, inlineEdit_1.InlineEditAdapter, (adapter) => adapter.provideInlineEdits(ide_core_common_1.Uri.revive(resource), context, token), undefined, undefined);
39438
- }
39439
- $freeInlineEdit(handle, pid) {
39440
- this.withAdapter(handle, inlineEdit_1.InlineEditAdapter, async (adapter) => {
39441
- // 增加延迟释放,避免在 ESC 退出时,InlineEdit 的 Rejected 命令被提前销毁导致异常
39442
- setTimeout(() => adapter.disposeEdit(pid), 100);
39443
- }, undefined, undefined);
39444
- }
39445
39415
  $provideInlineCompletions(handle, resource, position, context, token) {
39446
39416
  return this.withAdapter(handle, inlineCompletion_1.InlineCompletionAdapterBase, (adapter) => adapter.provideInlineCompletions(ide_core_common_1.Uri.revive(resource), position, context, token), undefined, undefined);
39447
39417
  }
@@ -46464,119 +46434,6 @@ class InlineCompletionAdapter extends InlineCompletionAdapterBase {
46464
46434
  exports.InlineCompletionAdapter = InlineCompletionAdapter;
46465
46435
 
46466
46436
 
46467
- /***/ }),
46468
-
46469
- /***/ "./src/hosted/api/vscode/language/inlineEdit.ts":
46470
- /*!******************************************************!*\
46471
- !*** ./src/hosted/api/vscode/language/inlineEdit.ts ***!
46472
- \******************************************************/
46473
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
46474
-
46475
- "use strict";
46476
-
46477
- Object.defineProperty(exports, "__esModule", ({ value: true }));
46478
- exports.InlineEditAdapter = void 0;
46479
- const tslib_1 = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.mjs");
46480
- const ide_core_common_1 = __webpack_require__(/*! @opensumi/ide-core-common */ "../core-common/lib/index.js");
46481
- const typeConvert = tslib_1.__importStar(__webpack_require__(/*! ../../../../common/vscode/converter */ "./src/common/vscode/converter.ts"));
46482
- const ext_types_1 = __webpack_require__(/*! ../../../../common/vscode/ext-types */ "./src/common/vscode/ext-types.ts");
46483
- class InlineEditAdapter {
46484
- async provideInlineEdits(uri, context, token) {
46485
- var _a;
46486
- const doc = this._documents.getDocument(uri);
46487
- const result = await this._provider.provideInlineEdit(doc, {
46488
- triggerKind: this.languageTriggerKindToVSCodeTriggerKind[context.triggerKind],
46489
- requestUuid: context.requestUuid,
46490
- }, token);
46491
- if (!result) {
46492
- // undefined and null are valid results
46493
- return undefined;
46494
- }
46495
- if (token.isCancellationRequested) {
46496
- // cancelled -> return without further ado, esp no caching
46497
- // of results as they will leak
46498
- return undefined;
46499
- }
46500
- let disposableStore;
46501
- const pid = this._references.createReferenceId({
46502
- dispose() {
46503
- disposableStore === null || disposableStore === void 0 ? void 0 : disposableStore.dispose();
46504
- },
46505
- item: result,
46506
- });
46507
- let acceptCommand;
46508
- if (result.accepted) {
46509
- if (!disposableStore) {
46510
- disposableStore = new ide_core_common_1.DisposableStore();
46511
- }
46512
- acceptCommand = this._commands.toInternal(result.accepted, disposableStore);
46513
- }
46514
- let rejectCommand;
46515
- if (result.rejected) {
46516
- if (!disposableStore) {
46517
- disposableStore = new ide_core_common_1.DisposableStore();
46518
- }
46519
- rejectCommand = this._commands.toInternal(result.rejected, disposableStore);
46520
- }
46521
- let shownCommand;
46522
- if (result.shown) {
46523
- if (!disposableStore) {
46524
- disposableStore = new ide_core_common_1.DisposableStore();
46525
- }
46526
- shownCommand = this._commands.toInternal(result.shown, disposableStore);
46527
- }
46528
- if (!disposableStore) {
46529
- disposableStore = new ide_core_common_1.DisposableStore();
46530
- }
46531
- const langResult = {
46532
- pid,
46533
- text: result.text,
46534
- range: typeConvert.Range.from(result.range),
46535
- showRange: typeConvert.Range.from(result.showRange),
46536
- accepted: acceptCommand,
46537
- rejected: rejectCommand,
46538
- shown: shownCommand,
46539
- commands: (_a = result.commands) === null || _a === void 0 ? void 0 : _a.map((c) => this._commands.toInternal(c, disposableStore)),
46540
- };
46541
- return langResult;
46542
- }
46543
- disposeEdit(pid) {
46544
- const data = this._references.disposeReferenceId(pid);
46545
- data === null || data === void 0 ? void 0 : data.dispose();
46546
- }
46547
- constructor(_extension, _documents, _provider, _commands) {
46548
- this._documents = _documents;
46549
- this._provider = _provider;
46550
- this._commands = _commands;
46551
- this._references = new ReferenceMap();
46552
- this.languageTriggerKindToVSCodeTriggerKind = {
46553
- [ext_types_1.InlineEditTriggerKind.Automatic]: ext_types_1.InlineEditTriggerKind.Automatic,
46554
- [ext_types_1.InlineEditTriggerKind.Invoke]: ext_types_1.InlineEditTriggerKind.Invoke,
46555
- };
46556
- }
46557
- }
46558
- exports.InlineEditAdapter = InlineEditAdapter;
46559
- class ReferenceMap {
46560
- constructor() {
46561
- this._references = new Map();
46562
- this._idPool = 1;
46563
- }
46564
- createReferenceId(value) {
46565
- const id = this._idPool++;
46566
- this._references.set(id, value);
46567
- return id;
46568
- }
46569
- disposeReferenceId(referenceId) {
46570
- const value = this._references.get(referenceId);
46571
- this._references.delete(referenceId);
46572
- return value;
46573
- }
46574
- get(referenceId) {
46575
- return this._references.get(referenceId);
46576
- }
46577
- }
46578
-
46579
-
46580
46437
  /***/ }),
46581
46438
 
46582
46439
  /***/ "./src/hosted/api/vscode/language/lens.ts":
@@ -49015,8 +48872,6 @@ function createAPIFactory(rpcProtocol, extensionService) {
49015
48872
  InlineCompletionList: workerExtTypes.InlineSuggestionList,
49016
48873
  authentication: (0, ext_host_authentication_1.createAuthenticationApiFactory)(extension, extHostAuthentication),
49017
48874
  comments: (0, ext_host_comments_1.createCommentsApiFactory)(extension, extHostComments),
49018
- InlineEdit: workerExtTypes.InlineEdit,
49019
- InlineEditTriggerKind: workerExtTypes.InlineEditTriggerKind,
49020
48875
  // Sumi 扩展 API
49021
48876
  ...sumiAPI(extension),
49022
48877
  });
@@ -50853,7 +50708,7 @@ function warning(valid, message) {
50853
50708
  // Support uglify
50854
50709
  if ( true && !valid && console !== undefined) {
50855
50710
  // eslint-disable-next-line no-console
50856
- console.warn(`Warning: ${message}`);
50711
+ console.error(`Warning: ${message}`);
50857
50712
  }
50858
50713
  }
50859
50714
  function note(valid, message) {
@@ -50897,10 +50752,9 @@ exports["default"] = warningOnce;
50897
50752
  * Where possible, operations execute without creating a new Buffer and copying everything over.
50898
50753
  */
50899
50754
  Object.defineProperty(exports, "__esModule", ({ value: true }));
50900
- exports.Cursor = exports.Buffers = exports.buffer4Capacity = exports.emptyBuffer = void 0;
50755
+ exports.Cursor = exports.Buffers = exports.emptyBuffer = void 0;
50901
50756
  exports.copy = copy;
50902
50757
  exports.emptyBuffer = new Uint8Array(0);
50903
- exports.buffer4Capacity = new Uint8Array(4);
50904
50758
  function copy(source, target, targetStart, sourceStart, sourceEnd) {
50905
50759
  target.set(source.subarray(sourceStart, sourceEnd), targetStart);
50906
50760
  }
@@ -50950,31 +50804,6 @@ class Buffers {
50950
50804
  }
50951
50805
  return target;
50952
50806
  }
50953
- slice4(start) {
50954
- let end = start + 4;
50955
- const buffers = this.buffers;
50956
- if (end > this.size) {
50957
- end = this.size;
50958
- }
50959
- if (start >= end) {
50960
- return exports.emptyBuffer;
50961
- }
50962
- let startBytes = 0;
50963
- let si = 0;
50964
- for (; si < buffers.length && startBytes + buffers[si].length <= start; si++) {
50965
- startBytes += buffers[si].length;
50966
- }
50967
- const target = exports.buffer4Capacity;
50968
- let ti = 0;
50969
- for (let ii = si; ti < end - start && ii < buffers.length; ii++) {
50970
- const len = buffers[ii].length;
50971
- const _start = ti === 0 ? start - startBytes : 0;
50972
- const _end = ti + len >= end - start ? Math.min(_start + (end - start) - ti, len) : len;
50973
- copy(buffers[ii], target, ti, _start, _end);
50974
- ti += _end - _start;
50975
- }
50976
- return target;
50977
- }
50978
50807
  pos(i) {
50979
50808
  if (i < 0 || i >= this.size) {
50980
50809
  throw new Error(`out of range, ${i} not in [0, ${this.size})`);
@@ -51146,11 +50975,6 @@ class Cursor {
51146
50975
  this.skip(n);
51147
50976
  return buffers;
51148
50977
  }
51149
- read4() {
51150
- const buffers = this.buffers.slice4(this.offset);
51151
- this.skip(4);
51152
- return buffers;
51153
- }
51154
50978
  skip(n) {
51155
50979
  let count = 0;
51156
50980
  while (this.chunkIndex < this.buffers.buffers.length) {
@@ -51453,7 +51277,6 @@ exports.BaseConnection = BaseConnection;
51453
51277
 
51454
51278
  Object.defineProperty(exports, "__esModule", ({ value: true }));
51455
51279
  exports.LengthFieldBasedFrameDecoder = exports.indicator = void 0;
51456
- /* eslint-disable no-console */
51457
51280
  const writer_1 = __webpack_require__(/*! @furyjs/fury/dist/lib/writer */ "../../node_modules/@furyjs/fury/dist/lib/writer.js");
51458
51281
  const ide_core_common_1 = __webpack_require__(/*! @opensumi/ide-core-common */ "../core-common/lib/index.js");
51459
51282
  const buffers_1 = __webpack_require__(/*! ../../buffers/buffers */ "../connection/lib/common/buffers/buffers.js");
@@ -51461,33 +51284,26 @@ const buffers_1 = __webpack_require__(/*! ../../buffers/buffers */ "../connectio
51461
51284
  * You can use `Buffer.from('\r\n\r\n')` to get this indicator.
51462
51285
  */
51463
51286
  exports.indicator = new Uint8Array([0x0d, 0x0a, 0x0d, 0x0a]);
51464
- /**
51465
- * The number of bytes in the length field.
51466
- *
51467
- * How many bytes are used to represent data length.
51468
- *
51469
- * For example, if the length field is 4 bytes, then the maximum length of the data is 2^32 = 4GB
51470
- */
51471
- const lengthFieldLength = 4;
51472
51287
  /**
51473
51288
  * sticky packet unpacking problems are generally problems at the transport layer.
51474
51289
  * we use a length field to represent the length of the data, and then read the data according to the length
51475
51290
  */
51476
51291
  class LengthFieldBasedFrameDecoder {
51477
51292
  constructor() {
51293
+ this.dataEmitter = new ide_core_common_1.Emitter();
51294
+ this.onData = this.dataEmitter.event;
51478
51295
  this.buffers = new buffers_1.Buffers();
51479
51296
  this.cursor = this.buffers.cursor();
51480
- this.processingPromise = null;
51481
51297
  this.contentLength = -1;
51482
51298
  this.state = 0;
51483
- }
51484
- onData(listener) {
51485
- this._onDataListener = listener;
51486
- return {
51487
- dispose: () => {
51488
- this._onDataListener = null;
51489
- },
51490
- };
51299
+ /**
51300
+ * The number of bytes in the length field.
51301
+ *
51302
+ * How many bytes are used to represent data length.
51303
+ *
51304
+ * For example, if the length field is 4 bytes, then the maximum length of the data is 2^32 = 4GB
51305
+ */
51306
+ this.lengthFieldLength = 4;
51491
51307
  }
51492
51308
  reset() {
51493
51309
  this.contentLength = -1;
@@ -51496,70 +51312,30 @@ class LengthFieldBasedFrameDecoder {
51496
51312
  }
51497
51313
  push(chunk) {
51498
51314
  this.buffers.push(chunk);
51499
- // 确保同一时间只有一个处理过程
51500
- if (!this.processingPromise) {
51501
- this.processingPromise = this.processBuffers().finally(() => {
51502
- this.processingPromise = null;
51503
- });
51315
+ let done = false;
51316
+ while (!done) {
51317
+ done = this.readFrame();
51504
51318
  }
51505
51319
  }
51506
- async processBuffers() {
51507
- let iterations = 0;
51508
- let hasMoreData = false;
51509
- do {
51510
- hasMoreData = false;
51511
- while (iterations < LengthFieldBasedFrameDecoder.MAX_ITERATIONS) {
51512
- if (this.buffers.byteLength === 0) {
51513
- break;
51514
- }
51515
- const result = await this.readFrame();
51516
- if (result === true) {
51517
- break;
51518
- }
51519
- iterations++;
51520
- if (iterations % 10 === 0) {
51521
- await new Promise((resolve) => setTimeout(resolve, 0));
51522
- }
51523
- }
51524
- // 检查剩余数据
51525
- if (this.buffers.byteLength > 0) {
51526
- hasMoreData = true;
51527
- // 异步继续处理,避免阻塞
51528
- await new Promise((resolve) => setImmediate(resolve));
51529
- iterations = 0; // 重置迭代计数器
51530
- }
51531
- } while (hasMoreData);
51532
- }
51533
- async readFrame() {
51534
- try {
51535
- const found = this.readLengthField();
51536
- if (!found) {
51537
- return true;
51538
- }
51320
+ readFrame() {
51321
+ const found = this.readLengthField();
51322
+ if (found) {
51539
51323
  const start = this.cursor.offset;
51540
51324
  const end = start + this.contentLength;
51541
- if (end > this.buffers.byteLength) {
51542
- return true;
51543
- }
51544
51325
  const binary = this.buffers.slice(start, end);
51545
- // 立即清理已处理的数据
51546
- this.buffers.splice(0, end);
51547
- this.reset();
51548
- if (this._onDataListener) {
51549
- try {
51550
- await Promise.resolve().then(() => { var _a; return (_a = this._onDataListener) === null || _a === void 0 ? void 0 : _a.call(this, binary); });
51551
- }
51552
- catch (error) {
51553
- console.error('[Frame Decoder] Error in data listener:', error);
51554
- }
51326
+ this.dataEmitter.fire(binary);
51327
+ if (this.buffers.byteLength > end) {
51328
+ this.contentLength = -1;
51329
+ this.state = 0;
51330
+ this.cursor.moveTo(end);
51331
+ // has more data, continue to parse
51332
+ return false;
51555
51333
  }
51556
- return false;
51557
- }
51558
- catch (error) {
51559
- console.error('[Frame Decoder] Error processing frame:', error);
51334
+ // delete used buffers
51335
+ this.buffers.splice(0, end);
51560
51336
  this.reset();
51561
- return true;
51562
51337
  }
51338
+ return true;
51563
51339
  }
51564
51340
  readLengthField() {
51565
51341
  const bufferLength = this.buffers.byteLength;
@@ -51575,12 +51351,12 @@ class LengthFieldBasedFrameDecoder {
51575
51351
  return false;
51576
51352
  }
51577
51353
  if (this.contentLength === -1) {
51578
- if (this.cursor.offset + lengthFieldLength > bufferLength) {
51354
+ if (this.cursor.offset + this.lengthFieldLength > bufferLength) {
51579
51355
  // Not enough data yet, wait for more data
51580
51356
  return false;
51581
51357
  }
51582
51358
  // read the content length
51583
- const buf = this.cursor.read4();
51359
+ const buf = this.cursor.read(this.lengthFieldLength);
51584
51360
  // fury writer use little endian
51585
51361
  this.contentLength = (0, ide_core_common_1.readUInt32LE)(buf, 0);
51586
51362
  }
@@ -51595,12 +51371,12 @@ class LengthFieldBasedFrameDecoder {
51595
51371
  let result = iter.next();
51596
51372
  while (!result.done) {
51597
51373
  switch (result.value) {
51598
- case 0x0d: // \r
51374
+ case 0x0d:
51599
51375
  switch (this.state) {
51600
51376
  case 0:
51601
51377
  this.state = 1;
51602
51378
  break;
51603
- case 2: // 第二个 \r
51379
+ case 2:
51604
51380
  this.state = 3;
51605
51381
  break;
51606
51382
  default:
@@ -51608,12 +51384,12 @@ class LengthFieldBasedFrameDecoder {
51608
51384
  break;
51609
51385
  }
51610
51386
  break;
51611
- case 0x0a: // \n
51387
+ case 0x0a:
51612
51388
  switch (this.state) {
51613
51389
  case 1:
51614
51390
  this.state = 2;
51615
51391
  break;
51616
- case 3: // 第二个 \n
51392
+ case 3:
51617
51393
  this.state = 4;
51618
51394
  iter.return();
51619
51395
  break;
@@ -51630,27 +51406,19 @@ class LengthFieldBasedFrameDecoder {
51630
51406
  }
51631
51407
  }
51632
51408
  dispose() {
51633
- this._onDataListener = null;
51409
+ this.dataEmitter.dispose();
51634
51410
  this.buffers.dispose();
51635
- this.reset();
51636
51411
  }
51637
51412
  static construct(content) {
51638
- // 每次都创建新的 writer,避免所有权问题
51639
- const writer = (0, writer_1.BinaryWriter)({});
51640
- try {
51641
- writer.buffer(exports.indicator);
51642
- writer.uint32(content.byteLength);
51643
- writer.buffer(content);
51644
- return writer;
51645
- }
51646
- catch (error) {
51647
- console.warn('[Frame Decoder] Error constructing frame:', error);
51648
- throw error;
51649
- }
51413
+ LengthFieldBasedFrameDecoder.writer.reset();
51414
+ LengthFieldBasedFrameDecoder.writer.buffer(exports.indicator);
51415
+ LengthFieldBasedFrameDecoder.writer.uint32(content.byteLength);
51416
+ LengthFieldBasedFrameDecoder.writer.buffer(content);
51417
+ return LengthFieldBasedFrameDecoder.writer.dump();
51650
51418
  }
51651
51419
  }
51652
51420
  exports.LengthFieldBasedFrameDecoder = LengthFieldBasedFrameDecoder;
51653
- LengthFieldBasedFrameDecoder.MAX_ITERATIONS = 50;
51421
+ LengthFieldBasedFrameDecoder.writer = (0, writer_1.BinaryWriter)({});
51654
51422
  //# sourceMappingURL=frame-decoder.js.map
51655
51423
 
51656
51424
  /***/ }),
@@ -51829,17 +51597,10 @@ class StreamConnection extends base_1.BaseConnection {
51829
51597
  });
51830
51598
  }
51831
51599
  send(data) {
51832
- const handle = frame_decoder_1.LengthFieldBasedFrameDecoder.construct(data).dumpAndOwn();
51833
- try {
51834
- this.writable.write(handle.get(), (error) => {
51835
- if (error) {
51836
- console.error('Failed to write data:', error);
51837
- }
51838
- });
51839
- }
51840
- finally {
51841
- handle.dispose();
51842
- }
51600
+ const result = frame_decoder_1.LengthFieldBasedFrameDecoder.construct(data);
51601
+ this.writable.write(result, () => {
51602
+ // TODO: logger error
51603
+ });
51843
51604
  }
51844
51605
  onMessage(cb) {
51845
51606
  return this.decoder.onData(cb);
@@ -51908,84 +51669,22 @@ exports.StreamConnection = StreamConnection;
51908
51669
 
51909
51670
  Object.defineProperty(exports, "__esModule", ({ value: true }));
51910
51671
  exports.WSWebSocketConnection = void 0;
51911
- const constants_1 = __webpack_require__(/*! ../../constants */ "../connection/lib/common/constants.js");
51912
51672
  const base_1 = __webpack_require__(/*! ./base */ "../connection/lib/common/connection/drivers/base.js");
51913
- const frame_decoder_1 = __webpack_require__(/*! ./frame-decoder */ "../connection/lib/common/connection/drivers/frame-decoder.js");
51914
51673
  class WSWebSocketConnection extends base_1.BaseConnection {
51915
51674
  constructor(socket) {
51916
51675
  super();
51917
51676
  this.socket = socket;
51918
- this.decoder = new frame_decoder_1.LengthFieldBasedFrameDecoder();
51919
- this.sendQueue = [];
51920
- this.pendingSize = 0;
51921
- this.sending = false;
51922
- this.socket.on('message', (data) => {
51923
- this.decoder.push(data);
51924
- });
51925
- }
51926
- async processSendQueue() {
51927
- if (this.sending) {
51928
- return;
51929
- }
51930
- this.sending = true;
51931
- while (this.sendQueue.length > 0) {
51932
- const { data, resolve, reject } = this.sendQueue[0];
51933
- let handle = null;
51934
- try {
51935
- handle = frame_decoder_1.LengthFieldBasedFrameDecoder.construct(data).dumpAndOwn();
51936
- const packet = handle.get();
51937
- for (let i = 0; i < packet.byteLength; i += constants_1.chunkSize) {
51938
- if (!this.isOpen()) {
51939
- throw new Error('Connection closed while sending');
51940
- }
51941
- await new Promise((resolve, reject) => {
51942
- const chunk = packet.subarray(i, Math.min(i + constants_1.chunkSize, packet.byteLength));
51943
- this.socket.send(chunk, { binary: true }, (error) => {
51944
- if (error) {
51945
- reject(error);
51946
- }
51947
- else {
51948
- resolve();
51949
- }
51950
- });
51951
- });
51952
- }
51953
- resolve();
51954
- }
51955
- catch (error) {
51956
- reject(error instanceof Error ? error : new Error(String(error)));
51957
- }
51958
- finally {
51959
- if (handle) {
51960
- try {
51961
- handle.dispose();
51962
- }
51963
- catch (error) {
51964
- console.warn('[WSWebSocket] Error disposing handle:', error);
51965
- }
51966
- }
51967
- this.pendingSize -= this.sendQueue[0].data.byteLength;
51968
- this.sendQueue.shift();
51969
- }
51970
- }
51971
- this.sending = false;
51972
51677
  }
51973
51678
  send(data) {
51974
- return new Promise((resolve, reject) => {
51975
- // 检查队列大小限制
51976
- if (this.sendQueue.length >= WSWebSocketConnection.MAX_QUEUE_SIZE) {
51977
- reject(new Error('Send queue full'));
51978
- return;
51979
- }
51980
- this.pendingSize += data.byteLength;
51981
- this.sendQueue.push({ data, resolve, reject });
51982
- this.processSendQueue().catch((error) => {
51983
- console.error('[WSWebSocket] Error processing queue:', error);
51984
- });
51985
- });
51679
+ this.socket.send(data);
51986
51680
  }
51987
51681
  onMessage(cb) {
51988
- return this.decoder.onData(cb);
51682
+ this.socket.on('message', cb);
51683
+ return {
51684
+ dispose: () => {
51685
+ this.socket.off('message', cb);
51686
+ },
51687
+ };
51989
51688
  }
51990
51689
  onceClose(cb) {
51991
51690
  this.socket.once('close', cb);
@@ -52000,17 +51699,9 @@ class WSWebSocketConnection extends base_1.BaseConnection {
52000
51699
  }
52001
51700
  dispose() {
52002
51701
  this.socket.removeAllListeners();
52003
- // 拒绝所有待发送的消息
52004
- while (this.sendQueue.length > 0) {
52005
- const { reject } = this.sendQueue.shift();
52006
- reject(new Error('Connection disposed'));
52007
- }
52008
- this.pendingSize = 0;
52009
- this.sending = false;
52010
51702
  }
52011
51703
  }
52012
51704
  exports.WSWebSocketConnection = WSWebSocketConnection;
52013
- WSWebSocketConnection.MAX_QUEUE_SIZE = 1000; // 限制队列长度
52014
51705
  //# sourceMappingURL=ws-websocket.js.map
52015
51706
 
52016
51707
  /***/ }),
@@ -52039,12 +51730,8 @@ tslib_1.__exportStar(__webpack_require__(/*! ./drivers */ "../connection/lib/com
52039
51730
  "use strict";
52040
51731
 
52041
51732
  Object.defineProperty(exports, "__esModule", ({ value: true }));
52042
- exports.chunkSize = exports.METHOD_NOT_REGISTERED = void 0;
51733
+ exports.METHOD_NOT_REGISTERED = void 0;
52043
51734
  exports.METHOD_NOT_REGISTERED = '$$METHOD_NOT_REGISTERED';
52044
- /**
52045
- * 分片大小, 1MB
52046
- */
52047
- exports.chunkSize = 1 * 1024 * 1024;
52048
51735
  //# sourceMappingURL=constants.js.map
52049
51736
 
52050
51737
  /***/ }),
@@ -52301,9 +51988,6 @@ const oneOf = (schemas, context) => {
52301
51988
  case 7:
52302
51989
  v = serializers[7].read();
52303
51990
  break;
52304
- default: {
52305
- throw new Error('unknown index: ' + idx);
52306
- }
52307
51991
  }
52308
51992
  v.kind = kinds[idx];
52309
51993
  return v;
@@ -53278,9 +52962,6 @@ class SumiConnection {
53278
52962
  const message = this.io.parse(data);
53279
52963
  const opType = message.kind;
53280
52964
  const requestId = message.requestId;
53281
- if (opType === message_io_1.OperationType.Error) {
53282
- this.logger.warn(`[${message.requestId}] Error received from server method ${message.method}: ${message.error}`);
53283
- }
53284
52965
  switch (opType) {
53285
52966
  case message_io_1.OperationType.Error:
53286
52967
  case message_io_1.OperationType.Response: {
@@ -56279,7 +55960,7 @@ exports.DEFAULT_APPLICATION_DESKTOP_HOST = 'desktop';
56279
55960
  exports.DEFAULT_APPLICATION_WEB_HOST = 'web';
56280
55961
  exports.DEFAULT_URI_SCHEME = 'sumi';
56281
55962
  exports.DEFAULT_OPENVSX_REGISTRY = 'https://open-vsx.org'; // Official Registry
56282
- exports.DEFAULT_VSCODE_ENGINE_VERSION = '1.96.2';
55963
+ exports.DEFAULT_VSCODE_ENGINE_VERSION = '1.94.2';
56283
55964
  //# sourceMappingURL=application.js.map
56284
55965
 
56285
55966
  /***/ }),
@@ -59012,23 +58693,6 @@ var AINativeSettingSectionsId;
59012
58693
  */
59013
58694
  AINativeSettingSectionsId["CodeEditsLintErrors"] = "ai.native.codeEdits.lintErrors";
59014
58695
  AINativeSettingSectionsId["CodeEditsLineChange"] = "ai.native.codeEdits.lineChange";
59015
- /**
59016
- * Language model API keys
59017
- */
59018
- AINativeSettingSectionsId["LLMModelSelection"] = "ai.native.llm.model.selection";
59019
- AINativeSettingSectionsId["DeepseekApiKey"] = "ai.native.deepseek.apiKey";
59020
- AINativeSettingSectionsId["AnthropicApiKey"] = "ai.native.anthropic.apiKey";
59021
- AINativeSettingSectionsId["OpenaiApiKey"] = "ai.native.openai.apiKey";
59022
- AINativeSettingSectionsId["OpenaiBaseURL"] = "ai.native.openai.baseURL";
59023
- /**
59024
- * MCP Server configurations
59025
- */
59026
- AINativeSettingSectionsId["MCPServers"] = "ai.native.mcp.servers";
59027
- AINativeSettingSectionsId["CodeEditsTyping"] = "ai.native.codeEdits.typing";
59028
- /**
59029
- * System prompt
59030
- */
59031
- AINativeSettingSectionsId["SystemPrompt"] = "ai.native.chat.system.prompt";
59032
58696
  })(AINativeSettingSectionsId || (exports.AINativeSettingSectionsId = AINativeSettingSectionsId = {}));
59033
58697
  exports.AI_NATIVE_SETTING_GROUP_ID = 'AI-Native';
59034
58698
  exports.AI_NATIVE_SETTING_GROUP_TITLE = 'AI Native';
@@ -59146,7 +58810,6 @@ exports.STORAGE_NAMESPACE = {
59146
58810
  RECENT_DATA: new ide_utils_1.URI('recent').withScheme(exports.STORAGE_SCHEMA.SCOPE),
59147
58811
  DEBUG: new ide_utils_1.URI('debug').withScheme(exports.STORAGE_SCHEMA.SCOPE),
59148
58812
  OUTLINE: new ide_utils_1.URI('outline').withScheme(exports.STORAGE_SCHEMA.SCOPE),
59149
- CHAT: new ide_utils_1.URI('chat').withScheme(exports.STORAGE_SCHEMA.SCOPE),
59150
58813
  // global database
59151
58814
  GLOBAL_LAYOUT: new ide_utils_1.URI('layout-global').withScheme(exports.STORAGE_SCHEMA.GLOBAL),
59152
58815
  GLOBAL_EXTENSIONS: new ide_utils_1.URI('extensions').withScheme(exports.STORAGE_SCHEMA.GLOBAL),
@@ -59536,9 +59199,6 @@ var ECodeEditsSourceTyping;
59536
59199
  (function (ECodeEditsSourceTyping) {
59537
59200
  ECodeEditsSourceTyping["LinterErrors"] = "lint_errors";
59538
59201
  ECodeEditsSourceTyping["LineChange"] = "line_change";
59539
- ECodeEditsSourceTyping["Typing"] = "typing";
59540
- // 主动触发
59541
- ECodeEditsSourceTyping["Trigger"] = "trigger";
59542
59202
  })(ECodeEditsSourceTyping || (exports.ECodeEditsSourceTyping = ECodeEditsSourceTyping = {}));
59543
59203
  // ## Code Edits ends ##
59544
59204
  //# sourceMappingURL=index.js.map
@@ -59909,7 +59569,7 @@ exports.ExtensionDidContributes = ExtensionDidContributes;
59909
59569
  "use strict";
59910
59570
 
59911
59571
  Object.defineProperty(exports, "__esModule", ({ value: true }));
59912
- exports.RecursiveWatcherBackend = exports.VSCFileChangeType = exports.FileChangeType = exports.FileChangeEvent = exports.FileChange = void 0;
59572
+ exports.VSCFileChangeType = exports.FileChangeType = exports.FileChangeEvent = exports.FileChange = void 0;
59913
59573
  const ide_utils_1 = __webpack_require__(/*! @opensumi/ide-utils */ "../utils/lib/index.js");
59914
59574
  var FileChange;
59915
59575
  (function (FileChange) {
@@ -59978,11 +59638,6 @@ var VSCFileChangeType;
59978
59638
  */
59979
59639
  VSCFileChangeType[VSCFileChangeType["Deleted"] = 3] = "Deleted";
59980
59640
  })(VSCFileChangeType || (exports.VSCFileChangeType = VSCFileChangeType = {}));
59981
- var RecursiveWatcherBackend;
59982
- (function (RecursiveWatcherBackend) {
59983
- RecursiveWatcherBackend["NSFW"] = "nsfw";
59984
- RecursiveWatcherBackend["PARCEL"] = "parcel";
59985
- })(RecursiveWatcherBackend || (exports.RecursiveWatcherBackend = RecursiveWatcherBackend = {}));
59986
59641
  //# sourceMappingURL=file-watch.js.map
59987
59642
 
59988
59643
  /***/ }),