@yankeguo/dsh-devlead-protocol 0.3.0-rc.1 → 0.4.0-rc.1

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/lib/client.js CHANGED
@@ -5,8 +5,10 @@ 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
7
  var DEVLEAD_REPORT_RECORD_TYPE = "plugin:devlead/report";
8
+ var DEVLEAD_REPORT_ANSWER_RECORD_TYPE = "plugin:devlead/report-answer";
8
9
  var DEVLEAD_RESET_RECORD_TYPE = "plugin:devlead/reset";
9
- var DEVLEAD_RECORD_VERSION = 1;
10
+ var DEVLEAD_REPAIR_RECORD_TYPE = "plugin:devlead/repair";
11
+ var DEVLEAD_RECORD_VERSION = 2;
10
12
  var DEVLEAD_PROJECTION_KEY = "devLead";
11
13
  var DEVLEAD_MODE_PROJECTION_KEY = "devLeadMode";
12
14
  var DEVLEAD_WATCH_PROJECTION_KEY = "devLeadWatch";
@@ -18,8 +20,14 @@ var DEVLEAD_DEFAULT_NOTIFICATION_RETENTION = 64;
18
20
  var DEVLEAD_ERROR_EXCERPT_MAX = 240;
19
21
  var DEVLEAD_REPORT_MESSAGE_MAX = 4e3;
20
22
  var DEVLEAD_REPORT_SUMMARY_MAX = 200;
23
+ var DEVLEAD_QUESTIONS_MAX = 32;
24
+ var DEVLEAD_QUESTION_OPTIONS_MAX = 16;
25
+ var DEVLEAD_QUESTION_FIELD_MAX = 2e3;
21
26
  var DEVLEAD_REPORT_MAX_PER_TURN = 4;
22
27
  var DEVLEAD_REPORT_RETENTION = 64;
28
+ var DEVLEAD_OPEN_QUESTION_PIN_MAX = 64;
29
+ var DEVLEAD_ANSWER_RETENTION = 128;
30
+ var DEVLEAD_IDEMPOTENCY_KEY_MAX = 200;
23
31
  var DEVLEAD_MAX_INSTANT = 864e13;
