@herbertgao/pi-extensions 2026.10.14 → 2026.10.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -6
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/node_modules/@narumitw/pi-btw/README.md +1 -1
- package/node_modules/@narumitw/pi-btw/dist/index.ts +77 -64
- package/node_modules/@narumitw/pi-btw/dist/index.ts.map +2 -2
- package/node_modules/@narumitw/pi-btw/docs/core-alignment.md +10 -2
- package/node_modules/@narumitw/pi-btw/package.json +5 -5
- package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +83 -63
- package/node_modules/@narumitw/pi-caffeinate/package.json +3 -3
- package/node_modules/pi-web-access/CHANGELOG.md +40 -0
- package/node_modules/pi-web-access/README.md +96 -22
- package/node_modules/pi-web-access/brave-rate-limit.ts +2 -2
- package/node_modules/pi-web-access/curator-page.ts +3 -1
- package/node_modules/pi-web-access/curator-server.ts +1 -0
- package/node_modules/pi-web-access/dist/index.js +2607 -1674
- package/node_modules/pi-web-access/dist/mcp-cli.js +1119 -327
- package/node_modules/pi-web-access/duckduckgo-rate-limit.ts +95 -0
- package/node_modules/pi-web-access/duckduckgo.ts +51 -45
- package/node_modules/pi-web-access/exa.ts +48 -6
- package/node_modules/pi-web-access/extract.ts +2 -2
- package/node_modules/pi-web-access/fetch-params.ts +5 -4
- package/node_modules/pi-web-access/field-extract.ts +347 -0
- package/node_modules/pi-web-access/gemini-search.ts +151 -13
- package/node_modules/pi-web-access/index.ts +128 -125
- package/node_modules/pi-web-access/mistral-search.ts +1 -1
- package/node_modules/pi-web-access/ninerouter.ts +92 -0
- package/node_modules/pi-web-access/offtopic-judge.ts +72 -0
- package/node_modules/pi-web-access/openai-search.ts +36 -10
- package/node_modules/pi-web-access/package.json +1 -1
- package/node_modules/pi-web-access/perplexity.ts +1 -0
- package/node_modules/pi-web-access/query-rewrite.ts +39 -13
- package/node_modules/pi-web-access/source-check.ts +31 -15
- package/node_modules/pi-web-access/summary-model-scope.ts +19 -1
- package/node_modules/pi-web-access/summary-review.ts +13 -20
- package/node_modules/pi-web-access/tool-arguments.ts +1 -1
- package/node_modules/pi-web-access/upgrade-notice.ts +47 -0
- package/node_modules/pi-web-access/utils.ts +26 -1
- package/node_modules/pi-web-access/web-tool-contract.ts +4 -1
- package/node_modules/pi-web-access/web-tool-core.ts +99 -19
- package/node_modules/pi-web-access/xai-search.ts +3 -3
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -24,8 +24,8 @@ The package bundles 5 active `@herbertgao/*` child packages—`pi-agency`, `pi-b
|
|
|
24
24
|
- `pi-provider-qoder@0.6.5`
|
|
25
25
|
- `@dietrichgebert/ponytail@5.3.2`
|
|
26
26
|
- `@juicesharp/rpiv-ask-user-question@2.15.0`
|
|
27
|
-
- `@narumitw/pi-btw@0.63.
|
|
28
|
-
- `@narumitw/pi-caffeinate@0.49.
|
|
27
|
+
- `@narumitw/pi-btw@0.63.1`
|
|
28
|
+
- `@narumitw/pi-caffeinate@0.49.13`
|
|
29
29
|
- `@pi-plugins/fast-mode@0.1.14`
|
|
30
30
|
- `@tifan/pi-copy-response@0.2.7`
|
|
31
31
|
- `@tifan/pi-handoff@2.2.2`
|
|
@@ -37,13 +37,13 @@ The package bundles 5 active `@herbertgao/*` child packages—`pi-agency`, `pi-b
|
|
|
37
37
|
- `pi-typesafe@0.13.0`
|
|
38
38
|
- `pi-next-cue@1.0.8`
|
|
39
39
|
- `pi-lens@4.4.5`
|
|
40
|
-
- `pi-web-access@0.
|
|
40
|
+
- `pi-web-access@0.45.0`
|
|
41
41
|
|
|
42
42
|
Pi loads their extensions and skills through `node_modules/` paths inside one package root. The upstream companions are pinned and bundled, not forked or renamed.
|
|
43
43
|
|
|
44
44
|
The locally customized CC package follows upstream `pi-cc-extensions@1.0.11`; SoL-Pi follows its complete main baseline `e1a586af` with Pi 1.x/codemode compatibility updates through `21956803`. Local behavior not already covered upstream is retained. SoL-Pi's `update_plan` now follows upstream's model-only contract: invoke it directly, not inside codemode scripts. Action Fusion and ccstyle write rich diffs coexist without disabling either feature. All four SoL-Pi features remain opt-in; its new non-persistent-session evidence archives remain on disk for consumers and require host or caller cleanup.
|
|
45
45
|
|
|
46
|
-
Antigravity `0.11.0` enriches search citations by visiting source sites by default (`ANTIGRAVITY_NO_SOURCE_ENRICH=1` disables enrichment). It refreshes a curated model catalog and upgrades the existing model cache; previously listed model IDs may disappear. Ask `2.15.0` lets other extensions in the same process answer or cancel TUI questionnaires through its event channel, without sender authentication. Its notes shortcut defaults to `n` and can be a single non-Latin character; reserved navigation keys stay on `n`. Web Access `0.
|
|
46
|
+
Antigravity `0.11.0` enriches search citations by visiting source sites by default (`ANTIGRAVITY_NO_SOURCE_ENRICH=1` disables enrichment). It refreshes a curated model catalog and upgrades the existing model cache; previously listed model IDs may disappear. Ask `2.15.0` lets other extensions in the same process answer or cancel TUI questionnaires through its event channel, without sender authentication. Its notes shortcut defaults to `n` and can be a single non-Latin character; reserved navigation keys stay on `n`. Web Access `0.45.0` keeps direct tool exposure and `toolActivation: auto` by default. Linkup, DeepSeek search and fetch, provider gateways, `toolActivation: "none"`, deferred exposure, GCE ADC, field extraction, 9router, and plain HTTP gateway URLs require explicit configuration.
|
|
47
47
|
|
|
48
48
|
Ponytail `5.3.2` updates the Pi skill guidance, including how to turn it off. Its Pi extension entry is unchanged; the new Claude Code band/board hooks are not registered by this aggregate.
|
|
49
49
|
|
|
@@ -55,11 +55,13 @@ Ponytail `5.3.2` updates the Pi skill guidance, including how to turn it off. It
|
|
|
55
55
|
|
|
56
56
|
`@herbertgao/pi-bark` sends localized Bark pushes when a user-facing Pi run fully settles or `@juicesharp/rpiv-ask-user-question` needs an answer. Notifications include emoji-labeled machine/path metadata and support the bundled official Pi badge through Bark's `icon` parameter. Configure it in `$PI_CODING_AGENT_DIR/bark.json` (normally `~/.pi/agent/bark.json`); see the [package README](../pi-bark/README.md). Without a valid endpoint it stays inactive.
|
|
57
57
|
|
|
58
|
-
`@narumitw/pi-caffeinate@0.49.
|
|
58
|
+
`@narumitw/pi-caffeinate@0.49.13` uses the host platform's sleep inhibitor during each Pi agent run. On macOS, `/caffeinate sleep` keeps the system awake while allowing the display to sleep; `/caffeinate display` also keeps the display awake. It releases the inhibitor when the run or session ends. Its D-Bus dependency remains on the normal socket transport under Node; Bun on Linux/macOS can use FFI and an in-process reader thread for Unix file-descriptor transport, and that thread can be unreferenced so the connection need not keep the process alive. It falls back when FFI is unavailable. No daemon or build step is added.
|
|
59
|
+
|
|
60
|
+
`@narumitw/pi-btw@0.63.1` opens its side workspace through the `@narumitw/pi-tui-kit@^0.67.0` fullscreen handoff. It does not start that UI when the flow is already disposed or the parent terminal cannot be restored. Importing new main-thread context stays manual.
|
|
59
61
|
|
|
60
62
|
`clef` asks Cloudflare Clef-flash an on-demand yes/no, choice, or score and prints the questions and answers in the transcript, plus a one-line notice. It is not a permission gate. `pi-typesafe@0.13.0` provides `/typesafe` and `typesafe_evaluate` for explicit structured decisions; `/typesafe enable` or `PI_TYPESAFE_ENABLED=1` is still required for agent tool calls. The default backend remains `https://api.typesafe.ai`. `PI_TYPESAFE_BACKEND` and `PI_TYPESAFE_MODEL` select the session backend and model, and `/typesafe login` stores a key for the named backend. Daily request, token, and USD caps are opt-in. OpenRouter, Command Code, Liquid, SubQ, and a named endpoint stay explicit and use that backend's own key. The promoted SDK is `@typesafe-ai/sdk@0.7.0`.
|
|
61
63
|
|
|
62
|
-
`@herbertgao/sol-pi` adds opt-in Action Fusion, ObservationPack, Evidence-Preserving Reducer, and Online Context Compact; see its [configuration guide](../sol-pi/docs/configuration.md). `pi-lens@4.4.5` publishes a public LSP config schema, reads user-level custom rule directories (project before user before built-in), normalizes argv-style server entries, downgrades `throw-new-error` to a warning, and counts Docker, JSON, and Jedi servers in idle eviction; language routing and the retained multi-root diagnostic facts are unchanged. It promotes `@ast-grep/cli` to `0.51.0` and `@ast-grep/napi` to `^0.51.0`. Concatenated SQL passed to `.execute()` is an advisory full-analysis finding; a parameterized `execute(sql, values)` call stays quiet. Keeping injected findings in later requests is opt-in. `pi-web-access@0.
|
|
64
|
+
`@herbertgao/sol-pi` adds opt-in Action Fusion, ObservationPack, Evidence-Preserving Reducer, and Online Context Compact; see its [configuration guide](../sol-pi/docs/configuration.md). `pi-lens@4.4.5` publishes a public LSP config schema, reads user-level custom rule directories (project before user before built-in), normalizes argv-style server entries, downgrades `throw-new-error` to a warning, and counts Docker, JSON, and Jedi servers in idle eviction; language routing and the retained multi-root diagnostic facts are unchanged. It promotes `@ast-grep/cli` to `0.51.0` and `@ast-grep/napi` to `^0.51.0`. Concatenated SQL passed to `.execute()` is an advisory full-analysis finding; a parameterized `execute(sql, values)` call stays quiet. Keeping injected findings in later requests is opt-in. `pi-web-access@0.45.0` provides configurable web search and fetch tools; its `toolActivation` defaults to `auto`, choosing eager or dynamic tool activation per model. `toolActivation: "none"` stays opt-in and still requires deferred exposure. Field extraction, 9router, empty or off-topic search fallback, and plain HTTP gateway URLs stay off unless configured. An unknown tool-call provider name fails instead of selecting a provider automatically, and DuckDuckGo searches stay spaced apart after a bot check. It adds structured search/fetch data for codemode and an optional, manually started `pi-web-access-mcp` stdio CLI; installing the aggregate does not start that server. Degoog, Keenable, Ceramic, Linkup, and DeepSeek fetch are explicit-only, excluded from automatic and `all` selection. Provider gateway base URLs are opt-in and are not configured by the aggregate. OpenAI search now defaults to `gpt-6-luna`, results and clone cleanup are scoped per extension instance, and the promoted `@modelcontextprotocol/sdk@^1.32.1` moves the bundle off GHSA-6qxp-vccf-f47h. Perplexity search now uses the Search API's ranked pages and snippets rather than a Sonar-generated answer; requests requiring prose still use Sonar. `pi-antigravity@0.11.0` reads Pi 0.86+ transcript system messages, so Antigravity requests carry Pi's system prompt and tools; it also registers `google_search` and `generate_image` tools that use the signed-in Antigravity account. `pi-provider-qoder@0.6.5` registers the `qoder` and `qoder-cn` model providers. Sign in with `/login qoder` (browser or a personal access token from [qoder.com/account/integrations](https://qoder.com/account/integrations)) or `/login qoder-cn` (token from [qoder.com.cn/account/integrations](https://qoder.com.cn/account/integrations)). `QODER_PERSONAL_ACCESS_TOKEN` and `QODERCN_PERSONAL_ACCESS_TOKEN` log those providers in at startup. `/qoder-usage footer on` replaces the status-bar footer for that session, so leave it off while the pi-cc footer is in use. Preferred Thinking 1.0.2 preserves an explicit subagent `--thinking` choice. Deprecated `@tifan/pi-titlebar-spinner` is no longer bundled; Rename remains the single owner of Herdr tab naming.
|
|
63
65
|
|
|
64
66
|
`pi-stash` is no longer bundled: `/btw` already preserves the main editor draft while handling side questions outside the main conversation. Prior `@herbertgao/pi-stash` releases remain available but are no longer maintained here.
|
|
65
67
|
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -36,7 +36,7 @@ THE SOFTWARE.
|
|
|
36
36
|
|
|
37
37
|
## `@narumitw/pi-caffeinate`
|
|
38
38
|
|
|
39
|
-
The aggregate bundles [`@narumitw/pi-caffeinate`](https://github.com/narumiruna/pi-extensions/tree/main/packages/pi-caffeinate) version 0.49.
|
|
39
|
+
The aggregate bundles [`@narumitw/pi-caffeinate`](https://github.com/narumiruna/pi-extensions/tree/main/packages/pi-caffeinate) version 0.49.13 under its original MIT license:
|
|
40
40
|
|
|
41
41
|
MIT License
|
|
42
42
|
|
|
@@ -191,7 +191,7 @@ The file is read for every `/btw` invocation, so edits apply without `/reload`.
|
|
|
191
191
|
- Resume state is memory-only and lasts only for the current extension instance.
|
|
192
192
|
- Main-conversation context is a limited text snapshot, not the complete session; see [context scope](./docs/workflows.md#choose-context-and-resume-threads).
|
|
193
193
|
- Clipboard access depends on Pi's host helper, the operating system, and the terminal.
|
|
194
|
-
- The live workspace
|
|
194
|
+
- The live workspace uses a separate TUI instance and BTW-owned private host-layout access because Pi has no public workspace-composition API; see the [core-alignment handoff](./docs/core-alignment.md) for tested safeguards, exact limits, and proposed APIs. This intentionally deviates from Pi's advice against a second terminal renderer: only one renderer owns the terminal at a time, without an official support guarantee. The [shared fullscreen handoff record](https://github.com/narumiruna/pi-extensions/blob/main/packages/pi-tui-kit/docs/fullscreen-handoff.md) records the Kit physical-lifecycle contract, two-consumer proof, release guards, and physical-terminal limits; layouts, input, and domain state stay in BTW.
|
|
195
195
|
- Pi does not expose all effective renderer options or a public clipboard-read callback. BTW uses native automatic wheel behavior but does not inherit private host wheel overrides or right-click clipboard paste.
|
|
196
196
|
- Conversation appearance follows native defaults, not custom host editor/footer extensions or private padding settings. BTW uses one-cell message padding and zero-cell editor padding; see the [appearance reference and before/after frames](./docs/native-appearance.md).
|
|
197
197
|
- Malformed, unsupported, or oversized Mermaid diagrams remain readable as fenced source; partial parses also show a warning.
|
|
@@ -1940,6 +1940,10 @@ var FullscreenUiDisposedError = class extends Error {
|
|
|
1940
1940
|
}
|
|
1941
1941
|
};
|
|
1942
1942
|
async function runBtwFullscreen(ctx, run, options = {}, dependencies = {}) {
|
|
1943
|
+
const { createFullscreenHandoff } = await import("@narumitw/pi-tui-kit/fullscreen-handoff");
|
|
1944
|
+
if (ctx.signal?.aborted || options.signal?.aborted || options.canRestoreParent?.() === false) {
|
|
1945
|
+
throw new FullscreenUiDisposedError();
|
|
1946
|
+
}
|
|
1943
1947
|
const createTui = dependencies.createTui ?? ((parent, theme, keybindings, fullscreenOptions) => createBtwFullscreenTui(
|
|
1944
1948
|
parent,
|
|
1945
1949
|
theme,
|
|
@@ -1973,7 +1977,8 @@ async function runBtwFullscreen(ctx, run, options = {}, dependencies = {}) {
|
|
|
1973
1977
|
done(value);
|
|
1974
1978
|
},
|
|
1975
1979
|
createTui,
|
|
1976
|
-
options
|
|
1980
|
+
options,
|
|
1981
|
+
createFullscreenHandoff
|
|
1977
1982
|
);
|
|
1978
1983
|
return host;
|
|
1979
1984
|
},
|
|
@@ -1992,7 +1997,7 @@ async function runBtwFullscreen(ctx, run, options = {}, dependencies = {}) {
|
|
|
1992
1997
|
return outcome.value;
|
|
1993
1998
|
}
|
|
1994
1999
|
var BtwFullscreenHost = class {
|
|
1995
|
-
constructor(parent, theme, keybindings, ctx, run, done, createTui, options) {
|
|
2000
|
+
constructor(parent, theme, keybindings, ctx, run, done, createTui, options, createHandoff) {
|
|
1996
2001
|
this.parent = parent;
|
|
1997
2002
|
this.theme = theme;
|
|
1998
2003
|
this.keybindings = keybindings;
|
|
@@ -2010,6 +2015,10 @@ var BtwFullscreenHost = class {
|
|
|
2010
2015
|
},
|
|
2011
2016
|
() => this.fullscreen?.requestRender()
|
|
2012
2017
|
);
|
|
2018
|
+
this.handoff = createHandoff(parent, {
|
|
2019
|
+
isCurrent: () => !this.disposed && !this.finished && !this.lifetimeController.signal.aborted && this.options.canRestoreParent?.() !== false,
|
|
2020
|
+
canRestoreParent: () => this.options.canRestoreParent?.() !== false
|
|
2021
|
+
});
|
|
2013
2022
|
this.sidePaneRatio = options.sidePaneRatio;
|
|
2014
2023
|
queueMicrotask(() => void this.start());
|
|
2015
2024
|
}
|
|
@@ -2022,7 +2031,7 @@ var BtwFullscreenHost = class {
|
|
|
2022
2031
|
createTui;
|
|
2023
2032
|
options;
|
|
2024
2033
|
fullscreen;
|
|
2025
|
-
|
|
2034
|
+
handoff;
|
|
2026
2035
|
cancelActiveCustom;
|
|
2027
2036
|
hardCancelActiveCustom;
|
|
2028
2037
|
removeHardCancelListener;
|
|
@@ -2030,13 +2039,8 @@ var BtwFullscreenHost = class {
|
|
|
2030
2039
|
started = false;
|
|
2031
2040
|
disposed = false;
|
|
2032
2041
|
finished = false;
|
|
2033
|
-
parentStopped = false;
|
|
2034
|
-
parentRestoreAttempted = false;
|
|
2035
|
-
fullscreenCreated = false;
|
|
2036
|
-
fullscreenStopped = false;
|
|
2037
|
-
parentRestoreQueued = false;
|
|
2038
2042
|
parentRestorePromise;
|
|
2039
|
-
|
|
2043
|
+
cleanupErrors = [];
|
|
2040
2044
|
removeMainThreadUpdateListener;
|
|
2041
2045
|
mainThreadRefreshTimer;
|
|
2042
2046
|
mainThreadInput;
|
|
@@ -2046,7 +2050,7 @@ var BtwFullscreenHost = class {
|
|
|
2046
2050
|
sidePaneWriteGeneration = 0;
|
|
2047
2051
|
confirmedSidePaneWriteGeneration = 0;
|
|
2048
2052
|
setParentOverlay(overlay) {
|
|
2049
|
-
this.
|
|
2053
|
+
this.handoff.setOverlayHandle(overlay);
|
|
2050
2054
|
}
|
|
2051
2055
|
render(width) {
|
|
2052
2056
|
return [truncateToWidth3(this.theme.fg("muted", "Opening btw side thread\u2026"), width)];
|
|
@@ -2074,12 +2078,12 @@ var BtwFullscreenHost = class {
|
|
|
2074
2078
|
getParentFullscreenLayout(this.parent);
|
|
2075
2079
|
getParentFullscreenScrollView(this.parent);
|
|
2076
2080
|
}
|
|
2077
|
-
this.
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
this.fullscreen
|
|
2081
|
-
|
|
2082
|
-
|
|
2081
|
+
this.fullscreen = await this.handoff.enter(
|
|
2082
|
+
() => this.createTui(this.parent, this.theme, this.keybindings, this.options)
|
|
2083
|
+
);
|
|
2084
|
+
if (!this.fullscreen || this.disposed || this.finished || this.options.canRestoreParent?.() === false) {
|
|
2085
|
+
throw new FullscreenUiDisposedError();
|
|
2086
|
+
}
|
|
2083
2087
|
this.watchMainThreadUpdates();
|
|
2084
2088
|
const shortcuts = resolveBtwShortcuts(
|
|
2085
2089
|
this.options.keybindings,
|
|
@@ -2128,11 +2132,19 @@ var BtwFullscreenHost = class {
|
|
|
2128
2132
|
try {
|
|
2129
2133
|
this.cancelActiveCustom?.();
|
|
2130
2134
|
} catch (error) {
|
|
2131
|
-
this.
|
|
2135
|
+
this.cleanupErrors.push(error);
|
|
2136
|
+
}
|
|
2137
|
+
this.queueParentRestore();
|
|
2138
|
+
await this.parentRestorePromise;
|
|
2139
|
+
if (this.cleanupErrors.length) {
|
|
2140
|
+
outcome = {
|
|
2141
|
+
kind: "failed",
|
|
2142
|
+
error: combineErrors(
|
|
2143
|
+
outcome.kind === "failed" ? [outcome.error, ...this.cleanupErrors] : this.cleanupErrors,
|
|
2144
|
+
"Pi BTW flow and terminal cleanup failed"
|
|
2145
|
+
)
|
|
2146
|
+
};
|
|
2132
2147
|
}
|
|
2133
|
-
if (this.parentRestorePromise) await this.parentRestorePromise;
|
|
2134
|
-
else this.restoreParent();
|
|
2135
|
-
if (this.cleanupError !== void 0) outcome = { kind: "failed", error: this.cleanupError };
|
|
2136
2148
|
this.finished = true;
|
|
2137
2149
|
this.done(outcome);
|
|
2138
2150
|
}
|
|
@@ -2168,16 +2180,13 @@ var BtwFullscreenHost = class {
|
|
|
2168
2180
|
if (signal.aborted) onAbort();
|
|
2169
2181
|
}
|
|
2170
2182
|
queueParentRestore() {
|
|
2171
|
-
if (this.
|
|
2172
|
-
this.
|
|
2183
|
+
if (this.parentRestorePromise) return;
|
|
2184
|
+
const restoration = this.handoff.restore().catch((error) => {
|
|
2185
|
+
this.cleanupErrors.push(error);
|
|
2186
|
+
});
|
|
2173
2187
|
this.parentRestorePromise = Promise.resolve().then(async () => {
|
|
2174
|
-
try {
|
|
2175
|
-
await this.fullscreen?.terminal.drainInput?.();
|
|
2176
|
-
} catch (error) {
|
|
2177
|
-
this.cleanupError ??= error;
|
|
2178
|
-
}
|
|
2179
|
-
this.parentRestoreQueued = false;
|
|
2180
2188
|
this.restoreParent();
|
|
2189
|
+
await restoration;
|
|
2181
2190
|
});
|
|
2182
2191
|
}
|
|
2183
2192
|
watchMainThreadUpdates() {
|
|
@@ -2202,50 +2211,26 @@ var BtwFullscreenHost = class {
|
|
|
2202
2211
|
try {
|
|
2203
2212
|
removeMainThreadUpdateListener?.();
|
|
2204
2213
|
} catch (error) {
|
|
2205
|
-
this.
|
|
2214
|
+
this.cleanupErrors.push(error);
|
|
2206
2215
|
}
|
|
2207
2216
|
try {
|
|
2208
2217
|
this.mainThreadInput.dispose();
|
|
2209
2218
|
} catch (error) {
|
|
2210
|
-
this.
|
|
2219
|
+
this.cleanupErrors.push(error);
|
|
2211
2220
|
}
|
|
2212
2221
|
const removeUpstreamAbortListener = this.removeUpstreamAbortListener;
|
|
2213
2222
|
this.removeUpstreamAbortListener = void 0;
|
|
2214
2223
|
try {
|
|
2215
2224
|
removeUpstreamAbortListener?.();
|
|
2216
2225
|
} catch (error) {
|
|
2217
|
-
this.
|
|
2226
|
+
this.cleanupErrors.push(error);
|
|
2218
2227
|
}
|
|
2219
2228
|
const removeHardCancelListener = this.removeHardCancelListener;
|
|
2220
2229
|
this.removeHardCancelListener = void 0;
|
|
2221
2230
|
try {
|
|
2222
2231
|
removeHardCancelListener?.();
|
|
2223
2232
|
} catch (error) {
|
|
2224
|
-
this.
|
|
2225
|
-
}
|
|
2226
|
-
if (this.fullscreenCreated && !this.fullscreenStopped) {
|
|
2227
|
-
this.fullscreenStopped = true;
|
|
2228
|
-
try {
|
|
2229
|
-
this.fullscreen?.stop({ preserveScreen: true });
|
|
2230
|
-
} catch (error) {
|
|
2231
|
-
this.cleanupError ??= error;
|
|
2232
|
-
}
|
|
2233
|
-
}
|
|
2234
|
-
if (!this.parentStopped || this.parentRestoreAttempted) return;
|
|
2235
|
-
const parentOverlay = this.parentOverlay;
|
|
2236
|
-
this.parentOverlay = void 0;
|
|
2237
|
-
try {
|
|
2238
|
-
parentOverlay?.setHidden(true);
|
|
2239
|
-
} catch (error) {
|
|
2240
|
-
this.cleanupError ??= error;
|
|
2241
|
-
}
|
|
2242
|
-
try {
|
|
2243
|
-
this.parentRestoreAttempted = true;
|
|
2244
|
-
if (this.options.canRestoreParent?.() === false) return;
|
|
2245
|
-
this.parent.start();
|
|
2246
|
-
this.parent.renderNow(false);
|
|
2247
|
-
} catch (error) {
|
|
2248
|
-
this.cleanupError ??= error;
|
|
2233
|
+
this.cleanupErrors.push(error);
|
|
2249
2234
|
}
|
|
2250
2235
|
}
|
|
2251
2236
|
createContext() {
|
|
@@ -2306,22 +2291,23 @@ var BtwFullscreenHost = class {
|
|
|
2306
2291
|
componentDisposed = true;
|
|
2307
2292
|
try {
|
|
2308
2293
|
component.dispose?.();
|
|
2309
|
-
} catch {
|
|
2294
|
+
} catch (error) {
|
|
2295
|
+
this.cleanupErrors.push(error);
|
|
2310
2296
|
}
|
|
2311
2297
|
};
|
|
2312
2298
|
const unmount = () => {
|
|
2313
|
-
|
|
2299
|
+
const cleanupErrors = [];
|
|
2314
2300
|
const removeFocusListener = removePaneFocusListener;
|
|
2315
2301
|
removePaneFocusListener = void 0;
|
|
2316
2302
|
try {
|
|
2317
2303
|
removeFocusListener?.();
|
|
2318
2304
|
} catch (error) {
|
|
2319
|
-
|
|
2305
|
+
cleanupErrors.push(error);
|
|
2320
2306
|
}
|
|
2321
2307
|
try {
|
|
2322
2308
|
splitPane?.dispose();
|
|
2323
2309
|
} catch (error) {
|
|
2324
|
-
|
|
2310
|
+
cleanupErrors.push(error);
|
|
2325
2311
|
}
|
|
2326
2312
|
splitPane = void 0;
|
|
2327
2313
|
try {
|
|
@@ -2329,18 +2315,18 @@ var BtwFullscreenHost = class {
|
|
|
2329
2315
|
else if (mounted && layoutMounted) fullscreen.setLayoutRoot(void 0);
|
|
2330
2316
|
else if (mounted && component) fullscreen.removeChild(component);
|
|
2331
2317
|
} catch (error) {
|
|
2332
|
-
|
|
2318
|
+
cleanupErrors.push(error);
|
|
2333
2319
|
}
|
|
2334
2320
|
if (overlay || mounted) {
|
|
2335
2321
|
try {
|
|
2336
2322
|
fullscreen.setFocus(null);
|
|
2337
2323
|
fullscreen.requestRender();
|
|
2338
2324
|
} catch (error) {
|
|
2339
|
-
|
|
2325
|
+
cleanupErrors.push(error);
|
|
2340
2326
|
}
|
|
2341
2327
|
}
|
|
2342
2328
|
disposeComponent();
|
|
2343
|
-
if (
|
|
2329
|
+
if (cleanupErrors.length) throw combineErrors(cleanupErrors, "Pi BTW custom UI cleanup failed");
|
|
2344
2330
|
};
|
|
2345
2331
|
const complete = () => {
|
|
2346
2332
|
if (promiseSettled || !hasPendingValue) return;
|
|
@@ -2375,7 +2361,7 @@ var BtwFullscreenHost = class {
|
|
|
2375
2361
|
unmount();
|
|
2376
2362
|
reject(error);
|
|
2377
2363
|
} catch (cleanupError) {
|
|
2378
|
-
reject(cleanupError);
|
|
2364
|
+
reject(combineErrors([error, cleanupError], "Pi BTW custom UI and cleanup failed"));
|
|
2379
2365
|
}
|
|
2380
2366
|
};
|
|
2381
2367
|
this.cancelActiveCustom = () => {
|
|
@@ -2512,6 +2498,33 @@ var BtwFullscreenHost = class {
|
|
|
2512
2498
|
}
|
|
2513
2499
|
}
|
|
2514
2500
|
};
|
|
2501
|
+
function combineErrors(errors, message) {
|
|
2502
|
+
const causes = [];
|
|
2503
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2504
|
+
const remember = (error) => {
|
|
2505
|
+
if (seen.has(error)) return;
|
|
2506
|
+
seen.add(error);
|
|
2507
|
+
if (error instanceof AggregateError) error.errors.forEach(remember);
|
|
2508
|
+
};
|
|
2509
|
+
const overlaps = (error, visited = /* @__PURE__ */ new Set()) => {
|
|
2510
|
+
if (seen.has(error)) return true;
|
|
2511
|
+
if (visited.has(error)) return false;
|
|
2512
|
+
visited.add(error);
|
|
2513
|
+
return error instanceof AggregateError && error.errors.some((cause) => overlaps(cause, visited));
|
|
2514
|
+
};
|
|
2515
|
+
const append = (error) => {
|
|
2516
|
+
if (seen.has(error)) return;
|
|
2517
|
+
if (error instanceof AggregateError && overlaps(error)) {
|
|
2518
|
+
seen.add(error);
|
|
2519
|
+
error.errors.forEach(append);
|
|
2520
|
+
return;
|
|
2521
|
+
}
|
|
2522
|
+
causes.push(error);
|
|
2523
|
+
remember(error);
|
|
2524
|
+
};
|
|
2525
|
+
errors.forEach(append);
|
|
2526
|
+
return causes.length === 1 ? causes[0] : new AggregateError(causes, message);
|
|
2527
|
+
}
|
|
2515
2528
|
function formatError3(error) {
|
|
2516
2529
|
return error instanceof Error ? error.message : String(error);
|
|
2517
2530
|
}
|