maka-agent 0.2.0-dev.64.20260929 → 0.2.0-dev.68.20261003

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 (109) hide show
  1. package/LICENSE +1 -1
  2. package/THIRD_PARTY_NOTICES.txt +3 -3
  3. package/dist/pi-tui-runner.js +26 -29
  4. package/dist/tui-copy-catalog.js +9 -9
  5. package/native/runtime-host-peer/prebuilds/darwin-arm64/maka_runtime_host_peer.node +0 -0
  6. package/native/runtime-host-peer/prebuilds/linux-arm64/maka_runtime_host_peer.node +0 -0
  7. package/native/runtime-host-peer/prebuilds/linux-x64/maka_runtime_host_peer.node +0 -0
  8. package/native/runtime-host-peer/prebuilds/win32-x64/maka_runtime_host_peer.node +0 -0
  9. package/native/runtime-host-windows-task-launcher/prebuilds/win32-x64/maka-runtime-host-task-launcher.exe +0 -0
  10. package/node_modules/@maka/acp-executor-plugin/dist/acp-catalog.js +132 -0
  11. package/node_modules/@maka/acp-executor-plugin/dist/index.js +251 -113
  12. package/node_modules/@maka/acp-executor-plugin/dist/plugin.mjs +431 -108
  13. package/node_modules/@maka/core/dist/executor-catalog.js +25 -3
  14. package/node_modules/@maka/core/dist/settings.js +2 -2
  15. package/node_modules/@maka/core/dist/tool-ledger-scanner.js +53 -150
  16. package/node_modules/@maka/runtime/dist/admission-limiter.js +3 -2
  17. package/node_modules/@maka/runtime/dist/ai-sdk-compaction.js +8 -1
  18. package/node_modules/@maka/runtime/dist/conversation-copy.js +6 -0
  19. package/node_modules/@maka/runtime/dist/plugin-data-services.js +7 -0
  20. package/node_modules/@maka/runtime/dist/plugin-executor-service.js +19 -3
  21. package/node_modules/@maka/runtime/dist/runtime-event-read-model.js +17 -0
  22. package/node_modules/@maka/runtime/dist/session-manager.js +26 -40
  23. package/node_modules/@maka/runtime/dist/stream-graph-coordinator.js +79 -13
  24. package/node_modules/@maka/runtime/dist/stream-graph-projection.js +64 -0
  25. package/node_modules/@maka/runtime/dist/stream-graph-read-model.js +138 -20
  26. package/node_modules/@maka/runtime/dist/tool-availability.js +10 -3
  27. package/node_modules/@maka/runtime/package.json +1 -0
  28. package/node_modules/@maka/runtime-host/dist/antigravity-program.js +49 -0
  29. package/node_modules/@maka/runtime-host/dist/candidate-entry.js +15 -0
  30. package/node_modules/@maka/runtime-host/dist/candidate-startup-failure.js +5 -0
  31. package/node_modules/@maka/runtime-host/dist/client/session-catalog-summary.js +1 -0
  32. package/node_modules/@maka/runtime-host/dist/client/startup-error.js +5 -0
  33. package/node_modules/@maka/runtime-host/dist/protocol/agent-graph.js +46 -1
  34. package/node_modules/@maka/runtime-host/dist/protocol/index.js +16 -1
  35. package/node_modules/@maka/runtime-host/dist/protocol/operations.js +5 -1
  36. package/node_modules/@maka/runtime-host/dist/protocol/plugin-platform.js +8 -2
  37. package/node_modules/@maka/runtime-host/dist/protocol/session-catalog.js +12 -0
  38. package/node_modules/@maka/runtime-host/dist/protocol/session-retirement.js +46 -10
  39. package/node_modules/@maka/runtime-host/dist/protocol/storage-usage.js +155 -0
  40. package/node_modules/@maka/runtime-host/dist/server/acp/antigravity.js +5 -19
  41. package/node_modules/@maka/runtime-host/dist/server/agent-graph-coordinator.js +23 -0
  42. package/node_modules/@maka/runtime-host/dist/server/canonical-turn-snapshot.js +5 -0
  43. package/node_modules/@maka/runtime-host/dist/server/execution-composition.js +41 -9
  44. package/node_modules/@maka/runtime-host/dist/server/external-agent-setup-coordinator.js +3 -0
  45. package/node_modules/@maka/runtime-host/dist/server/hosted-execution-tool-profile.js +2 -0
  46. package/node_modules/@maka/runtime-host/dist/server/plugin-data-runtime.js +6 -0
  47. package/node_modules/@maka/runtime-host/dist/server/plugin-scratch-directory.js +55 -0
  48. package/node_modules/@maka/runtime-host/dist/server/session-catalog-coordinator.js +46 -6
  49. package/node_modules/@maka/runtime-host/dist/server/session-retirement-coordinator.js +112 -36
  50. package/node_modules/@maka/runtime-host/dist/server/session-revision-coordinator.js +27 -1
  51. package/node_modules/@maka/runtime-host/dist/server/storage-usage-coordinator.js +67 -0
  52. package/node_modules/@maka/runtime-host/dist/server/workhub-inspection-tool.js +208 -0
  53. package/node_modules/@maka/runtime-host/package.json +1 -0
  54. package/node_modules/@maka/storage/dist/git-worktree-child-executor.js +3 -1
  55. package/node_modules/@maka/storage/dist/operational-state-store.js +0 -13
  56. package/node_modules/@maka/storage/dist/session-store.js +9 -6
  57. package/node_modules/@maka/storage/dist/sqlite-file-set.js +22 -0
  58. package/node_modules/@maka/storage/dist/sqlite-long-term-memory-store.js +1 -3
  59. package/node_modules/@maka/storage/dist/sqlite-runtime-store.js +10 -260
  60. package/node_modules/@maka/storage/dist/sqlite-session-catalog-query.js +1 -0
  61. package/node_modules/@maka/storage/dist/sqlite-session-metadata-schema.js +18 -6
  62. package/node_modules/@maka/storage/dist/sqlite-session-metadata-store.js +28 -6
  63. package/node_modules/@maka/storage/dist/storage-footprint.js +239 -0
  64. package/node_modules/@maka/storage/dist/storage-writer-composition.js +10 -1
  65. package/node_modules/axios/CHANGELOG.md +62 -0
  66. package/node_modules/axios/README.md +297 -5
  67. package/node_modules/axios/dist/axios.js +728 -170
  68. package/node_modules/axios/dist/axios.min.js +3 -3
  69. package/node_modules/axios/dist/browser/axios.cjs +871 -188
  70. package/node_modules/axios/dist/esm/axios.js +871 -188
  71. package/node_modules/axios/dist/esm/axios.min.js +2 -2
  72. package/node_modules/axios/dist/node/axios.cjs +1037 -225
  73. package/node_modules/axios/lib/adapters/fetch.js +64 -11
  74. package/node_modules/axios/lib/adapters/http.js +140 -67
  75. package/node_modules/axios/lib/adapters/xhr.js +52 -3
  76. package/node_modules/axios/lib/core/Axios.js +43 -20
  77. package/node_modules/axios/lib/core/AxiosError.js +33 -2
  78. package/node_modules/axios/lib/core/AxiosHeaders.js +124 -1
  79. package/node_modules/axios/lib/core/InterceptorManager.js +107 -8
  80. package/node_modules/axios/lib/core/buildFullPath.js +41 -15
  81. package/node_modules/axios/lib/core/dispatchRequest.js +8 -2
  82. package/node_modules/axios/lib/core/mergeConfig.js +19 -4
  83. package/node_modules/axios/lib/core/methodList.js +17 -0
  84. package/node_modules/axios/lib/core/setFormDataHeaders.js +27 -0
  85. package/node_modules/axios/lib/defaults/index.js +2 -1
  86. package/node_modules/axios/lib/env/data.js +1 -1
  87. package/node_modules/axios/lib/helpers/Http2Sessions.js +2 -0
  88. package/node_modules/axios/lib/helpers/HttpStatusCode.js +12 -1
  89. package/node_modules/axios/lib/helpers/combineURLs.js +11 -3
  90. package/node_modules/axios/lib/helpers/composeSignals.js +12 -1
  91. package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +115 -54
  92. package/node_modules/axios/lib/helpers/formDataToJSON.js +11 -5
  93. package/node_modules/axios/lib/helpers/fromDataURI.js +5 -4
  94. package/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
  95. package/node_modules/axios/lib/helpers/parseHeaders.js +5 -3
  96. package/node_modules/axios/lib/helpers/progressEventReducer.js +4 -4
  97. package/node_modules/axios/lib/helpers/resolveConfig.js +5 -17
  98. package/node_modules/axios/lib/helpers/shouldBypassProxy.js +300 -5
  99. package/node_modules/axios/lib/helpers/throttle.js +3 -2
  100. package/node_modules/axios/lib/helpers/toFormData.js +17 -23
  101. package/node_modules/axios/lib/platform/node/classes/Buffer.js +11 -0
  102. package/node_modules/axios/lib/utils.js +151 -18
  103. package/node_modules/axios/package.json +21 -19
  104. package/node_modules/brace-expansion/dist/commonjs/index.js +69 -25
  105. package/node_modules/brace-expansion/dist/esm/index.js +68 -24
  106. package/node_modules/brace-expansion/package.json +2 -1
  107. package/node_modules/fast-uri/index.js +10 -6
  108. package/node_modules/fast-uri/package.json +1 -1
  109. package/package.json +1 -1
