better-dsh 0.3.0-c → 0.3.0-e
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/cordis.patch.yml +0 -4
- package/lib/LaunchOptions-3peHoOAx.js +4 -0
- package/lib/{LaunchOptions-kGXcZOe0.js → LaunchOptions-DXdeJis3.js} +1 -1
- package/lib/{bidi-BalpKaJc.js → bidi-CwtLGgcA.js} +1 -1
- package/lib/client/index.js +7 -6
- package/lib/failover/index.js +1 -1
- package/lib/fs-aware/sandbox-plugin.js +3 -3
- package/lib/{index-browser-CysrjMyM.js → index-browser-Bp3vxHC3.js} +4 -4
- package/lib/index.js +5 -5
- package/lib/{kernel-env-D8UOWeji.js → kernel-env-BLPZE-I3.js} +2 -2
- package/lib/kernel-env.js +1 -1
- package/lib/{lsp-server-registry-BXvUTBY7.js → lsp-server-registry-BcdkHROD.js} +1 -1
- package/lib/{lsp-server-registry-CH9WNFFt.js → lsp-server-registry-D4VLs1Sm.js} +1 -1
- package/lib/{main-BQeFrBM1.js → main-BXwPLuYr.js} +1 -1
- package/lib/{main-CupOhMp5.js → main-CKFNYpqT.js} +4 -4
- package/lib/mobile/plugin.d.ts +1 -1
- package/lib/{puppeteer-core-CSk2PtSm.js → puppeteer-core-Bliv_vNf.js} +8 -8
- package/lib/remote/plugin.js +3 -3
- package/lib/url-schemes/index.d.ts +11 -11
- package/lib/url-schemes/index.js +12 -12
- package/lib/web-password.d.ts +7 -7
- package/lib/web-password.js +4 -0
- package/lib/{web-trust-Dej_RI2B.d.ts → web-trust-C_Y6o8Z2.d.ts} +11 -11
- package/lib/web-trust.d.ts +1 -2
- package/lib/{wrap-T4I0nfPM.js → wrap-0VA0uFx8.js} +1 -1
- package/package.json +2 -7
- package/lib/LaunchOptions-B874eBu2.js +0 -4
- package/lib/bundle-delivery.d.ts +0 -20
- package/lib/bundle-delivery.js +0 -212
- package/scripts/register-bundle.mjs +0 -80
package/cordis.patch.yml
CHANGED
|
@@ -17,10 +17,6 @@
|
|
|
17
17
|
# `python` is only a hint: the runtime OWNS the kernel environment. An
|
|
18
18
|
# explicit interpreter (DASHR_KERNEL_PYTHON) is verified; the bare
|
|
19
19
|
- insert:
|
|
20
|
-
# No-op standalone; keeps a containing pack's local companion delivery current.
|
|
21
|
-
- id: dashr-bundle-delivery
|
|
22
|
-
name: 'better-dsh/bundle-delivery'
|
|
23
|
-
|
|
24
20
|
- id: dashr-repl
|
|
25
21
|
name: 'better-dsh'
|
|
26
22
|
config:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as __require } from "./chunk-DQxbwPpZ.js";
|
|
2
2
|
import { A as stringToTypedArray, G as first, H as delayWhen, K as firstValueFrom, L as combineLatest, M as assert, Q as map, S as timeout, St as debug, Tt as environment, V as defer, W as filter, at as race, b as isString, bt as TouchError, c as evaluationString, d as fromEmitterEvent, g as isDate, gt as ProtocolError, h as getSourceUrlComment, ht as ConnectionClosedError, i as SOURCE_URL_REGEX, k as stringToBase64, lt as switchMap, m as getSourcePuppeteerURLIfAvailable, o as debugCatchError, ot as raceWith, q as from, r as PuppeteerURL, rt as of, s as debugError, u as fromAbortSignal, v as isPlainObject, vt as TargetCloseError, x as parsePDFOptions, xt as UnsupportedOperation, y as isRegExp, yt as TimeoutError } from "./util-BHL_dfV_.js";
|
|
3
|
-
import { $n as Deferred, $t as scriptInjector, Bt as throwIfDetached, Ct as WebWorkerEvent, Dn as DeviceRequestPrompt, Dt as normalizeHeaderValue, Fn as Browser, Hn as DisposableStack, Ht as bindIsolatedHandle, In as WEB_PERMISSION_TO_PROTOCOL_PERMISSION, It as Dialog, Jn as CallbackRegistry, Kn as disposeSymbol, Ln as CDPSession, Lt as Accessibility, Mn as invokeAtMostOnceForArguments, Mt as InterceptResolutionAction, Nn as throwIfDisposed, Nt as STATUS_TEXTS, On as BrowserContext, Ot as SecurityDetails, Pt as handleError, Rt as Frame, St as WebWorker, Ut as JSHandle, Vt as ElementHandle, Zn as isErrorLike, _t as Mouse, an as stringifyFunction, cn as Tracing, dt as ConsoleMessage, en as ARIAQueryHandler, fn as Coverage, gt as Keyboard, ht as TargetType, in as interpolateFunction, jn as inertIfDisposed, jt as HTTPRequest, kn as bubble, kt as HTTPResponse, mn as Page, mt as Target, nn as LazyArg, on as AsyncIterableUtil, sn as FileChooser, un as EmulationManager, vt as MouseButton, wt as Realm, yt as Touchscreen, zn as EventEmitter } from "./index-browser-
|
|
3
|
+
import { $n as Deferred, $t as scriptInjector, Bt as throwIfDetached, Ct as WebWorkerEvent, Dn as DeviceRequestPrompt, Dt as normalizeHeaderValue, Fn as Browser, Hn as DisposableStack, Ht as bindIsolatedHandle, In as WEB_PERMISSION_TO_PROTOCOL_PERMISSION, It as Dialog, Jn as CallbackRegistry, Kn as disposeSymbol, Ln as CDPSession, Lt as Accessibility, Mn as invokeAtMostOnceForArguments, Mt as InterceptResolutionAction, Nn as throwIfDisposed, Nt as STATUS_TEXTS, On as BrowserContext, Ot as SecurityDetails, Pt as handleError, Rt as Frame, St as WebWorker, Ut as JSHandle, Vt as ElementHandle, Zn as isErrorLike, _t as Mouse, an as stringifyFunction, cn as Tracing, dt as ConsoleMessage, en as ARIAQueryHandler, fn as Coverage, gt as Keyboard, ht as TargetType, in as interpolateFunction, jn as inertIfDisposed, jt as HTTPRequest, kn as bubble, kt as HTTPResponse, mn as Page, mt as Target, nn as LazyArg, on as AsyncIterableUtil, sn as FileChooser, un as EmulationManager, vt as MouseButton, wt as Realm, yt as Touchscreen, zn as EventEmitter } from "./index-browser-Bp3vxHC3.js";
|
|
4
4
|
import "./BrowserWebSocketTransport-wm99h94r.js";
|
|
5
5
|
|
|
6
6
|
//#region node_modules/mitt/dist/mitt.mjs
|
package/lib/client/index.js
CHANGED
|
@@ -613,7 +613,7 @@ function CompactionRow({ t, loadConfig, save }) {
|
|
|
613
613
|
* Register the dictionaries and the General settings row.
|
|
614
614
|
*
|
|
615
615
|
* Called from the plugin's client entry, which already injects `locale`,
|
|
616
|
-
* `slots` and `
|
|
616
|
+
* `slots`, `remote.settings` and `configForms`.
|
|
617
617
|
*
|
|
618
618
|
* @param ctx - client root context.
|
|
619
619
|
*/
|
|
@@ -622,7 +622,7 @@ function setupCompactionRow(ctx) {
|
|
|
622
622
|
zh: zh$1,
|
|
623
623
|
en: en$1
|
|
624
624
|
}), "compaction-tuning: dictionaries");
|
|
625
|
-
ctx.slots.inject("settings.general.item", function* () {
|
|
625
|
+
ctx.effect(() => ctx.configForms.whileServed([COMPACTION_SETTINGS_ENTRY], () => ctx.slots.inject("settings.general.item", function* () {
|
|
626
626
|
yield ctx.slots.register({
|
|
627
627
|
name: "settings.general.item",
|
|
628
628
|
id: COMPACTION_SETTINGS_NS,
|
|
@@ -647,7 +647,7 @@ function setupCompactionRow(ctx) {
|
|
|
647
647
|
}
|
|
648
648
|
})
|
|
649
649
|
}, CompactionRow);
|
|
650
|
-
});
|
|
650
|
+
})), "compaction-tuning: served settings row");
|
|
651
651
|
}
|
|
652
652
|
|
|
653
653
|
//#endregion
|
|
@@ -658,7 +658,8 @@ const inject = [
|
|
|
658
658
|
"locale",
|
|
659
659
|
"remote",
|
|
660
660
|
"remote.settings",
|
|
661
|
-
"remote.session"
|
|
661
|
+
"remote.session",
|
|
662
|
+
"configForms"
|
|
662
663
|
];
|
|
663
664
|
/**
|
|
664
665
|
* Register the `failover` dictionaries and the General settings row.
|
|
@@ -671,7 +672,7 @@ function apply(ctx) {
|
|
|
671
672
|
}), "llm-failover: dictionaries");
|
|
672
673
|
setupMobileLayout(ctx);
|
|
673
674
|
setupCompactionRow(ctx);
|
|
674
|
-
ctx.slots.inject("settings.general.item", function* () {
|
|
675
|
+
ctx.effect(() => ctx.configForms.whileServed([FAILOVER_SETTINGS_ENTRY], () => ctx.slots.inject("settings.general.item", function* () {
|
|
675
676
|
yield ctx.slots.register({
|
|
676
677
|
name: "settings.general.item",
|
|
677
678
|
id: "failover",
|
|
@@ -702,7 +703,7 @@ function apply(ctx) {
|
|
|
702
703
|
}
|
|
703
704
|
})
|
|
704
705
|
}, FailoverRow);
|
|
705
|
-
});
|
|
706
|
+
})), "llm-failover: served settings row");
|
|
706
707
|
}
|
|
707
708
|
|
|
708
709
|
//#endregion
|
package/lib/failover/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as Schema } from "../lib-C8_jXvwA.js";
|
|
2
|
-
import { randomUUID } from "node:crypto";
|
|
3
2
|
import { Context } from "@deepseek-ai/cordis";
|
|
3
|
+
import { randomUUID } from "node:crypto";
|
|
4
4
|
import { RetryId } from "@deepseek-ai/dsh-llm-retry";
|
|
5
5
|
|
|
6
6
|
//#region src/failover/config.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { f as UrlSchemesError, t as buildFsLayerResolver } from "../wrap-
|
|
2
|
-
import { stat } from "node:fs/promises";
|
|
3
|
-
import { dirname, sep } from "node:path";
|
|
1
|
+
import { f as UrlSchemesError, t as buildFsLayerResolver } from "../wrap-0VA0uFx8.js";
|
|
4
2
|
import { Context } from "@deepseek-ai/cordis";
|
|
3
|
+
import { dirname, sep } from "node:path";
|
|
4
|
+
import { stat } from "node:fs/promises";
|
|
5
5
|
import { LocalFileSystem } from "@deepseek-ai/dsh-fs-local";
|
|
6
6
|
import { FsError } from "@deepseek-ai/dsh-fs";
|
|
7
7
|
import { writableRoots } from "@deepseek-ai/dsh-sandbox";
|
|
@@ -20792,7 +20792,7 @@ async function _connectToBiDiBrowser(connectionTransport, url, options) {
|
|
|
20792
20792
|
const { bidiConnection, cdpConnection, closeCallback } = await getBiDiConnection(connectionTransport, url, options);
|
|
20793
20793
|
return await (await import(
|
|
20794
20794
|
/* webpackIgnore: true */
|
|
20795
|
-
"./bidi-
|
|
20795
|
+
"./bidi-CwtLGgcA.js"
|
|
20796
20796
|
)).BidiBrowser.create({
|
|
20797
20797
|
connection: bidiConnection,
|
|
20798
20798
|
cdpConnection,
|
|
@@ -20815,7 +20815,7 @@ async function _connectToBiDiBrowser(connectionTransport, url, options) {
|
|
|
20815
20815
|
async function getBiDiConnection(connectionTransport, url, options) {
|
|
20816
20816
|
const BiDi = await import(
|
|
20817
20817
|
/* webpackIgnore: true */
|
|
20818
|
-
"./bidi-
|
|
20818
|
+
"./bidi-CwtLGgcA.js"
|
|
20819
20819
|
);
|
|
20820
20820
|
const { slowMo = 0, protocolTimeout, idGenerator = createIncrementalIdGenerator() } = options;
|
|
20821
20821
|
const pureBidiConnection = new BiDi.BidiConnection(url, connectionTransport, idGenerator, slowMo, protocolTimeout);
|
|
@@ -20887,10 +20887,10 @@ async function getConnectionTransport(options) {
|
|
|
20887
20887
|
endpointUrl: connectionURL
|
|
20888
20888
|
};
|
|
20889
20889
|
} else if (options.channel && isNode) {
|
|
20890
|
-
const { detectBrowserPlatform, resolveDefaultUserDataDir, Browser: Browser$1 } = await import("./main-
|
|
20890
|
+
const { detectBrowserPlatform, resolveDefaultUserDataDir, Browser: Browser$1 } = await import("./main-BXwPLuYr.js");
|
|
20891
20891
|
const platform = detectBrowserPlatform();
|
|
20892
20892
|
if (!platform) throw new Error("Could not detect required browser platform");
|
|
20893
|
-
const { convertPuppeteerChannelToBrowsersChannel } = await import("./LaunchOptions-
|
|
20893
|
+
const { convertPuppeteerChannelToBrowsersChannel } = await import("./LaunchOptions-3peHoOAx.js");
|
|
20894
20894
|
const { join } = await import("node:path");
|
|
20895
20895
|
const portPath = join(resolveDefaultUserDataDir(Browser$1.CHROME, platform, convertPuppeteerChannelToBrowsersChannel(options.channel)), "DevToolsActivePort");
|
|
20896
20896
|
try {
|
package/lib/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { t as Schema } from "./lib-C8_jXvwA.js";
|
|
2
2
|
import { a as RESERVED_ERROR_MEMBERS, i as RESERVED_BINDING_GLOBALS, n as DUNDER_MEMBER, o as ReplRuntime, r as PORTABLE_RESERVED_WORDS, t as isFlatBindableName } from "./py-sdk-D7klhpWb.js";
|
|
3
|
-
import { s as resolveKernelEnv } from "./kernel-env-
|
|
3
|
+
import { s as resolveKernelEnv } from "./kernel-env-BLPZE-I3.js";
|
|
4
4
|
import { t as captureAllTools } from "./native-capture-BEByDXYM.js";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
|
-
import { randomBytes, randomUUID } from "node:crypto";
|
|
7
|
-
import { spawn } from "node:child_process";
|
|
8
|
-
import { join } from "node:path";
|
|
9
|
-
import { fileURLToPath } from "node:url";
|
|
10
6
|
import { Context } from "@deepseek-ai/cordis";
|
|
7
|
+
import { randomBytes, randomUUID } from "node:crypto";
|
|
11
8
|
import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
import { spawn } from "node:child_process";
|
|
12
11
|
import { tmpdir } from "node:os";
|
|
13
12
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
14
13
|
import { createInterface } from "node:readline";
|
|
14
|
+
import { fileURLToPath } from "node:url";
|
|
15
15
|
import { TOOL_RUNTIME_SCHEDULER, defineTool } from "@deepseek-ai/dsh-tools";
|
|
16
16
|
import * as dshLlm from "@deepseek-ai/dsh-llm";
|
|
17
17
|
import { BlockAssembler, HarnessError, createUserMessage } from "@deepseek-ai/dsh-llm";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { existsSync, mkdirSync } from "node:fs";
|
|
2
2
|
import { dirname, join, resolve } from "node:path";
|
|
3
|
+
import { execFile } from "node:child_process";
|
|
3
4
|
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { existsSync, mkdirSync } from "node:fs";
|
|
5
5
|
import { promisify } from "node:util";
|
|
6
6
|
|
|
7
7
|
//#region src/kernel-env.ts
|
package/lib/kernel-env.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as PACKAGE_ROOT, c as uvInstallArgs, d as venvFallbackArgs, i as IPYKERNEL_VERSION, l as uvToolEnv, n as DEFAULT_KERNEL_PYTHON_VERSION, o as pipInstallArgs, r as DILL_VERSION, s as resolveKernelEnv, t as AUTO_PYTHON_SENTINEL, u as uvVenvArgs } from "./kernel-env-
|
|
1
|
+
import { a as PACKAGE_ROOT, c as uvInstallArgs, d as venvFallbackArgs, i as IPYKERNEL_VERSION, l as uvToolEnv, n as DEFAULT_KERNEL_PYTHON_VERSION, o as pipInstallArgs, r as DILL_VERSION, s as resolveKernelEnv, t as AUTO_PYTHON_SENTINEL, u as uvVenvArgs } from "./kernel-env-BLPZE-I3.js";
|
|
2
2
|
|
|
3
3
|
export { AUTO_PYTHON_SENTINEL, DEFAULT_KERNEL_PYTHON_VERSION, DILL_VERSION, IPYKERNEL_VERSION, PACKAGE_ROOT, pipInstallArgs, resolveKernelEnv, uvInstallArgs, uvToolEnv, uvVenvArgs, venvFallbackArgs };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as primaryServerForFile, c as serversForFile, i as installServer, n as findWorkspaceRoot, o as resolveCommandPath, r as installHintFor, s as serverByName, t as clearCommandProbeCache } from "./lsp-server-registry-
|
|
1
|
+
import { a as primaryServerForFile, c as serversForFile, i as installServer, n as findWorkspaceRoot, o as resolveCommandPath, r as installHintFor, s as serverByName, t as clearCommandProbeCache } from "./lsp-server-registry-D4VLs1Sm.js";
|
|
2
2
|
|
|
3
3
|
export { clearCommandProbeCache, findWorkspaceRoot, installHintFor, installServer, primaryServerForFile, resolveCommandPath, serverByName, serversForFile };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as Browser, a as TimeoutError, b as ChromeReleaseChannel, c as computeSystemExecutablePath, d as InstalledBrowser, f as detectBrowserPlatform, g as resolveDefaultUserDataDir, h as resolveBuildId, i as Process, l as launch, m as getVersionComparator, n as uninstall, o as WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX, p as createProfile, r as CDP_WEBSOCKET_ENDPOINT_REGEX, s as computeExecutablePath, t as getInstalledBrowsers, u as Cache, v as BrowserPlatform, y as BrowserTag } from "./main-
|
|
1
|
+
import { _ as Browser, a as TimeoutError, b as ChromeReleaseChannel, c as computeSystemExecutablePath, d as InstalledBrowser, f as detectBrowserPlatform, g as resolveDefaultUserDataDir, h as resolveBuildId, i as Process, l as launch, m as getVersionComparator, n as uninstall, o as WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX, p as createProfile, r as CDP_WEBSOCKET_ENDPOINT_REGEX, s as computeExecutablePath, t as getInstalledBrowsers, u as Cache, v as BrowserPlatform, y as BrowserTag } from "./main-CKFNYpqT.js";
|
|
2
2
|
|
|
3
3
|
export { Browser, BrowserPlatform, BrowserTag, CDP_WEBSOCKET_ENDPOINT_REGEX, Cache, ChromeReleaseChannel, InstalledBrowser, Process, TimeoutError, WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX, computeExecutablePath, computeSystemExecutablePath, createProfile, detectBrowserPlatform, getInstalledBrowsers, getVersionComparator, launch, resolveBuildId, resolveDefaultUserDataDir, uninstall };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import childProcess, { execFile, execSync, spawn, spawnSync } from "node:child_process";
|
|
3
|
-
import { mkdir, readdir, unlink } from "node:fs/promises";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import { URL as URL$1, urlToHttpOptions } from "node:url";
|
|
6
2
|
import fs, { accessSync, constants, existsSync, readFileSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import childProcess, { execFile, execSync, spawn, spawnSync } from "node:child_process";
|
|
7
5
|
import os from "node:os";
|
|
8
6
|
import readline from "node:readline";
|
|
7
|
+
import { URL as URL$1, urlToHttpOptions } from "node:url";
|
|
9
8
|
import { debuglog, promisify } from "node:util";
|
|
9
|
+
import { mkdir, readdir, unlink } from "node:fs/promises";
|
|
10
10
|
import { EventEmitter } from "node:events";
|
|
11
11
|
import * as http from "node:http";
|
|
12
12
|
import * as https from "node:https";
|
package/lib/mobile/plugin.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { _ as Browser$1, a as TimeoutError$1, c as computeSystemExecutablePath, f as detectBrowserPlatform, h as resolveBuildId, l as launch$1, n as uninstall, o as WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX, p as createProfile, r as CDP_WEBSOCKET_ENDPOINT_REGEX, s as computeExecutablePath, t as getInstalledBrowsers } from "./main-
|
|
1
|
+
import { _ as Browser$1, a as TimeoutError$1, c as computeSystemExecutablePath, f as detectBrowserPlatform, h as resolveBuildId, l as launch$1, n as uninstall, o as WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX, p as createProfile, r as CDP_WEBSOCKET_ENDPOINT_REGEX, s as computeExecutablePath, t as getInstalledBrowsers } from "./main-CKFNYpqT.js";
|
|
2
2
|
import { C as unitToPixels, Ct as getCapturedLogs, E as paperFormats, F as bufferCount, J as fromEvent, K as firstValueFrom, M as assert, Q as map, S as timeout, St as debug, T as withSourcePuppeteerURLIfNone, Tt as environment, W as filter, Z as lastValueFrom, _ as isNumber, _t as PuppeteerError, a as UTILITY_WORLD_NAME, at as race, b as isString, bt as TouchError, c as evaluationString, d as fromEmitterEvent, dt as takeUntil, f as getReadableAsTypedArray, ft as tap, g as isDate, gt as ProtocolError, h as getSourceUrlComment, ht as ConnectionClosedError, i as SOURCE_URL_REGEX, l as filterAsync, m as getSourcePuppeteerURLIfAvailable, mt as timer, n as NETWORK_IDLE_TIME, o as debugCatchError, p as getReadableFromProtocolStream, q as from, r as PuppeteerURL, s as debugError, t as DEFAULT_VIEWPORT, u as fromAbortSignal, v as isPlainObject, vt as TargetCloseError, w as validateDialogType, wt as setLogCapture, x as parsePDFOptions, xt as UnsupportedOperation, y as isRegExp, yt as TimeoutError, z as concatMap } from "./util-BHL_dfV_.js";
|
|
3
|
-
import { $ as pageBindingInitString, $n as Deferred, $t as scriptInjector, A as NetworkManager, An as guarded, At as DEFAULT_INTERCEPT_RESOLUTION_PRIORITY, B as MAIN_WORLD, Bn as AsyncDisposableStack, Bt as throwIfDetached, C as WebMCPToolCall, Cn as NodeLocator, Ct as WebWorkerEvent, D as CdpTouchscreen, Dn as DeviceRequestPrompt, Dt as normalizeHeaderValue, E as CdpTouchHandle, En as TimeoutSettings, Et as WaitTask, F as CdpFrame, Fn as Browser, Ft as headersArray, G as CdpJSHandle, Gn as asyncDisposeSymbol, Gt as XPathQueryHandler, H as FrameManagerEvent, Hn as DisposableStack, Ht as bindIsolatedHandle, I as referrerPolicyToProtocol, In as WEB_PERMISSION_TO_PROTOCOL_PERMISSION, It as Dialog, J as addPageBinding, Jn as CallbackRegistry, Jt as PQueryHandler, K as releaseObject, Kn as disposeSymbol, Kt as TextQueryHandler, L as LifecycleWatcher, Ln as CDPSession, Lt as Accessibility, M as CdpHTTPResponse, Mt as InterceptResolutionAction, N as CdpHTTPRequest, Nt as STATUS_TEXTS, O as _keyDefinitions, On as BrowserContext, Ot as SecurityDetails, P as FrameTree, Pn as Mutex, Pt as handleError, Q as createEvaluationError, Qn as rewriteError, Qt as ScriptInjector, R as IsolatedWorld, Rn as CDPSessionEvent, Rt as Frame, S as WebMCPTool, Sn as MappedLocator, St as WebWorker, T as CdpMouse, Tn as RaceLocator, Tt as TaskManager, U as ExecutionContext, Un as DisposableStackPolyfill, Ut as JSHandle, V as PUPPETEER_WORLD, Vn as AsyncDisposableStackPolyfill, Vt as ElementHandle, W as CdpElementHandle, Wn as SuppressedError, Wt as getQueryHandlerAndSelector, X as createClientError, Xn as isErrnoException, Xt as CustomQueryHandlerRegistry, Y as convertConsoleMessageLevel, Yn as createProtocolErrorMessage, Yt as PierceQueryHandler, Z as createConsoleMessage, Zn as isErrorLike, Zt as customQueryHandlers, _ as CdpBrowserContext, _n as DelegatedLocator, _t as Mouse, a as KnownDevices, at as CdpPreloadScript, b as convertSameSiteFromPuppeteerToCdp, bn as Locator, bt as createIncrementalIdGenerator, c as _connectToCdpBrowser, cn as Tracing, ct as isTargetClosedError, d as CdpTarget, dn as CSSCoverage, dt as ConsoleMessage, en as ARIAQueryHandler, et as valueFromJSHandle, f as DevToolsTarget, fn as Coverage, ft as CdpBluetoothEmulation, g as WorkerTarget, gn as supportedMetrics, gt as Keyboard, h as PageTarget, hn as setDefaultScreenshotOptions, ht as TargetType, i as assertSupportedUrlRestrictions, it as CdpDeviceRequestPromptManager, j as NetworkEventManager, jt as HTTPRequest, k as FrameManager, kt as HTTPResponse, l as CdpBrowser, ln as EmulatedState, lt as CdpCDPSession, m as OtherTarget, mn as Page, mt as Target, n as TaskQueue, nn as LazyArg, nt as valueFromRemoteObjectReference, o as PredefinedNetworkConditions, on as AsyncIterableUtil, ot as CdpDialog, p as InitializationStatus, pn as JSCoverage, pt as Binding, q as CDP_BINDING_PREFIX, qn as Callback, qt as parsePSelectors, r as Puppeteer, rn as transposeIterableHandle, rt as CdpDeviceRequestPrompt, s as ExtensionTransport, sn as FileChooser, st as Connection, t as PUPPETEER_REVISIONS, tn as QueryHandler, tt as valueFromPrimitiveRemoteObject, u as TargetManager, un as EmulationManager, ut as NetworkManagerEvent, v as CdpPage, vn as FilteredLocator, vt as MouseButton, w as CdpKeyboard, wn as RETRY_DELAY, wt as Realm, x as WebMCP, xn as LocatorEvent, xt as Extension, y as convertCookiesPartitionKeyFromPuppeteerToCdp, yn as FunctionLocator, yt as Touchscreen, z as CdpWebWorker, zn as EventEmitter, zt as FrameEvent } from "./index-browser-
|
|
3
|
+
import { $ as pageBindingInitString, $n as Deferred, $t as scriptInjector, A as NetworkManager, An as guarded, At as DEFAULT_INTERCEPT_RESOLUTION_PRIORITY, B as MAIN_WORLD, Bn as AsyncDisposableStack, Bt as throwIfDetached, C as WebMCPToolCall, Cn as NodeLocator, Ct as WebWorkerEvent, D as CdpTouchscreen, Dn as DeviceRequestPrompt, Dt as normalizeHeaderValue, E as CdpTouchHandle, En as TimeoutSettings, Et as WaitTask, F as CdpFrame, Fn as Browser, Ft as headersArray, G as CdpJSHandle, Gn as asyncDisposeSymbol, Gt as XPathQueryHandler, H as FrameManagerEvent, Hn as DisposableStack, Ht as bindIsolatedHandle, I as referrerPolicyToProtocol, In as WEB_PERMISSION_TO_PROTOCOL_PERMISSION, It as Dialog, J as addPageBinding, Jn as CallbackRegistry, Jt as PQueryHandler, K as releaseObject, Kn as disposeSymbol, Kt as TextQueryHandler, L as LifecycleWatcher, Ln as CDPSession, Lt as Accessibility, M as CdpHTTPResponse, Mt as InterceptResolutionAction, N as CdpHTTPRequest, Nt as STATUS_TEXTS, O as _keyDefinitions, On as BrowserContext, Ot as SecurityDetails, P as FrameTree, Pn as Mutex, Pt as handleError, Q as createEvaluationError, Qn as rewriteError, Qt as ScriptInjector, R as IsolatedWorld, Rn as CDPSessionEvent, Rt as Frame, S as WebMCPTool, Sn as MappedLocator, St as WebWorker, T as CdpMouse, Tn as RaceLocator, Tt as TaskManager, U as ExecutionContext, Un as DisposableStackPolyfill, Ut as JSHandle, V as PUPPETEER_WORLD, Vn as AsyncDisposableStackPolyfill, Vt as ElementHandle, W as CdpElementHandle, Wn as SuppressedError, Wt as getQueryHandlerAndSelector, X as createClientError, Xn as isErrnoException, Xt as CustomQueryHandlerRegistry, Y as convertConsoleMessageLevel, Yn as createProtocolErrorMessage, Yt as PierceQueryHandler, Z as createConsoleMessage, Zn as isErrorLike, Zt as customQueryHandlers, _ as CdpBrowserContext, _n as DelegatedLocator, _t as Mouse, a as KnownDevices, at as CdpPreloadScript, b as convertSameSiteFromPuppeteerToCdp, bn as Locator, bt as createIncrementalIdGenerator, c as _connectToCdpBrowser, cn as Tracing, ct as isTargetClosedError, d as CdpTarget, dn as CSSCoverage, dt as ConsoleMessage, en as ARIAQueryHandler, et as valueFromJSHandle, f as DevToolsTarget, fn as Coverage, ft as CdpBluetoothEmulation, g as WorkerTarget, gn as supportedMetrics, gt as Keyboard, h as PageTarget, hn as setDefaultScreenshotOptions, ht as TargetType, i as assertSupportedUrlRestrictions, it as CdpDeviceRequestPromptManager, j as NetworkEventManager, jt as HTTPRequest, k as FrameManager, kt as HTTPResponse, l as CdpBrowser, ln as EmulatedState, lt as CdpCDPSession, m as OtherTarget, mn as Page, mt as Target, n as TaskQueue, nn as LazyArg, nt as valueFromRemoteObjectReference, o as PredefinedNetworkConditions, on as AsyncIterableUtil, ot as CdpDialog, p as InitializationStatus, pn as JSCoverage, pt as Binding, q as CDP_BINDING_PREFIX, qn as Callback, qt as parsePSelectors, r as Puppeteer, rn as transposeIterableHandle, rt as CdpDeviceRequestPrompt, s as ExtensionTransport, sn as FileChooser, st as Connection, t as PUPPETEER_REVISIONS, tn as QueryHandler, tt as valueFromPrimitiveRemoteObject, u as TargetManager, un as EmulationManager, ut as NetworkManagerEvent, v as CdpPage, vn as FilteredLocator, vt as MouseButton, w as CdpKeyboard, wn as RETRY_DELAY, wt as Realm, x as WebMCP, xn as LocatorEvent, xt as Extension, y as convertCookiesPartitionKeyFromPuppeteerToCdp, yn as FunctionLocator, yt as Touchscreen, z as CdpWebWorker, zn as EventEmitter, zt as FrameEvent } from "./index-browser-Bp3vxHC3.js";
|
|
4
4
|
import { t as BrowserWebSocketTransport } from "./BrowserWebSocketTransport-wm99h94r.js";
|
|
5
|
-
import { t as convertPuppeteerChannelToBrowsersChannel } from "./LaunchOptions-
|
|
5
|
+
import { t as convertPuppeteerChannelToBrowsersChannel } from "./LaunchOptions-DXdeJis3.js";
|
|
6
6
|
import { t as NodeWebSocketTransport } from "./NodeWebSocketTransport-D9ysYGLM.js";
|
|
7
|
-
import { spawn, spawnSync } from "node:child_process";
|
|
8
|
-
import { mkdtemp, rename, unlink } from "node:fs/promises";
|
|
9
|
-
import path, { dirname, join } from "node:path";
|
|
10
7
|
import fs, { existsSync } from "node:fs";
|
|
8
|
+
import path, { dirname, join } from "node:path";
|
|
9
|
+
import { spawn, spawnSync } from "node:child_process";
|
|
11
10
|
import os, { tmpdir } from "node:os";
|
|
12
11
|
import { debuglog } from "node:util";
|
|
12
|
+
import { mkdtemp, rename, unlink } from "node:fs/promises";
|
|
13
13
|
import { PassThrough } from "node:stream";
|
|
14
14
|
|
|
15
15
|
//#region node_modules/puppeteer-core/lib/puppeteer/node-env-setup.js
|
|
@@ -240,7 +240,7 @@ var BrowserLauncher = class {
|
|
|
240
240
|
const bidiOnly = process.env["PUPPETEER_WEBDRIVER_BIDI_ONLY"] === "true";
|
|
241
241
|
const BiDi = await import(
|
|
242
242
|
/* webpackIgnore: true */
|
|
243
|
-
"./bidi-
|
|
243
|
+
"./bidi-CwtLGgcA.js"
|
|
244
244
|
);
|
|
245
245
|
const bidiConnection = await BiDi.connectBidiOverCdp(cdpConnection);
|
|
246
246
|
return await BiDi.BidiBrowser.create({
|
|
@@ -262,7 +262,7 @@ var BrowserLauncher = class {
|
|
|
262
262
|
const transport = await NodeWebSocketTransport.create(browserWSEndpoint);
|
|
263
263
|
const BiDi = await import(
|
|
264
264
|
/* webpackIgnore: true */
|
|
265
|
-
"./bidi-
|
|
265
|
+
"./bidi-CwtLGgcA.js"
|
|
266
266
|
);
|
|
267
267
|
const bidiConnection = new BiDi.BidiConnection(browserWSEndpoint, transport, opts.idGenerator, opts.slowMo, opts.protocolTimeout);
|
|
268
268
|
return await BiDi.BidiBrowser.create({
|
package/lib/remote/plugin.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as Schema } from "../lib-C8_jXvwA.js";
|
|
2
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
2
3
|
import { randomBytes } from "node:crypto";
|
|
3
|
-
import { spawn } from "node:child_process";
|
|
4
|
-
import { readFile } from "node:fs/promises";
|
|
5
4
|
import { join } from "node:path";
|
|
6
|
-
import {
|
|
5
|
+
import { spawn } from "node:child_process";
|
|
7
6
|
import { homedir } from "node:os";
|
|
8
7
|
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
8
|
+
import { readFile } from "node:fs/promises";
|
|
9
9
|
|
|
10
10
|
//#region src/remote/oneshot.ts
|
|
11
11
|
/** 单流硬收集帽(4M UTF-16 code units,ASCII≈4MB):防失控输出吃内存;模型面截断由上层 tailWindow 负责。 */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as Schema } from "../index-DTDXUe6m.js";
|
|
2
1
|
import { Context } from "@deepseek-ai/cordis";
|
|
3
2
|
import { ToolDefinition } from "@deepseek-ai/dsh-tools";
|
|
3
|
+
import * as _deepseek_ai_schemastery9 from "@deepseek-ai/schemastery";
|
|
4
4
|
|
|
5
5
|
//#region src/url-schemes/tools/write.d.ts
|
|
6
6
|
|
|
@@ -50,12 +50,12 @@ declare const inject: string[];
|
|
|
50
50
|
* real patch-line config. Schema-level defaults (both ON — the service is
|
|
51
51
|
* opt-out) survive every overlay layer, per the v0.2.2a ruling.
|
|
52
52
|
*/
|
|
53
|
-
declare const Config:
|
|
54
|
-
urlSchemes:
|
|
55
|
-
hashline:
|
|
53
|
+
declare const Config: _deepseek_ai_schemastery9.default<Schemastery.ObjectS<NoInfer<{
|
|
54
|
+
urlSchemes: _deepseek_ai_schemastery9.default<boolean, boolean, "defined">;
|
|
55
|
+
hashline: _deepseek_ai_schemastery9.default<boolean, boolean, "defined">;
|
|
56
56
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
57
|
-
urlSchemes:
|
|
58
|
-
hashline:
|
|
57
|
+
urlSchemes: _deepseek_ai_schemastery9.default<boolean, boolean, "defined">;
|
|
58
|
+
hashline: _deepseek_ai_schemastery9.default<boolean, boolean, "defined">;
|
|
59
59
|
}>>, "plain">;
|
|
60
60
|
/** Register the four URL-aware tools on one agent's own scope layer. */
|
|
61
61
|
/**
|
|
@@ -75,12 +75,12 @@ declare function apply(ctx: Context, config: UrlSchemesConfig | undefined): void
|
|
|
75
75
|
declare const _default: {
|
|
76
76
|
name: string;
|
|
77
77
|
inject: string[];
|
|
78
|
-
Config:
|
|
79
|
-
urlSchemes:
|
|
80
|
-
hashline:
|
|
78
|
+
Config: _deepseek_ai_schemastery9.default<Schemastery.ObjectS<NoInfer<{
|
|
79
|
+
urlSchemes: _deepseek_ai_schemastery9.default<boolean, boolean, "defined">;
|
|
80
|
+
hashline: _deepseek_ai_schemastery9.default<boolean, boolean, "defined">;
|
|
81
81
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
82
|
-
urlSchemes:
|
|
83
|
-
hashline:
|
|
82
|
+
urlSchemes: _deepseek_ai_schemastery9.default<boolean, boolean, "defined">;
|
|
83
|
+
hashline: _deepseek_ai_schemastery9.default<boolean, boolean, "defined">;
|
|
84
84
|
}>>, "plain">;
|
|
85
85
|
apply: typeof apply;
|
|
86
86
|
};
|
package/lib/url-schemes/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { r as __toESM, t as __commonJS } from "../chunk-DQxbwPpZ.js";
|
|
2
2
|
import { t as Schema } from "../lib-C8_jXvwA.js";
|
|
3
|
-
import { a as PACKAGE_ROOT } from "../kernel-env-
|
|
3
|
+
import { a as PACKAGE_ROOT } from "../kernel-env-BLPZE-I3.js";
|
|
4
4
|
import { n as captureNativeTools } from "../native-capture-BEByDXYM.js";
|
|
5
|
-
import { a as createHttpHandler, c as listDvcDevices, d as UrlResolver, f as UrlSchemesError, h as SCHEME_NAMES, i as HTTP_SCHEMES, l as registerDvcDevice, m as parseUrl, n as wrapFsWithSchemes, o as createDvcHandler, p as applySelector, r as resolveDocsDir, s as dispatchDvcWrite, u as createDshHandler } from "../wrap-
|
|
5
|
+
import { a as createHttpHandler, c as listDvcDevices, d as UrlResolver, f as UrlSchemesError, h as SCHEME_NAMES, i as HTTP_SCHEMES, l as registerDvcDevice, m as parseUrl, n as wrapFsWithSchemes, o as createDvcHandler, p as applySelector, r as resolveDocsDir, s as dispatchDvcWrite, u as createDshHandler } from "../wrap-0VA0uFx8.js";
|
|
6
6
|
import { n as Parser } from "../web-tree-sitter-CPrPD4J2.js";
|
|
7
|
-
import { a as primaryServerForFile, c as serversForFile, n as findWorkspaceRoot, o as resolveCommandPath, r as installHintFor, s as serverByName } from "../lsp-server-registry-
|
|
7
|
+
import { a as primaryServerForFile, c as serversForFile, n as findWorkspaceRoot, o as resolveCommandPath, r as installHintFor, s as serverByName } from "../lsp-server-registry-D4VLs1Sm.js";
|
|
8
8
|
import { createRequire } from "node:module";
|
|
9
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
9
10
|
import { createHash, randomUUID } from "node:crypto";
|
|
10
|
-
import {
|
|
11
|
-
import * as fsPromises from "node:fs/promises";
|
|
12
|
-
import { mkdir, mkdtemp, readFile, readdir, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
|
|
11
|
+
import { accessSync, constants, existsSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
13
12
|
import * as path$1 from "node:path";
|
|
14
13
|
import { dirname, isAbsolute, join, posix, relative, resolve, sep } from "node:path";
|
|
15
|
-
import {
|
|
16
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
17
|
-
import { accessSync, constants, existsSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
14
|
+
import { spawn } from "node:child_process";
|
|
18
15
|
import { homedir, tmpdir } from "node:os";
|
|
16
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
19
17
|
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
18
|
+
import * as fsPromises from "node:fs/promises";
|
|
19
|
+
import { mkdir, mkdtemp, readFile, readdir, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
|
|
20
20
|
import { FsError } from "@deepseek-ai/dsh-fs";
|
|
21
21
|
import { ESCALATION_TARGETS, approveEscalation, escalationHintMarker, sandboxDenialMarker, validateEscalationArgs } from "@deepseek-ai/dsh-sandbox";
|
|
22
22
|
import { gunzipSync } from "node:zlib";
|
|
@@ -1435,7 +1435,7 @@ const PUPPETEER_CORE_VERSION = "25.3.0";
|
|
|
1435
1435
|
*/
|
|
1436
1436
|
async function loadPuppeteer() {
|
|
1437
1437
|
if (puppeteerModule === void 0) try {
|
|
1438
|
-
puppeteerModule = await import("../puppeteer-core-
|
|
1438
|
+
puppeteerModule = await import("../puppeteer-core-Bliv_vNf.js");
|
|
1439
1439
|
} catch {
|
|
1440
1440
|
try {
|
|
1441
1441
|
puppeteerModule = await import(pathToFileURL((await ensureVendored({
|
|
@@ -2500,7 +2500,7 @@ function ensureMustHave(gate, language) {
|
|
|
2500
2500
|
if (!MUST_HAVE.has(language) || gate.installTried.has(language)) return;
|
|
2501
2501
|
gate.installTried.add(language);
|
|
2502
2502
|
(async () => {
|
|
2503
|
-
const registry = await import("../lsp-server-registry-
|
|
2503
|
+
const registry = await import("../lsp-server-registry-BcdkHROD.js");
|
|
2504
2504
|
const probePath = `/tmp/x.${language === "python" ? "py" : "ts"}`;
|
|
2505
2505
|
const primary = registry.primaryServerForFile(probePath);
|
|
2506
2506
|
if (primary === null) return;
|
|
@@ -3189,7 +3189,7 @@ async function lspDeviceRead(subpath, session) {
|
|
|
3189
3189
|
if (parsed === void 0) return `unknown read path dvc://lsp/${subpath} — reads: status | diagnostics?file=…[&all=1] | definition?file=&line=[&character=|&symbol=] | references?… | hover?…`;
|
|
3190
3190
|
if (parsed.action === "status") {
|
|
3191
3191
|
const availability = {};
|
|
3192
|
-
const registry = await import("../lsp-server-registry-
|
|
3192
|
+
const registry = await import("../lsp-server-registry-BcdkHROD.js");
|
|
3193
3193
|
for (const language of [
|
|
3194
3194
|
"python",
|
|
3195
3195
|
"typescript",
|
package/lib/web-password.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as Schema } from "./index-DTDXUe6m.js";
|
|
2
1
|
import { Context } from "@deepseek-ai/cordis";
|
|
3
2
|
import { CredentialRecord } from "@deepseek-ai/dsh-credentials";
|
|
4
3
|
import { IncomingMessage } from "node:http";
|
|
4
|
+
import * as _deepseek_ai_schemastery19 from "@deepseek-ai/schemastery";
|
|
5
5
|
|
|
6
6
|
//#region src/web-password.d.ts
|
|
7
7
|
|
|
@@ -123,10 +123,10 @@ interface WebPasswordConfig {
|
|
|
123
123
|
/** Absolute browser-session lifetime in days. Default: 30 (the native default). */
|
|
124
124
|
cookieMaxAgeDays?: number;
|
|
125
125
|
}
|
|
126
|
-
declare const Config:
|
|
127
|
-
cookieMaxAgeDays:
|
|
126
|
+
declare const Config: _deepseek_ai_schemastery19.default<Schemastery.ObjectS<NoInfer<{
|
|
127
|
+
cookieMaxAgeDays: _deepseek_ai_schemastery19.default<number, number, "defined">;
|
|
128
128
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
129
|
-
cookieMaxAgeDays:
|
|
129
|
+
cookieMaxAgeDays: _deepseek_ai_schemastery19.default<number, number, "defined">;
|
|
130
130
|
}>>, "plain">;
|
|
131
131
|
/** Cordis plugin name; also the scope of this row's credential record. */
|
|
132
132
|
declare const name = "dashr-web-password";
|
|
@@ -145,10 +145,10 @@ declare function apply(ctx: Context, config?: WebPasswordConfig): void;
|
|
|
145
145
|
declare const _default: {
|
|
146
146
|
name: string;
|
|
147
147
|
inject: string[];
|
|
148
|
-
Config:
|
|
149
|
-
cookieMaxAgeDays:
|
|
148
|
+
Config: _deepseek_ai_schemastery19.default<Schemastery.ObjectS<NoInfer<{
|
|
149
|
+
cookieMaxAgeDays: _deepseek_ai_schemastery19.default<number, number, "defined">;
|
|
150
150
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
151
|
-
cookieMaxAgeDays:
|
|
151
|
+
cookieMaxAgeDays: _deepseek_ai_schemastery19.default<number, number, "defined">;
|
|
152
152
|
}>>, "plain">;
|
|
153
153
|
apply: typeof apply;
|
|
154
154
|
};
|
package/lib/web-password.js
CHANGED
|
@@ -388,6 +388,10 @@ var PasswordGate = class {
|
|
|
388
388
|
*/
|
|
389
389
|
async handle(req, res) {
|
|
390
390
|
try {
|
|
391
|
+
if (this.ctx.get("profileContext")?.name === "desktop" && req.method === "GET" && new URL(req.url ?? "/", "http://dsh.invalid").searchParams.has("token")) {
|
|
392
|
+
this.ctx.connection.authorizeIndex(req, res);
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
391
395
|
const state = await this.gateState();
|
|
392
396
|
if (req.method === "POST") {
|
|
393
397
|
await this.handleLogin(req, res, state);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as Schema } from "./index-DTDXUe6m.js";
|
|
2
1
|
import { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import * as _deepseek_ai_schemastery0 from "@deepseek-ai/schemastery";
|
|
3
3
|
|
|
4
4
|
//#region src/web-trust.d.ts
|
|
5
5
|
|
|
@@ -76,12 +76,12 @@ interface TrustConfig {
|
|
|
76
76
|
trustedPageAuthorities?: readonly string[];
|
|
77
77
|
}
|
|
78
78
|
/** Row config schema (schema-level default derives from `DSH_TRUSTED_HOSTS`). */
|
|
79
|
-
declare const Config:
|
|
80
|
-
trustAllHosts:
|
|
81
|
-
trustedPageAuthorities:
|
|
79
|
+
declare const Config: _deepseek_ai_schemastery0.default<Schemastery.ObjectS<NoInfer<{
|
|
80
|
+
trustAllHosts: _deepseek_ai_schemastery0.default<boolean, boolean, "defined">;
|
|
81
|
+
trustedPageAuthorities: _deepseek_ai_schemastery0.default<string[], string[], "defined">;
|
|
82
82
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
83
|
-
trustAllHosts:
|
|
84
|
-
trustedPageAuthorities:
|
|
83
|
+
trustAllHosts: _deepseek_ai_schemastery0.default<boolean, boolean, "defined">;
|
|
84
|
+
trustedPageAuthorities: _deepseek_ai_schemastery0.default<string[], string[], "defined">;
|
|
85
85
|
}>>, "plain">;
|
|
86
86
|
/** Cordis plugin name. */
|
|
87
87
|
declare const name = "dashr-web-trust";
|
|
@@ -100,12 +100,12 @@ declare function apply(ctx: Context, config: TrustConfig | undefined): void;
|
|
|
100
100
|
declare const _default: {
|
|
101
101
|
name: string;
|
|
102
102
|
inject: string[];
|
|
103
|
-
Config:
|
|
104
|
-
trustAllHosts:
|
|
105
|
-
trustedPageAuthorities:
|
|
103
|
+
Config: _deepseek_ai_schemastery0.default<Schemastery.ObjectS<NoInfer<{
|
|
104
|
+
trustAllHosts: _deepseek_ai_schemastery0.default<boolean, boolean, "defined">;
|
|
105
|
+
trustedPageAuthorities: _deepseek_ai_schemastery0.default<string[], string[], "defined">;
|
|
106
106
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
107
|
-
trustAllHosts:
|
|
108
|
-
trustedPageAuthorities:
|
|
107
|
+
trustAllHosts: _deepseek_ai_schemastery0.default<boolean, boolean, "defined">;
|
|
108
|
+
trustedPageAuthorities: _deepseek_ai_schemastery0.default<string[], string[], "defined">;
|
|
109
109
|
}>>, "plain">;
|
|
110
110
|
apply: typeof apply;
|
|
111
111
|
};
|
package/lib/web-trust.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { a as _default, c as buildTrustScript, d as name, i as TrustConfig, l as deriveDefaultPageAuthorities, n as Config, o as apply, r as MobileConfig, s as buildMobileScript, t as BootScriptRow, u as inject } from "./web-trust-Dej_RI2B.js";
|
|
1
|
+
import { a as _default, c as buildTrustScript, d as name, i as TrustConfig, l as deriveDefaultPageAuthorities, n as Config, o as apply, r as MobileConfig, s as buildMobileScript, t as BootScriptRow, u as inject } from "./web-trust-C_Y6o8Z2.js";
|
|
3
2
|
export { BootScriptRow, Config, MobileConfig, TrustConfig, apply, buildMobileScript, buildTrustScript, _default as default, deriveDefaultPageAuthorities, inject, name };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-dsh",
|
|
3
|
-
"version": "0.3.0-
|
|
3
|
+
"version": "0.3.0-e",
|
|
4
4
|
"description": "Make your dsh ready for serious coding tasks. (Tools x Schemas)^REPL. `skill://`, `ctx://`, `agent://`, `dvc://`, `dsh://`, IPython REPL, Context as Variables, cross compactions recallable, full context revive. `hash-edit`, `dvc://browser`, subagent as function, workflow as function.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -60,10 +60,6 @@
|
|
|
60
60
|
"types": "./lib/webserver.d.ts",
|
|
61
61
|
"default": "./lib/webserver.js"
|
|
62
62
|
},
|
|
63
|
-
"./bundle-delivery": {
|
|
64
|
-
"types": "./lib/bundle-delivery.d.ts",
|
|
65
|
-
"default": "./lib/bundle-delivery.js"
|
|
66
|
-
},
|
|
67
63
|
"./hmr": {
|
|
68
64
|
"types": "./lib/hmr.d.ts",
|
|
69
65
|
"default": "./lib/hmr.js"
|
|
@@ -83,8 +79,7 @@
|
|
|
83
79
|
"cordis.patch.yml",
|
|
84
80
|
"eval-description.md",
|
|
85
81
|
"url-schemes-instruction.md",
|
|
86
|
-
"scripts/kernel-provision.mjs"
|
|
87
|
-
"scripts/register-bundle.mjs"
|
|
82
|
+
"scripts/kernel-provision.mjs"
|
|
88
83
|
],
|
|
89
84
|
"scripts": {
|
|
90
85
|
"prebuild": "node scripts/copy-docs.mjs",
|
package/lib/bundle-delivery.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ProfileContext } from "@deepseek-ai/dsh-app-boot";
|
|
2
|
-
import { Context } from "@deepseek-ai/cordis";
|
|
3
|
-
|
|
4
|
-
//#region src/bundle-delivery.d.ts
|
|
5
|
-
declare const name = "dashr-bundle-delivery";
|
|
6
|
-
declare const inject: string[];
|
|
7
|
-
interface DeliveryResult {
|
|
8
|
-
installed: string[];
|
|
9
|
-
restartRequired: boolean;
|
|
10
|
-
}
|
|
11
|
-
/** First registration enables a companion; native reconciliation preserves retained disablement. */
|
|
12
|
-
declare function reconcileBundledDelivery(profile: ProfileContext, signal?: AbortSignal): Promise<DeliveryResult>;
|
|
13
|
-
declare function apply(ctx: Context): void;
|
|
14
|
-
declare const _default: {
|
|
15
|
-
name: string;
|
|
16
|
-
inject: string[];
|
|
17
|
-
apply: typeof apply;
|
|
18
|
-
};
|
|
19
|
-
//#endregion
|
|
20
|
-
export { apply, _default as default, inject, name, reconcileBundledDelivery };
|
package/lib/bundle-delivery.js
DELETED
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
-
import { spawn } from "node:child_process";
|
|
3
|
-
import { mkdir, readFile, realpath, rename, rm, writeFile } from "node:fs/promises";
|
|
4
|
-
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
5
|
-
import { fileURLToPath } from "node:url";
|
|
6
|
-
import { withFileLock, writeFileAtomic } from "@deepseek-ai/dsh-atomic-write";
|
|
7
|
-
import * as AppBoot from "@deepseek-ai/dsh-app-boot";
|
|
8
|
-
|
|
9
|
-
//#region src/bundle-delivery.ts
|
|
10
|
-
const name = "dashr-bundle-delivery";
|
|
11
|
-
const inject = ["profileContext", "appReady"];
|
|
12
|
-
const hash = (bytes) => createHash("sha256").update(bytes).digest("hex");
|
|
13
|
-
const nativePackages = AppBoot.PluginPackages?.prototype;
|
|
14
|
-
const restartForPromotion = nativePackages !== void 0 && typeof Reflect.get(nativePackages, "refresh") === "function";
|
|
15
|
-
const json = async (path$1) => JSON.parse(await readFile(path$1, "utf8"));
|
|
16
|
-
async function optionalJson(path$1) {
|
|
17
|
-
try {
|
|
18
|
-
return await json(path$1);
|
|
19
|
-
} catch (error) {
|
|
20
|
-
if (error.code === "ENOENT") return void 0;
|
|
21
|
-
throw error;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
async function contained(root, path$1) {
|
|
25
|
-
if (isAbsolute(path$1)) throw new Error("Pack delivery path must be relative");
|
|
26
|
-
const base = await realpath(root), file = await realpath(resolve(base, path$1));
|
|
27
|
-
const rel = relative(base, file);
|
|
28
|
-
if (rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`) || isAbsolute(rel)) throw new Error("Pack delivery path escapes its owner");
|
|
29
|
-
return file;
|
|
30
|
-
}
|
|
31
|
-
/** A child process avoids inheriting a running HMR transaction's AsyncLocalStorage. */
|
|
32
|
-
async function installNative(profile, archive, expected, signal) {
|
|
33
|
-
signal?.throwIfAborted();
|
|
34
|
-
const childScript = fileURLToPath(new URL("../scripts/register-bundle.mjs", import.meta.url));
|
|
35
|
-
return new Promise((done, fail) => {
|
|
36
|
-
const child = spawn(process.execPath, [childScript], {
|
|
37
|
-
stdio: [
|
|
38
|
-
"pipe",
|
|
39
|
-
"pipe",
|
|
40
|
-
"pipe"
|
|
41
|
-
],
|
|
42
|
-
cwd: profile.dir
|
|
43
|
-
});
|
|
44
|
-
let output = "", diagnostic = "";
|
|
45
|
-
const abort = () => {
|
|
46
|
-
child.kill("SIGTERM");
|
|
47
|
-
};
|
|
48
|
-
const timeout = setTimeout(abort, 36e4);
|
|
49
|
-
signal?.addEventListener("abort", abort, { once: true });
|
|
50
|
-
child.stdout.setEncoding("utf8").on("data", (chunk) => {
|
|
51
|
-
output = (output + chunk).slice(-32768);
|
|
52
|
-
});
|
|
53
|
-
child.stderr.setEncoding("utf8").on("data", (chunk) => {
|
|
54
|
-
diagnostic = (diagnostic + chunk).slice(-4096);
|
|
55
|
-
});
|
|
56
|
-
child.on("error", fail);
|
|
57
|
-
child.on("close", (code) => {
|
|
58
|
-
clearTimeout(timeout);
|
|
59
|
-
signal?.removeEventListener("abort", abort);
|
|
60
|
-
if (signal?.aborted) {
|
|
61
|
-
fail(signal.reason);
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
if (code !== 0) {
|
|
65
|
-
fail(/* @__PURE__ */ new Error(`Native companion registration failed (${code}): ${diagnostic.trim() || output.trim()}`));
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
try {
|
|
69
|
-
const result = JSON.parse(output);
|
|
70
|
-
if (result.exitCode !== 0) fail(/* @__PURE__ */ new Error(`Native companion registration failed (${result.exitCode}); diagnostics: ${result.logPath ?? "unavailable"}`));
|
|
71
|
-
else if (![
|
|
72
|
-
"installed",
|
|
73
|
-
"owner-changed",
|
|
74
|
-
"companion-changed",
|
|
75
|
-
"companion-removed"
|
|
76
|
-
].includes(result.disposition)) fail(/* @__PURE__ */ new Error("Native companion registration returned an invalid disposition"));
|
|
77
|
-
else done(result.disposition);
|
|
78
|
-
} catch (error) {
|
|
79
|
-
fail(error);
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
child.stdin.on("error", () => {});
|
|
83
|
-
child.stdin.end(JSON.stringify({
|
|
84
|
-
profile,
|
|
85
|
-
archive,
|
|
86
|
-
expected
|
|
87
|
-
}));
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
/** First registration enables a companion; native reconciliation preserves retained disablement. */
|
|
91
|
-
async function reconcileBundledDelivery(profile, signal) {
|
|
92
|
-
const directory = join(profile.home, "bundle-artifacts");
|
|
93
|
-
await mkdir(directory, {
|
|
94
|
-
recursive: true,
|
|
95
|
-
mode: 448
|
|
96
|
-
});
|
|
97
|
-
const key = hash(profile.dir);
|
|
98
|
-
return withFileLock(join(directory, key + ".delivery"), async () => {
|
|
99
|
-
signal?.throwIfAborted();
|
|
100
|
-
const receiptPath = join(directory, key + ".json");
|
|
101
|
-
const receipts = await optionalJson(receiptPath) ?? {};
|
|
102
|
-
const manifest = await json(join(profile.dir, "package.json"));
|
|
103
|
-
const result = {
|
|
104
|
-
installed: [],
|
|
105
|
-
restartRequired: false
|
|
106
|
-
};
|
|
107
|
-
for (const owner of Object.keys(manifest.dependencies ?? {})) {
|
|
108
|
-
const ownerDir = join(profile.dir, "node_modules", owner);
|
|
109
|
-
const ownerManifest = await optionalJson(join(ownerDir, "package.json"));
|
|
110
|
-
if (ownerManifest?.superd?.delivery === void 0) continue;
|
|
111
|
-
const descriptorPath = await contained(ownerDir, ownerManifest.superd.delivery);
|
|
112
|
-
const descriptor = await json(descriptorPath);
|
|
113
|
-
if (!Array.isArray(descriptor.companions)) throw new Error("Invalid pack delivery descriptor");
|
|
114
|
-
for (const item of descriptor.companions) {
|
|
115
|
-
if (item.name !== "better-dsh" || item.version !== ownerManifest.dependencies?.[item.name] || !/^[a-f0-9]{64}$/.test(item.sha256)) throw new Error("Invalid companion identity/version/digest");
|
|
116
|
-
const bytes = await readFile(await contained(dirname(descriptorPath), item.tarball));
|
|
117
|
-
if (hash(bytes) !== item.sha256) throw new Error(`Pack companion SHA256 mismatch: ${item.name}`);
|
|
118
|
-
const archive = join(directory, `${item.name}-${item.sha256}.tgz`);
|
|
119
|
-
const cached = await optionalJson(join(profile.dir, "node_modules", item.name, "package.json"));
|
|
120
|
-
const current = await json(join(profile.dir, "package.json"));
|
|
121
|
-
const ownerSpec = current.dependencies?.[owner];
|
|
122
|
-
if (ownerSpec === void 0) continue;
|
|
123
|
-
const priorSpec = current.dependencies?.[item.name];
|
|
124
|
-
const receiptKey = `${owner}:${item.name}`;
|
|
125
|
-
if (priorSpec === void 0 && receipts[receiptKey] === item.sha256) continue;
|
|
126
|
-
if (priorSpec === "file:" + archive && cached?.name === item.name && cached.version === item.version) {
|
|
127
|
-
receipts[receiptKey] = item.sha256;
|
|
128
|
-
await writeFileAtomic(receiptPath, JSON.stringify(receipts) + "\n", { mode: 384 });
|
|
129
|
-
continue;
|
|
130
|
-
}
|
|
131
|
-
try {
|
|
132
|
-
if (hash(await readFile(archive)) !== item.sha256) throw new Error(`Cached companion SHA256 mismatch: ${item.name}`);
|
|
133
|
-
} catch (error) {
|
|
134
|
-
if (error.code !== "ENOENT") throw error;
|
|
135
|
-
const temporary = archive + "." + randomUUID() + ".tmp";
|
|
136
|
-
try {
|
|
137
|
-
await writeFile(temporary, bytes, {
|
|
138
|
-
flag: "wx",
|
|
139
|
-
mode: 384
|
|
140
|
-
});
|
|
141
|
-
await rename(temporary, archive);
|
|
142
|
-
} finally {
|
|
143
|
-
await rm(temporary, { force: true });
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
signal?.throwIfAborted();
|
|
147
|
-
const disposition = await installNative(profile, archive, {
|
|
148
|
-
owner,
|
|
149
|
-
ownerSpec,
|
|
150
|
-
companion: item,
|
|
151
|
-
...priorSpec === void 0 ? {} : { priorSpec }
|
|
152
|
-
}, signal);
|
|
153
|
-
if (disposition === "owner-changed" || disposition === "companion-changed") continue;
|
|
154
|
-
receipts[receiptKey] = item.sha256;
|
|
155
|
-
await writeFileAtomic(receiptPath, JSON.stringify(receipts) + "\n", { mode: 384 });
|
|
156
|
-
if (disposition === "companion-removed") continue;
|
|
157
|
-
result.installed.push(`${item.name}@${item.version}`);
|
|
158
|
-
result.restartRequired ||= priorSpec !== void 0 || restartForPromotion;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
return result;
|
|
162
|
-
}, { waitMs: 12e4 });
|
|
163
|
-
}
|
|
164
|
-
function apply(ctx) {
|
|
165
|
-
const signal = new AbortController();
|
|
166
|
-
let started = false, running = false, again = false;
|
|
167
|
-
const reconcile = async () => {
|
|
168
|
-
if (!started || signal.signal.aborted) return;
|
|
169
|
-
if (running) {
|
|
170
|
-
again = true;
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
|
-
running = true;
|
|
174
|
-
try {
|
|
175
|
-
const result = await reconcileBundledDelivery(ctx.profileContext, signal.signal);
|
|
176
|
-
if (result.installed.length) {
|
|
177
|
-
ctx.logger.info(`Registered ${result.installed.join(", ")} from its containing local pack${result.restartRequired ? "; restart DSH to use the updated code" : ""}`);
|
|
178
|
-
ctx.emit("plugin-manager/changed", { reason: "install" });
|
|
179
|
-
}
|
|
180
|
-
} catch (error) {
|
|
181
|
-
if (!signal.signal.aborted) ctx.logger.error("Local pack companion registration failed; retry by re-enabling the bundle", error);
|
|
182
|
-
} finally {
|
|
183
|
-
running = false;
|
|
184
|
-
if (again && !signal.signal.aborted) {
|
|
185
|
-
again = false;
|
|
186
|
-
reconcile();
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
ctx.effect(() => {
|
|
191
|
-
const offReady = ctx.appReady.onReady(() => {
|
|
192
|
-
started = true;
|
|
193
|
-
reconcile();
|
|
194
|
-
});
|
|
195
|
-
const offChange = ctx.on("plugin-manager/changed", () => {
|
|
196
|
-
reconcile();
|
|
197
|
-
});
|
|
198
|
-
return () => {
|
|
199
|
-
offReady();
|
|
200
|
-
offChange();
|
|
201
|
-
signal.abort();
|
|
202
|
-
};
|
|
203
|
-
}, "bundle-delivery: native registration");
|
|
204
|
-
}
|
|
205
|
-
var bundle_delivery_default = {
|
|
206
|
-
name,
|
|
207
|
-
inject,
|
|
208
|
-
apply
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
//#endregion
|
|
212
|
-
export { apply, bundle_delivery_default as default, inject, name, reconcileBundledDelivery };
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// Separate-process entry for the SAME native package operations used by dsh plugin.
|
|
2
|
-
// No shell interpolation, package scripts, upstream edits, or companion registry lookup.
|
|
3
|
-
import { createRequire } from 'node:module'
|
|
4
|
-
import { createHash } from 'node:crypto'
|
|
5
|
-
import { readFile, realpath } from 'node:fs/promises'
|
|
6
|
-
import { dirname, join, relative, resolve, isAbsolute, sep } from 'node:path'
|
|
7
|
-
import { pathToFileURL } from 'node:url'
|
|
8
|
-
let input = ''
|
|
9
|
-
for await (const bytes of process.stdin) input += bytes
|
|
10
|
-
const {profile,archive,expected} = JSON.parse(input)
|
|
11
|
-
const require = createRequire(profile.installAnchor)
|
|
12
|
-
const {runProfilePnpm} = await import(pathToFileURL(require.resolve('@deepseek-ai/dsh-plugin-manager/operations')).href)
|
|
13
|
-
const {withFileLock} = await import(pathToFileURL(require.resolve('@deepseek-ai/dsh-atomic-write')).href)
|
|
14
|
-
const abort = new AbortController()
|
|
15
|
-
process.once('SIGTERM', () => abort.abort())
|
|
16
|
-
const json = async path => JSON.parse(await readFile(path, 'utf8'))
|
|
17
|
-
const hash = bytes => createHash('sha256').update(bytes).digest('hex')
|
|
18
|
-
async function contained(root, path) {
|
|
19
|
-
if (typeof path !== 'string' || isAbsolute(path)) throw new Error('Pack delivery path must be relative')
|
|
20
|
-
const base = await realpath(root), file = await realpath(resolve(base, path)), rel = relative(base, file)
|
|
21
|
-
if (rel === '..' || rel.startsWith('..' + sep) || isAbsolute(rel)) throw new Error('Pack delivery path escapes its owner')
|
|
22
|
-
return file
|
|
23
|
-
}
|
|
24
|
-
const skipped = disposition => ({ exitCode: 0, disposition })
|
|
25
|
-
// Complete each native acquisition/release before observing cancellation;
|
|
26
|
-
// exiting during its async lock-file write can strand incomplete lock metadata.
|
|
27
|
-
async function withCancellableProfileLock(operation) {
|
|
28
|
-
const path = join(profile.dir, 'package.json'), deadline = Date.now() + 120000
|
|
29
|
-
for (;;) {
|
|
30
|
-
abort.signal.throwIfAborted()
|
|
31
|
-
let acquired = false
|
|
32
|
-
try {
|
|
33
|
-
return await withFileLock(path, async () => {
|
|
34
|
-
acquired = true
|
|
35
|
-
abort.signal.throwIfAborted()
|
|
36
|
-
return operation()
|
|
37
|
-
}, { waitMs: Math.min(250, Math.max(0, deadline - Date.now())) })
|
|
38
|
-
} catch (error) {
|
|
39
|
-
abort.signal.throwIfAborted()
|
|
40
|
-
if (acquired || Date.now() >= deadline
|
|
41
|
-
|| error.message !== `atomic-write: timed out waiting for the writer lock at ${path}.lock`) throw error
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
const result = await withCancellableProfileLock(async () => {
|
|
46
|
-
abort.signal.throwIfAborted()
|
|
47
|
-
const current = await json(join(profile.dir, 'package.json'))
|
|
48
|
-
if (typeof expected.ownerSpec !== 'string' || current.dependencies?.[expected.owner] !== expected.ownerSpec) return skipped('owner-changed')
|
|
49
|
-
const ownerDir = join(profile.dir, 'node_modules', expected.owner)
|
|
50
|
-
let owner, descriptorPath, descriptor
|
|
51
|
-
try {
|
|
52
|
-
owner = await json(join(ownerDir, 'package.json'))
|
|
53
|
-
if (owner.dependencies?.[expected.companion.name] !== expected.companion.version || owner.superd?.delivery === undefined) return skipped('owner-changed')
|
|
54
|
-
descriptorPath = await contained(ownerDir, owner.superd.delivery)
|
|
55
|
-
descriptor = await json(descriptorPath)
|
|
56
|
-
} catch (error) {
|
|
57
|
-
if (error.code === 'ENOENT') return skipped('owner-changed')
|
|
58
|
-
throw error
|
|
59
|
-
}
|
|
60
|
-
const item = descriptor.companions?.find(item => item.name === expected.companion.name)
|
|
61
|
-
if (item?.version !== expected.companion.version || item.sha256 !== expected.companion.sha256
|
|
62
|
-
|| hash(await readFile(await contained(dirname(descriptorPath), item.tarball))) !== expected.companion.sha256) return skipped('owner-changed')
|
|
63
|
-
const prior = current.dependencies?.[item.name]
|
|
64
|
-
if (prior !== expected.priorSpec) return skipped(prior === undefined && expected.priorSpec !== undefined ? 'companion-removed' : 'companion-changed')
|
|
65
|
-
if (hash(await readFile(archive)) !== item.sha256) throw new Error('Cached companion SHA256 mismatch')
|
|
66
|
-
abort.signal.throwIfAborted()
|
|
67
|
-
// Same public operation and writer lock used by the native Plugin Manager;
|
|
68
|
-
// intent is checked after acquisition, before a queued install can undo removal.
|
|
69
|
-
const operation = await runProfilePnpm({profile:profile.name,dir:profile.dir,installAnchor:profile.installAnchor,cwd:profile.dir,home:profile.home}, ['add','file:'+archive,'--ignore-scripts'], {
|
|
70
|
-
...profile.packageManager, execution:'service', signal:abort.signal, outputBytes:16384,
|
|
71
|
-
lookupTimeoutMs:120000, idleTimeoutMs:120000,
|
|
72
|
-
})
|
|
73
|
-
if (operation.exitCode === 0) {
|
|
74
|
-
const installed = await json(join(profile.dir, 'node_modules', item.name, 'package.json'))
|
|
75
|
-
const after = await json(join(profile.dir, 'package.json'))
|
|
76
|
-
if (installed.name !== item.name || installed.version !== item.version || after.dependencies?.[item.name] !== 'file:' + archive) throw new Error('Native companion registration did not install the exact local artifact')
|
|
77
|
-
}
|
|
78
|
-
return { exitCode: operation.exitCode, logPath: operation.logPath, disposition: 'installed' }
|
|
79
|
-
})
|
|
80
|
-
process.stdout.write(JSON.stringify(result)+'\n')
|