@morlay/dsh-session-mode-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 +21 -0
- package/dist/client.cjs +40584 -0
- package/dist/cordis.patch.yml +4 -0
- package/dist/index.mjs +47 -0
- package/package.json +53 -3
- package/src/dsh-bundle.client.ts +42 -0
- package/src/dsh-bundle.ts +59 -0
- package/README.md +0 -3
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { dshHomePath } from "@deepseek-ai/dsh-home-paths";
|
|
2
|
+
import { ToolRegistrationsDefault } from "@morlay/dsh-agent";
|
|
3
|
+
import { bootstrapApplication, configure } from "@morlay/zephyr";
|
|
4
|
+
import { provideSessionMode, provideSessionModeEndpoints } from "@morlay/session-mode";
|
|
5
|
+
import { AppEnvDefault, RemoteHandlersDefault, provideAppEnv } from "@morlay/zephyr-app";
|
|
6
|
+
// src/dsh-bundle.ts
|
|
7
|
+
/**
|
|
8
|
+
* 本 bundle 装的行清单。
|
|
9
|
+
*
|
|
10
|
+
* 导出只给包内用例看(装配形状是判据):dsh 运行时从这里只取 `apply` / `name` / `inject` / `rows`。
|
|
11
|
+
*/
|
|
12
|
+
const providers = () => [
|
|
13
|
+
...provideAppEnv(configure(AppEnvDefault, {
|
|
14
|
+
dataDir: dshHomePath(),
|
|
15
|
+
profileDir: dshHomePath()
|
|
16
|
+
})),
|
|
17
|
+
RemoteHandlersDefault,
|
|
18
|
+
ToolRegistrationsDefault,
|
|
19
|
+
...provideSessionMode(),
|
|
20
|
+
...provideSessionModeEndpoints()
|
|
21
|
+
];
|
|
22
|
+
const name = "session-mode";
|
|
23
|
+
const inject = [
|
|
24
|
+
"typert",
|
|
25
|
+
"remoteAccess",
|
|
26
|
+
"systemPrompt",
|
|
27
|
+
"tools",
|
|
28
|
+
"skills",
|
|
29
|
+
"agents",
|
|
30
|
+
"sessions",
|
|
31
|
+
"sessionProjections",
|
|
32
|
+
"storageDomain"
|
|
33
|
+
];
|
|
34
|
+
async function apply(ctx) {
|
|
35
|
+
const app = await bootstrapApplication({
|
|
36
|
+
providers: providers(),
|
|
37
|
+
ctx
|
|
38
|
+
});
|
|
39
|
+
return async () => {
|
|
40
|
+
await app.dispose();
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
const rows = [{ insert: [{
|
|
44
|
+
id: "session-mode",
|
|
45
|
+
name: "@morlay/dsh-session-mode-profile"
|
|
46
|
+
}] }];
|
|
47
|
+
export { apply, inject, name, providers, rows };
|
package/package.json
CHANGED
|
@@ -1,6 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morlay/dsh-session-mode-profile",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
3
|
+
"version": "0.2.0-alpha.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "dsh 行入口(bundle 层):把 @morlay/session-mode 装成 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
|
+
"./client": {
|
|
18
|
+
"default": "./dist/client.cjs"
|
|
19
|
+
},
|
|
20
|
+
"./cordis.patch.yml": "./dist/cordis.patch.yml"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@morlay/dsh-agent": "^0.2.0-alpha.0",
|
|
24
|
+
"@morlay/session-mode": "^0.2.0-alpha.0",
|
|
25
|
+
"@morlay/zephyr": "^0.2.0-alpha.0",
|
|
26
|
+
"@morlay/zephyr-app": "^0.2.0-alpha.0"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@deepseek-ai/dsh-home-paths": "^0.2.3-alpha.3"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"dsh": ">= 0.2.3-alpha.3 < 0.2.4"
|
|
33
|
+
},
|
|
34
|
+
"dsh": {
|
|
35
|
+
"client": {
|
|
36
|
+
"platform": "web",
|
|
37
|
+
"inject": [
|
|
38
|
+
"@deepseek-ai/dsh-client-locale",
|
|
39
|
+
"@deepseek-ai/dsh-client-shortcuts",
|
|
40
|
+
"@deepseek-ai/dsh-client-ui-file-drag",
|
|
41
|
+
"@deepseek-ai/dsh-client-ui-layout",
|
|
42
|
+
"@deepseek-ai/dsh-client-ui-renderer",
|
|
43
|
+
"@deepseek-ai/dsh-client-ui-theme"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"bundle": {
|
|
47
|
+
"patch": "./dist/cordis.patch.yml"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "https://github.com/morlay/zephyr.git",
|
|
53
|
+
"directory": "packages/dsh-bundle/dsh-session-mode-profile"
|
|
54
|
+
},
|
|
55
|
+
"scripts": {}
|
|
6
56
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// client 行(dsh 的浏览器半):与宿主侧同一条装配形状,只是挂在 client ctx 上。
|
|
2
|
+
import { bootstrapApplication, type Context } from "@morlay/zephyr";
|
|
3
|
+
import type { ProviderEntry } from "@morlay/zephyr";
|
|
4
|
+
import { provideClientConnection, provideRemoteTransport } from "@morlay/zephyr-app/client";
|
|
5
|
+
import { provideSessionModeUi } from "@morlay/session-mode/ui";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 客户端装配清单:**传输(我们自己的)** + 本 bundle 的业务行。
|
|
9
|
+
*
|
|
10
|
+
* 判据(`src/__tests__/self-sufficiency.spec.ts`)直接 boot 这一份——测试与发布线装的是同一个东西。
|
|
11
|
+
* @returns 清单。
|
|
12
|
+
*/
|
|
13
|
+
export const clientProviders = (): readonly ProviderEntry[] => [
|
|
14
|
+
...provideClientConnection(),
|
|
15
|
+
...provideRemoteTransport(),
|
|
16
|
+
...provideSessionModeUi(),
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export const name = "ui-session-mode";
|
|
20
|
+
|
|
21
|
+
// `inject` 手写:浏览器上下文里能等到的只有**上游 client 行发布的服务**(宿主装了哪些行只有运行时知道,
|
|
22
|
+
// 这里推不出来)。两件事不要混:`package.json` 的 `dsh.client.inject` 是包名与模块加载顺序,
|
|
23
|
+
// 这一份是 cordis 服务注入、fiber 的激活顺序——留空就会在宿主的上游行之前 apply,预检报「没有提供者」。
|
|
24
|
+
// 只列**本 bundle 之外**的服务:`clientProviders()` 自己装的那些(`client-connection` / `remote-transport`)
|
|
25
|
+
// 写进来 = 等自己,永远不会激活。
|
|
26
|
+
export const inject: readonly string[] = [
|
|
27
|
+
// 上游 `dsh-client-locale`:`ctx.provide("locale", …)`(`client/locale/src/client/index.ts`)——字典面要它。
|
|
28
|
+
"locale",
|
|
29
|
+
// 上游 gateway 的 client 半:`super(ctx, "remote")`(`api/gateway/src/client/index.ts`)——端点客户端的转发目标。
|
|
30
|
+
"remote",
|
|
31
|
+
// 上游 `ui-sidebar-right`:`ctx.reflect.provide("sidebarRightTabs", tabs)`(`client/index.ts`)——tab 注册表。
|
|
32
|
+
"sidebarRightTabs",
|
|
33
|
+
// 上游 `ui-renderer` 的槽注册表:`super(ctx, "slots")`(`client/registry.ts`)。
|
|
34
|
+
"slots",
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
export async function apply(ctx: Context): Promise<() => Promise<void>> {
|
|
38
|
+
const app = await bootstrapApplication({ providers: clientProviders(), ctx: ctx as never });
|
|
39
|
+
return async () => {
|
|
40
|
+
await app.dispose();
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { dshHomePath } from "@deepseek-ai/dsh-home-paths";
|
|
2
|
+
import { ToolRegistrationsDefault } from "@morlay/dsh-agent";
|
|
3
|
+
import { bootstrapApplication, configure, type Context, type ProviderEntry } from "@morlay/zephyr";
|
|
4
|
+
import { provideSessionMode, provideSessionModeEndpoints } from "@morlay/session-mode";
|
|
5
|
+
import { AppEnvDefault, provideAppEnv, RemoteHandlersDefault } from "@morlay/zephyr-app";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 本 bundle 装的行清单。
|
|
9
|
+
*
|
|
10
|
+
* 导出只给包内用例看(装配形状是判据):dsh 运行时从这里只取 `apply` / `name` / `inject` / `rows`。
|
|
11
|
+
*/
|
|
12
|
+
export const providers = (): readonly ProviderEntry[] => [
|
|
13
|
+
// dsh 专属:部署参数与 Remote 路由表在 dsh 的 profile 里没有装配面,由这一层自带。
|
|
14
|
+
// 排最前:后面的行注入它们,按序 mount 才能取到。
|
|
15
|
+
// 部署参数是 dsh 的 home(DSH_HOME):值由装配层给,AppEnv 自己不去读环境变量。
|
|
16
|
+
...provideAppEnv(configure(AppEnvDefault, { dataDir: dshHomePath(), profileDir: dshHomePath() })),
|
|
17
|
+
RemoteHandlersDefault,
|
|
18
|
+
// 注册项读口同样是我们的适配行(能力层的 ToolRegistrationsDefault,读上游 tools 契约背后那一面):
|
|
19
|
+
// 本 bundle 的 SessionScope / ToolGuidance / per-agent 行都注入它,dsh 的 profile 里没人装它。
|
|
20
|
+
ToolRegistrationsDefault,
|
|
21
|
+
// 上下文装配(通道 + 收口)与子代理说明**已经在 provideSessionMode() 里**,这里不再单独装:
|
|
22
|
+
// 同名服务注册两次会当场抛 `service "zephyr-…" has been registered`。
|
|
23
|
+
...provideSessionMode(),
|
|
24
|
+
...provideSessionModeEndpoints(),
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
// dsh 行入口:宿主侧(server / host)的行合成一个 cordis 插件;client 是独立出口,不进这里。
|
|
28
|
+
// `inject` 只列**本 bundle 之外**的服务:上游 Loader 据此等依赖就绪;本插件自己发布的服务由
|
|
29
|
+
// apply 内按序 mount 满足(把它们也列进去 = 等自己,永远不会激活)。
|
|
30
|
+
export const name = "session-mode";
|
|
31
|
+
|
|
32
|
+
export const inject: readonly string[] = [
|
|
33
|
+
"typert",
|
|
34
|
+
"remoteAccess",
|
|
35
|
+
"systemPrompt",
|
|
36
|
+
"tools",
|
|
37
|
+
"skills",
|
|
38
|
+
"agents",
|
|
39
|
+
"sessions",
|
|
40
|
+
"sessionProjections",
|
|
41
|
+
"storageDomain",
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
export async function apply(ctx: Context): Promise<() => Promise<void>> {
|
|
45
|
+
// 多行装配:行与行之间的服务互相可见(令牌表 + 依赖序),并且挂在宿主传入的 ctx 上——
|
|
46
|
+
// dispose 只拆本次装配,不销毁宿主的 ctx。
|
|
47
|
+
const app = await bootstrapApplication({ providers: providers(), ctx: ctx as never });
|
|
48
|
+
return async () => {
|
|
49
|
+
await app.dispose();
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// patch 的行声明:只 insert 本包的行。
|
|
54
|
+
// 不再 disable 上游默认行——上下文装配与工具说明是上游概念(agent-instructions / system-prompt),
|
|
55
|
+
// 没有叫 context-assembler / tool-guidance 的上游行 id,禁了只会得到一条「entry not found」警告且静默无效
|
|
56
|
+
// (见票据 04「行 id 核对」)。
|
|
57
|
+
export const rows = [
|
|
58
|
+
{ insert: [{ id: "session-mode", name: "@morlay/dsh-session-mode-profile" }] },
|
|
59
|
+
] as const;
|
package/README.md
DELETED