package/LICENSE CHANGED
@@ -253,7 +253,7 @@ License: MIT
253
253
 
254
254
  Maka includes an ejected adaptation of Astryx ChatReasoning v0.1.9 in
255
255
  `packages/ui/src/astryx-chat-reasoning.tsx` and generated theme artifacts in
256
- `apps/desktop/src/renderer/astryx-theme/`, based on Astryx theme-neutral v0.6.2.
256
+ `apps/desktop/src/renderer/astryx-theme/`, based on Astryx theme-neutral v0.6.3.
257
257
  Maka also redistributes
258
258
  `patches/@astryxdesign+core+0.6.3.patch`, which modifies the MIT-licensed Astryx
259
259
  core package. The following MIT License applies to that material:
@@ -2304,7 +2304,7 @@ SOFTWARE.
2304
2304
 
2305
2305
  ================================================================================
2306
2306
 
2307
- Package: axios@1.18.1
2307
+ Package: axios@1.20.0
2308
2308
  Declared license: MIT
2309
2309
  Selected license: MIT
2310
2310
  Repository: https://github.com/axios/axios.git
@@ -3004,7 +3004,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3004
3004
 
3005
3005
  ================================================================================
3006
3006
 
3007
- Package: brace-expansion@5.0.9
3007
+ Package: brace-expansion@5.0.12
3008
3008
  Declared license: MIT
