@zhangj1164/dsh-github-issue 0.0.0-stage → 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/README.i18n.yaml +6 -0
- package/README.md +115 -3
- package/README.zh.md +115 -0
- package/cordis.patch.yml +19 -0
- package/lib/client.d.ts +2 -0
- package/lib/client.js +1 -0
- package/lib/index.d.ts +198 -0
- package/lib/index.js +627 -0
- package/lib/invariant.d.ts +14 -0
- package/lib/invariant.js +19 -0
- package/lib/types.d.ts +137 -0
- package/lib/types.js +1 -0
- package/package.json +70 -6
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
//#region src/types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Pure types of the GitHub-issue domain: the one home of the issue report
|
|
4
|
+
* template, request/response contracts, and the built-in optimization prompt
|
|
5
|
+
* identity. Free of this package's host-side value imports.
|
|
6
|
+
*
|
|
7
|
+
* The issue report template is pinned Markdown so reports are uniform: every
|
|
8
|
+
* generated report follows the same section structure, which is what makes the
|
|
9
|
+
* GitHub prefill and human review consistent.
|
|
10
|
+
*
|
|
11
|
+
* @module @zhangj1164/dsh-github-issue/types
|
|
12
|
+
*/
|
|
13
|
+
/** Input for generating a GitHub issue report from telemetry analysis. */
|
|
14
|
+
interface GithubIssueGenerateReportRequest {
|
|
15
|
+
/**
|
|
16
|
+
* The plugin ids whose failures were analyzed, in the order they were read.
|
|
17
|
+
*
|
|
18
|
+
* A list rather than one id because a suite is what a reader cares about: a
|
|
19
|
+
* report covering only `memo` cannot mention a `github-issue` failure, and the
|
|
20
|
+
* packages of one deployment fail and get fixed together.
|
|
21
|
+
*/
|
|
22
|
+
readonly pluginIds: readonly string[];
|
|
23
|
+
/** Total events recorded for the analyzed plugins. */
|
|
24
|
+
readonly totalEvents: number;
|
|
25
|
+
/** Total failure events recorded for the analyzed plugins. */
|
|
26
|
+
readonly totalFailures: number;
|
|
27
|
+
/** Failure groups from the telemetry analysis, joined on feature-code anchor. */
|
|
28
|
+
readonly failureGroups: readonly GithubIssueFailureGroupInput[];
|
|
29
|
+
/**
|
|
30
|
+
* Provider route override; omit to use this service's `Config` or the
|
|
31
|
+
* deployment's `agentDefaultModel`.
|
|
32
|
+
*/
|
|
33
|
+
readonly provider?: string;
|
|
34
|
+
/** Model id override; omit to follow the same fallback as `provider`. */
|
|
35
|
+
readonly model?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Time range the analysis read, when it read any events. A report without it
|
|
38
|
+
* cannot be told apart from one about a live incident.
|
|
39
|
+
*/
|
|
40
|
+
readonly window?: GithubIssueAnalysisWindow;
|
|
41
|
+
}
|
|
42
|
+
/** The time range one telemetry analysis covered. */
|
|
43
|
+
interface GithubIssueAnalysisWindow {
|
|
44
|
+
/** Timestamp (epoch ms) of the oldest event considered. */
|
|
45
|
+
readonly firstEventAt: number;
|
|
46
|
+
/** Timestamp (epoch ms) of the newest event considered. */
|
|
47
|
+
readonly lastEventAt: number;
|
|
48
|
+
}
|
|
49
|
+
/** One failure group input — the analysis projection of a feature-code group. */
|
|
50
|
+
interface GithubIssueFailureGroupInput {
|
|
51
|
+
/** The feature-code anchor shared by every event in this group. */
|
|
52
|
+
readonly featureCodeRef: string;
|
|
53
|
+
/** Number of failures in this group. */
|
|
54
|
+
readonly count: number;
|
|
55
|
+
/** The most recent failure's error code, when known. */
|
|
56
|
+
readonly errorCode?: string;
|
|
57
|
+
/** The most recent failure's error message. */
|
|
58
|
+
readonly errorMessage?: string;
|
|
59
|
+
/** Timestamp (epoch ms) of the most recent failure, when the analysis knew it. */
|
|
60
|
+
readonly lastFailureAt?: number;
|
|
61
|
+
/** Attempts of the same action recorded after the most recent failure. */
|
|
62
|
+
readonly attemptsAfterLastFailure?: number;
|
|
63
|
+
/** Route the most recent failure ran on, when those events recorded one. */
|
|
64
|
+
readonly route?: GithubIssueFailureRoute;
|
|
65
|
+
}
|
|
66
|
+
/** The model route a failure group ran on. */
|
|
67
|
+
interface GithubIssueFailureRoute {
|
|
68
|
+
/** Provider id the failing call used. */
|
|
69
|
+
readonly provider: string;
|
|
70
|
+
/** Model id the failing call used. */
|
|
71
|
+
readonly model: string;
|
|
72
|
+
/** HTTP-style status the adapter reported, when it reported one. */
|
|
73
|
+
readonly status?: number;
|
|
74
|
+
}
|
|
75
|
+
/** The generated GitHub issue report. */
|
|
76
|
+
interface GithubIssueReport {
|
|
77
|
+
/** Issue title (concise summary). */
|
|
78
|
+
readonly title: string;
|
|
79
|
+
/** Full issue body in Markdown, following the pinned template. */
|
|
80
|
+
readonly body: string;
|
|
81
|
+
/** Labels for the issue. */
|
|
82
|
+
readonly labels: readonly string[];
|
|
83
|
+
}
|
|
84
|
+
/** Result of report generation. */
|
|
85
|
+
type GithubIssueGenerateReportResult = {
|
|
86
|
+
readonly ok: true;
|
|
87
|
+
readonly value: GithubIssueReport;
|
|
88
|
+
} | {
|
|
89
|
+
readonly ok: false;
|
|
90
|
+
readonly error: {
|
|
91
|
+
readonly code: 'llm-failure' | 'route-missing';
|
|
92
|
+
readonly message: string;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
/** Request to build a pre-filled GitHub issue creation URL. */
|
|
96
|
+
interface GithubIssuePrefillRequest {
|
|
97
|
+
/** The repository URL (e.g. `https://github.com/owner/repo`). */
|
|
98
|
+
readonly repoUrl: string;
|
|
99
|
+
/** The report to prefill. */
|
|
100
|
+
readonly report: GithubIssueReport;
|
|
101
|
+
}
|
|
102
|
+
/** Result of the prefill URL construction. */
|
|
103
|
+
type GithubIssuePrefillResult = {
|
|
104
|
+
readonly ok: true;
|
|
105
|
+
readonly value: string;
|
|
106
|
+
} | {
|
|
107
|
+
readonly ok: false;
|
|
108
|
+
readonly error: {
|
|
109
|
+
readonly code: 'invalid-url';
|
|
110
|
+
readonly message: string;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
/** Input for optimizing a natural-language issue description with the model. */
|
|
114
|
+
interface GithubIssueOptimizeRequest {
|
|
115
|
+
/** The user's raw natural-language description of the problem. */
|
|
116
|
+
readonly description: string;
|
|
117
|
+
/**
|
|
118
|
+
* Provider route override; omit to use this service's `Config` or the
|
|
119
|
+
* deployment's `agentDefaultModel`.
|
|
120
|
+
*/
|
|
121
|
+
readonly provider?: string;
|
|
122
|
+
/** Model id override; omit to follow the same fallback as `provider`. */
|
|
123
|
+
readonly model?: string;
|
|
124
|
+
}
|
|
125
|
+
/** Result of issue optimization. */
|
|
126
|
+
type GithubIssueOptimizeResult = {
|
|
127
|
+
readonly ok: true;
|
|
128
|
+
readonly value: GithubIssueReport;
|
|
129
|
+
} | {
|
|
130
|
+
readonly ok: false;
|
|
131
|
+
readonly error: {
|
|
132
|
+
readonly code: 'llm-failure' | 'empty-input' | 'route-missing';
|
|
133
|
+
readonly message: string;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
//#endregion
|
|
137
|
+
export { GithubIssueAnalysisWindow, GithubIssueFailureGroupInput, GithubIssueFailureRoute, GithubIssueGenerateReportRequest, GithubIssueGenerateReportResult, GithubIssueOptimizeRequest, GithubIssueOptimizeResult, GithubIssuePrefillRequest, GithubIssuePrefillResult, GithubIssueReport };
|
package/lib/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,70 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@zhangj1164/dsh-github-issue",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@zhangj1164/dsh-github-issue",
|
|
3
|
+
"description": "GitHub issue generation and optimization service for DeepSeek Harness: builds structured issue reports from telemetry analysis, pre-filled issue URLs, and AI-optimized descriptions",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"types": "lib/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./lib/index.d.ts",
|
|
11
|
+
"default": "./lib/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./invariant": {
|
|
14
|
+
"types": "./lib/invariant.d.ts",
|
|
15
|
+
"default": "./lib/invariant.js"
|
|
16
|
+
},
|
|
17
|
+
"./types": {
|
|
18
|
+
"types": "./lib/types.d.ts",
|
|
19
|
+
"default": "./lib/types.js"
|
|
20
|
+
},
|
|
21
|
+
"./client": {
|
|
22
|
+
"types": "./lib/client.d.ts",
|
|
23
|
+
"default": "./lib/client.js"
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"lib/**/*.js",
|
|
29
|
+
"lib/**/*.d.ts",
|
|
30
|
+
"cordis.patch.yml"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsdown",
|
|
34
|
+
"prepare": "tsdown"
|
|
35
|
+
},
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/zhangj1164/dsh-mega-plugins.git",
|
|
40
|
+
"directory": "packages/github-issue/dsh-github-issue"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"dsh": {
|
|
46
|
+
"bundle": {
|
|
47
|
+
"patch": "./cordis.patch.yml"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@deepseek-ai/schemastery": "^3.18.0",
|
|
52
|
+
"zod": "^4.4.3"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"@deepseek-ai/cordis": "^4.0.0",
|
|
56
|
+
"@deepseek-ai/dsh-invariants": "^0.1.5-rc.1",
|
|
57
|
+
"@deepseek-ai/dsh-llm": "^0.1.5-rc.1",
|
|
58
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.1.5-rc.1"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@deepseek-ai/cordis": "^4.0.0",
|
|
62
|
+
"@deepseek-ai/dsh-invariants": "^0.1.5-rc.1",
|
|
63
|
+
"@deepseek-ai/dsh-llm": "^0.1.5-rc.1",
|
|
64
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.1.5-rc.1",
|
|
65
|
+
"@types/node": "^22.20.0",
|
|
66
|
+
"tsdown": "^0.22.2",
|
|
67
|
+
"typescript": "^5.9.0",
|
|
68
|
+
"vite": "^8.2.2"
|
|
69
|
+
}
|
|
70
|
+
}
|