@sparkelf/dsh-web-runtime-compat 0.0.0-stage → 0.2.9-alpha.109

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/lib/index.js ADDED
@@ -0,0 +1,31 @@
1
+ import { networkInterfaces } from "node:os";
2
+ //#region lib/types/index.js
3
+ /**
4
+ * Publish the pre-0.2.3 `webRuntime` service beside `webStartup`.
5
+ *
6
+ * 0.2.3 renamed the bind-dependent provider to `webStartup`. Third-party bundles
7
+ * that still inject `webRuntime` would stay pending forever, so this row rebuilds
8
+ * the old shape from the new services: the sampled LAN literals for a wildcard
9
+ * bind plus the deployment's own trusted hosts.
10
+ * @module @sparkelf/dsh-web-runtime-compat
11
+ */
12
+ /** Stable plugin name. */
13
+ const name = "web-runtime-compat";
14
+ /** `webStartup` supplies the flags; `webServer` reports the bound host. */
15
+ const inject = ["webStartup", "webServer"];
16
+ /**
17
+ * Publish `webRuntime` for the lifetime of this plugin.
18
+ * @param ctx - plugin context injecting the startup and server services.
19
+ */
20
+ function apply(ctx) {
21
+ const server = ctx.get("webServer");
22
+ const startup = ctx.get("webStartup");
23
+ const boundHost = server?.host ?? "";
24
+ const lanAddresses = boundHost === "" || boundHost === "0.0.0.0" || boundHost === "::" ? Object.values(networkInterfaces()).flat().filter((iface) => iface !== void 0 && iface.family === "IPv4" && !iface.internal).map((iface) => iface.address) : [];
25
+ ctx.provide("webRuntime", {
26
+ lanAddresses,
27
+ trustedHosts: [...lanAddresses, ...startup?.trustedHosts ?? []]
28
+ });
29
+ }
30
+ //#endregion
31
+ export { apply, inject, name };
@@ -0,0 +1,18 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ /** Stable plugin name. */
3
+ export declare const name = "web-runtime-compat";
4
+ /** `webStartup` supplies the flags; `webServer` reports the bound host. */
5
+ export declare const inject: string[];
6
+ /** The pre-0.2.3 service shape. */
7
+ export interface WebRuntimeCompat {
8
+ /** Non-internal IPv4 literals sampled from a wildcard bind. */
9
+ readonly lanAddresses: readonly string[];
10
+ /** Authorities this deployment serves, as the old row exposed them. */
11
+ readonly trustedHosts: readonly string[];
12
+ }
13
+ /**
14
+ * Publish `webRuntime` for the lifetime of this plugin.
15
+ * @param ctx - plugin context injecting the startup and server services.
16
+ */
17
+ export declare function apply(ctx: Context): void;
18
+ //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,35 @@
1
1
  {
2
+ "description": "Provide the pre-0.2.3 webRuntime service from webStartup for third-party bundles that still inject it",
3
+ "exports": {
4
+ ".": {
5
+ "default": "./lib/index.js",
6
+ "types": "./lib/types/index.d.ts"
7
+ },
8
+ "./package.json": "./package.json"
9
+ },
10
+ "files": [
11
+ "lib/index.js",
12
+ "lib/types/**/*.d.ts"
13
+ ],
14
+ "license": "MIT",
15
+ "main": "lib/index.js",
2
16
  "name": "@sparkelf/dsh-web-runtime-compat",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
17
+ "peerDependencies": {
18
+ "@deepseek-ai/cordis": ">=4.2.0-alpha.1",
19
+ "@deepseek-ai/dsh-host-webserver": ">=0.2.3-alpha.2"
20
+ },
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "repository": {
25
+ "directory": "packages/plus/web-runtime-compat",
26
+ "type": "git",
27
+ "url": "git+https://github.com/deepseek-ai/deepseek-harness.git"
28
+ },
29
+ "scripts": {
30
+ "bundle": "tsdown"
31
+ },
32
+ "type": "module",
33
+ "types": "lib/types/index.d.ts",
34
+ "version": "0.2.9-alpha.109"
35
+ }
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.