24
32
  var DEVLEAD_REPORT_KINDS = [
25
33
  "progress",
@@ -28,6 +36,12 @@ var DEVLEAD_REPORT_KINDS = [
28
36
  "question",
29
37
  "fyi"
30
38
  ];
39
+ var DEVLEAD_PROMPT_INTENTS = [
40
+ "instruction",
41
+ "answer",
42
+ "correction",
43
+ "background"
44
+ ];
31
45
 
32
46
  // packages/protocol/src/format.ts
33
47
  var DEVLEAD_TRANSITIONS = [
@@ -47,7 +61,7 @@ function notificationId(sessionId, turn, transition) {
47
61
  return `${sessionId}:${turn}:${transition}`;
48
62
  }
49
63
  function excerptLine(text, max) {
50
- const collapsed = text.replace(/\s+/gu, " ").trim();
64
+ const collapsed = text.replace(/\s+/gu, " ").replace(/[\u0000-\u001f\u007f-\u009f]/gu, "").trim();
51
65
  if (collapsed.length === 0) return void 0;
52
66
  const budget = Number.isFinite(max) ? Math.floor(max) : Number.POSITIVE_INFINITY;
53
67
  if (budget < 1) return void 0;
@@ -117,17 +131,26 @@ function reportDigest(reports) {
117
131
  return reports.map(reportLine);
118
132
  }
119
133
  export {
134
+ DEVLEAD_ANSWER_RETENTION,
120
135
  DEVLEAD_COMMAND_NAME,
121
136
  DEVLEAD_DEFAULT_MAX_WATCHED,
122
137
  DEVLEAD_DEFAULT_NOTIFICATION_RETENTION,
123
138
  DEVLEAD_ERROR_EXCERPT_MAX,
139
+ DEVLEAD_IDEMPOTENCY_KEY_MAX,
124
140
  DEVLEAD_MAX_INSTANT,
125
141
  DEVLEAD_MESSAGE_KIND,
126
142
  DEVLEAD_MODE_PROJECTION_KEY,
127
143
  DEVLEAD_MODE_RECORD_TYPE,
128
144
  DEVLEAD_NOTIFICATION_RECORD_TYPE,
145
+ DEVLEAD_OPEN_QUESTION_PIN_MAX,
129
146
  DEVLEAD_PROJECTION_KEY,
147
+ DEVLEAD_PROMPT_INTENTS,
148
+ DEVLEAD_QUESTIONS_MAX,
149
+ DEVLEAD_QUESTION_FIELD_MAX,
150
+ DEVLEAD_QUESTION_OPTIONS_MAX,
130
151
  DEVLEAD_RECORD_VERSION,
152
+ DEVLEAD_REPAIR_RECORD_TYPE,
153
+ DEVLEAD_REPORT_ANSWER_RECORD_TYPE,
131
154
  DEVLEAD_REPORT_KINDS,
132
155
  DEVLEAD_REPORT_MAX_PER_TURN,
133
156
  DEVLEAD_REPORT_MESSAGE_MAX,
package/lib/index.js CHANGED
@@ -5,8 +5,10 @@ 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
7
  var DEVLEAD_REPORT_RECORD_TYPE = "plugin:devlead/report";
8
+ var DEVLEAD_REPORT_ANSWER_RECORD_TYPE = "plugin:devlead/report-answer";
8
9
  var DEVLEAD_RESET_RECORD_TYPE = "plugin:devlead/reset";
9
- var DEVLEAD_RECORD_VERSION = 1;
10
+ var DEVLEAD_REPAIR_RECORD_TYPE = "plugin:devlead/repair";
11
+ var DEVLEAD_RECORD_VERSION = 2;
10
12
  var DEVLEAD_PROJECTION_KEY = "devLead";
11
13
  var DEVLEAD_MODE_PROJECTION_KEY = "devLeadMode";
12
14
  var DEVLEAD_WATCH_PROJECTION_KEY = "devLeadWatch";
@@ -18,8 +20,14 @@ var DEVLEAD_DEFAULT_NOTIFICATION_RETENTION = 64;
18
20
  var DEVLEAD_ERROR_EXCERPT_MAX = 240;
19
21
  var DEVLEAD_REPORT_MESSAGE_MAX = 4e3;
20
22
  var DEVLEAD_REPORT_SUMMARY_MAX = 200;
23
+ var DEVLEAD_QUESTIONS_MAX = 32;
24
+ var DEVLEAD_QUESTION_OPTIONS_MAX = 16;
25
+ var DEVLEAD_QUESTION_FIELD_MAX = 2e3;
21
26
  var DEVLEAD_REPORT_MAX_PER_TURN = 4;
22
27
  var DEVLEAD_REPORT_RETENTION = 64;
28
+ var DEVLEAD_OPEN_QUESTION_PIN_MAX = 64;
29
+ var DEVLEAD_ANSWER_RETENTION = 128;
30
+ var DEVLEAD_IDEMPOTENCY_KEY_MAX = 200;
23
31
  var DEVLEAD_MAX_INSTANT = 864e13;
24
32
  var DEVLEAD_REPORT_KINDS = [
25
33
  "progress",
@@ -28,6 +36,12 @@ var DEVLEAD_REPORT_KINDS = [
28
36
  "question",
29
37
  "fyi"
30
38
  ];
39
+ var DEVLEAD_PROMPT_INTENTS = [
40
+ "instruction",
41
+ "answer",
42
+ "correction",
43
+ "background"
44
+ ];
31
45
 
32
46
  // packages/protocol/src/format.ts
33
47
  var DEVLEAD_TRANSITIONS = [
@@ -47,7 +61,7 @@ function notificationId(sessionId, turn, transition) {
47
61
  return `${sessionId}:${turn}:${transition}`;
48
62
  }
49
63
  function excerptLine(text, max) {
50
- const collapsed = text.replace(/\s+/gu, " ").trim();
64
+ const collapsed = text.replace(/\s+/gu, " ").replace(/[\u0000-\u001f\u007f-\u009f]/gu, "").trim();
51
65
  if (collapsed.length === 0) return void 0;
52
66
  const budget = Number.isFinite(max) ? Math.floor(max) : Number.POSITIVE_INFINITY;
53
67
  if (budget < 1) return void 0;
@@ -117,17 +131,26 @@ function reportDigest(reports) {
117
131
  return reports.map(reportLine);
118
132
  }
119
133
  export {
134
+ DEVLEAD_ANSWER_RETENTION,
120
135
  DEVLEAD_COMMAND_NAME,
121
136
  DEVLEAD_DEFAULT_MAX_WATCHED,
122
137
  DEVLEAD_DEFAULT_NOTIFICATION_RETENTION,
123
138
  DEVLEAD_ERROR_EXCERPT_MAX,
139
+ DEVLEAD_IDEMPOTENCY_KEY_MAX,
124
140
  DEVLEAD_MAX_INSTANT,
125
141
  DEVLEAD_MESSAGE_KIND,
126
142
  DEVLEAD_MODE_PROJECTION_KEY,
127
143
  DEVLEAD_MODE_RECORD_TYPE,
128
144
  DEVLEAD_NOTIFICATION_RECORD_TYPE,
145
+ DEVLEAD_OPEN_QUESTION_PIN_MAX,
129
146
  DEVLEAD_PROJECTION_KEY,
147
+ DEVLEAD_PROMPT_INTENTS,
148
+ DEVLEAD_QUESTIONS_MAX,
149
+ DEVLEAD_QUESTION_FIELD_MAX,
150
+ DEVLEAD_QUESTION_OPTIONS_MAX,
130
151
  DEVLEAD_RECORD_VERSION,
152
+ DEVLEAD_REPAIR_RECORD_TYPE,
153
+ DEVLEAD_REPORT_ANSWER_RECORD_TYPE,
131
154
  DEVLEAD_REPORT_KINDS,
132
155
  DEVLEAD_REPORT_MAX_PER_TURN,
133
156
  DEVLEAD_REPORT_MESSAGE_MAX,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yankeguo/dsh-devlead-protocol",
3
- "version": "0.3.0-rc.1",
3
+ "version": "0.4.0-rc.1",
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",
@@ -13,6 +13,7 @@
13
13
  "./package.json": "./package.json"
14
14
  },
15
15
  "files": [
16
+ "LICENSE",
16
17
  "lib",
17
18
  "locale/*.json",
18
19
  "README.md"