3009
3009
  Selected license: MIT
3010
3010
  Repository: git+https://github.com/juliangruber/brace-expansion.git
@@ -3970,7 +3970,7 @@ SOFTWARE.
3970
3970
 
3971
3971
  ================================================================================
3972
3972
 
3973
- Package: fast-uri@3.1.7
3973
+ Package: fast-uri@3.1.8
3974
3974
  Declared license: BSD-3-Clause
3975
3975
  Selected license: BSD-3-Clause
3976
3976
  Repository: git+https://github.com/fastify/fast-uri.git
@@ -786,7 +786,7 @@ export async function runMakaPiTui(input) {
786
786
  return true;
787
787
  };
788
788
  // Refill the editor from a retract result, prepended to any current draft.
789
- // Shared by the interrupt path and the alt+↑ path. The text always comes
789
+ // Shared by the interrupt path and the Shift+← path. The text always comes
790
790
  // from `driver.retractQueued()` — an authoritative queue mutation — never
791
791
  // from the render mirror, which can
792
792
  // lag a step-boundary consumption and would resurrect an already-consumed
@@ -879,7 +879,7 @@ export async function runMakaPiTui(input) {
879
879
  return;
880
880
  }
881
881
  // First-run has no connection, so the wizard is the only surface. This is
882
- // the single choke point for idle submits (Enter, Alt+Enter, steer
882
+ // the single choke point for idle submits (Enter, steer
883
883
  // fallback): reopen the wizard instead of opening a turn against a
