@morlay/dsh-configurable-sandbox-profile 0.0.0-stage → 0.2.0-alpha.0

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) 2025 morlay
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.
@@ -0,0 +1,4 @@
1
+ # 本文件由 @morlay/dsh-configurable-sandbox-profile 的 devkit build 生成,请勿手工编辑
2
+ - insert:
3
+ - id: configurable-sandbox
4
+ name: "@morlay/dsh-configurable-sandbox-profile"
package/dist/index.mjs ADDED
@@ -0,0 +1,33 @@
1
+ import { dshHomePath } from "@deepseek-ai/dsh-home-paths";
2
+ import { bootstrapApplication, configure } from "@morlay/zephyr";
3
+ import { provideConfigurableSandbox } from "@morlay/configurable-sandbox";
4
+ import { AppEnvDefault, RemoteHandlersDefault, provideAppEnv } from "@morlay/zephyr-app";
5
+ // src/dsh-bundle.ts
6
+ const providers = () => [
7
+ ...provideAppEnv(configure(AppEnvDefault, {
8
+ dataDir: dshHomePath(),
9
+ profileDir: dshHomePath()
10
+ })),
11
+ RemoteHandlersDefault,
12
+ ...provideConfigurableSandbox()
13
+ ];
14
+ const name = "configurable-sandbox";
15
+ const inject = [
16
+ "typert",
17
+ "remoteAccess",
18
+ "sandboxPolicy"
19
+ ];
20
+ async function apply(ctx) {
21
+ const app = await bootstrapApplication({
22
+ providers: providers(),
23
+ ctx
24
+ });
25
+ return async () => {
26
+ await app.dispose();
27
+ };
28
+ }
29
+ const rows = [{ insert: [{
30
+ id: "configurable-sandbox",
31
+ name: "@morlay/dsh-configurable-sandbox-profile"
32
+ }] }];
33
+ export { apply, inject, name, rows };
package/package.json CHANGED
@@ -1,6 +1,41 @@
1
1
  {
2
2
  "name": "@morlay/dsh-configurable-sandbox-profile",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.0-alpha.0",
4
+ "private": false,
5
+ "description": "dsh 行入口(bundle 层):把 @morlay/configurable-sandbox 装成 dsh 的 bundle 行。",
6
+ "files": [
7
+ "dist",
8
+ "src",
9
+ "!**/__tests__"
10
+ ],
11
+ "type": "module",
12
+ "exports": {
13
+ ".": {
14
+ "default": "./dist/index.mjs"
15
+ },
16
+ "./package.json": "./package.json",
17
+ "./cordis.patch.yml": "./dist/cordis.patch.yml"
18
+ },
19
+ "dependencies": {
20
+ "@morlay/configurable-sandbox": "^0.2.0-alpha.0",
21
+ "@morlay/zephyr": "^0.2.0-alpha.0",
22
+ "@morlay/zephyr-app": "^0.2.0-alpha.0"
23
+ },
24
+ "peerDependencies": {
25
+ "@deepseek-ai/dsh-home-paths": "^0.2.3-alpha.3"
26
+ },
27
+ "engines": {
28
+ "dsh": ">= 0.2.3-alpha.3 < 0.2.4"
29
+ },
30
+ "dsh": {
31
+ "bundle": {
32
+ "patch": "./dist/cordis.patch.yml"
33
+ }
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "https://github.com/morlay/zephyr.git",
38
+ "directory": "packages/dsh-bundle/dsh-configurable-sandbox-profile"
39
+ },
40
+ "scripts": {}
6
41
  }
@@ -0,0 +1,33 @@
1
+ import { dshHomePath } from "@deepseek-ai/dsh-home-paths";
2
+ import { bootstrapApplication, configure, type Context, type ProviderEntry } from "@morlay/zephyr";
3
+ import { provideConfigurableSandbox } from "@morlay/configurable-sandbox";
4
+ import { AppEnvDefault, provideAppEnv, RemoteHandlersDefault } from "@morlay/zephyr-app";
5
+
6
+ const providers = (): readonly ProviderEntry[] => [
7
+ // dsh 专属:部署参数与 Remote 路由表在 dsh 的 profile 里没有装配面,由这一层自带(排最前)。
8
+ // 部署参数是 dsh 的 home(DSH_HOME):值由装配层给,AppEnv 自己不去读环境变量。
9
+ ...provideAppEnv(configure(AppEnvDefault, { dataDir: dshHomePath(), profileDir: dshHomePath() })),
10
+ RemoteHandlersDefault,
11
+ ...provideConfigurableSandbox(),
12
+ ];
13
+
14
+ // dsh 行入口:宿主侧(server / host)的行合成一个 cordis 插件;client 是独立出口,不进这里。
15
+ // `inject` 只列**本 bundle 之外**的服务:上游 Loader 据此等依赖就绪;本插件自己发布的服务由
16
+ // apply 内按序 mount 满足(把它们也列进去 = 等自己,永远不会激活)。
17
+ export const name = "configurable-sandbox";
18
+
19
+ export const inject: readonly string[] = ["typert", "remoteAccess", "sandboxPolicy"];
20
+
21
+ export async function apply(ctx: Context): Promise<() => Promise<void>> {
22
+ // 多行装配:行与行之间的服务互相可见(令牌表 + 依赖序),并且挂在宿主传入的 ctx 上——
23
+ // dispose 只拆本次装配,不销毁宿主的 ctx。
24
+ const app = await bootstrapApplication({ providers: providers(), ctx: ctx as never });
25
+ return async () => {
26
+ await app.dispose();
27
+ };
28
+ }
29
+
30
+ // patch 的行声明:dsh Loader 按它装配本包的行入口(`name` 指到 `./dsh-bundle` 子出口)。
31
+ export const rows = [
32
+ { insert: [{ id: "configurable-sandbox", name: "@morlay/dsh-configurable-sandbox-profile" }] },
33
+ ] as const;
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.