@yankeguo/dsh-devlead-protocol 0.4.2 → 0.4.3-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 +13 -3
- package/lib/index.js +13 -3
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -23,6 +23,7 @@ var DEVLEAD_TOOL_PREFIX = "devlead_";
|
|
|
23
23
|
var DEVLEAD_DEFAULT_MAX_WATCHED = 64;
|
|
24
24
|
var DEVLEAD_DEFAULT_NOTIFICATION_RETENTION = 64;
|
|
25
25
|
var DEVLEAD_ERROR_EXCERPT_MAX = 240;
|
|
26
|
+
var DEVLEAD_ASSISTANT_EXCERPT_MAX = 4096;
|
|
26
27
|
var DEVLEAD_REPORT_MESSAGE_MAX = 4e3;
|
|
27
28
|
var DEVLEAD_REPORT_SUMMARY_MAX = 200;
|
|
28
29
|
var DEVLEAD_QUESTIONS_MAX = 32;
|
|
@@ -97,9 +98,11 @@ function sessionRefLabel(sessionId, title) {
|
|
|
97
98
|
function notificationLine(notification) {
|
|
98
99
|
const who = sessionRefLabel(notification.sessionId, notification.sessionTitle);
|
|
99
100
|
const error51 = presentLine(notification.error);
|
|
100
|
-
const
|
|
101
|
+
const summary = typeof notification.summary === "string" ? excerptLine(notification.summary, DEVLEAD_ASSISTANT_EXCERPT_MAX) : void 0;
|
|
102
|
+
const detail = error51 ?? (summary === void 0 ? void 0 : `${summary}${notification.summaryTruncated === true ? " [truncated]" : ""}`);
|
|
101
103
|
const suffix = detail === void 0 ? "" : `: ${detail}`;
|
|
102
|
-
|
|
104
|
+
const interrupt = notification.cancelledByLeadInterrupt === true ? " (cancelled by your interrupt)" : "";
|
|
105
|
+
return `${who} \u2014 turn ${notification.turn} ${transitionLabel(notification.transition)}${interrupt}${suffix}`;
|
|
103
106
|
}
|
|
104
107
|
function notificationDigest(notifications) {
|
|
105
108
|
return notifications.map(notificationLine);
|
|
@@ -14696,6 +14699,9 @@ var taskSchema = external_exports.object({
|
|
|
14696
14699
|
function createDevLeadBoardSchema(isAbsolutePath) {
|
|
14697
14700
|
const projectSchema2 = external_exports.object({
|
|
14698
14701
|
id: idSchema,
|
|
14702
|
+
// Optional only at the durable decode boundary so schema-v1 files written
|
|
14703
|
+
// before project-local CAS remain readable; the Host backfills and persists it.
|
|
14704
|
+
revision: external_exports.number().int().nonnegative().safe().optional(),
|
|
14699
14705
|
workspace: external_exports.object({
|
|
14700
14706
|
path: external_exports.string().min(1).max(DEVLEAD_BOARD_PATH_MAX).refine(isAbsolutePath, {
|
|
14701
14707
|
message: "workspace path must be absolute"
|
|
@@ -14751,7 +14757,10 @@ function createDevLeadBoardSchema(isAbsolutePath) {
|
|
|
14751
14757
|
});
|
|
14752
14758
|
}
|
|
14753
14759
|
});
|
|
14754
|
-
})
|
|
14760
|
+
}).transform((board) => ({
|
|
14761
|
+
...board,
|
|
14762
|
+
projects: board.projects.map((project) => ({ ...project, revision: project.revision ?? board.revision }))
|
|
14763
|
+
}));
|
|
14755
14764
|
return boardSchema;
|
|
14756
14765
|
}
|
|
14757
14766
|
|
|
@@ -14880,6 +14889,7 @@ function parseDevLeadNotesIndex(value) {
|
|
|
14880
14889
|
}
|
|
14881
14890
|
export {
|
|
14882
14891
|
DEVLEAD_ANSWER_RETENTION,
|
|
14892
|
+
DEVLEAD_ASSISTANT_EXCERPT_MAX,
|
|
14883
14893
|
DEVLEAD_BOARD_DIR_SEGMENTS,
|
|
14884
14894
|
DEVLEAD_BOARD_FILE_NAME,
|
|
14885
14895
|
DEVLEAD_BOARD_ID_MAX,
|
package/lib/index.js
CHANGED
|
@@ -23,6 +23,7 @@ var DEVLEAD_TOOL_PREFIX = "devlead_";
|
|
|
23
23
|
var DEVLEAD_DEFAULT_MAX_WATCHED = 64;
|
|
24
24
|
var DEVLEAD_DEFAULT_NOTIFICATION_RETENTION = 64;
|
|
25
25
|
var DEVLEAD_ERROR_EXCERPT_MAX = 240;
|
|
26
|
+
var DEVLEAD_ASSISTANT_EXCERPT_MAX = 4096;
|
|
26
27
|
var DEVLEAD_REPORT_MESSAGE_MAX = 4e3;
|
|
27
28
|
var DEVLEAD_REPORT_SUMMARY_MAX = 200;
|
|
28
29
|
var DEVLEAD_QUESTIONS_MAX = 32;
|
|
@@ -97,9 +98,11 @@ function sessionRefLabel(sessionId, title) {
|
|
|
97
98
|
function notificationLine(notification) {
|
|
98
99
|
const who = sessionRefLabel(notification.sessionId, notification.sessionTitle);
|
|
99
100
|
const error51 = presentLine(notification.error);
|
|
100
|
-
const
|
|
101
|
+
const summary = typeof notification.summary === "string" ? excerptLine(notification.summary, DEVLEAD_ASSISTANT_EXCERPT_MAX) : void 0;
|
|
102
|
+
const detail = error51 ?? (summary === void 0 ? void 0 : `${summary}${notification.summaryTruncated === true ? " [truncated]" : ""}`);
|
|
101
103
|
const suffix = detail === void 0 ? "" : `: ${detail}`;
|
|
102
|
-
|
|
104
|
+
const interrupt = notification.cancelledByLeadInterrupt === true ? " (cancelled by your interrupt)" : "";
|
|
105
|
+
return `${who} \u2014 turn ${notification.turn} ${transitionLabel(notification.transition)}${interrupt}${suffix}`;
|
|
103
106
|
}
|
|
104
107
|
function notificationDigest(notifications) {
|
|
105
108
|
return notifications.map(notificationLine);
|
|
@@ -14696,6 +14699,9 @@ var taskSchema = external_exports.object({
|
|
|
14696
14699
|
function createDevLeadBoardSchema(isAbsolutePath) {
|
|
14697
14700
|
const projectSchema2 = external_exports.object({
|
|
14698
14701
|
id: idSchema,
|
|
14702
|
+
// Optional only at the durable decode boundary so schema-v1 files written
|
|
14703
|
+
// before project-local CAS remain readable; the Host backfills and persists it.
|
|
14704
|
+
revision: external_exports.number().int().nonnegative().safe().optional(),
|
|
14699
14705
|
workspace: external_exports.object({
|
|
14700
14706
|
path: external_exports.string().min(1).max(DEVLEAD_BOARD_PATH_MAX).refine(isAbsolutePath, {
|
|
14701
14707
|
message: "workspace path must be absolute"
|
|
@@ -14751,7 +14757,10 @@ function createDevLeadBoardSchema(isAbsolutePath) {
|
|
|
14751
14757
|
});
|
|
14752
14758
|
}
|
|
14753
14759
|
});
|
|
14754
|
-
})
|
|
14760
|
+
}).transform((board) => ({
|
|
14761
|
+
...board,
|
|
14762
|
+
projects: board.projects.map((project) => ({ ...project, revision: project.revision ?? board.revision }))
|
|
14763
|
+
}));
|
|
14755
14764
|
return boardSchema;
|
|
14756
14765
|
}
|
|
14757
14766
|
|
|
@@ -14880,6 +14889,7 @@ function parseDevLeadNotesIndex(value) {
|
|
|
14880
14889
|
}
|
|
14881
14890
|
export {
|
|
14882
14891
|
DEVLEAD_ANSWER_RETENTION,
|
|
14892
|
+
DEVLEAD_ASSISTANT_EXCERPT_MAX,
|
|
14883
14893
|
DEVLEAD_BOARD_DIR_SEGMENTS,
|
|
14884
14894
|
DEVLEAD_BOARD_FILE_NAME,
|
|
14885
14895
|
DEVLEAD_BOARD_ID_MAX,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yankeguo/dsh-devlead-protocol",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3-rc.1",
|
|
4
4
|
"description": "Pure shared protocol of the devlead plugin suite: durable mode, watched-session and notification types, the project-board wire schema shared by Host and browser, plus the pure fold and formatting rules both sides use.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|