@yankeguo/dsh-devlead-protocol 0.1.1 → 0.2.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/README.md +47 -0
- package/lib/client.js +7 -2
- package/lib/index.js +7 -2
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# @yankeguo/dsh-devlead-protocol
|
|
2
|
+
|
|
3
|
+
Pure shared protocol for the DevLead plugin suite: durable record payloads, Session projection
|
|
4
|
+
types, formatting helpers, and the constants both the Host and the browser bundle use.
|
|
5
|
+
|
|
6
|
+
This package has **no runtime dependency** on any DSH package. Its single DSH import is a
|
|
7
|
+
type-only projection-map augmentation; it is erased at build time. Installing it alone does not
|
|
8
|
+
enable DevLead — install the bundle (below) to get the host service, tools, command, and UI.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
Normally installed as part of the main bundle:
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
dsh plugin --profile desktop add @yankeguo/dsh-devlead-bundle
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Only install this package directly when you are composing the suite yourself.
|
|
19
|
+
|
|
20
|
+
## Exports
|
|
21
|
+
|
|
22
|
+
| Export | Contents |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| `@yankeguo/dsh-devlead-protocol` | Host entry; re-exports the client-safe surface |
|
|
25
|
+
| `@yankeguo/dsh-devlead-protocol/client` | Browser-safe constants, types, and pure formatting helpers |
|
|
26
|
+
| `@yankeguo/dsh-devlead-protocol/package.json` | Package manifest |
|
|
27
|
+
|
|
28
|
+
The public contract includes the `devLead` / `devLeadMode` projection keys and types, durable
|
|
29
|
+
`plugin:devlead/*` record types and their version (mode / watch / notification / **reset**;
|
|
30
|
+
`DevLeadResetRecord` discards every earlier DevLead record of a Session and restarts both
|
|
31
|
+
projections from their empty state), retention/excerpt/instant constants, transition vocabulary,
|
|
32
|
+
`notificationLine` / `excerptLine` / `formatInstant`, the `DevLeadUseWorkspaceRequest` shape
|
|
33
|
+
(`{ path, title?, create? }`, `create` defaults to `false`), and the `DevLeadIsolation` outcome
|
|
34
|
+
carried by the required `DevLeadCreatedSession.isolation` field.
|
|
35
|
+
|
|
36
|
+
## Related docs
|
|
37
|
+
|
|
38
|
+
- [Repository README (English)](https://github.com/yankeguo/dsh-devlead/blob/main/README.md) / [中文](https://github.com/yankeguo/dsh-devlead/blob/main/README.zh.md)
|
|
39
|
+
- [Design notes](https://github.com/yankeguo/dsh-devlead/blob/main/docs/DESIGN.md)
|
|
40
|
+
- [Optional-dependency audit](https://github.com/yankeguo/dsh-devlead/blob/main/docs/OPTIONAL-DEPENDENCIES.md)
|
|
41
|
+
|
|
42
|
+
## 中文
|
|
43
|
+
|
|
44
|
+
`@yankeguo/dsh-devlead-protocol` 是 DevLead 套件的纯协议包:host 与浏览器共用的类型、常量、
|
|
45
|
+
projection 键、`plugin:devlead/*` 持久记录类型(mode / watch / notification / reset)与格式化
|
|
46
|
+
函数,以及 `DevLeadUseWorkspaceRequest`、必填的 `DevLeadCreatedSession.isolation` 等请求/结果
|
|
47
|
+
形状。它没有运行时 DSH 依赖,通常随 bundle 安装。完整中文文档见[根 README.zh.md](https://github.com/yankeguo/dsh-devlead/blob/main/README.zh.md)与[设计说明](https://github.com/yankeguo/dsh-devlead/blob/main/docs/DESIGN.md)。
|
package/lib/client.js
CHANGED
|
@@ -4,14 +4,17 @@
|
|
|
4
4
|
var DEVLEAD_MODE_RECORD_TYPE = "plugin:devlead/mode";
|
|
5
5
|
var DEVLEAD_WATCH_RECORD_TYPE = "plugin:devlead/watch";
|
|
6
6
|
var DEVLEAD_NOTIFICATION_RECORD_TYPE = "plugin:devlead/notification";
|
|
7
|
+
var DEVLEAD_RESET_RECORD_TYPE = "plugin:devlead/reset";
|
|
7
8
|
var DEVLEAD_RECORD_VERSION = 1;
|
|
8
9
|
var DEVLEAD_PROJECTION_KEY = "devLead";
|
|
10
|
+
var DEVLEAD_MODE_PROJECTION_KEY = "devLeadMode";
|
|
9
11
|
var DEVLEAD_COMMAND_NAME = "devlead";
|
|
10
12
|
var DEVLEAD_MESSAGE_KIND = "devlead";
|
|
11
13
|
var DEVLEAD_TOOL_PREFIX = "devlead_";
|
|
12
14
|
var DEVLEAD_DEFAULT_MAX_WATCHED = 64;
|
|
13
15
|
var DEVLEAD_DEFAULT_NOTIFICATION_RETENTION = 64;
|
|
14
16
|
var DEVLEAD_ERROR_EXCERPT_MAX = 240;
|
|
17
|
+
var DEVLEAD_MAX_INSTANT = 864e13;
|
|
15
18
|
|
|
16
19
|
// packages/protocol/src/format.ts
|
|
17
20
|
var DEVLEAD_TRANSITIONS = [
|
|
@@ -53,8 +56,7 @@ function transitionLabel(transition) {
|
|
|
53
56
|
}
|
|
54
57
|
function presentLine(value) {
|
|
55
58
|
if (value === void 0) return void 0;
|
|
56
|
-
|
|
57
|
-
return trimmed.length === 0 ? void 0 : trimmed;
|
|
59
|
+
return excerptLine(value, DEVLEAD_ERROR_EXCERPT_MAX);
|
|
58
60
|
}
|
|
59
61
|
function notificationLine(notification) {
|
|
60
62
|
const title = presentLine(notification.sessionTitle);
|
|
@@ -75,11 +77,14 @@ export {
|
|
|
75
77
|
DEVLEAD_DEFAULT_MAX_WATCHED,
|
|
76
78
|
DEVLEAD_DEFAULT_NOTIFICATION_RETENTION,
|
|
77
79
|
DEVLEAD_ERROR_EXCERPT_MAX,
|
|
80
|
+
DEVLEAD_MAX_INSTANT,
|
|
78
81
|
DEVLEAD_MESSAGE_KIND,
|
|
82
|
+
DEVLEAD_MODE_PROJECTION_KEY,
|
|
79
83
|
DEVLEAD_MODE_RECORD_TYPE,
|
|
80
84
|
DEVLEAD_NOTIFICATION_RECORD_TYPE,
|
|
81
85
|
DEVLEAD_PROJECTION_KEY,
|
|
82
86
|
DEVLEAD_RECORD_VERSION,
|
|
87
|
+
DEVLEAD_RESET_RECORD_TYPE,
|
|
83
88
|
DEVLEAD_TOOL_PREFIX,
|
|
84
89
|
DEVLEAD_TRANSITIONS,
|
|
85
90
|
DEVLEAD_WATCH_RECORD_TYPE,
|
package/lib/index.js
CHANGED
|
@@ -4,14 +4,17 @@
|
|
|
4
4
|
var DEVLEAD_MODE_RECORD_TYPE = "plugin:devlead/mode";
|
|
5
5
|
var DEVLEAD_WATCH_RECORD_TYPE = "plugin:devlead/watch";
|
|
6
6
|
var DEVLEAD_NOTIFICATION_RECORD_TYPE = "plugin:devlead/notification";
|
|
7
|
+
var DEVLEAD_RESET_RECORD_TYPE = "plugin:devlead/reset";
|
|
7
8
|
var DEVLEAD_RECORD_VERSION = 1;
|
|
8
9
|
var DEVLEAD_PROJECTION_KEY = "devLead";
|
|
10
|
+
var DEVLEAD_MODE_PROJECTION_KEY = "devLeadMode";
|
|
9
11
|
var DEVLEAD_COMMAND_NAME = "devlead";
|
|
10
12
|
var DEVLEAD_MESSAGE_KIND = "devlead";
|
|
11
13
|
var DEVLEAD_TOOL_PREFIX = "devlead_";
|
|
12
14
|
var DEVLEAD_DEFAULT_MAX_WATCHED = 64;
|
|
13
15
|
var DEVLEAD_DEFAULT_NOTIFICATION_RETENTION = 64;
|
|
14
16
|
var DEVLEAD_ERROR_EXCERPT_MAX = 240;
|
|
17
|
+
var DEVLEAD_MAX_INSTANT = 864e13;
|
|
15
18
|
|
|
16
19
|
// packages/protocol/src/format.ts
|
|
17
20
|
var DEVLEAD_TRANSITIONS = [
|
|
@@ -53,8 +56,7 @@ function transitionLabel(transition) {
|
|
|
53
56
|
}
|
|
54
57
|
function presentLine(value) {
|
|
55
58
|
if (value === void 0) return void 0;
|
|
56
|
-
|
|
57
|
-
return trimmed.length === 0 ? void 0 : trimmed;
|
|
59
|
+
return excerptLine(value, DEVLEAD_ERROR_EXCERPT_MAX);
|
|
58
60
|
}
|
|
59
61
|
function notificationLine(notification) {
|
|
60
62
|
const title = presentLine(notification.sessionTitle);
|
|
@@ -75,11 +77,14 @@ export {
|
|
|
75
77
|
DEVLEAD_DEFAULT_MAX_WATCHED,
|
|
76
78
|
DEVLEAD_DEFAULT_NOTIFICATION_RETENTION,
|
|
77
79
|
DEVLEAD_ERROR_EXCERPT_MAX,
|
|
80
|
+
DEVLEAD_MAX_INSTANT,
|
|
78
81
|
DEVLEAD_MESSAGE_KIND,
|
|
82
|
+
DEVLEAD_MODE_PROJECTION_KEY,
|
|
79
83
|
DEVLEAD_MODE_RECORD_TYPE,
|
|
80
84
|
DEVLEAD_NOTIFICATION_RECORD_TYPE,
|
|
81
85
|
DEVLEAD_PROJECTION_KEY,
|
|
82
86
|
DEVLEAD_RECORD_VERSION,
|
|
87
|
+
DEVLEAD_RESET_RECORD_TYPE,
|
|
83
88
|
DEVLEAD_TOOL_PREFIX,
|
|
84
89
|
DEVLEAD_TRANSITIONS,
|
|
85
90
|
DEVLEAD_WATCH_RECORD_TYPE,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yankeguo/dsh-devlead-protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Pure shared protocol of the devlead plugin suite: durable mode, watched-session and notification types, plus the pure fold and formatting rules used by both Host and browser.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"./package.json": "./package.json"
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
|
-
"lib"
|
|
15
|
+
"lib",
|
|
16
|
+
"README.md"
|
|
16
17
|
],
|
|
17
18
|
"engines": {
|
|
18
19
|
"dsh": ">=0.2.2-rc.1 <0.3.0"
|