@artenx/dshb 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +1 -1
  2. package/lib/auth/index.js +10 -2
  3. package/lib/auth/index.js.map +1 -1
  4. package/lib/client.js +1 -1
  5. package/lib/client.js.map +1 -1
  6. package/lib/core/index.js +1 -1
  7. package/lib/core/workspace-instruction-context.d.ts +281 -122
  8. package/lib/core/workspace-instruction-context.js +1 -1
  9. package/lib/exec-docker/docker-backend.d.ts +1 -1
  10. package/lib/exec-docker/docker-client.d.ts +1 -1
  11. package/lib/exec-docker/docker-client.js +4 -1
  12. package/lib/exec-docker/docker-client.js.map +1 -1
  13. package/lib/exec-docker/process-provider.js +39 -5
  14. package/lib/exec-docker/process-provider.js.map +1 -1
  15. package/lib/exec-docker/remote-docker-cli.d.ts +1 -1
  16. package/lib/exec-docker/remote-docker-cli.js +1 -1
  17. package/lib/exec-docker/remote-docker-cli.js.map +1 -1
  18. package/lib/exec-ssh/executor.d.ts +1 -2
  19. package/lib/exec-ssh/executor.js +7 -5
  20. package/lib/exec-ssh/executor.js.map +1 -1
  21. package/lib/exec-ssh/process-provider.js +36 -5
  22. package/lib/exec-ssh/process-provider.js.map +1 -1
  23. package/lib/router/decorate-shell.d.ts +11 -2
  24. package/lib/router/decorate-shell.js +80 -18
  25. package/lib/router/decorate-shell.js.map +1 -1
  26. package/lib/router/router-shell.d.ts +2 -3
  27. package/lib/router/router-shell.js +4 -13
  28. package/lib/router/router-shell.js.map +1 -1
  29. package/lib/{workspace-instruction-context-CxUldQkP.js → workspace-instruction-context-DzHFTN87.js} +156 -76
  30. package/lib/workspace-instruction-context-DzHFTN87.js.map +1 -0
  31. package/package.json +34 -33
  32. package/lib/workspace-instruction-context-CxUldQkP.js.map +0 -1
package/README.md CHANGED
@@ -13,6 +13,6 @@ Restart the corresponding DSH Web profile after installation.
13
13
  ## Requirements
14
14
 
15
15
  - Node.js 22.13 or newer
16
- - DeepSeek Harness 0.1.5-rc.1
16
+ - DeepSeek Harness 0.1.7-rc.1
17
17
 
18
18
  Source code and complete documentation: https://github.com/Artenx/dsh-honeybee
package/lib/auth/index.js CHANGED
@@ -11,13 +11,21 @@ const name = "dshb-auth";
11
11
  const inject = ["webServer"];
