better-dsh 0.3.0 → 0.3.1
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 +49 -178
- package/cordis.patch.yml +4 -35
- package/docs/adr/0015-independent-bundles-agent-remote.md +40 -0
- package/docs/remote-tools.md +56 -0
- package/docs/specs/omp-python-repl-port/runtime-guide.md +33 -0
- package/docs/specs/omp-python-repl-port/spec.md +61 -0
- package/docs/specs/remote-tool-enhancement/spec.md +203 -0
- package/dsh-docs/baseline.md +13 -0
- package/dsh-docs/subsystems/invariants.md +3 -0
- package/dsh-docs/subsystems/invariants.zh.md +3 -0
- package/eval-description.md +7 -3
- package/lib/{LaunchOptions-kGXcZOe0.js → LaunchOptions-5eg7E0ye.js} +1 -1
- package/lib/LaunchOptions-DxQQ0s-A.js +4 -0
- package/lib/{bidi-BalpKaJc.js → bidi-CwabFH07.js} +1 -1
- package/lib/client/index.js +30 -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-B-9jm12n.js} +4 -4
- package/lib/index.d.ts +17 -41
- package/lib/index.js +473 -1678
- package/lib/kernel-env-BOF0fNHn.js +91 -0
- package/lib/kernel-env.d.ts +4 -58
- package/lib/kernel-env.js +2 -2
- 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-CupOhMp5.js → main-BeCgUd20.js} +8 -6
- package/lib/{main-BQeFrBM1.js → main-Dv_UQqG2.js} +1 -1
- package/lib/mobile/plugin.d.ts +1 -1
- package/lib/omp-python/DILL-LICENSE +35 -0
- package/lib/omp-python/OMP-LICENSE +23 -0
- package/lib/omp-python/better_snapshot.py +391 -0
- package/lib/omp-python/better_support.py +425 -0
- package/lib/omp-python/dill-provenance.json +55 -0
- package/lib/omp-python/provenance.json +13 -0
- package/lib/omp-python/runner.py +2499 -0
- package/lib/omp-python/vendor/dill/__diff.py +234 -0
- package/lib/omp-python/vendor/dill/__info__.py +291 -0
- package/lib/omp-python/vendor/dill/__init__.py +119 -0
- package/lib/omp-python/vendor/dill/_dill.py +2265 -0
- package/lib/omp-python/vendor/dill/_objects.py +545 -0
- package/lib/omp-python/vendor/dill/_shims.py +193 -0
- package/lib/omp-python/vendor/dill/detect.py +287 -0
- package/lib/omp-python/vendor/dill/logger.py +285 -0
- package/lib/omp-python/vendor/dill/objtypes.py +24 -0
- package/lib/omp-python/vendor/dill/pointers.py +122 -0
- package/lib/omp-python/vendor/dill/session.py +612 -0
- package/lib/omp-python/vendor/dill/settings.py +25 -0
- package/lib/omp-python/vendor/dill/source.py +1025 -0
- package/lib/omp-python/vendor/dill/temp.py +252 -0
- package/lib/{puppeteer-core-CSk2PtSm.js → puppeteer-core-Dnd7eqel.js} +9 -9
- package/lib/remote/plugin.d.ts +459 -5
- package/lib/remote/plugin.js +2389 -210
- package/lib/url-schemes/index.d.ts +11 -11
- package/lib/url-schemes/index.js +12 -12
- package/lib/web-password.d.ts +8 -8
- package/lib/web-password.js +5 -1
- package/lib/{web-trust-Dej_RI2B.d.ts → web-trust-CwZrTBcl.d.ts} +11 -11
- package/lib/web-trust.d.ts +1 -2
- package/lib/welcome-notice.d.ts +5 -7
- package/lib/welcome-notice.js +9 -48
- package/lib/{wrap-T4I0nfPM.js → wrap-0VA0uFx8.js} +1 -1
- package/package.json +6 -23
- package/scripts/kernel-provision.mjs +4 -34
- package/lib/LaunchOptions-B874eBu2.js +0 -4
- package/lib/bundle-delivery.d.ts +0 -20
- package/lib/bundle-delivery.js +0 -209
- package/lib/hmr.d.ts +0 -32
- package/lib/hmr.js +0 -49
- package/lib/kernel-bridge.py +0 -172
- package/lib/kernel-env-D8UOWeji.js +0 -195
- package/lib/webserver.d.ts +0 -10
- package/lib/webserver.js +0 -19
- package/scripts/register-bundle.mjs +0 -80
|
@@ -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_schemastery17 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_schemastery17.default<Schemastery.ObjectS<NoInfer<{
|
|
54
|
+
urlSchemes: _deepseek_ai_schemastery17.default<boolean, boolean, "defined">;
|
|
55
|
+
hashline: _deepseek_ai_schemastery17.default<boolean, boolean, "defined">;
|
|
56
56
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
57
|
-
urlSchemes:
|
|
58
|
-
hashline:
|
|
57
|
+
urlSchemes: _deepseek_ai_schemastery17.default<boolean, boolean, "defined">;
|
|
58
|
+
hashline: _deepseek_ai_schemastery17.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_schemastery17.default<Schemastery.ObjectS<NoInfer<{
|
|
79
|
+
urlSchemes: _deepseek_ai_schemastery17.default<boolean, boolean, "defined">;
|
|
80
|
+
hashline: _deepseek_ai_schemastery17.default<boolean, boolean, "defined">;
|
|
81
81
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
82
|
-
urlSchemes:
|
|
83
|
-
hashline:
|
|
82
|
+
urlSchemes: _deepseek_ai_schemastery17.default<boolean, boolean, "defined">;
|
|
83
|
+
hashline: _deepseek_ai_schemastery17.default<boolean, boolean, "defined">;
|
|
84
84
|
}>>, "plain">;
|
|
85
85
|
apply: typeof apply;
|
|
86
86
|
};
|
package/lib/url-schemes/index.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
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 {
|
|
3
|
+
import { i as PACKAGE_ROOT } from "../kernel-env-BOF0fNHn.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
9
|
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";
|
|
10
|
+
import { accessSync, constants, existsSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
13
11
|
import * as path$1 from "node:path";
|
|
14
12
|
import { dirname, isAbsolute, join, posix, relative, resolve, sep } from "node:path";
|
|
13
|
+
import { spawn } from "node:child_process";
|
|
15
14
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
16
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
17
|
-
import { accessSync, constants, existsSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
18
|
-
import { homedir, tmpdir } from "node:os";
|
|
19
15
|
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
16
|
+
import * as fsPromises from "node:fs/promises";
|
|
17
|
+
import { lstat, mkdir, mkdtemp, readFile, readdir, readlink, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
|
|
20
18
|
import { FsError } from "@deepseek-ai/dsh-fs";
|
|
21
19
|
import { ESCALATION_TARGETS, approveEscalation, escalationHintMarker, sandboxDenialMarker, validateEscalationArgs } from "@deepseek-ai/dsh-sandbox";
|
|
20
|
+
import { homedir, tmpdir } from "node:os";
|
|
22
21
|
import { gunzipSync } from "node:zlib";
|
|
23
22
|
import { SessionId } from "@deepseek-ai/dsh-session";
|
|
24
23
|
import { resolveDshHome } from "@deepseek-ai/dsh-home-paths";
|
|
25
24
|
import { DatabaseSync } from "node:sqlite";
|
|
25
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
26
26
|
|
|
27
27
|
//#region src/devices/ast/engine/grammar-manifest.mjs
|
|
28
28
|
/**
|
|
@@ -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-Dnd7eqel.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
|
-
import { CredentialRecord } from "@deepseek-ai/dsh-credentials";
|
|
4
2
|
import { IncomingMessage } from "node:http";
|
|
3
|
+
import { CredentialRecord } from "@deepseek-ai/dsh-credentials";
|
|
4
|
+
import * as _deepseek_ai_schemastery11 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_schemastery11.default<Schemastery.ObjectS<NoInfer<{
|
|
127
|
+
cookieMaxAgeDays: _deepseek_ai_schemastery11.default<number, number, "defined">;
|
|
128
128
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
129
|
-
cookieMaxAgeDays:
|
|
129
|
+
cookieMaxAgeDays: _deepseek_ai_schemastery11.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_schemastery11.default<Schemastery.ObjectS<NoInfer<{
|
|
149
|
+
cookieMaxAgeDays: _deepseek_ai_schemastery11.default<number, number, "defined">;
|
|
150
150
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
151
|
-
cookieMaxAgeDays:
|
|
151
|
+
cookieMaxAgeDays: _deepseek_ai_schemastery11.default<number, number, "defined">;
|
|
152
152
|
}>>, "plain">;
|
|
153
153
|
apply: typeof apply;
|
|
154
154
|
};
|
package/lib/web-password.js
CHANGED
|
@@ -335,7 +335,7 @@ async function resolveDistIndex() {
|
|
|
335
335
|
* @returns the markup with `<base href="./">` after the head open tag.
|
|
336
336
|
*/
|
|
337
337
|
function withBaseHref(html) {
|
|
338
|
-
return html.replace(/<head(?:\s[^>]*)?>/i, (open) => `${open}<base href="./">`);
|
|
338
|
+
return html.replace(/<head(?:\s[^>]*)?>/i, (open$1) => `${open$1}<base href="./">`);
|
|
339
339
|
}
|
|
340
340
|
/**
|
|
341
341
|
* The root-route gate: one exact `/` handler owning the door, and the only
|
|
@@ -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_schemastery1 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_schemastery1.default<Schemastery.ObjectS<NoInfer<{
|
|
80
|
+
trustAllHosts: _deepseek_ai_schemastery1.default<boolean, boolean, "defined">;
|
|
81
|
+
trustedPageAuthorities: _deepseek_ai_schemastery1.default<string[], string[], "defined">;
|
|
82
82
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
83
|
-
trustAllHosts:
|
|
84
|
-
trustedPageAuthorities:
|
|
83
|
+
trustAllHosts: _deepseek_ai_schemastery1.default<boolean, boolean, "defined">;
|
|
84
|
+
trustedPageAuthorities: _deepseek_ai_schemastery1.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_schemastery1.default<Schemastery.ObjectS<NoInfer<{
|
|
104
|
+
trustAllHosts: _deepseek_ai_schemastery1.default<boolean, boolean, "defined">;
|
|
105
|
+
trustedPageAuthorities: _deepseek_ai_schemastery1.default<string[], string[], "defined">;
|
|
106
106
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
107
|
-
trustAllHosts:
|
|
108
|
-
trustedPageAuthorities:
|
|
107
|
+
trustAllHosts: _deepseek_ai_schemastery1.default<boolean, boolean, "defined">;
|
|
108
|
+
trustedPageAuthorities: _deepseek_ai_schemastery1.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-CwZrTBcl.js";
|
|
3
2
|
export { BootScriptRow, Config, MobileConfig, TrustConfig, apply, buildMobileScript, buildTrustScript, _default as default, deriveDefaultPageAuthorities, inject, name };
|
package/lib/welcome-notice.d.ts
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import * as _deepseek_ai_schemastery0 from "@deepseek-ai/schemastery";
|
|
2
3
|
|
|
3
4
|
//#region src/welcome-notice.d.ts
|
|
4
5
|
declare const name = "dashr-welcome-notice";
|
|
5
6
|
declare const inject: string[];
|
|
6
|
-
|
|
7
|
-
declare function
|
|
8
|
-
/** Resolve from the owning DSH installation, never from this plugin's build dependencies. */
|
|
9
|
-
declare function readHostWelcomeVersion(installAnchor: string): string;
|
|
10
|
-
/** Keep the original settings namespace and native UI; project policy before startup settles. */
|
|
11
|
-
declare function apply(ctx: Context): Promise<(() => Promise<void>) | undefined>;
|
|
7
|
+
declare const Config: _deepseek_ai_schemastery0.default<NoInfer<Schemastery.ObjectS<{}>>, NoInfer<Schemastery.ObjectT<{}>>, "volatile">;
|
|
8
|
+
declare function apply(ctx: Context): void;
|
|
12
9
|
declare const _default: {
|
|
13
10
|
name: string;
|
|
14
11
|
inject: string[];
|
|
12
|
+
Config: _deepseek_ai_schemastery0.default<NoInfer<Schemastery.ObjectS<{}>>, NoInfer<Schemastery.ObjectT<{}>>, "volatile">;
|
|
15
13
|
apply: typeof apply;
|
|
16
14
|
};
|
|
17
15
|
//#endregion
|
|
18
|
-
export { apply, _default as default, inject, name
|
|
16
|
+
export { Config, apply, _default as default, inject, name };
|
package/lib/welcome-notice.js
CHANGED
|
@@ -1,59 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { readFileSync } from "node:fs";
|
|
1
|
+
import { t as Schema } from "./lib-C8_jXvwA.js";
|
|
3
2
|
|
|
4
3
|
//#region src/welcome-notice.ts
|
|
5
4
|
const name = "dashr-welcome-notice";
|
|
6
|
-
const inject = [
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (values.length !== 1) throw new Error("dashr-welcome-notice: expected one WELCOME_NOTICE_VERSION in the installed Models client; check the upstream bundle layout or disable this entry");
|
|
13
|
-
return values[0][2];
|
|
14
|
-
}
|
|
15
|
-
/** Resolve from the owning DSH installation, never from this plugin's build dependencies. */
|
|
16
|
-
function readHostWelcomeVersion(installAnchor) {
|
|
17
|
-
return parseWelcomeVersion(readFileSync(createRequire(createRequire(installAnchor).resolve("@deepseek-ai/dsh-web-app/package.json")).resolve("@deepseek-ai/dsh-client-ui-settings-models/client"), "utf8"));
|
|
18
|
-
}
|
|
19
|
-
/** Keep the original settings namespace and native UI; project policy before startup settles. */
|
|
20
|
-
async function apply(ctx) {
|
|
21
|
-
const entry = [...ctx.loader.entries()].find((entry$1) => entry$1.options.id === NAMESPACE);
|
|
22
|
-
if (entry === void 0 || entry.disabled) return;
|
|
23
|
-
const version = readHostWelcomeVersion(ctx.profileContext.installAnchor);
|
|
24
|
-
const original = { ...entry.options.config ?? {} };
|
|
25
|
-
const unhook = ctx.on("internal/config", function(_raw, next) {
|
|
26
|
-
const config = next();
|
|
27
|
-
return this.entry?.options.id === NAMESPACE ? {
|
|
28
|
-
...config,
|
|
29
|
-
[FIELD]: version
|
|
30
|
-
} : config;
|
|
31
|
-
}, { global: true });
|
|
32
|
-
try {
|
|
33
|
-
if (entry.fiber === void 0) await entry.init();
|
|
34
|
-
await entry.fiber?.await();
|
|
35
|
-
await entry.update({ config: {
|
|
36
|
-
...original,
|
|
37
|
-
[FIELD]: version
|
|
38
|
-
} });
|
|
39
|
-
} catch (error) {
|
|
40
|
-
unhook();
|
|
41
|
-
throw error;
|
|
42
|
-
}
|
|
43
|
-
return async () => {
|
|
44
|
-
unhook();
|
|
45
|
-
if (entry.fiber === void 0 || entry.disabled) return;
|
|
46
|
-
const config = { ...entry.options.config ?? {} };
|
|
47
|
-
if (Object.hasOwn(original, FIELD)) config[FIELD] = original[FIELD];
|
|
48
|
-
else delete config[FIELD];
|
|
49
|
-
await entry.update({ config });
|
|
50
|
-
};
|
|
5
|
+
const inject = [];
|
|
6
|
+
const Config = Schema.object({}).volatile();
|
|
7
|
+
function apply(ctx) {
|
|
8
|
+
ctx.inject(["settings"], (child) => {
|
|
9
|
+
child.effect(() => child.settings.configure({ auto: false }, ctx.fiber));
|
|
10
|
+
});
|
|
51
11
|
}
|
|
52
12
|
var welcome_notice_default = {
|
|
53
13
|
name,
|
|
54
14
|
inject,
|
|
15
|
+
Config,
|
|
55
16
|
apply
|
|
56
17
|
};
|
|
57
18
|
|
|
58
19
|
//#endregion
|
|
59
|
-
export { apply, welcome_notice_default as default, inject, name
|
|
20
|
+
export { Config, apply, welcome_notice_default as default, inject, name };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-dsh",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Make your dsh ready for serious coding tasks. (Tools x Schemas)^REPL. `skill://`, `ctx://`, `agent://`, `dvc://`, `dsh://`,
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "Make your dsh ready for serious coding tasks. (Tools x Schemas)^REPL. `skill://`, `ctx://`, `agent://`, `dvc://`, `dsh://`, Python 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",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -55,18 +55,6 @@
|
|
|
55
55
|
"./welcome-notice": {
|
|
56
56
|
"types": "./lib/welcome-notice.d.ts",
|
|
57
57
|
"default": "./lib/welcome-notice.js"
|
|
58
|
-
},
|
|
59
|
-
"./webserver": {
|
|
60
|
-
"types": "./lib/webserver.d.ts",
|
|
61
|
-
"default": "./lib/webserver.js"
|
|
62
|
-
},
|
|
63
|
-
"./bundle-delivery": {
|
|
64
|
-
"types": "./lib/bundle-delivery.d.ts",
|
|
65
|
-
"default": "./lib/bundle-delivery.js"
|
|
66
|
-
},
|
|
67
|
-
"./hmr": {
|
|
68
|
-
"types": "./lib/hmr.d.ts",
|
|
69
|
-
"default": "./lib/hmr.js"
|
|
70
58
|
}
|
|
71
59
|
},
|
|
72
60
|
"imports": {
|
|
@@ -83,8 +71,7 @@
|
|
|
83
71
|
"cordis.patch.yml",
|
|
84
72
|
"eval-description.md",
|
|
85
73
|
"url-schemes-instruction.md",
|
|
86
|
-
"scripts/kernel-provision.mjs"
|
|
87
|
-
"scripts/register-bundle.mjs"
|
|
74
|
+
"scripts/kernel-provision.mjs"
|
|
88
75
|
],
|
|
89
76
|
"scripts": {
|
|
90
77
|
"prebuild": "node scripts/copy-docs.mjs",
|
|
@@ -144,7 +131,6 @@
|
|
|
144
131
|
"@deepseek-ai/dsh-fs-local": ">=0.1.5-0 <0.3.0-0",
|
|
145
132
|
"@deepseek-ai/dsh-home-paths": ">=0.1.5-0 <0.3.0-0",
|
|
146
133
|
"@deepseek-ai/dsh-host-webserver": ">=0.1.5-0 <0.3.0-0",
|
|
147
|
-
"@deepseek-ai/dsh-invariants": ">=0.1.5-0 <0.3.0-0",
|
|
148
134
|
"@deepseek-ai/dsh-llm": ">=0.1.5-0 <0.3.0-0",
|
|
149
135
|
"@deepseek-ai/dsh-llm-retry": ">=0.1.5-0 <0.3.0-0",
|
|
150
136
|
"@deepseek-ai/dsh-persona": ">=0.1.5-0 <0.3.0-0",
|
|
@@ -180,7 +166,7 @@
|
|
|
180
166
|
"@deepseek-ai/dsh-atomic-write": ">=0.1.5-0 <0.3.0-0",
|
|
181
167
|
"@deepseek-ai/dsh-cmdline": ">=0.1.5-0 <0.3.0-0",
|
|
182
168
|
"@deepseek-ai/dsh-plugin-manager": ">=0.1.5-0 <0.3.0-0",
|
|
183
|
-
"@deepseek-ai/dsh-
|
|
169
|
+
"@deepseek-ai/dsh-jobs": ">=0.1.5-0 <0.3.0-0"
|
|
184
170
|
},
|
|
185
171
|
"peerDependenciesMeta": {
|
|
186
172
|
"@deepseek-ai/cordis": {
|
|
@@ -228,9 +214,6 @@
|
|
|
228
214
|
"@deepseek-ai/dsh-home-paths": {
|
|
229
215
|
"optional": true
|
|
230
216
|
},
|
|
231
|
-
"@deepseek-ai/dsh-invariants": {
|
|
232
|
-
"optional": true
|
|
233
|
-
},
|
|
234
217
|
"@deepseek-ai/dsh-llm": {
|
|
235
218
|
"optional": true
|
|
236
219
|
},
|
|
@@ -372,7 +355,7 @@
|
|
|
372
355
|
"@deepseek-ai/dsh-plugin-manager": {
|
|
373
356
|
"optional": true
|
|
374
357
|
},
|
|
375
|
-
"@deepseek-ai/dsh-
|
|
358
|
+
"@deepseek-ai/dsh-jobs": {
|
|
376
359
|
"optional": true
|
|
377
360
|
}
|
|
378
361
|
},
|
|
@@ -418,7 +401,7 @@
|
|
|
418
401
|
"deepseek-harness",
|
|
419
402
|
"repl",
|
|
420
403
|
"eval",
|
|
421
|
-
"
|
|
404
|
+
"python",
|
|
422
405
|
"kernel",
|
|
423
406
|
"agent",
|
|
424
407
|
"plugin"
|
|
@@ -1,35 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* Fail-open by design (2026-09-03 ruling): any failure logs a remedy hint and
|
|
7
|
-
* exits 0. The installation must NEVER fail because the kernel could not be
|
|
8
|
-
* provisioned here — the daemon spin-up check (primary path) and first-use
|
|
9
|
-
* lazy provisioning (final fallback) complete the three-trigger ladder.
|
|
10
|
-
*/
|
|
11
|
-
import { access } from 'node:fs/promises'
|
|
12
|
-
|
|
13
|
-
const libUrl = new URL('../lib/kernel-env.js', import.meta.url)
|
|
14
|
-
|
|
15
|
-
try {
|
|
16
|
-
await access(libUrl)
|
|
17
|
-
} catch {
|
|
18
|
-
// Dev checkout before the first build, or a pruned install: nothing to call.
|
|
19
|
-
console.log('[dashr] kernel-env build output not present yet — skipping install-time pre-provision (the daemon spin-up check will provision on start)')
|
|
20
|
-
process.exit(0)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const { resolveKernelEnv } = await import(libUrl)
|
|
24
|
-
|
|
25
|
-
try {
|
|
26
|
-
const env = await resolveKernelEnv({
|
|
27
|
-
autoInstall: true,
|
|
28
|
-
log: (level, message) => console[level === 'warn' ? 'warn' : 'log'](`[dashr] ${message}`),
|
|
29
|
-
})
|
|
30
|
-
console.log(`[dashr] kernel ready: python ${env.version} at ${env.python}${env.dill ? '' : ' (dill missing — snapshots disabled)'}`)
|
|
31
|
-
} catch (error) {
|
|
32
|
-
console.warn(`[dashr] kernel pre-provision failed (non-blocking): ${error instanceof Error ? error.message : String(error)}`)
|
|
33
|
-
console.warn('[dashr] remedies: run "npm run kernel:venv" in the dashr package; or rely on the daemon spin-up check / first-use auto-install; or set python to a prepared interpreter')
|
|
34
|
-
process.exit(0)
|
|
35
|
-
}
|
|
2
|
+
/** Explicit compatibility command: prepare only a stdlib Python environment, never pip packages. */
|
|
3
|
+
const { resolveKernelEnv } = await import(new URL('../lib/kernel-env.js', import.meta.url).href)
|
|
4
|
+
const env = await resolveKernelEnv({ log: (level, message) => console[level === 'warn' ? 'warn' : 'log'](message) })
|
|
5
|
+
console.log(`Better Python REPL ready: Python ${env.version} at ${env.python}`)
|
package/lib/bundle-delivery.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Context } from "@deepseek-ai/cordis";
|
|
2
|
-
import { ProfileContext } from "@deepseek-ai/dsh-app-boot";
|
|
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 };
|