884
884
  // connection-less driver. Slash commands above already routed to the
885
885
  // command layer (/exit still exits, /help still shows help).
@@ -959,29 +959,16 @@ export async function runMakaPiTui(input) {
959
959
  }
960
960
  submitMessage(text, 'current_turn');
961
961
  };
962
- // Alt+Enter: during a turn, queue the text to open the next turn; when idle,
963
- // it submits like Enter.
964
- const handleAltEnter = () => {
965
- // Mirror Enter's control-busy guard BEFORE touching the editor: during a
966
- // control action (busy without a running turn) submitPrompt would drop the
967
- // prompt, so keep the draft in place instead of clearing it into the void.
968
- if (busy && !turnRunning)
969
- return;
970
- // Interrupt convergence window: the turn is being stopped, so nothing may
971
- // be queued onto it and no fresh turn may open — keep the draft.
972
- if (interruptRequested)
973
- return;
962
+ // Tab: during a turn, queue the draft to open the next turn. Idle Tab never
963
+ // reaches this — it stays the editor's completion trigger (key handler gate).
964
+ const queueDraftForNextTurn = () => {
974
965
  const text = editor.getExpandedText().trim();
975
966
  if (!text)
976
967
  return;
977
968
  editor.setText('');
978
- if (!turnRunning) {
979
- submitPrompt(text);
980
- return;
981
- }
982
969
  submitMessage(text, 'next_turn');
983
970
  };
984
- // Alt+↑: take back every queued message from the Runtime Host, joined and
971
+ // Shift+←: take back every queued message from the Runtime Host, joined and
985
972
  // prepended to the current draft for re-editing.
986
973
  const retractQueuedMessages = () => {
987
974
  void (async () => {
@@ -4119,20 +4106,30 @@ export async function runMakaPiTui(input) {
4119
4106
  }
4120
4107
  return { consume: true };
4121
4108
  }
4122
- // Alt+Enter: queue a followup (during a turn) or submit (when idle). Alt+↑:
4123
- // take back the queued messages to re-edit. Neither is an editor binding
4124
- // (newline is shift+enter/ctrl+j; history is plain up), so intercepting
4125
- // here does not collide with the editor's own keys.
4126
- if (matchesKey(data, Key.alt('enter')) && !isKeyRepeat(data)) {
4127
- handleAltEnter();
4109
+ // Tab: queue a followup during a turn — the route terminals deliver
4110
+ // reliably, unlike the Alt chords they claim for themselves (#3538;
4111
+ // Codex's default). The editor owns Tab everywhere else: it
4112
+ // triggers/accepts completion, so a turn-running Tab only queues a
4113
+ // non-empty draft while no completion popup is open. Idle Tab stays
4114
+ // with the editor rather than submitting.
4115
+ if (turnRunning &&
4116
+ !interruptRequested &&
4117
+ !editorPastePending &&
4118
+ editor.getText().trim().length > 0 &&
4119
+ !editor.isShowingAutocomplete() &&
4120
+ matchesKey(data, Key.tab) &&
4121
+ !isKeyRepeat(data)) {
4122
+ queueDraftForNextTurn();
4128
4123
  return { consume: true };
4129
4124
  }
4130
- if (matchesKey(data, Key.alt('up')) && !isKeyRepeat(data)) {
4125
+ // Shift+←: retract queued messages (Codex's edit_queued_message
4126
+ // default). Not an editor binding, and an empty retract refill is a
4127
+ // no-op, so consuming unconditionally loses nothing — same rationale
4128
+ // the old Alt+↑ binding used.
4129
+ if (matchesKey(data, Key.shift('left')) && !isKeyRepeat(data)) {
4131
4130
  // Always retract from the authority: the render mirror lags the
4132
- // queue_update event, so an enqueue followed by Alt+Up in the same
4131
+ // queue_update event, so an enqueue followed by Shift+← in the same
4133
4132
  // tick would see an empty mirror while the runtime holds the message.
4134
- // Alt+Up is not an editor binding, and an empty retract refill is a
4135
- // no-op, so consuming unconditionally loses nothing.
4136
4133
  retractQueuedMessages();
4137
4134
  return { consume: true };
4138
4135
  }
@@ -1032,8 +1032,8 @@ export const TUI_COPY_RESOURCES = {
1032
1032
  ' Ctrl+T — expand or collapse all thinking in view',
1033
1033
  ' Scroll the transcript with your terminal or trackpad',
1034
1034
  ' Enter (during a turn) — steer: inject a message into the running turn',
1035
- ' Alt+Enter (during a turn) — queue a message for the next turn',
1036
- ' Alt+↑ — take queued messages back into the editor to re-edit',
1035
+ ' Tab (during a turn) — queue a message for the next turn',
1036
+ ' Shift+← — take queued messages back into the editor to re-edit',
1037
1037
  ' Esc Esc (during a turn) — interrupt the turn',
1038
1038
  ' Esc Esc (when idle) — rewind to an earlier turn',
1039
1039
  ' Ctrl+C — stop the turn, clear input, or press twice to exit',
@@ -1086,8 +1086,8 @@ export const TUI_COPY_RESOURCES = {
1086
1086
  ' Ctrl+T — 展开或折叠视图中的所有思考块',
1087
1087
  ' 使用终端或触控板滚动对话记录',
1088
1088
  ' Enter(任务运行中)— 将消息注入当前任务',
1089
- ' Alt+Enter(任务运行中)— 将消息排入下一轮',
1090
- ' Alt+↑ — 将已排队消息取回编辑器重新编辑',
1089
+ ' Tab(任务运行中)— 将消息排入下一轮',
1090
+ ' Shift+← — 将已排队消息取回编辑器重新编辑',
1091
1091
  ' Esc Esc(任务运行中)— 中断当前任务',
1092
1092
  ' Esc Esc(空闲时)— 回退到较早的轮次',
1093
1093
  ' Ctrl+C — 停止任务、清空输入,或连续按两次退出',
@@ -1140,8 +1140,8 @@ export const TUI_COPY_RESOURCES = {
1140
1140
  ' Ctrl+T — 展開或摺疊檢視中的所有思考區塊',
1141
1141
  ' 使用終端機或觸控板捲動對話記錄',
1142
1142
  ' Enter(任務執行中)— 將訊息注入目前任務',
1143
- ' Alt+Enter(任務執行中)— 將訊息排入下一輪',
1144
- ' Alt+↑ — 將已排隊訊息取回編輯器重新編輯',
1143
+ ' Tab(任務執行中)— 將訊息排入下一輪',
1144
+ ' Shift+← — 將已排隊訊息取回編輯器重新編輯',
1145
1145
  ' Esc Esc(任務執行中)— 中斷目前任務',
1146
1146
  ' Esc Esc(空閒時)— 回退到較早的輪次',
1147
1147
  ' Ctrl+C — 停止任務、清空輸入,或連續按兩次退出',
@@ -1372,17 +1372,17 @@ export const TUI_COPY_RESOURCES = {
1372
1372
  en: {
1373
1373
  steeringLabel: 'Steering:',
1374
1374
  queuedLabel: 'Queued:',
1375
- requeueHint: 'Alt+↑ take queued messages back to re-edit',
1375
+ requeueHint: 'Shift+← take queued messages back to re-edit',
1376
1376
  },
1377
1377
  'zh-CN': {
1378
1378
  steeringLabel: '注入:',
1379
1379
  queuedLabel: '已排队:',
1380
- requeueHint: 'Alt+↑ 取回队列以重新编辑',
1380
+ requeueHint: 'Shift+← 取回队列以重新编辑',
1381
1381
  },
1382
1382
  'zh-TW': {
1383
1383
  steeringLabel: '調整方向:',
1384
1384
  queuedLabel: '已排入佇列:',
1385
- requeueHint: 'Alt+↑ 取回佇列訊息重新編輯',
1385
+ requeueHint: 'Shift+← 取回佇列訊息重新編輯',
1386
1386
  },
1387
1387
  },
1388
1388
  'session-status': {
@@ -0,0 +1,132 @@
1
+ /*
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+ const CATALOG_TTL_MS = 60_000;
20
+ const PROBE_TIMEOUT_MS = 30_000;
21
+ /** Instance-scoped candidates. Only a retained task Session owns workspace configuration. */
22
+ export class AcpCatalog {
23
+ admission;
24
+ probe;
25
+ unavailable;
26
+ #cached;
27
+ #pending;
28
+ #tail;
29
+ #operations = new Set();
30
+ #revision = 0;
31
+ #disposed = false;
32
+ constructor(admission, probe, unavailable) {
33
+ this.admission = admission;
34
+ this.probe = probe;
35
+ this.unavailable = unavailable;
36
+ }
37
+ async get(signal, refresh = false) {
38
+ signal.throwIfAborted();
39
+ if (this.#disposed)
40
+ return this.unavailable();
41
+ if (refresh)
42
+ this.invalidate();
43
+ while (true) {
44
+ signal.throwIfAborted();
45
+ if (this.#disposed)
46
+ return this.unavailable();
47
+ const cached = this.#cached;
48
+ if (cached && cached.expires > Date.now())
49
+ return cached.entry;
50
+ const pending = this.#ensureProbe();
51
+ const result = await waitForSignal(pending.promise, signal);
52
+ signal.throwIfAborted();
53
+ if (this.#disposed)
54
+ return this.unavailable();
55
+ // An invalidation need not have another caller to start its replacement.
56
+ // Only superseded revisions retry; genuine failures remain terminal.
57
+ if (pending.revision !== this.#revision)
58
+ continue;
59
+ return result;
60
+ }
61
+ }
62
+ #ensureProbe() {
63
+ if (!this.#pending) {
64
+ const revision = this.#revision;
65
+ const controller = new AbortController();
66
+ const startup = AbortSignal.any([controller.signal, AbortSignal.timeout(PROBE_TIMEOUT_MS)]);
67
+ const previous = this.#tail;
68
+ const run = async () => {
69
+ try {
70
+ // A refresh must drain the superseded process before starting its replacement.
71
+ await previous;
72
+ startup.throwIfAborted();
73
+ const permit = await this.admission.acquire(startup);
74
+ let entry;
75
+ try {
76
+ startup.throwIfAborted();
77
+ // probe settles only after its process and temporary directory have been disposed.
78
+ entry = await this.probe(startup);
79
+ }
80
+ finally {
81
+ permit.release();
82
+ }
83
+ if (startup.aborted || revision !== this.#revision || this.#disposed)
84
+ return this.unavailable();
85
+ if (entry.readiness === 'ready')
86
+ this.#cached = { entry, expires: Date.now() + CATALOG_TTL_MS };
87
+ return entry;
88
+ }
89
+ catch {
90
+ return this.unavailable();
91
+ }
92
+ };
93
+ const promise = run().finally(() => {
94
+ this.#operations.delete(promise);
95
+ if (this.#pending?.promise === promise)
96
+ this.#pending = undefined;
97
+ if (this.#tail === promise)
98
+ this.#tail = undefined;
99
+ });
100
+ this.#pending = { revision, controller, promise };
101
+ this.#tail = promise;
102
+ this.#operations.add(promise);
103
+ }
104
+ return this.#pending;
105
+ }
106
+ invalidate() {
107
+ this.#revision++;
108
+ this.#cached = undefined;
109
+ this.#pending?.controller.abort(new Error('ACP catalog invalidated'));
110
+ this.#pending = undefined;
111
+ }
112
+ async dispose() {
113
+ this.#disposed = true;
114
+ this.invalidate();
115
+ await Promise.allSettled(this.#operations);
116
+ }
117
+ }
118
+ /** A caller can stop waiting without cancelling a probe shared by other drafts. */
119
+ async function waitForSignal(promise, signal) {
120
+ signal.throwIfAborted();
121
+ return await new Promise((resolve, reject) => {
122
+ const aborted = () => reject(signal.reason);
123
+ signal.addEventListener('abort', aborted, { once: true });
124
+ void promise.then((value) => {
125
+ signal.removeEventListener('abort', aborted);
126
+ resolve(value);
127
+ }, (error) => {
128
+ signal.removeEventListener('abort', aborted);
129
+ reject(error);
130
+ });
131
+ });
132
+ }