dsh-life-pack 0.1.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/cordis.patch.yml +6 -0
- package/dist/client.d.ts +19 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +21 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/install.d.ts +20 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +48 -0
- package/dist/install.js.map +1 -0
- package/dist/nav.d.ts +45 -0
- package/dist/nav.d.ts.map +1 -0
- package/dist/nav.js +42 -0
- package/dist/nav.js.map +1 -0
- package/package.json +40 -0
package/cordis.patch.yml
ADDED
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** dsh-life-pack 客户端存根(P10 脚手架)。
|
|
2
|
+
*
|
|
3
|
+
* 只导航:写死槽位原生组件描述,不做动态按需加载,不做外嵌页。
|
|
4
|
+
* 面板只经 host.call 触发导航,跨技能取数由各单品走自家 host.call 链,
|
|
5
|
+
* 总管不 import 单品实现(见 boundaries 断言)。
|
|
6
|
+
* 缺席纯条件渲染,无轮询(本文件无任何定时器)。
|
|
7
|
+
*/
|
|
8
|
+
import type { HasTabsPort } from './nav.js';
|
|
9
|
+
export interface HostCaller {
|
|
10
|
+
call(method: string, args: unknown): Promise<unknown>;
|
|
11
|
+
}
|
|
12
|
+
export declare const MANAGER_COMPONENT: {
|
|
13
|
+
readonly kind: "native";
|
|
14
|
+
readonly name: "LifePackNav";
|
|
15
|
+
};
|
|
16
|
+
export declare function mountManagerClient(port: HasTabsPort): () => void;
|
|
17
|
+
export declare function requestOpenViaHost(host: HostCaller, slotId: string): Promise<unknown>;
|
|
18
|
+
export declare function openViaPort(port: HasTabsPort, slotId: string, sessionId?: string): void;
|
|
19
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACvD;AAED,eAAO,MAAM,iBAAiB;;;CAAmD,CAAC;AAElF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,IAAI,CAIhE;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAErF;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAEvF"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** dsh-life-pack 客户端存根(P10 脚手架)。
|
|
2
|
+
*
|
|
3
|
+
* 只导航:写死槽位原生组件描述,不做动态按需加载,不做外嵌页。
|
|
4
|
+
* 面板只经 host.call 触发导航,跨技能取数由各单品走自家 host.call 链,
|
|
5
|
+
* 总管不 import 单品实现(见 boundaries 断言)。
|
|
6
|
+
* 缺席纯条件渲染,无轮询(本文件无任何定时器)。
|
|
7
|
+
*/
|
|
8
|
+
import { MANAGER_TABS, openManagerTab } from './nav.js';
|
|
9
|
+
export const MANAGER_COMPONENT = { kind: 'native', name: 'LifePackNav' };
|
|
10
|
+
export function mountManagerClient(port) {
|
|
11
|
+
const order = [...MANAGER_TABS].sort((a, b) => a.order - b.order);
|
|
12
|
+
void order;
|
|
13
|
+
return () => { };
|
|
14
|
+
}
|
|
15
|
+
export function requestOpenViaHost(host, slotId) {
|
|
16
|
+
return host.call('ilife.manager.open', { slotId });
|
|
17
|
+
}
|
|
18
|
+
export function openViaPort(port, slotId, sessionId) {
|
|
19
|
+
openManagerTab(port, slotId, sessionId);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAOxD,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAW,CAAC;AAElF,MAAM,UAAU,kBAAkB,CAAC,IAAiB;IAClD,MAAM,KAAK,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IAClE,KAAK,KAAK,CAAC;IACX,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAgB,EAAE,MAAc;IACjE,OAAO,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAiB,EAAE,MAAc,EAAE,SAAkB;IAC/E,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;AAC1C,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** dsh-life-pack host 半(P10 脚手架,照抄 DSH 官方插件包模式)。
|
|
2
|
+
*
|
|
3
|
+
* 形态:cordis 插件(name/inject/apply)+ dsh.bundle.patch 装配行。
|
|
4
|
+
* 本包无单品依赖、无单品 import;设置页不住这里(住各单品包,
|
|
5
|
+
* 由一次 registerTab 自动在 DSH 设置页 side 卡片多一张小卡)。
|
|
6
|
+
*/
|
|
7
|
+
export declare const name = "dsh-life-pack";
|
|
8
|
+
export declare const inject: readonly string[];
|
|
9
|
+
export declare function apply(_ctx: unknown): void;
|
|
10
|
+
export { MANAGER_TABS, MANAGER_PLUGIN, DUAL_ADD_PREFIX, dualInstallCmd, recoFor, tabsForPresence, openManagerTab } from './nav.js';
|
|
11
|
+
export type { ManagerTab, RecoTab, Presence, HasTabsPort, OpenPort } from './nav.js';
|
|
12
|
+
export { MANAGER_PACKAGE, SINGLE_PLUGINS, reconcileBundles, assertDualBundles, assertNegativeSingleOnly } from './install.js';
|
|
13
|
+
export { MANAGER_COMPONENT, mountManagerClient, requestOpenViaHost, openViaPort } from './client.js';
|
|
14
|
+
export type { HostCaller } from './client.js';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,IAAI,kBAAkB,CAAC;AACpC,eAAO,MAAM,MAAM,EAAE,SAAS,MAAM,EAAO,CAAC;AAE5C,wBAAgB,KAAK,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAEzC;AAED,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACnI,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC9H,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACrG,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** dsh-life-pack host 半(P10 脚手架,照抄 DSH 官方插件包模式)。
|
|
2
|
+
*
|
|
3
|
+
* 形态:cordis 插件(name/inject/apply)+ dsh.bundle.patch 装配行。
|
|
4
|
+
* 本包无单品依赖、无单品 import;设置页不住这里(住各单品包,
|
|
5
|
+
* 由一次 registerTab 自动在 DSH 设置页 side 卡片多一张小卡)。
|
|
6
|
+
*/
|
|
7
|
+
export const name = 'dsh-life-pack';
|
|
8
|
+
export const inject = [];
|
|
9
|
+
export function apply(_ctx) {
|
|
10
|
+
void _ctx;
|
|
11
|
+
}
|
|
12
|
+
export { MANAGER_TABS, MANAGER_PLUGIN, DUAL_ADD_PREFIX, dualInstallCmd, recoFor, tabsForPresence, openManagerTab } from './nav.js';
|
|
13
|
+
export { MANAGER_PACKAGE, SINGLE_PLUGINS, reconcileBundles, assertDualBundles, assertNegativeSingleOnly } from './install.js';
|
|
14
|
+
export { MANAGER_COMPONENT, mountManagerClient, requestOpenViaHost, openViaPort } from './client.js';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,IAAI,GAAG,eAAe,CAAC;AACpC,MAAM,CAAC,MAAM,MAAM,GAAsB,EAAE,CAAC;AAE5C,MAAM,UAAU,KAAK,CAAC,IAAa;IACjC,KAAK,IAAI,CAAC;AACZ,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEnI,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC9H,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** dsh-life-pack 安装口径(P10 脚手架,P1 #2 定案单命令双包)。
|
|
2
|
+
*
|
|
3
|
+
* 真相(#2 真机结论):dsh plugin 是 pnpm 薄转发,add 单品等价 pnpm add,
|
|
4
|
+
* 传递依赖落盘是;激活否:reconcile 只扫直接 dependencies,传递的 manager
|
|
5
|
+
* 不进 bundles;pnpm 隔离布局下从 profile 解析不到它。
|
|
6
|
+
*
|
|
7
|
+
* 口径:任何单品落地时总管必须已在位导航。实现为单命令双包:
|
|
8
|
+
* dsh plugin add dsh-life-pack dsh-calorie
|
|
9
|
+
* 两者皆直接依赖,由 reconcile 按序激活。单品 package 内保留对总管的
|
|
10
|
+
* dependencies 只作本地开发兜底,不作为单 add 即激活的依据。
|
|
11
|
+
* 不许单卸总管:缺席时总管对应 tab 显示推荐安装并提示补装(见 nav.ts)。
|
|
12
|
+
* 安装验收以 bundles 双含为准,另加单 add 单品后 bundles 无总管的负向断言。
|
|
13
|
+
*/
|
|
14
|
+
export declare const MANAGER_PACKAGE: "dsh-life-pack";
|
|
15
|
+
export declare const SINGLE_PLUGINS: readonly string[];
|
|
16
|
+
/** reconcile 语义仿真:只扫直接 dependencies,按序进 bundles(P1 定案)。 */
|
|
17
|
+
export declare function reconcileBundles(directDeps: readonly string[]): string[];
|
|
18
|
+
export declare function assertDualBundles(bundles: readonly string[], single: string): void;
|
|
19
|
+
export declare function assertNegativeSingleOnly(bundles: readonly string[]): void;
|
|
20
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,eAAe,EAAG,eAAwB,CAAC;AAExD,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAO3C,CAAC;AAEF,2DAA2D;AAC3D,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAUxE;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAOlF;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAIzE"}
|
package/dist/install.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** dsh-life-pack 安装口径(P10 脚手架,P1 #2 定案单命令双包)。
|
|
2
|
+
*
|
|
3
|
+
* 真相(#2 真机结论):dsh plugin 是 pnpm 薄转发,add 单品等价 pnpm add,
|
|
4
|
+
* 传递依赖落盘是;激活否:reconcile 只扫直接 dependencies,传递的 manager
|
|
5
|
+
* 不进 bundles;pnpm 隔离布局下从 profile 解析不到它。
|
|
6
|
+
*
|
|
7
|
+
* 口径:任何单品落地时总管必须已在位导航。实现为单命令双包:
|
|
8
|
+
* dsh plugin add dsh-life-pack dsh-calorie
|
|
9
|
+
* 两者皆直接依赖,由 reconcile 按序激活。单品 package 内保留对总管的
|
|
10
|
+
* dependencies 只作本地开发兜底,不作为单 add 即激活的依据。
|
|
11
|
+
* 不许单卸总管:缺席时总管对应 tab 显示推荐安装并提示补装(见 nav.ts)。
|
|
12
|
+
* 安装验收以 bundles 双含为准,另加单 add 单品后 bundles 无总管的负向断言。
|
|
13
|
+
*/
|
|
14
|
+
export const MANAGER_PACKAGE = 'dsh-life-pack';
|
|
15
|
+
export const SINGLE_PLUGINS = [
|
|
16
|
+
'dsh-memo-ilife',
|
|
17
|
+
'dsh-calorie',
|
|
18
|
+
'dsh-schedule-ilife',
|
|
19
|
+
'dsh-home-ilife',
|
|
20
|
+
'dsh-chef',
|
|
21
|
+
'dsh-bill-ilife',
|
|
22
|
+
];
|
|
23
|
+
/** reconcile 语义仿真:只扫直接 dependencies,按序进 bundles(P1 定案)。 */
|
|
24
|
+
export function reconcileBundles(directDeps) {
|
|
25
|
+
const seen = new Set();
|
|
26
|
+
const out = [];
|
|
27
|
+
for (const d of directDeps) {
|
|
28
|
+
if (!seen.has(d)) {
|
|
29
|
+
seen.add(d);
|
|
30
|
+
out.push(d);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return out;
|
|
34
|
+
}
|
|
35
|
+
export function assertDualBundles(bundles, single) {
|
|
36
|
+
if (!bundles.includes(MANAGER_PACKAGE)) {
|
|
37
|
+
throw new Error('bundles 缺总管[' + MANAGER_PACKAGE + ']:请用单命令双包补装:dsh plugin add dsh-life-pack ' + single);
|
|
38
|
+
}
|
|
39
|
+
if (!bundles.includes(single)) {
|
|
40
|
+
throw new Error('bundles 缺单品[' + single + ']');
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export function assertNegativeSingleOnly(bundles) {
|
|
44
|
+
if (bundles.includes(MANAGER_PACKAGE)) {
|
|
45
|
+
throw new Error('负向断言失败:单 add 单品时 bundles 不应含总管(传递依赖不激活,P1 #2)');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,eAAwB,CAAC;AAExD,MAAM,CAAC,MAAM,cAAc,GAAsB;IAC/C,gBAAgB;IAChB,aAAa;IACb,oBAAoB;IACpB,gBAAgB;IAChB,UAAU;IACV,gBAAgB;CACjB,CAAC;AAEF,2DAA2D;AAC3D,MAAM,UAAU,gBAAgB,CAAC,UAA6B;IAC5D,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;QAC3B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YACjB,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACZ,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAA0B,EAAE,MAAc;IAC1E,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CAAC,cAAc,GAAG,eAAe,GAAG,2CAA2C,GAAG,MAAM,CAAC,CAAC;IAC3G,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,cAAc,GAAG,MAAM,GAAG,GAAG,CAAC,CAAC;IACjD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,OAA0B;IACjE,IAAI,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,CAAC;AACH,CAAC"}
|
package/dist/nav.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** dsh-life-pack 导航表(P10 脚手架,P3 #4 定案 order)。
|
|
2
|
+
*
|
|
3
|
+
* 总管只导航:6 tab 描述子仅做 openTab 路径导航,内容由各单品包自注册
|
|
4
|
+
* slot 提供;总管不 import 任何单品页/单品包(见 boundaries 断言)。
|
|
5
|
+
* 缺席纯条件渲染:present 缺谁就回谁的 reco(推荐安装+补装提示),不轮询。
|
|
6
|
+
* 子页不占栏:卡路里 diet/exercise/goal 等 ilife:calorie:* 后缀只在单品
|
|
7
|
+
* 主面板内导航,绝不在此表另起 tab 行。
|
|
8
|
+
* 60 deck:map 为 matt 探针已占位,本表不动它。
|
|
9
|
+
*/
|
|
10
|
+
export interface ManagerTab {
|
|
11
|
+
readonly skill: string;
|
|
12
|
+
readonly slotId: string;
|
|
13
|
+
readonly order: number;
|
|
14
|
+
readonly title: string;
|
|
15
|
+
/** 提供该 tab 的单品插件包名(仅文档级引用,不 import)。 */
|
|
16
|
+
readonly plugin: string;
|
|
17
|
+
}
|
|
18
|
+
export interface RecoTab extends ManagerTab {
|
|
19
|
+
readonly kind: 'reco';
|
|
20
|
+
/** 补装命令(单命令双包口径,总管必须已在位)。 */
|
|
21
|
+
readonly installCmd: string;
|
|
22
|
+
readonly hint: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const MANAGER_PLUGIN: "dsh-life-pack";
|
|
25
|
+
export declare const DUAL_ADD_PREFIX: "dsh plugin add dsh-life-pack";
|
|
26
|
+
export declare function dualInstallCmd(singlePlugin: string): string;
|
|
27
|
+
/** P3 定案 6 tab(order 升序即 + 号菜单顺序;已打开条不受 order 控制)。 */
|
|
28
|
+
export declare const MANAGER_TABS: readonly ManagerTab[];
|
|
29
|
+
export declare function recoFor(tab: ManagerTab): RecoTab;
|
|
30
|
+
export type Presence = ReadonlySet<string>;
|
|
31
|
+
export declare function tabsForPresence(present: Presence): readonly (ManagerTab | RecoTab)[];
|
|
32
|
+
export interface OpenPort {
|
|
33
|
+
openTab(seed: {
|
|
34
|
+
readonly type: string;
|
|
35
|
+
readonly path: string;
|
|
36
|
+
}, scope?: {
|
|
37
|
+
readonly sessionId?: string;
|
|
38
|
+
}): void;
|
|
39
|
+
}
|
|
40
|
+
export interface HasTabsPort extends OpenPort {
|
|
41
|
+
hasTabs(): boolean;
|
|
42
|
+
}
|
|
43
|
+
/** 总管导航:只做 openTab 路径导航(内容型打开),缺席由调用方渲染 reco。 */
|
|
44
|
+
export declare function openManagerTab(port: HasTabsPort, slotId: string, sessionId?: string): void;
|
|
45
|
+
//# sourceMappingURL=nav.d.ts.map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,CAAA;KAAE,GAAG,IAAI,CAAC;CAChH;AAED,MAAM,WAAW,WAAY,SAAQ,QAAQ;IAC3C,OAAO,IAAI,OAAO,CAAC;CACpB;AAED,iDAAiD;AACjD,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAG1F"}
|
package/dist/nav.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** dsh-life-pack 导航表(P10 脚手架,P3 #4 定案 order)。
|
|
2
|
+
*
|
|
3
|
+
* 总管只导航:6 tab 描述子仅做 openTab 路径导航,内容由各单品包自注册
|
|
4
|
+
* slot 提供;总管不 import 任何单品页/单品包(见 boundaries 断言)。
|
|
5
|
+
* 缺席纯条件渲染:present 缺谁就回谁的 reco(推荐安装+补装提示),不轮询。
|
|
6
|
+
* 子页不占栏:卡路里 diet/exercise/goal 等 ilife:calorie:* 后缀只在单品
|
|
7
|
+
* 主面板内导航,绝不在此表另起 tab 行。
|
|
8
|
+
* 60 deck:map 为 matt 探针已占位,本表不动它。
|
|
9
|
+
*/
|
|
10
|
+
export const MANAGER_PLUGIN = 'dsh-life-pack';
|
|
11
|
+
export const DUAL_ADD_PREFIX = 'dsh plugin add dsh-life-pack';
|
|
12
|
+
export function dualInstallCmd(singlePlugin) {
|
|
13
|
+
return DUAL_ADD_PREFIX + ' ' + singlePlugin;
|
|
14
|
+
}
|
|
15
|
+
/** P3 定案 6 tab(order 升序即 + 号菜单顺序;已打开条不受 order 控制)。 */
|
|
16
|
+
export const MANAGER_TABS = [
|
|
17
|
+
{ skill: 'memo', slotId: 'ilife:memo', order: 70, title: '备忘录', plugin: 'dsh-memo-ilife' },
|
|
18
|
+
{ skill: 'calorie', slotId: 'ilife:calorie', order: 75, title: '卡路里', plugin: 'dsh-calorie' },
|
|
19
|
+
{ skill: 'schedule', slotId: 'ilife:schedule', order: 80, title: '作息', plugin: 'dsh-schedule-ilife' },
|
|
20
|
+
{ skill: 'home', slotId: 'ilife:home', order: 85, title: '居家', plugin: 'dsh-home-ilife' },
|
|
21
|
+
{ skill: 'chef', slotId: 'ilife:chef', order: 90, title: '大厨', plugin: 'dsh-chef' },
|
|
22
|
+
{ skill: 'bill', slotId: 'ilife:cookie', order: 95, title: '记账', plugin: 'dsh-bill-ilife' },
|
|
23
|
+
];
|
|
24
|
+
export function recoFor(tab) {
|
|
25
|
+
const installCmd = dualInstallCmd(tab.plugin);
|
|
26
|
+
return {
|
|
27
|
+
...tab,
|
|
28
|
+
kind: 'reco',
|
|
29
|
+
installCmd,
|
|
30
|
+
hint: '未安装[' + tab.plugin + '],请补装后使用:' + installCmd,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export function tabsForPresence(present) {
|
|
34
|
+
return MANAGER_TABS.map((t) => (present.has(t.slotId) ? t : recoFor(t)));
|
|
35
|
+
}
|
|
36
|
+
/** 总管导航:只做 openTab 路径导航(内容型打开),缺席由调用方渲染 reco。 */
|
|
37
|
+
export function openManagerTab(port, slotId, sessionId) {
|
|
38
|
+
if (!port.hasTabs())
|
|
39
|
+
return;
|
|
40
|
+
port.openTab({ type: slotId, path: slotId }, sessionId ? { sessionId } : undefined);
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=nav.js.map
|
package/dist/nav.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav.js","sourceRoot":"","sources":["../src/nav.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAkBH,MAAM,CAAC,MAAM,cAAc,GAAG,eAAwB,CAAC;AAEvD,MAAM,CAAC,MAAM,eAAe,GAAG,8BAAuC,CAAC;AAEvE,MAAM,UAAU,cAAc,CAAC,YAAoB;IACjD,OAAO,eAAe,GAAG,GAAG,GAAG,YAAY,CAAC;AAC9C,CAAC;AAED,sDAAsD;AACtD,MAAM,CAAC,MAAM,YAAY,GAA0B;IACjD,EAAE,KAAK,EAAE,MAAM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AAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3E,CAAC;AAUD,iDAAiD;AACjD,MAAM,UAAU,cAAc,CAAC,IAAiB,EAAE,MAAc,EAAE,SAAkB;IAClF,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;QAAE,OAAO;IAC5B,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACtF,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-life-pack",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "爱生活总管插件 P10 脚手架:6 tab 只导航+推荐安装,不依赖单品、不 import 单品页",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./dist/index.js",
|
|
10
|
+
"./client": "./dist/client.js",
|
|
11
|
+
"./package.json": "./package.json"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"cordis.patch.yml"
|
|
16
|
+
],
|
|
17
|
+
"keywords": [
|
|
18
|
+
"dsh",
|
|
19
|
+
"deepseek-harness",
|
|
20
|
+
"plugin",
|
|
21
|
+
"ilife"
|
|
22
|
+
],
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=22.13"
|
|
26
|
+
},
|
|
27
|
+
"dsh": {
|
|
28
|
+
"bundle": {
|
|
29
|
+
"patch": "./cordis.patch.yml"
|
|
30
|
+
},
|
|
31
|
+
"client": {
|
|
32
|
+
"platform": "web",
|
|
33
|
+
"inject": []
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsc -b",
|
|
38
|
+
"test": "node --test test/smoke.test.mjs"
|
|
39
|
+
}
|
|
40
|
+
}
|