@opensumi/ide-components 3.3.4-next-1727344885.0 → 3.3.4-next-1729497448.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 (2) hide show
  1. package/dist/index.js +3 -3
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -6148,7 +6148,7 @@ eval("\n/**\n * 项目中会使用到的模块接口定义\n */\nObject.definePr
6148
6148
  /***/ ((__unused_webpack_module, exports) => {
6149
6149
 
6150
6150
  "use strict";
6151
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Schemes = void 0;\nvar Schemes;\n(function (Schemes) {\n /**\n * A schema that is used for models that exist in memory\n * only and that have no correspondence on a server or such.\n */\n Schemes.inMemory = 'inmemory';\n /**\n * A schema that is used for setting files\n */\n Schemes.vscode = 'vscode';\n /**\n * A schema that is used for internal private files\n */\n Schemes.internal = 'private';\n /**\n * A walk-through document.\n */\n Schemes.walkThrough = 'walkThrough';\n /**\n * An embedded code snippet.\n */\n Schemes.walkThroughSnippet = 'walkThroughSnippet';\n Schemes.http = 'http';\n Schemes.https = 'https';\n Schemes.file = 'file';\n Schemes.mailto = 'mailto';\n Schemes.untitled = 'untitled';\n Schemes.data = 'data';\n Schemes.command = 'command';\n Schemes.vscodeRemote = 'vscode-remote';\n Schemes.userData = 'vscode-userdata';\n Schemes.userStorage = 'user_storage';\n Schemes.design = 'design';\n /**\n * Scheme used for loading the WebAssembly files.\n */\n Schemes.wasm = 'wasm';\n /**\n * Scheme used to loading the monaco utilities.\n */\n Schemes.monaco = 'monaco';\n Schemes.notebookCell = 'vscode-notebook-cell';\n})(Schemes = exports.Schemes || (exports.Schemes = {}));\n//# sourceMappingURL=network.js.map\n\n//# sourceURL=webpack://@opensumi/ide-components/../core-common/lib/network.js?");
6151
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Schemes = void 0;\nvar Schemes;\n(function (Schemes) {\n /**\n * A schema that is used for models that exist in memory\n * only and that have no correspondence on a server or such.\n */\n Schemes.inMemory = 'inmemory';\n /**\n * A schema that is used for setting files\n */\n Schemes.vscode = 'vscode';\n /**\n * A schema that is used for internal private files\n */\n Schemes.internal = 'private';\n /**\n * A walk-through document.\n */\n Schemes.walkThrough = 'walkThrough';\n /**\n * An embedded code snippet.\n */\n Schemes.walkThroughSnippet = 'walkThroughSnippet';\n Schemes.http = 'http';\n Schemes.https = 'https';\n Schemes.file = 'file';\n Schemes.mailto = 'mailto';\n Schemes.untitled = 'untitled';\n Schemes.data = 'data';\n Schemes.command = 'command';\n Schemes.vscodeRemote = 'vscode-remote';\n Schemes.userData = 'vscode-userdata';\n Schemes.userStorage = 'user_storage';\n Schemes.design = 'design';\n /**\n * Scheme used for loading the WebAssembly files.\n */\n Schemes.wasm = 'wasm';\n /**\n * Scheme used to loading the monaco utilities.\n */\n Schemes.monaco = 'monaco';\n})(Schemes = exports.Schemes || (exports.Schemes = {}));\n//# sourceMappingURL=network.js.map\n\n//# sourceURL=webpack://@opensumi/ide-components/../core-common/lib/network.js?");
6152
6152
 
6153
6153
  /***/ }),
6154
6154
 
@@ -6236,7 +6236,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
6236
6236
  /***/ ((__unused_webpack_module, exports) => {
6237
6237
 
6238
6238
  "use strict";
6239
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.AI_NATIVE_SETTING_GROUP_TITLE = exports.AI_NATIVE_SETTING_GROUP_ID = exports.AINativeSettingSectionsId = void 0;\nvar AINativeSettingSectionsId;\n(function (AINativeSettingSectionsId) {\n /**\n * inline diff preview mode\n */\n AINativeSettingSectionsId[\"InlineDiffPreviewMode\"] = \"ai.native.inlineDiff.preview.mode\";\n AINativeSettingSectionsId[\"InlineChatAutoVisible\"] = \"ai.native.inlineChat.auto.visible\";\n AINativeSettingSectionsId[\"InlineChatCodeActionEnabled\"] = \"ai.native.inlineChat.codeAction.enabled\";\n AINativeSettingSectionsId[\"InterfaceQuickNavigationEnabled\"] = \"ai.native.interface.quickNavigation.enabled\";\n AINativeSettingSectionsId[\"ChatVisibleType\"] = \"ai.native.chat.visible.type\";\n /**\n * Whether to enable prompt engineering, some LLM models may not perform well on prompt engineering.\n */\n AINativeSettingSectionsId[\"IntelligentCompletionsPromptEngineeringEnabled\"] = \"ai.native.intelligentCompletions.promptEngineering.enabled\";\n AINativeSettingSectionsId[\"IntelligentCompletionsDebounceTime\"] = \"ai.native.intelligentCompletions.debounceTime\";\n AINativeSettingSectionsId[\"IntelligentCompletionsCacheEnabled\"] = \"ai.native.intelligentCompletions.cache.enabled\";\n AINativeSettingSectionsId[\"IntelligentCompletionsAlwaysVisible\"] = \"ai.native.intelligentCompletions.alwaysVisible\";\n})(AINativeSettingSectionsId = exports.AINativeSettingSectionsId || (exports.AINativeSettingSectionsId = {}));\nexports.AI_NATIVE_SETTING_GROUP_ID = 'AI-Native';\nexports.AI_NATIVE_SETTING_GROUP_TITLE = 'AI Native';\n//# sourceMappingURL=ai-native.js.map\n\n//# sourceURL=webpack://@opensumi/ide-components/../core-common/lib/settings/ai-native.js?");
6239
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.AI_NATIVE_SETTING_GROUP_TITLE = exports.AI_NATIVE_SETTING_GROUP_ID = exports.AINativeSettingSectionsId = void 0;\nvar AINativeSettingSectionsId;\n(function (AINativeSettingSectionsId) {\n /**\n * inline diff preview mode\n */\n AINativeSettingSectionsId[\"InlineDiffPreviewMode\"] = \"ai.native.inlineDiff.preview.mode\";\n AINativeSettingSectionsId[\"InlineChatAutoVisible\"] = \"ai.native.inlineChat.auto.visible\";\n AINativeSettingSectionsId[\"InlineChatCodeActionEnabled\"] = \"ai.native.inlineChat.codeAction.enabled\";\n AINativeSettingSectionsId[\"InterfaceQuickNavigationEnabled\"] = \"ai.native.interface.quickNavigation.enabled\";\n AINativeSettingSectionsId[\"ChatVisibleType\"] = \"ai.native.chat.visible.type\";\n /**\n * Whether to enable prompt engineering, some LLM models may not perform well on prompt engineering.\n */\n AINativeSettingSectionsId[\"InlineCompletionsPromptEngineeringEnabled\"] = \"ai.native.inlineCompletions.promptEngineering.enabled\";\n AINativeSettingSectionsId[\"InlineCompletionsDebounceTime\"] = \"ai.native.inlineCompletions.debounceTime\";\n AINativeSettingSectionsId[\"InlineCompletionsCacheEnabled\"] = \"ai.native.inlineCompletions.cache.enabled\";\n})(AINativeSettingSectionsId = exports.AINativeSettingSectionsId || (exports.AINativeSettingSectionsId = {}));\nexports.AI_NATIVE_SETTING_GROUP_ID = 'AI-Native';\nexports.AI_NATIVE_SETTING_GROUP_TITLE = 'AI Native';\n//# sourceMappingURL=ai-native.js.map\n\n//# sourceURL=webpack://@opensumi/ide-components/../core-common/lib/settings/ai-native.js?");
6240
6240
 
6241
6241
  /***/ }),
6242
6242
 
@@ -6588,7 +6588,7 @@ eval("\n/* ---------------------------------------------------------------------
6588
6588
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6589
6589
 
6590
6590
  "use strict";
6591
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.StateTracer = exports.retry = exports.sleep = exports.disposableTimeout = exports.RunOnceScheduler = exports.raceCancellation = exports.timeout = exports.first = exports.IdleValue = exports.runWhenIdle = exports.asPromise = exports.raceTimeout = exports.isThenable = exports.AutoOpenBarrier = exports.Barrier = exports.ThrottledDelayer = exports.Delayer = exports.Sequencer = exports.Throttler = exports.hookCancellationToken = exports.createCancelablePromise = exports.FRAME_FIVE = exports.FRAME_FOUR = exports.FRAME_THREE = exports.FRAME_TWO = exports.FRAME_ONE = void 0;\nconst cancellation_1 = __webpack_require__(/*! ./cancellation */ \"../utils/lib/cancellation.js\");\nconst disposable_1 = __webpack_require__(/*! ./disposable */ \"../utils/lib/disposable.js\");\nconst errors_1 = __webpack_require__(/*! ./errors */ \"../utils/lib/errors.js\");\n// 浏览器渲染帧\nexports.FRAME_ONE = 16;\nexports.FRAME_TWO = exports.FRAME_ONE * 2;\nexports.FRAME_THREE = exports.FRAME_ONE * 3;\nexports.FRAME_FOUR = exports.FRAME_ONE * 4;\nexports.FRAME_FIVE = exports.FRAME_ONE * 5;\nfunction createCancelablePromise(callback) {\n const source = new cancellation_1.CancellationTokenSource();\n const thenable = callback(source.token);\n const promise = new Promise((resolve, reject) => {\n source.token.onCancellationRequested(() => {\n reject((0, errors_1.canceled)());\n });\n Promise.resolve(thenable).then((value) => {\n source.dispose();\n resolve(value);\n }, (err) => {\n source.dispose();\n reject(err);\n });\n });\n return new (class {\n cancel() {\n source.cancel();\n }\n then(resolve, reject) {\n return promise.then(resolve, reject);\n }\n catch(reject) {\n return this.then(undefined, reject);\n }\n finally(onfinally) {\n return promise.finally(onfinally);\n }\n })();\n}\nexports.createCancelablePromise = createCancelablePromise;\nfunction hookCancellationToken(token, promise) {\n return new Promise((resolve, reject) => {\n const sub = token.onCancellationRequested(() => reject(new Error('This promise is cancelled')));\n promise\n .then((value) => {\n sub.dispose();\n resolve(value);\n })\n .catch((err) => {\n sub.dispose();\n reject(err);\n });\n });\n}\nexports.hookCancellationToken = hookCancellationToken;\n/**\n * A helper to prevent accumulation of sequential async tasks.\n *\n * Imagine a mail man with the sole task of delivering letters. As soon as\n * a letter submitted for delivery, he drives to the destination, delivers it\n * and returns to his base. Imagine that during the trip, N more letters were submitted.\n * When the mail man returns, he picks those N letters and delivers them all in a\n * single trip. Even though N+1 submissions occurred, only 2 deliveries were made.\n *\n * The throttler implements this via the queue() method, by providing it a task\n * factory. Following the example:\n *\n * \t\tconst throttler = new Throttler();\n * \t\tconst letters = [];\n *\n * \t\tfunction deliver() {\n * \t\t\tconst lettersToDeliver = letters;\n * \t\t\tletters = [];\n * \t\t\treturn makeTheTrip(lettersToDeliver);\n * \t\t}\n *\n * \t\tfunction onLetterReceived(l) {\n * \t\t\tletters.push(l);\n * \t\t\tthrottler.queue(deliver);\n * \t\t}\n */\nclass Throttler {\n constructor() {\n this.activePromise = null;\n this.queuedPromise = null;\n this.queuedPromiseFactory = null;\n }\n queue(promiseFactory) {\n if (this.activePromise) {\n this.queuedPromiseFactory = promiseFactory;\n if (!this.queuedPromise) {\n const onComplete = () => {\n this.queuedPromise = null;\n const result = this.queue(this.queuedPromiseFactory);\n this.queuedPromiseFactory = null;\n return result;\n };\n this.queuedPromise = new Promise((c) => {\n this.activePromise && this.activePromise.then(onComplete, onComplete).then(c);\n });\n }\n return new Promise((c, e) => {\n this.queuedPromise && this.queuedPromise.then(c, e);\n });\n }\n this.activePromise = promiseFactory();\n return new Promise((c, e) => {\n var _a;\n (_a = this.activePromise) === null || _a === void 0 ? void 0 : _a.then((result) => {\n this.activePromise = null;\n c(result);\n }, (err) => {\n this.activePromise = null;\n e(err);\n });\n });\n }\n}\nexports.Throttler = Throttler;\nclass Sequencer {\n constructor() {\n this.current = Promise.resolve(null);\n }\n queue(promiseTask) {\n return (this.current = this.current.then(() => promiseTask()));\n }\n}\nexports.Sequencer = Sequencer;\n/**\n * A helper to delay execution of a task that is being requested often.\n *\n * Following the throttler, now imagine the mail man wants to optimize the number of\n * trips proactively. The trip itself can be long, so he decides not to make the trip\n * as soon as a letter is submitted. Instead he waits a while, in case more\n * letters are submitted. After said waiting period, if no letters were submitted, he\n * decides to make the trip. Imagine that N more letters were submitted after the first\n * one, all within a short period of time between each other. Even though N+1\n * submissions occurred, only 1 delivery was made.\n *\n * The delayer offers this behavior via the trigger() method, into which both the task\n * to be executed and the waiting period (delay) must be passed in as arguments. Following\n * the example:\n *\n * \t\tconst delayer = new Delayer(WAITING_PERIOD);\n * \t\tconst letters = [];\n *\n * \t\tfunction letterReceived(l) {\n * \t\t\tletters.push(l);\n * \t\t\tdelayer.trigger(() => { return makeTheTrip(); });\n * \t\t}\n */\nclass Delayer {\n constructor(defaultDelay) {\n this.defaultDelay = defaultDelay;\n this.timeout = null;\n this.completionPromise = null;\n this.doResolve = null;\n this.task = null;\n }\n trigger(task, delay = this.defaultDelay) {\n this.task = task;\n this.cancelTimeout();\n if (!this.completionPromise) {\n this.completionPromise = new Promise((c, e) => {\n this.doResolve = c;\n this.doReject = e;\n })\n .then(() => {\n this.completionPromise = null;\n this.doResolve = null;\n const task = this.task;\n this.task = null;\n return task && task();\n })\n .catch();\n }\n this.timeout = setTimeout(() => {\n var _a;\n this.timeout = null;\n (_a = this.doResolve) === null || _a === void 0 ? void 0 : _a.call(this, null);\n }, delay);\n return this.completionPromise;\n }\n isTriggered() {\n return this.timeout !== null;\n }\n cancel() {\n this.cancelTimeout();\n if (this.completionPromise) {\n this.doReject && this.doReject((0, errors_1.canceled)());\n this.completionPromise = null;\n }\n }\n cancelTimeout() {\n if (this.timeout !== null) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n }\n dispose() {\n this.cancelTimeout();\n }\n}\nexports.Delayer = Delayer;\n/**\n * A helper to delay execution of a task that is being requested often, while\n * preventing accumulation of consecutive executions, while the task runs.\n *\n * The mail man is clever and waits for a certain amount of time, before going\n * out to deliver letters. While the mail man is going out, more letters arrive\n * and can only be delivered once he is back. Once he is back the mail man will\n * do one more trip to deliver the letters that have accumulated while he was out.\n */\nclass ThrottledDelayer {\n constructor(defaultDelay) {\n this.delayer = new Delayer(defaultDelay);\n this.throttler = new Throttler();\n }\n trigger(promiseFactory, delay) {\n return this.delayer.trigger(() => this.throttler.queue(promiseFactory), delay);\n }\n isTriggered() {\n return this.delayer.isTriggered();\n }\n cancel() {\n this.delayer.cancel();\n }\n dispose() {\n this.delayer.dispose();\n }\n}\nexports.ThrottledDelayer = ThrottledDelayer;\n/**\n * A barrier that is initially closed and then becomes opened permanently.\n */\nclass Barrier {\n constructor() {\n this._isOpen = false;\n this._promise = new Promise((c) => {\n this._completePromise = c;\n });\n }\n isOpen() {\n return this._isOpen;\n }\n open() {\n this._isOpen = true;\n this._completePromise(true);\n }\n wait() {\n return this._promise;\n }\n reject() {\n this._isOpen = false;\n this._completePromise(false);\n }\n}\nexports.Barrier = Barrier;\n/**\n * A barrier that is initially closed and then becomes opened permanently after a certain period of\n * time or when open is called explicitly\n */\nclass AutoOpenBarrier extends Barrier {\n constructor(autoOpenTimeMs) {\n super();\n this._timeout = setTimeout(() => this.open(), autoOpenTimeMs);\n }\n open() {\n clearTimeout(this._timeout);\n super.open();\n }\n}\nexports.AutoOpenBarrier = AutoOpenBarrier;\nfunction isThenable(obj) {\n return obj && typeof obj.then === 'function';\n}\nexports.isThenable = isThenable;\nfunction raceTimeout(promise, timeout, onTimeout) {\n let promiseResolve;\n const timer = setTimeout(() => {\n promiseResolve === null || promiseResolve === void 0 ? void 0 : promiseResolve(undefined);\n onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout();\n }, timeout);\n return Promise.race([\n promise.finally(() => clearTimeout(timer)),\n new Promise((resolve) => (promiseResolve = resolve)),\n ]);\n}\nexports.raceTimeout = raceTimeout;\nfunction asPromise(callback) {\n return new Promise((resolve, reject) => {\n const item = callback();\n if (isThenable(item)) {\n item.then(resolve, reject);\n }\n else {\n resolve(item);\n }\n });\n}\nexports.asPromise = asPromise;\n(function () {\n if (typeof requestIdleCallback !== 'function' || typeof cancelIdleCallback !== 'function') {\n const dummyIdle = Object.freeze({\n didTimeout: true,\n timeRemaining() {\n return 15;\n },\n });\n exports.runWhenIdle = (runner) => {\n const handle = setTimeout(() => runner(dummyIdle));\n let disposed = false;\n return {\n dispose() {\n if (disposed) {\n return;\n }\n disposed = true;\n clearTimeout(handle);\n },\n };\n };\n }\n else {\n exports.runWhenIdle = (runner, timeout) => {\n const handle = requestIdleCallback(runner, typeof timeout === 'number' ? { timeout } : undefined);\n let disposed = false;\n return {\n dispose() {\n if (disposed) {\n return;\n }\n disposed = true;\n cancelIdleCallback(handle);\n },\n };\n };\n }\n})();\n/**\n * An implementation of the \"idle-until-urgent\"-strategy as introduced\n * here: https://philipwalton.com/articles/idle-until-urgent/\n */\nclass IdleValue {\n constructor(executor) {\n this._didRun = false;\n this._executor = () => {\n try {\n this._value = executor();\n }\n catch (err) {\n this._error = err;\n }\n finally {\n this._didRun = true;\n }\n };\n this._handle = (0, exports.runWhenIdle)(() => this._executor());\n }\n dispose() {\n this._handle.dispose();\n }\n getValue() {\n if (!this._didRun) {\n this._handle.dispose();\n this._executor();\n }\n if (this._error) {\n throw this._error;\n }\n return this._value;\n }\n}\nexports.IdleValue = IdleValue;\nfunction first(promiseFactories, shouldStop = (t) => !!t, defaultValue = null) {\n let index = 0;\n const len = promiseFactories.length;\n const loop = () => {\n if (index >= len) {\n return Promise.resolve(defaultValue);\n }\n const factory = promiseFactories[index++];\n const promise = Promise.resolve(factory());\n return promise.then((result) => {\n if (shouldStop(result)) {\n return Promise.resolve(result);\n }\n return loop();\n });\n };\n return loop();\n}\nexports.first = first;\nfunction timeout(millis, token) {\n if (!token) {\n return createCancelablePromise((token) => timeout(millis, token));\n }\n return new Promise((resolve, reject) => {\n const handle = setTimeout(resolve, millis);\n token.onCancellationRequested(() => {\n clearTimeout(handle);\n reject((0, errors_1.canceled)());\n });\n });\n}\nexports.timeout = timeout;\nfunction raceCancellation(promise, token, defaultValue) {\n return Promise.race([\n promise,\n new Promise((resolve) => token.onCancellationRequested(() => resolve(defaultValue))),\n ]);\n}\nexports.raceCancellation = raceCancellation;\nclass RunOnceScheduler {\n constructor(runner, delay) {\n this.timeoutToken = -1;\n this.runner = runner;\n this.timeout = delay;\n this.timeoutHandler = this.onTimeout.bind(this);\n }\n /**\n * Dispose RunOnceScheduler\n */\n dispose() {\n this.cancel();\n this.runner = null;\n }\n /**\n * Cancel current scheduled runner (if any).\n */\n cancel() {\n if (this.isScheduled()) {\n clearTimeout(this.timeoutToken);\n this.timeoutToken = -1;\n }\n }\n /**\n * Cancel previous runner (if any) & schedule a new runner.\n */\n schedule(delay = this.timeout) {\n this.cancel();\n this.timeoutToken = setTimeout(this.timeoutHandler, delay);\n }\n trigger() {\n this.cancel();\n this.onTimeout();\n }\n get delay() {\n return this.timeout;\n }\n set delay(value) {\n this.timeout = value;\n }\n /**\n * Returns true if scheduled.\n */\n isScheduled() {\n return this.timeoutToken !== -1;\n }\n onTimeout() {\n this.timeoutToken = -1;\n if (this.runner) {\n this.doRun();\n }\n }\n doRun() {\n if (this.runner) {\n this.runner();\n }\n }\n}\nexports.RunOnceScheduler = RunOnceScheduler;\nfunction disposableTimeout(handler, timeout = 0) {\n const timer = setTimeout(handler, timeout);\n return (0, disposable_1.toDisposable)(() => clearTimeout(timer));\n}\nexports.disposableTimeout = disposableTimeout;\nfunction sleep(time) {\n return new Promise((resolve) => setTimeout(resolve, time));\n}\nexports.sleep = sleep;\nconst retry = async (task, options) => {\n const { delay, retries, onFailedAttempt, timeout } = options;\n try {\n if (timeout) {\n const result = await raceTimeout(task(), timeout || 0);\n if (result === undefined) {\n throw new Error('Timeout');\n }\n return result;\n }\n return task();\n }\n catch (error) {\n if (retries === 0) {\n throw error;\n }\n if (onFailedAttempt) {\n onFailedAttempt(error);\n }\n await sleep(delay);\n return (0, exports.retry)(task, { delay, retries: retries - 1, onFailedAttempt, timeout });\n }\n};\nexports.retry = retry;\nclass StateTracer {\n constructor() {\n this.deferred = {};\n }\n has(state) {\n return this.deferred[state] !== undefined;\n }\n delete(state) {\n delete this.deferred[state];\n }\n record(state) {\n if (this.deferred[state] === undefined) {\n this.deferred[state] = new Barrier();\n }\n }\n fulfill(state) {\n if (this.deferred[state] !== undefined) {\n this.deferred[state].open();\n }\n else {\n this.deferred[state] = new Barrier();\n this.deferred[state].open();\n }\n }\n reachedState(state) {\n if (this.deferred[state] === undefined) {\n this.deferred[state] = new Barrier();\n }\n return this.deferred[state].wait();\n }\n reachedAnyState(...states) {\n return Promise.race(states.map((s) => this.reachedState(s)));\n }\n dispose() {\n Object.keys(this.deferred).forEach((key) => {\n this.deferred[key].reject();\n });\n this.deferred = {};\n }\n}\nexports.StateTracer = StateTracer;\n//# sourceMappingURL=async.js.map\n\n//# sourceURL=webpack://@opensumi/ide-components/../utils/lib/async.js?");
6591
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.StateTracer = exports.retry = exports.sleep = exports.disposableTimeout = exports.RunOnceScheduler = exports.raceCancellation = exports.timeout = exports.first = exports.IdleValue = exports.runWhenIdle = exports.asPromise = exports.raceTimeout = exports.isThenable = exports.AutoOpenBarrier = exports.Barrier = exports.ThrottledDelayer = exports.Delayer = exports.Sequencer = exports.Throttler = exports.hookCancellationToken = exports.createCancelablePromise = exports.FRAME_THREE = exports.FRAME_TWO = exports.FRAME_ONE = void 0;\nconst cancellation_1 = __webpack_require__(/*! ./cancellation */ \"../utils/lib/cancellation.js\");\nconst disposable_1 = __webpack_require__(/*! ./disposable */ \"../utils/lib/disposable.js\");\nconst errors_1 = __webpack_require__(/*! ./errors */ \"../utils/lib/errors.js\");\n// 浏览器渲染帧\nexports.FRAME_ONE = 16;\nexports.FRAME_TWO = exports.FRAME_ONE * 2;\nexports.FRAME_THREE = exports.FRAME_ONE * 3;\nfunction createCancelablePromise(callback) {\n const source = new cancellation_1.CancellationTokenSource();\n const thenable = callback(source.token);\n const promise = new Promise((resolve, reject) => {\n source.token.onCancellationRequested(() => {\n reject((0, errors_1.canceled)());\n });\n Promise.resolve(thenable).then((value) => {\n source.dispose();\n resolve(value);\n }, (err) => {\n source.dispose();\n reject(err);\n });\n });\n return new (class {\n cancel() {\n source.cancel();\n }\n then(resolve, reject) {\n return promise.then(resolve, reject);\n }\n catch(reject) {\n return this.then(undefined, reject);\n }\n finally(onfinally) {\n return promise.finally(onfinally);\n }\n })();\n}\nexports.createCancelablePromise = createCancelablePromise;\nfunction hookCancellationToken(token, promise) {\n return new Promise((resolve, reject) => {\n const sub = token.onCancellationRequested(() => reject(new Error('This promise is cancelled')));\n promise\n .then((value) => {\n sub.dispose();\n resolve(value);\n })\n .catch((err) => {\n sub.dispose();\n reject(err);\n });\n });\n}\nexports.hookCancellationToken = hookCancellationToken;\n/**\n * A helper to prevent accumulation of sequential async tasks.\n *\n * Imagine a mail man with the sole task of delivering letters. As soon as\n * a letter submitted for delivery, he drives to the destination, delivers it\n * and returns to his base. Imagine that during the trip, N more letters were submitted.\n * When the mail man returns, he picks those N letters and delivers them all in a\n * single trip. Even though N+1 submissions occurred, only 2 deliveries were made.\n *\n * The throttler implements this via the queue() method, by providing it a task\n * factory. Following the example:\n *\n * \t\tconst throttler = new Throttler();\n * \t\tconst letters = [];\n *\n * \t\tfunction deliver() {\n * \t\t\tconst lettersToDeliver = letters;\n * \t\t\tletters = [];\n * \t\t\treturn makeTheTrip(lettersToDeliver);\n * \t\t}\n *\n * \t\tfunction onLetterReceived(l) {\n * \t\t\tletters.push(l);\n * \t\t\tthrottler.queue(deliver);\n * \t\t}\n */\nclass Throttler {\n constructor() {\n this.activePromise = null;\n this.queuedPromise = null;\n this.queuedPromiseFactory = null;\n }\n queue(promiseFactory) {\n if (this.activePromise) {\n this.queuedPromiseFactory = promiseFactory;\n if (!this.queuedPromise) {\n const onComplete = () => {\n this.queuedPromise = null;\n const result = this.queue(this.queuedPromiseFactory);\n this.queuedPromiseFactory = null;\n return result;\n };\n this.queuedPromise = new Promise((c) => {\n this.activePromise && this.activePromise.then(onComplete, onComplete).then(c);\n });\n }\n return new Promise((c, e) => {\n this.queuedPromise && this.queuedPromise.then(c, e);\n });\n }\n this.activePromise = promiseFactory();\n return new Promise((c, e) => {\n var _a;\n (_a = this.activePromise) === null || _a === void 0 ? void 0 : _a.then((result) => {\n this.activePromise = null;\n c(result);\n }, (err) => {\n this.activePromise = null;\n e(err);\n });\n });\n }\n}\nexports.Throttler = Throttler;\nclass Sequencer {\n constructor() {\n this.current = Promise.resolve(null);\n }\n queue(promiseTask) {\n return (this.current = this.current.then(() => promiseTask()));\n }\n}\nexports.Sequencer = Sequencer;\n/**\n * A helper to delay execution of a task that is being requested often.\n *\n * Following the throttler, now imagine the mail man wants to optimize the number of\n * trips proactively. The trip itself can be long, so he decides not to make the trip\n * as soon as a letter is submitted. Instead he waits a while, in case more\n * letters are submitted. After said waiting period, if no letters were submitted, he\n * decides to make the trip. Imagine that N more letters were submitted after the first\n * one, all within a short period of time between each other. Even though N+1\n * submissions occurred, only 1 delivery was made.\n *\n * The delayer offers this behavior via the trigger() method, into which both the task\n * to be executed and the waiting period (delay) must be passed in as arguments. Following\n * the example:\n *\n * \t\tconst delayer = new Delayer(WAITING_PERIOD);\n * \t\tconst letters = [];\n *\n * \t\tfunction letterReceived(l) {\n * \t\t\tletters.push(l);\n * \t\t\tdelayer.trigger(() => { return makeTheTrip(); });\n * \t\t}\n */\nclass Delayer {\n constructor(defaultDelay) {\n this.defaultDelay = defaultDelay;\n this.timeout = null;\n this.completionPromise = null;\n this.doResolve = null;\n this.task = null;\n }\n trigger(task, delay = this.defaultDelay) {\n this.task = task;\n this.cancelTimeout();\n if (!this.completionPromise) {\n this.completionPromise = new Promise((c, e) => {\n this.doResolve = c;\n this.doReject = e;\n })\n .then(() => {\n this.completionPromise = null;\n this.doResolve = null;\n const task = this.task;\n this.task = null;\n return task && task();\n })\n .catch();\n }\n this.timeout = setTimeout(() => {\n var _a;\n this.timeout = null;\n (_a = this.doResolve) === null || _a === void 0 ? void 0 : _a.call(this, null);\n }, delay);\n return this.completionPromise;\n }\n isTriggered() {\n return this.timeout !== null;\n }\n cancel() {\n this.cancelTimeout();\n if (this.completionPromise) {\n this.doReject && this.doReject((0, errors_1.canceled)());\n this.completionPromise = null;\n }\n }\n cancelTimeout() {\n if (this.timeout !== null) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n }\n dispose() {\n this.cancelTimeout();\n }\n}\nexports.Delayer = Delayer;\n/**\n * A helper to delay execution of a task that is being requested often, while\n * preventing accumulation of consecutive executions, while the task runs.\n *\n * The mail man is clever and waits for a certain amount of time, before going\n * out to deliver letters. While the mail man is going out, more letters arrive\n * and can only be delivered once he is back. Once he is back the mail man will\n * do one more trip to deliver the letters that have accumulated while he was out.\n */\nclass ThrottledDelayer {\n constructor(defaultDelay) {\n this.delayer = new Delayer(defaultDelay);\n this.throttler = new Throttler();\n }\n trigger(promiseFactory, delay) {\n return this.delayer.trigger(() => this.throttler.queue(promiseFactory), delay);\n }\n isTriggered() {\n return this.delayer.isTriggered();\n }\n cancel() {\n this.delayer.cancel();\n }\n dispose() {\n this.delayer.dispose();\n }\n}\nexports.ThrottledDelayer = ThrottledDelayer;\n/**\n * A barrier that is initially closed and then becomes opened permanently.\n */\nclass Barrier {\n constructor() {\n this._isOpen = false;\n this._promise = new Promise((c) => {\n this._completePromise = c;\n });\n }\n isOpen() {\n return this._isOpen;\n }\n open() {\n this._isOpen = true;\n this._completePromise(true);\n }\n wait() {\n return this._promise;\n }\n reject() {\n this._isOpen = false;\n this._completePromise(false);\n }\n}\nexports.Barrier = Barrier;\n/**\n * A barrier that is initially closed and then becomes opened permanently after a certain period of\n * time or when open is called explicitly\n */\nclass AutoOpenBarrier extends Barrier {\n constructor(autoOpenTimeMs) {\n super();\n this._timeout = setTimeout(() => this.open(), autoOpenTimeMs);\n }\n open() {\n clearTimeout(this._timeout);\n super.open();\n }\n}\nexports.AutoOpenBarrier = AutoOpenBarrier;\nfunction isThenable(obj) {\n return obj && typeof obj.then === 'function';\n}\nexports.isThenable = isThenable;\nfunction raceTimeout(promise, timeout, onTimeout) {\n let promiseResolve;\n const timer = setTimeout(() => {\n promiseResolve === null || promiseResolve === void 0 ? void 0 : promiseResolve(undefined);\n onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout();\n }, timeout);\n return Promise.race([\n promise.finally(() => clearTimeout(timer)),\n new Promise((resolve) => (promiseResolve = resolve)),\n ]);\n}\nexports.raceTimeout = raceTimeout;\nfunction asPromise(callback) {\n return new Promise((resolve, reject) => {\n const item = callback();\n if (isThenable(item)) {\n item.then(resolve, reject);\n }\n else {\n resolve(item);\n }\n });\n}\nexports.asPromise = asPromise;\n(function () {\n if (typeof requestIdleCallback !== 'function' || typeof cancelIdleCallback !== 'function') {\n const dummyIdle = Object.freeze({\n didTimeout: true,\n timeRemaining() {\n return 15;\n },\n });\n exports.runWhenIdle = (runner) => {\n const handle = setTimeout(() => runner(dummyIdle));\n let disposed = false;\n return {\n dispose() {\n if (disposed) {\n return;\n }\n disposed = true;\n clearTimeout(handle);\n },\n };\n };\n }\n else {\n exports.runWhenIdle = (runner, timeout) => {\n const handle = requestIdleCallback(runner, typeof timeout === 'number' ? { timeout } : undefined);\n let disposed = false;\n return {\n dispose() {\n if (disposed) {\n return;\n }\n disposed = true;\n cancelIdleCallback(handle);\n },\n };\n };\n }\n})();\n/**\n * An implementation of the \"idle-until-urgent\"-strategy as introduced\n * here: https://philipwalton.com/articles/idle-until-urgent/\n */\nclass IdleValue {\n constructor(executor) {\n this._didRun = false;\n this._executor = () => {\n try {\n this._value = executor();\n }\n catch (err) {\n this._error = err;\n }\n finally {\n this._didRun = true;\n }\n };\n this._handle = (0, exports.runWhenIdle)(() => this._executor());\n }\n dispose() {\n this._handle.dispose();\n }\n getValue() {\n if (!this._didRun) {\n this._handle.dispose();\n this._executor();\n }\n if (this._error) {\n throw this._error;\n }\n return this._value;\n }\n}\nexports.IdleValue = IdleValue;\nfunction first(promiseFactories, shouldStop = (t) => !!t, defaultValue = null) {\n let index = 0;\n const len = promiseFactories.length;\n const loop = () => {\n if (index >= len) {\n return Promise.resolve(defaultValue);\n }\n const factory = promiseFactories[index++];\n const promise = Promise.resolve(factory());\n return promise.then((result) => {\n if (shouldStop(result)) {\n return Promise.resolve(result);\n }\n return loop();\n });\n };\n return loop();\n}\nexports.first = first;\nfunction timeout(millis, token) {\n if (!token) {\n return createCancelablePromise((token) => timeout(millis, token));\n }\n return new Promise((resolve, reject) => {\n const handle = setTimeout(resolve, millis);\n token.onCancellationRequested(() => {\n clearTimeout(handle);\n reject((0, errors_1.canceled)());\n });\n });\n}\nexports.timeout = timeout;\nfunction raceCancellation(promise, token, defaultValue) {\n return Promise.race([\n promise,\n new Promise((resolve) => token.onCancellationRequested(() => resolve(defaultValue))),\n ]);\n}\nexports.raceCancellation = raceCancellation;\nclass RunOnceScheduler {\n constructor(runner, delay) {\n this.timeoutToken = -1;\n this.runner = runner;\n this.timeout = delay;\n this.timeoutHandler = this.onTimeout.bind(this);\n }\n /**\n * Dispose RunOnceScheduler\n */\n dispose() {\n this.cancel();\n this.runner = null;\n }\n /**\n * Cancel current scheduled runner (if any).\n */\n cancel() {\n if (this.isScheduled()) {\n clearTimeout(this.timeoutToken);\n this.timeoutToken = -1;\n }\n }\n /**\n * Cancel previous runner (if any) & schedule a new runner.\n */\n schedule(delay = this.timeout) {\n this.cancel();\n this.timeoutToken = setTimeout(this.timeoutHandler, delay);\n }\n trigger() {\n this.cancel();\n this.onTimeout();\n }\n get delay() {\n return this.timeout;\n }\n set delay(value) {\n this.timeout = value;\n }\n /**\n * Returns true if scheduled.\n */\n isScheduled() {\n return this.timeoutToken !== -1;\n }\n onTimeout() {\n this.timeoutToken = -1;\n if (this.runner) {\n this.doRun();\n }\n }\n doRun() {\n if (this.runner) {\n this.runner();\n }\n }\n}\nexports.RunOnceScheduler = RunOnceScheduler;\nfunction disposableTimeout(handler, timeout = 0) {\n const timer = setTimeout(handler, timeout);\n return (0, disposable_1.toDisposable)(() => clearTimeout(timer));\n}\nexports.disposableTimeout = disposableTimeout;\nfunction sleep(time) {\n return new Promise((resolve) => setTimeout(resolve, time));\n}\nexports.sleep = sleep;\nconst retry = async (task, options) => {\n const { delay, retries, onFailedAttempt, timeout } = options;\n try {\n if (timeout) {\n const result = await raceTimeout(task(), timeout || 0);\n if (result === undefined) {\n throw new Error('Timeout');\n }\n return result;\n }\n return task();\n }\n catch (error) {\n if (retries === 0) {\n throw error;\n }\n if (onFailedAttempt) {\n onFailedAttempt(error);\n }\n await sleep(delay);\n return (0, exports.retry)(task, { delay, retries: retries - 1, onFailedAttempt, timeout });\n }\n};\nexports.retry = retry;\nclass StateTracer {\n constructor() {\n this.deferred = {};\n }\n has(state) {\n return this.deferred[state] !== undefined;\n }\n delete(state) {\n delete this.deferred[state];\n }\n record(state) {\n if (this.deferred[state] === undefined) {\n this.deferred[state] = new Barrier();\n }\n }\n fulfill(state) {\n if (this.deferred[state] !== undefined) {\n this.deferred[state].open();\n }\n else {\n this.deferred[state] = new Barrier();\n this.deferred[state].open();\n }\n }\n reachedState(state) {\n if (this.deferred[state] === undefined) {\n this.deferred[state] = new Barrier();\n }\n return this.deferred[state].wait();\n }\n reachedAnyState(...states) {\n return Promise.race(states.map((s) => this.reachedState(s)));\n }\n dispose() {\n Object.keys(this.deferred).forEach((key) => {\n this.deferred[key].reject();\n });\n this.deferred = {};\n }\n}\nexports.StateTracer = StateTracer;\n//# sourceMappingURL=async.js.map\n\n//# sourceURL=webpack://@opensumi/ide-components/../utils/lib/async.js?");
6592
6592
 
6593
6593
  /***/ }),
6594
6594
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensumi/ide-components",
3
- "version": "3.3.4-next-1727344885.0",
3
+ "version": "3.3.4-next-1729497448.0",
4
4
  "description": "@opensumi/ide-components",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -16,8 +16,8 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@ant-design/icons": "^4.6.4",
19
- "@opensumi/ide-core-common": "3.3.4-next-1727344885.0",
20
- "@opensumi/ide-utils": "3.3.4-next-1727344885.0",
19
+ "@opensumi/ide-core-common": "3.3.4-next-1729497448.0",
20
+ "@opensumi/ide-utils": "3.3.4-next-1729497448.0",
21
21
  "@opensumi/react-custom-scrollbars-2": "^4.3.4",
22
22
  "@rc-component/mini-decimal": "^1.0.1",
23
23
  "fuzzy": "^0.1.3",
@@ -38,10 +38,10 @@
38
38
  "react-window": "^1.8.5"
39
39
  },
40
40
  "devDependencies": {
41
- "@opensumi/ide-dev-tool": "3.3.4-next-1727344885.0",
41
+ "@opensumi/ide-dev-tool": "3.3.4-next-1729497448.0",
42
42
  "@types/marked": "^4.0.7",
43
43
  "@types/react-window": "^1.8.5",
44
44
  "prop-types": "^15.8.1"
45
45
  },
46
- "gitHead": "d1683cd89971d85ea479d7ea348cc8ee33e05988"
46
+ "gitHead": "8890905f094f2156204ad44304e9400656bddf75"
47
47
  }