@sparkelf/dsh-patch-web-runtime-compat 0.0.0-stage → 0.2.1-alpha.22

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DeepSeek
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,35 @@
1
1
  {
2
+ "description": "Data-only exact official-source patch republishing the bind-dependent webRuntime service beside its alpha.2 successor",
3
+ "dshPatch": {
4
+ "formatVersion": 1,
5
+ "variants": [
6
+ {
7
+ "dsh": ">=0.2.1-alpha.2",
8
+ "file": "./patches/web-runtime-compat.patch",
9
+ "id": "web-runtime-service-compat",
10
+ "target": {
11
+ "baseRevision": "6851e496285b2c9670066fdd142e7e46da586649",
12
+ "kind": "dsh-source",
13
+ "paths": [
14
+ "packages/bundle/web-app/"
15
+ ]
16
+ }
17
+ }
18
+ ]
19
+ },
20
+ "files": [
21
+ "patches/*.patch"
22
+ ],
23
+ "license": "MIT",
2
24
  "name": "@sparkelf/dsh-patch-web-runtime-compat",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "repository": {
29
+ "directory": "patches/npm/web-runtime-compat",
30
+ "type": "git",
31
+ "url": "git+https://github.com/SparkElf/deepseek-harness-plus.git"
32
+ },
33
+ "type": "module",
34
+ "version": "0.2.1-alpha.22"
35
+ }
@@ -0,0 +1,84 @@
1
+ diff --git a/packages/bundle/web-app/src/index.ts b/packages/bundle/web-app/src/index.ts
2
+ index 28e078bd31..67f8c01043 100644
3
+ --- a/packages/bundle/web-app/src/index.ts
4
+ +++ b/packages/bundle/web-app/src/index.ts
5
+ @@ -15,6 +15,7 @@
6
+ import { spawn, type ChildProcess } from 'node:child_process'
7
+ import { createRequire } from 'node:module'
8
+ import { isIP } from 'node:net'
9
+ +import { networkInterfaces } from 'node:os'
10
+ import { dirname, join } from 'node:path'
11
+ import { fileURLToPath } from 'node:url'
12
+ import type { Context } from '@deepseek-ai/cordis'
13
+ @@ -22,7 +23,7 @@ import z from '@deepseek-ai/schemastery'
14
+ import { addHarnessSourceSection, auditStartupEntries } from '@deepseek-ai/dsh-app-boot'
15
+ import type {} from '@deepseek-ai/dsh-client-connection'
16
+ import * as FrontendStatic from '@deepseek-ai/dsh-host-frontend-static'
17
+ -import { isLoopbackHost, normalizeBindAddress } from '@deepseek-ai/dsh-host-webserver'
18
+ +import { isLoopbackHost, isWildcardHost, normalizeBindAddress } from '@deepseek-ai/dsh-host-webserver'
19
+ import { launchedThroughSsh, launchEnvironmentOf } from '@deepseek-ai/dsh-launch-environment'
20
+ import { scrubbedParentEnv } from '@deepseek-ai/dsh-subprocess'
21
+ import type {} from '@deepseek-ai/cordis-plugin-loader'
22
+ @@ -60,6 +61,17 @@ export interface Config {
23
+ * Absent or YAML `null` advertises the bind-address URL.
24
+ */
25
+ publicUrl?: string
26
+ + /**
27
+ + * Non-loopback authorities a deployment serves this GUI on, appended to the
28
+ + * sampled LAN literals. The listener's own bind address is accepted
29
+ + * separately, so this list carries only what the bind cannot name: a reverse
30
+ + * proxy's host, or a public origin a browser actually uses.
31
+ + *
32
+ + * Superseded by the `connection` row's own `trustedHosts`, which is where a
33
+ + * deployment adds authorities today. Kept so a profile layer written against
34
+ + * the pre-rename row keeps reaching the host fence.
35
+ + */
36
+ + trustedHosts?: string[]
37
+ }
38
+
39
+ export const Config: z<Config> = z.object({
40
+ @@ -67,6 +79,7 @@ export const Config: z<Config> = z.object({
41
+ printUrl: z.boolean().default(true),
42
+ surfaceContext: z.boolean().default(true),
43
+ publicUrl: z.transform(z.string(), value => parsePublicUrl(value).href),
44
+ + trustedHosts: z.array(String).default([]),
45
+ })
46
+
47
+ /** Environment variable naming the advertised URL of this Web GUI. */
48
+ @@ -245,6 +258,36 @@ export function apply(ctx: Context, config: Config): void {
49
+ // through a local forwarding address that this process cannot derive.
50
+ const handoffBrowser = config.openBrowser && !launchedThroughSsh(launchEnvironmentOf(ctx))
51
+ ctx.plugin(FrontendStatic, { distIndex: internals.resolveDistIndex() })
52
+ +
53
+ + // WEB_RUNTIME_COMPAT: alpha.2 renamed the bind-dependent service from
54
+ + // `webRuntime` to `webStartup` and taught its own rows the new name. A
55
+ + // third-party bundle cannot follow the rename: dsh-better-sidebar and
56
+ + // dsh-video-preview declare `inject: [..., 'webRuntime', ...]`, and Cordis
57
+ + // holds an injected row pending until the named service appears. A deployment
58
+ + // that mounts them loses the sidebar routes and the video preview that are the
59
+ + // whole reason they are mounted, so the old shape is published beside the new
60
+ + // one for as long as those bundles ask for it.
61
+ + //
62
+ + // The shape is the pre-rename service: LAN literals sampled once from a
63
+ + // wildcard bind, then this invocation's and the deployment's own authorities.
64
+ + // `webStartup` already carries the flag-supplied half, so it is read rather
65
+ + // than re-parsed, and `isWildcardHost` is the webserver's own predicate
66
+ + // rather than a string comparison against the IPv4 any-address. This row's
67
+ + // `trustedHosts` reaches the fence again here: alpha.2 moved the deployment
68
+ + // list to the `connection` row, which leaves a profile layer written against
69
+ + // the old row — one that serves a reverse-proxied origin — configuring a key
70
+ + // nothing reads.
71
+ + const compatLanAddresses = isWildcardHost(boundHost)
72
+ + ? Object.values(networkInterfaces()).flat()
73
+ + .filter((iface): iface is NonNullable<typeof iface> => iface !== undefined && iface.family === 'IPv4' && !iface.internal)
74
+ + .map(iface => iface.address)
75
+ + : []
76
+ + const compatStartup = ctx.get('webStartup') as { trustedHosts?: readonly string[] } | undefined
77
+ + ctx.provide('webRuntime', {
78
+ + lanAddresses: compatLanAddresses,
79
+ + trustedHosts: [...compatLanAddresses, ...config.trustedHosts ?? [], ...compatStartup?.trustedHosts ?? []],
80
+ + })
81
+ +
82
+ if (config.surfaceContext) {
83
+ ctx.inject(['systemPrompt'], (promptCtx) => {
84
+ addHarnessSourceSection(promptCtx, SOURCE_ROOT)
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.