12
12
  function registerFrontendBootRaceWorkaround(ctx) {
13
13
  try {
14
- const manifestPath = createRequire(import.meta.url).resolve("@deepseek-ai/dsh-web-frontend/package.json", { paths: [process.cwd()] });
14
+ const resolver = createRequire(import.meta.url);
15
+ let manifestPath;
16
+ try {
17
+ const webAppManifest = resolver.resolve("@deepseek-ai/dsh-web-app/package.json");
18
+ manifestPath = createRequire(webAppManifest).resolve("@deepseek-ai/dsh-web-frontend/package.json");
19
+ } catch {
20
+ manifestPath = resolver.resolve("@deepseek-ai/dsh-web-frontend/package.json", { paths: [process.cwd()] });
21
+ }
15
22
  const assetDir = join(dirname(manifestPath), "dist", "assets");
16
23
  const assetName = readdirSync(assetDir).find((name) => /^index-.*\.js$/.test(name));
17
24
  if (!assetName) return;
18
25
  const assetPath = join(assetDir, assetName);
19
26
  const source = readFileSync(assetPath, "utf8");
20
- const patched = source.replace(/await ([A-Za-z_$][\w$]*)\.await\(\),this\.assertEntriesActive\(([A-Za-z_$][\w$]*)\)/, "await $1.await(),await new Promise(r=>setTimeout(r,8000)),this.assertEntriesActive($2)");
27
+ const legacyPatch = source.replace(/await ([A-Za-z_$][\w$]*)\.await\(\),this\.assertEntriesActive\(([A-Za-z_$][\w$]*)\)/, "await $1.await(),await new Promise(r=>setTimeout(r,8000)),this.assertEntriesActive($2)");
28
+ const patched = legacyPatch !== source ? legacyPatch : source.replace(/await ([A-Za-z_$][\w$]*)\.await\(\),([A-Za-z_$][\w$]*)\(([A-Za-z_$][\w$]*),([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\)/, "await $1.await(),await new Promise(r=>setTimeout(r,8000)),$2($3,$4)");
21
29
  if (patched === source) return;
22
30
  ctx.effect(() => ctx.webServer.register({
23
31
  kind: "exact",
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/auth/index.ts"],"sourcesContent":["import { readFileSync, readdirSync } from 'node:fs'\nimport { createRequire } from 'node:module'\nimport { basename, dirname, join } from 'node:path'\nimport type { Context } from '@deepseek-ai/cordis'\nimport { sharedCredentialStore } from './credentials.js'\nimport { decorateWebServer } from './decorate-webserver.js'\nimport { installLoopbackCompat } from './loopback-compat.js'\nimport { LoginRateLimiter } from './ratelimit.js'\nimport { registerAuthRoutes } from './routes.js'\n\nexport const name = 'dshb-auth'\n\nexport const inject = ['webServer']\n\nfunction registerFrontendBootRaceWorkaround(ctx: Context): void {\n try {\n // Resolve from the active profile so the route patches the same hashed asset\n // that dsh-web-app's static fallback serves.\n const resolver = createRequire(import.meta.url)\n const manifestPath = resolver.resolve('@deepseek-ai/dsh-web-frontend/package.json', {\n paths: [process.cwd()],\n })\n const assetDir = join(dirname(manifestPath), 'dist', 'assets')\n const assetName = readdirSync(assetDir).find((name) => /^index-.*\\.js$/.test(name))\n if (!assetName) return\n\n const assetPath = join(assetDir, assetName)\n const source = readFileSync(assetPath, 'utf8')\n // DSH 0.1.5 asserts before api-remotes' dynamic remote namespace fibers\n // settle. Delay the assertion so mountApp sees the complete client graph;\n // real activation failures still throw after the bounded wait. The loader\n // and context identifiers are minified per build, so match them by shape\n // rather than by the identifier names of any single bundle.\n const patched = source.replace(\n /await ([A-Za-z_$][\\w$]*)\\.await\\(\\),this\\.assertEntriesActive\\(([A-Za-z_$][\\w$]*)\\)/,\n 'await $1.await(),await new Promise(r=>setTimeout(r,8000)),this.assertEntriesActive($2)',\n )\n if (patched === source) return\n\n ctx.effect(() =>\n ctx.webServer.register({\n kind: 'exact',\n path: `/assets/${basename(assetPath)}`,\n handler: (_req, res) => {\n res.writeHead(200, {\n 'cache-control': 'no-store',\n 'content-type': 'application/javascript; charset=utf-8',\n })\n res.end(patched)\n },\n }),\n )\n } catch {\n // Upstream assets are optional from DSHB's perspective. A missing or changed\n // frontend layout simply skips this version-specific workaround.\n }\n}\n\nexport function apply(ctx: Context): void {\n decorateWebServer(ctx.webServer, sharedCredentialStore())\n registerFrontendBootRaceWorkaround(ctx)\n ctx.webServer.tapIndex(installLoopbackCompat)\n registerAuthRoutes(ctx, sharedCredentialStore(), new LoginRateLimiter())\n\n // DSH 0.1.5 introduced a browser-auth fence on the connection package: the SPA\n // fallback calls connection.authorizeIndex() on \"/\" (mints/checks DSH's own\n // launch-token cookie), and /api routes run requestRejection() which 401s when\n // that DSH cookie is absent. DSHB uses its own session cookie and must stay the\n // sole auth gate (DSH 0.1.1 had no such connection fence, so DSHB worked there).\n // Neutralize the connection's browserAuth.isAuthenticated check so DSH's fence\n // never rejects a DSHB-authenticated (or loopback) request; DSHB's gate still\n // rejects unauthenticated access to gated routes. Property is read at request\n // time, so installing it once after connection is ready suffices.\n ctx.inject(['connection'], (connCtx: Context) => {\n const conn = (connCtx as unknown as { connection?: { browserAuth?: { isAuthenticated?: (...a: unknown[]) => unknown; __dshbNeutralized?: true } } }).connection\n const auth = conn?.browserAuth\n if (auth && typeof auth.isAuthenticated === 'function' && !auth.__dshbNeutralized) {\n auth.isAuthenticated = () => true\n auth.__dshbNeutralized = true\n }\n })\n}\n"],"mappings":";;;;;;;;;AAUA,MAAa,OAAO;AAEpB,MAAa,SAAS,CAAC,WAAW;AAElC,SAAS,mCAAmC,KAAoB;CAC9D,IAAI;EAIF,MAAM,eADW,cAAc,YAAY,GACf,CAAC,CAAC,QAAQ,8CAA8C,EAClF,OAAO,CAAC,QAAQ,IAAI,CAAC,EACvB,CAAC;EACD,MAAM,WAAW,KAAK,QAAQ,YAAY,GAAG,QAAQ,QAAQ;EAC7D,MAAM,YAAY,YAAY,QAAQ,CAAC,CAAC,MAAM,SAAS,iBAAiB,KAAK,IAAI,CAAC;EAClF,IAAI,CAAC,WAAW;EAEhB,MAAM,YAAY,KAAK,UAAU,SAAS;EAC1C,MAAM,SAAS,aAAa,WAAW,MAAM;EAM7C,MAAM,UAAU,OAAO,QACrB,uFACA,wFACF;EACA,IAAI,YAAY,QAAQ;EAExB,IAAI,aACF,IAAI,UAAU,SAAS;GACrB,MAAM;GACN,MAAM,WAAW,SAAS,SAAS;GACnC,UAAU,MAAM,QAAQ;IACtB,IAAI,UAAU,KAAK;KACjB,iBAAiB;KACjB,gBAAgB;IAClB,CAAC;IACD,IAAI,IAAI,OAAO;GACjB;EACF,CAAC,CACH;CACF,QAAQ,CAGR;AACF;AAEA,SAAgB,MAAM,KAAoB;CACxC,kBAAkB,IAAI,WAAW,sBAAsB,CAAC;CACxD,mCAAmC,GAAG;CACtC,IAAI,UAAU,SAAS,qBAAqB;CAC5C,mBAAmB,KAAK,sBAAsB,GAAG,IAAI,iBAAiB,CAAC;CAWvE,IAAI,OAAO,CAAC,YAAY,IAAI,YAAqB;EAE/C,MAAM,OADQ,QAAuI,YAClI;EACnB,IAAI,QAAQ,OAAO,KAAK,oBAAoB,cAAc,CAAC,KAAK,mBAAmB;GACjF,KAAK,wBAAwB;GAC7B,KAAK,oBAAoB;EAC3B;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/auth/index.ts"],"sourcesContent":["import { readFileSync, readdirSync } from 'node:fs'\nimport { createRequire } from 'node:module'\nimport { basename, dirname, join } from 'node:path'\nimport type { Context } from '@deepseek-ai/cordis'\nimport { sharedCredentialStore } from './credentials.js'\nimport { decorateWebServer } from './decorate-webserver.js'\nimport { installLoopbackCompat } from './loopback-compat.js'\nimport { LoginRateLimiter } from './ratelimit.js'\nimport { registerAuthRoutes } from './routes.js'\n\nexport const name = 'dshb-auth'\n\nexport const inject = ['webServer']\n\nfunction registerFrontendBootRaceWorkaround(ctx: Context): void {\n try {\n // Resolve the frontend through the same `dsh-web-app` bundle the webserver\n // loads, so the patched hashed asset is the one the static fallback serves.\n // `process.cwd()` may hold a different installation whose asset filename\n // the server never requests, leaving the served bundle unpatched.\n const resolver = createRequire(import.meta.url)\n let manifestPath: string\n try {\n const webAppManifest = resolver.resolve('@deepseek-ai/dsh-web-app/package.json')\n manifestPath = createRequire(webAppManifest).resolve('@deepseek-ai/dsh-web-frontend/package.json')\n } catch {\n manifestPath = resolver.resolve('@deepseek-ai/dsh-web-frontend/package.json', {\n paths: [process.cwd()],\n })\n }\n const assetDir = join(dirname(manifestPath), 'dist', 'assets')\n const assetName = readdirSync(assetDir).find((name) => /^index-.*\\.js$/.test(name))\n if (!assetName) return\n\n const assetPath = join(assetDir, assetName)\n const source = readFileSync(assetPath, 'utf8')\n // DSH asserts before api-remotes' dynamic remote namespace fibers settle.\n // Delay the assertion so mountApp sees the complete client graph; real\n // activation failures still throw after the bounded wait. The minified\n // identifiers vary between builds, and 0.1.7 moved the assertion into nE.\n const legacyPatch = source.replace(\n /await ([A-Za-z_$][\\w$]*)\\.await\\(\\),this\\.assertEntriesActive\\(([A-Za-z_$][\\w$]*)\\)/,\n 'await $1.await(),await new Promise(r=>setTimeout(r,8000)),this.assertEntriesActive($2)',\n )\n const patched = legacyPatch !== source\n ? legacyPatch\n : source.replace(\n /await ([A-Za-z_$][\\w$]*)\\.await\\(\\),([A-Za-z_$][\\w$]*)\\(([A-Za-z_$][\\w$]*),([A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)*)\\)/,\n 'await $1.await(),await new Promise(r=>setTimeout(r,8000)),$2($3,$4)',\n )\n if (patched === source) return\n\n ctx.effect(() =>\n ctx.webServer.register({\n kind: 'exact',\n path: `/assets/${basename(assetPath)}`,\n handler: (_req, res) => {\n res.writeHead(200, {\n 'cache-control': 'no-store',\n 'content-type': 'application/javascript; charset=utf-8',\n })\n res.end(patched)\n },\n }),\n )\n } catch {\n // Upstream assets are optional from DSHB's perspective. A missing or changed\n // frontend layout simply skips this version-specific workaround.\n }\n}\n\nexport function apply(ctx: Context): void {\n decorateWebServer(ctx.webServer, sharedCredentialStore())\n registerFrontendBootRaceWorkaround(ctx)\n ctx.webServer.tapIndex(installLoopbackCompat)\n registerAuthRoutes(ctx, sharedCredentialStore(), new LoginRateLimiter())\n\n // DSH 0.1.5 introduced a browser-auth fence on the connection package: the SPA\n // fallback calls connection.authorizeIndex() on \"/\" (mints/checks DSH's own\n // launch-token cookie), and /api routes run requestRejection() which 401s when\n // that DSH cookie is absent. DSHB uses its own session cookie and must stay the\n // sole auth gate (DSH 0.1.1 had no such connection fence, so DSHB worked there).\n // Neutralize the connection's browserAuth.isAuthenticated check so DSH's fence\n // never rejects a DSHB-authenticated (or loopback) request; DSHB's gate still\n // rejects unauthenticated access to gated routes. Property is read at request\n // time, so installing it once after connection is ready suffices.\n ctx.inject(['connection'], (connCtx: Context) => {\n const conn = (connCtx as unknown as { connection?: { browserAuth?: { isAuthenticated?: (...a: unknown[]) => unknown; __dshbNeutralized?: true } } }).connection\n const auth = conn?.browserAuth\n if (auth && typeof auth.isAuthenticated === 'function' && !auth.__dshbNeutralized) {\n auth.isAuthenticated = () => true\n auth.__dshbNeutralized = true\n }\n })\n}\n"],"mappings":";;;;;;;;;AAUA,MAAa,OAAO;AAEpB,MAAa,SAAS,CAAC,WAAW;AAElC,SAAS,mCAAmC,KAAoB;CAC9D,IAAI;EAKF,MAAM,WAAW,cAAc,YAAY,GAAG;EAC9C,IAAI;EACJ,IAAI;GACF,MAAM,iBAAiB,SAAS,QAAQ,uCAAuC;GAC/E,eAAe,cAAc,cAAc,CAAC,CAAC,QAAQ,4CAA4C;EACnG,QAAQ;GACN,eAAe,SAAS,QAAQ,8CAA8C,EAC5E,OAAO,CAAC,QAAQ,IAAI,CAAC,EACvB,CAAC;EACH;EACA,MAAM,WAAW,KAAK,QAAQ,YAAY,GAAG,QAAQ,QAAQ;EAC7D,MAAM,YAAY,YAAY,QAAQ,CAAC,CAAC,MAAM,SAAS,iBAAiB,KAAK,IAAI,CAAC;EAClF,IAAI,CAAC,WAAW;EAEhB,MAAM,YAAY,KAAK,UAAU,SAAS;EAC1C,MAAM,SAAS,aAAa,WAAW,MAAM;EAK7C,MAAM,cAAc,OAAO,QACzB,uFACA,wFACF;EACA,MAAM,UAAU,gBAAgB,SAC5B,cACA,OAAO,QACL,0HACA,qEACF;EACJ,IAAI,YAAY,QAAQ;EAExB,IAAI,aACF,IAAI,UAAU,SAAS;GACrB,MAAM;GACN,MAAM,WAAW,SAAS,SAAS;GACnC,UAAU,MAAM,QAAQ;IACtB,IAAI,UAAU,KAAK;KACjB,iBAAiB;KACjB,gBAAgB;IAClB,CAAC;IACD,IAAI,IAAI,OAAO;GACjB;EACF,CAAC,CACH;CACF,QAAQ,CAGR;AACF;AAEA,SAAgB,MAAM,KAAoB;CACxC,kBAAkB,IAAI,WAAW,sBAAsB,CAAC;CACxD,mCAAmC,GAAG;CACtC,IAAI,UAAU,SAAS,qBAAqB;CAC5C,mBAAmB,KAAK,sBAAsB,GAAG,IAAI,iBAAiB,CAAC;CAWvE,IAAI,OAAO,CAAC,YAAY,IAAI,YAAqB;EAE/C,MAAM,OADQ,QAAuI,YAClI;EACnB,IAAI,QAAQ,OAAO,KAAK,oBAAoB,cAAc,CAAC,KAAK,mBAAmB;GACjF,KAAK,wBAAwB;GAC7B,KAAK,oBAAoB;EAC3B;CACF,CAAC;AACH"}
package/lib/client.js CHANGED
@@ -3042,7 +3042,7 @@ window.__ModuleLoader__.load({
3042
3042
  installMobile(ctx);
3043
3043
  registerWorkspaceInstructionMenu(ctx);
3044
3044
  ctx.plugin({
3045
- inject: ["slots", "settingsScope"],
3045
+ inject: ["slots"],
3046
3046
  apply: (sub) => {
3047
3047
  sub.slots.inject("settings.section", () => sub.slots.register({
3048
3048
  name: "settings.section",