@perrylink/dsh-github 0.6.2 → 0.6.3
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.es.md +1 -1
- package/README.hi.md +1 -1
- package/README.md +1 -1
- package/README.pt.md +1 -1
- package/README.zh.md +1 -1
- package/lib/approval-gate.d.ts +1 -1
- package/lib/ci/bot.d.ts +2 -2
- package/lib/ci/pipeline.d.ts +2 -2
- package/lib/ci/review-rules.d.ts +2 -2
- package/lib/ci/tool.d.ts +1 -1
- package/lib/commands.d.ts +2 -2
- package/lib/credential.d.ts +1 -1
- package/lib/github.d.ts +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/jobs.d.ts +2 -2
- package/lib/state.d.ts +6 -6
- package/lib/tools.d.ts +2 -2
- package/package.json +128 -121
- package/scripts/check-endpoints.mjs +48 -0
- package/scripts/fix-dts.mjs +39 -0
- package/scripts/prepare.mjs +9 -0
- package/scripts/verify-artifacts.mjs +32 -0
- package/scripts/verify-self-contained.mjs +27 -0
package/README.es.md
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
| Superficie | Estado |
|
|
45
45
|
|---|---|
|
|
46
|
-
| Harness | DeepSeek Harness `0.1.0-rc.
|
|
46
|
+
| Harness | DeepSeek Harness `0.1.0-rc.8` (compatibilidad declarada para `0.1.0-rc.8`) |
|
|
47
47
|
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
48
48
|
| Plataformas | Todas (plugin host; red saliente a GitHub) |
|
|
49
49
|
| Modelo | Cualquiera (la revisión estática es determinista; `reviewMode: "model"` es opcional) |
|
package/README.hi.md
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
| सतह | स्थिति |
|
|
45
45
|
|---|---|
|
|
46
|
-
| Harness | DeepSeek Harness `0.1.0-rc.
|
|
46
|
+
| Harness | DeepSeek Harness `0.1.0-rc.8` (`0.1.0-rc.8` के लिए compat घोषित) |
|
|
47
47
|
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
48
48
|
| Platforms | सभी (host plugin; GitHub की ओर outbound network) |
|
|
49
49
|
| Model | कोई भी (static review deterministic है; `reviewMode: "model"` वैकल्पिक है) |
|
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
| Surface | Status |
|
|
45
45
|
|---|---|
|
|
46
|
-
| Harness | DeepSeek Harness `0.1.0-rc.
|
|
46
|
+
| Harness | DeepSeek Harness `0.1.0-rc.8` (compat declared for `0.1.0-rc.8`) |
|
|
47
47
|
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
48
48
|
| Platforms | All (host plugin; outbound network to GitHub) |
|
|
49
49
|
| Model | Any (static review is deterministic; `reviewMode: "model"` is optional) |
|
package/README.pt.md
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
| Superfície | Status |
|
|
45
45
|
|---|---|
|
|
46
|
-
| Harness | DeepSeek Harness `0.1.0-rc.
|
|
46
|
+
| Harness | DeepSeek Harness `0.1.0-rc.8` (compatibilidade declarada para `0.1.0-rc.8`) |
|
|
47
47
|
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
48
48
|
| Plataformas | Todas (plugin host; rede de saída para o GitHub) |
|
|
49
49
|
| Modelo | Qualquer (a revisão estática é determinística; `reviewMode: "model"` é opcional) |
|
package/README.zh.md
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
| 界面 | 状态 |
|
|
45
45
|
|---|---|
|
|
46
|
-
| Harness | DeepSeek Harness `0.1.0-rc.
|
|
46
|
+
| Harness | DeepSeek Harness `0.1.0-rc.8`(兼容声明覆盖 `0.1.0-rc.8`) |
|
|
47
47
|
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
48
48
|
| Platforms | 全部(host 插件;出站网络访问 GitHub) |
|
|
49
49
|
| Model | 任意(静态审查是确定性的;`reviewMode: "model"` 为可选) |
|
package/lib/approval-gate.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* @module dsh-github/approval-gate
|
|
14
14
|
*/
|
|
15
15
|
import type { Context } from '@deepseek-ai/cordis';
|
|
16
|
-
import type { GithubState } from './state.
|
|
16
|
+
import type { GithubState } from './state.js';
|
|
17
17
|
/**
|
|
18
18
|
* Register the approval gate. Registration is an effect: disposing the plugin
|
|
19
19
|
* fiber removes the listener.
|
package/lib/ci/bot.d.ts
CHANGED
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
* @module dsh-github/ci/bot
|
|
18
18
|
*/
|
|
19
19
|
import type { Context } from '@deepseek-ai/cordis';
|
|
20
|
-
import type { CommandsService } from '../types.
|
|
21
|
-
import type { GithubState } from '../state.
|
|
20
|
+
import type { CommandsService } from '../types.js';
|
|
21
|
+
import type { GithubState } from '../state.js';
|
|
22
22
|
/** Live bot status surfaced by `/ci status`. */
|
|
23
23
|
export interface CiBotStatus {
|
|
24
24
|
polling: boolean;
|
package/lib/ci/pipeline.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Finding } from '../review.
|
|
2
|
-
import { type GithubState, type RateLimitValue } from '../state.
|
|
1
|
+
import type { Finding } from '../review.js';
|
|
2
|
+
import { type GithubState, type RateLimitValue } from '../state.js';
|
|
3
3
|
/** The gate verdict: pass, needs changes, or skipped by the filters. */
|
|
4
4
|
export type CiVerdict = 'pass' | 'needs-changes' | 'skipped';
|
|
5
5
|
/** Tasks the pipeline (and the `ci_run` tool) understands. */
|
package/lib/ci/review-rules.d.ts
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* identical output.
|
|
10
10
|
* @module dsh-github/ci/review-rules
|
|
11
11
|
*/
|
|
12
|
-
import type { Finding } from '../review.
|
|
13
|
-
import type { CiConfig } from '../config.
|
|
12
|
+
import type { Finding } from '../review.js';
|
|
13
|
+
import type { CiConfig } from '../config.js';
|
|
14
14
|
/** One changed file's stats, as reported by the PR files endpoint. */
|
|
15
15
|
export interface ChangedFileStat {
|
|
16
16
|
path: string;
|
package/lib/ci/tool.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GithubState } from '../state.
|
|
1
|
+
import type { GithubState } from '../state.js';
|
|
2
2
|
/** `ci_run`: run one CI review pass (write; approval-gated upstream). */
|
|
3
3
|
export declare function ciRunTool(state: GithubState): import("@deepseek-ai/dsh-tools").ToolDefinition;
|
|
4
4
|
//# sourceMappingURL=tool.d.ts.map
|
package/lib/commands.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CommandDefinition, CommandsService, JobRegistry } from './types.
|
|
2
|
-
import type { GithubState } from './state.
|
|
1
|
+
import type { CommandDefinition, CommandsService, JobRegistry } from './types.js';
|
|
2
|
+
import type { GithubState } from './state.js';
|
|
3
3
|
/** Register the /pr command family. */
|
|
4
4
|
export declare function registerPrCommand(commands: CommandsService, state: GithubState): () => void;
|
|
5
5
|
/** Register the /review command family. */
|
package/lib/credential.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CredentialProvider } from '@deepseek-ai/dsh-credentials';
|
|
2
|
-
import type { TokenSource } from './config.
|
|
2
|
+
import type { TokenSource } from './config.js';
|
|
3
3
|
/** A resolved non-empty token and the source layer that supplied it. */
|
|
4
4
|
export interface ResolvedToken {
|
|
5
5
|
value: string;
|
package/lib/github.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* request bodies, error messages, and returned values never contain it.
|
|
8
8
|
* @module dsh-github/github
|
|
9
9
|
*/
|
|
10
|
-
import type { Config } from './config.
|
|
10
|
+
import type { Config } from './config.js';
|
|
11
11
|
/** GitHub rate-limit facts, surfaced to the model on every read result. */
|
|
12
12
|
export interface RateLimitInfo {
|
|
13
13
|
remaining: number | null;
|
package/lib/index.d.ts
CHANGED
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
* @module dsh-github
|
|
27
27
|
*/
|
|
28
28
|
import type { Context } from '@deepseek-ai/cordis';
|
|
29
|
-
import { type GitRunner } from './git.
|
|
30
|
-
import { type GhRunner } from './credential.
|
|
31
|
-
import { Config, type Config as PluginConfig } from './config.
|
|
29
|
+
import { type GitRunner } from './git.js';
|
|
30
|
+
import { type GhRunner } from './credential.js';
|
|
31
|
+
import { Config, type Config as PluginConfig } from './config.js';
|
|
32
32
|
export declare const name = "dsh-github";
|
|
33
33
|
/** Services this plugin requires; all exist in any profile built on dsh-base. */
|
|
34
34
|
export declare const inject: string[];
|
package/lib/jobs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { GithubAgent, GithubJobId, JobRegistry } from './types.
|
|
2
|
-
import type { GithubState } from './state.
|
|
1
|
+
import type { GithubAgent, GithubJobId, JobRegistry } from './types.js';
|
|
2
|
+
import type { GithubState } from './state.js';
|
|
3
3
|
/** Producer kind — also the `<kind>-N` id prefix; the host treats it as opaque. */
|
|
4
4
|
export declare const REVIEW_JOB_KIND = "github-review";
|
|
5
5
|
export interface StartReviewJobInput {
|
package/lib/state.d.ts
CHANGED
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
* @module dsh-github/state
|
|
10
10
|
*/
|
|
11
11
|
import type { CredentialProvider } from '@deepseek-ai/dsh-credentials';
|
|
12
|
-
import { GithubClient, type RateLimitInfo } from './github.
|
|
13
|
-
import { type GitRunner } from './git.
|
|
14
|
-
import { type GhRunner, type TokenResolution } from './credential.
|
|
15
|
-
import type { SubagentsService } from './types.
|
|
16
|
-
import type { ReviewReport } from './review.
|
|
17
|
-
import { type Config } from './config.
|
|
12
|
+
import { GithubClient, type RateLimitInfo } from './github.js';
|
|
13
|
+
import { type GitRunner } from './git.js';
|
|
14
|
+
import { type GhRunner, type TokenResolution } from './credential.js';
|
|
15
|
+
import type { SubagentsService } from './types.js';
|
|
16
|
+
import type { ReviewReport } from './review.js';
|
|
17
|
+
import { type Config } from './config.js';
|
|
18
18
|
/** Result of resolving which repository a call targets. */
|
|
19
19
|
export type RepoResolution = {
|
|
20
20
|
ok: true;
|
package/lib/tools.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type GithubState, type RateLimitValue } from './state.
|
|
2
|
-
import { type GithubErrorValue } from './present.
|
|
1
|
+
import { type GithubState, type RateLimitValue } from './state.js';
|
|
2
|
+
import { type GithubErrorValue } from './present.js';
|
|
3
3
|
export declare const RATE_LIMIT_SCHEMA: {
|
|
4
4
|
readonly type: "object";
|
|
5
5
|
readonly additionalProperties: false;
|
package/package.json
CHANGED
|
@@ -1,121 +1,128 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@perrylink/dsh-github",
|
|
3
|
-
"version": "0.6.
|
|
4
|
-
"description": "Official-grade GitHub CI for DeepSeek Harness: composite action (review PRs / fix CI / report), polling PR review bot with idempotent inline comments, a status-check gate, and approval-gated PR/issue/repo/file tools",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "lib/index.js",
|
|
7
|
-
"types": "lib/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./lib/index.d.ts",
|
|
11
|
-
"import": "./lib/index.js"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"files": [
|
|
15
|
-
"lib",
|
|
16
|
-
"action.yml",
|
|
17
|
-
"scripts",
|
|
18
|
-
"cordis.patch.yml",
|
|
19
|
-
"README.md",
|
|
20
|
-
"README.zh.md",
|
|
21
|
-
"README.es.md",
|
|
22
|
-
"README.pt.md",
|
|
23
|
-
"README.hi.md",
|
|
24
|
-
"LICENSE"
|
|
25
|
-
],
|
|
26
|
-
"scripts": {
|
|
27
|
-
"build": "tsc --noEmitOnError",
|
|
28
|
-
"prepare": "node scripts/prepare.mjs",
|
|
29
|
-
"prepublishOnly": "npm run build && npm test",
|
|
30
|
-
"test": "vitest run",
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
},
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
},
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
"@deepseek-ai/
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
"@deepseek-ai/
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
"@deepseek-ai/
|
|
112
|
-
"@deepseek-ai/dsh-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
"@deepseek-ai/
|
|
116
|
-
"@deepseek-ai/
|
|
117
|
-
"@
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
|
|
121
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@perrylink/dsh-github",
|
|
3
|
+
"version": "0.6.3",
|
|
4
|
+
"description": "Official-grade GitHub CI for DeepSeek Harness: composite action (review PRs / fix CI / report), polling PR review bot with idempotent inline comments, a status-check gate, and approval-gated PR/issue/repo/file tools",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"types": "lib/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./lib/index.d.ts",
|
|
11
|
+
"import": "./lib/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"lib",
|
|
16
|
+
"action.yml",
|
|
17
|
+
"scripts",
|
|
18
|
+
"cordis.patch.yml",
|
|
19
|
+
"README.md",
|
|
20
|
+
"README.zh.md",
|
|
21
|
+
"README.es.md",
|
|
22
|
+
"README.pt.md",
|
|
23
|
+
"README.hi.md",
|
|
24
|
+
"LICENSE"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc --noEmitOnError && node scripts/fix-dts.mjs",
|
|
28
|
+
"prepare": "node scripts/prepare.mjs",
|
|
29
|
+
"prepublishOnly": "npm run build && npm test",
|
|
30
|
+
"test": "vitest run",
|
|
31
|
+
"test:coverage": "vitest run --coverage",
|
|
32
|
+
"typecheck": "tsc --noEmit",
|
|
33
|
+
"lint": "oxlint",
|
|
34
|
+
"check:readmes": "node scripts/check-readmes.mjs",
|
|
35
|
+
"verify:self-contained": "node scripts/verify-self-contained.mjs",
|
|
36
|
+
"verify:artifacts": "node scripts/verify-artifacts.mjs"
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"dsh",
|
|
40
|
+
"dsh-plugin",
|
|
41
|
+
"deepseek-harness",
|
|
42
|
+
"github",
|
|
43
|
+
"github-actions",
|
|
44
|
+
"pull-request",
|
|
45
|
+
"code-review",
|
|
46
|
+
"ci",
|
|
47
|
+
"issue-tracker"
|
|
48
|
+
],
|
|
49
|
+
"license": "Apache-2.0",
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
},
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "https://github.com/PerryLink/dsh-github"
|
|
56
|
+
},
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
59
|
+
},
|
|
60
|
+
"dsh": {
|
|
61
|
+
"bundle": {
|
|
62
|
+
"patch": "./cordis.patch.yml"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"dshWorkshop": {
|
|
66
|
+
"schema": "omdsh-workshop-package/v1",
|
|
67
|
+
"type": "plugin",
|
|
68
|
+
"integration": {
|
|
69
|
+
"protocol": "harness-profile",
|
|
70
|
+
"artifact": "cordis.patch.yml"
|
|
71
|
+
},
|
|
72
|
+
"install": {
|
|
73
|
+
"mode": "transactional",
|
|
74
|
+
"adapter": "profile-bundle",
|
|
75
|
+
"failurePolicy": "generation-rollback",
|
|
76
|
+
"touchesCurrentBeforeActivation": false
|
|
77
|
+
},
|
|
78
|
+
"lifecycle": {
|
|
79
|
+
"activation": "restart-profile",
|
|
80
|
+
"dispose": "supported"
|
|
81
|
+
},
|
|
82
|
+
"permissions": [
|
|
83
|
+
"network:outbound",
|
|
84
|
+
"filesystem:write"
|
|
85
|
+
],
|
|
86
|
+
"compatibility": {
|
|
87
|
+
"dshVersions": [
|
|
88
|
+
"0.1.0-rc.8"
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
"capability": {
|
|
92
|
+
"id": "gh-ci",
|
|
93
|
+
"kind": "command",
|
|
94
|
+
"invocation": "/ci",
|
|
95
|
+
"expected": "runs the review engine for the requested PR, posts idempotent inline review comments and publishes the status-check verdict (success / changes needed)"
|
|
96
|
+
},
|
|
97
|
+
"evidence": {
|
|
98
|
+
"install": null,
|
|
99
|
+
"failureIsolation": null,
|
|
100
|
+
"hotReload": null,
|
|
101
|
+
"remove": null
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"dependencies": {
|
|
105
|
+
"@deepseek-ai/schemastery": "^3.18.1"
|
|
106
|
+
},
|
|
107
|
+
"peerDependencies": {
|
|
108
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
109
|
+
"@deepseek-ai/dsh-credentials": ">=0.1.0-rc.8 <0.2.0",
|
|
110
|
+
"@deepseek-ai/dsh-llm": ">=0.1.0-rc.8 <0.2.0",
|
|
111
|
+
"@deepseek-ai/dsh-session": ">=0.1.0-rc.8 <0.2.0",
|
|
112
|
+
"@deepseek-ai/dsh-tools": ">=0.1.0-rc.8 <0.2.0"
|
|
113
|
+
},
|
|
114
|
+
"devDependencies": {
|
|
115
|
+
"@deepseek-ai/cordis": "4.0.1",
|
|
116
|
+
"@deepseek-ai/cordis-plugin-loader": "1.0.2",
|
|
117
|
+
"@deepseek-ai/dsh-credentials": "0.1.0-rc.8",
|
|
118
|
+
"@deepseek-ai/dsh-llm": "0.1.0-rc.8",
|
|
119
|
+
"@deepseek-ai/dsh-session": "0.1.0-rc.8",
|
|
120
|
+
"@deepseek-ai/dsh-tools": "0.1.0-rc.8",
|
|
121
|
+
"@deepseek-ai/schemastery": "3.18.1",
|
|
122
|
+
"@types/node": "^22.0.0",
|
|
123
|
+
"@vitest/coverage-v8": "3.2.0",
|
|
124
|
+
"oxlint": "0.18.1",
|
|
125
|
+
"typescript": "^5.7.0",
|
|
126
|
+
"vitest": "^3.2.0"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// scripts/check-endpoints.mjs — M3 外部端点存活探测(Claude Code check-mcp-urls
|
|
2
|
+
// 模式):401/403/405/5xx = 存活(未带凭据的预期响应),仅 404/410/DNS/TLS/超时
|
|
3
|
+
// = 失败。GitHub API 为插件声明的固定公共端点。
|
|
4
|
+
import { request } from 'node:https'
|
|
5
|
+
|
|
6
|
+
const ENDPOINTS = [
|
|
7
|
+
{ name: 'GitHub API', url: 'https://api.github.com' },
|
|
8
|
+
{ name: 'GitHub web', url: 'https://github.com' },
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
const TIMEOUT_MS = Number(process.env.TIMEOUT_MS ?? 15000)
|
|
12
|
+
|
|
13
|
+
function probe(url) {
|
|
14
|
+
return new Promise((resolve) => {
|
|
15
|
+
const controller = new AbortController()
|
|
16
|
+
const timer = setTimeout(() => controller.abort(), TIMEOUT_MS)
|
|
17
|
+
const req = request(url, { method: 'GET', headers: { 'user-agent': 'dsh-endpoint-liveness/1.0' }, signal: controller.signal }, (res) => {
|
|
18
|
+
res.resume()
|
|
19
|
+
clearTimeout(timer)
|
|
20
|
+
resolve({ status: res.statusCode })
|
|
21
|
+
})
|
|
22
|
+
req.on('error', (error) => {
|
|
23
|
+
clearTimeout(timer)
|
|
24
|
+
const message = String(error?.message ?? error)
|
|
25
|
+
if (controller.signal.aborted) return resolve({ status: null, error: 'timeout' })
|
|
26
|
+
if (message.includes('ENOTFOUND')) return resolve({ status: null, error: 'DNS' })
|
|
27
|
+
if (/certificate|TLS|SSL|EPROTO/u.test(message)) return resolve({ status: null, error: 'TLS' })
|
|
28
|
+
resolve({ status: null, error: message })
|
|
29
|
+
})
|
|
30
|
+
req.end()
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const failures = []
|
|
35
|
+
for (const endpoint of ENDPOINTS) {
|
|
36
|
+
const result = await probe(endpoint.url)
|
|
37
|
+
const status = result.status
|
|
38
|
+
const alive = status === 200 || (status !== null && status >= 400 && status !== 404 && status !== 410)
|
|
39
|
+
const verdict = alive ? 'ALIVE' : 'FAIL'
|
|
40
|
+
console.log(`${verdict} ${String(status ?? result.error)} ${endpoint.name} ${endpoint.url}`)
|
|
41
|
+
if (!alive) failures.push(`${endpoint.name}: ${String(status ?? result.error)}`)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (failures.length > 0) {
|
|
45
|
+
console.error(`\nendpoint liveness failed:\n- ${failures.join('\n- ')}`)
|
|
46
|
+
process.exit(1)
|
|
47
|
+
}
|
|
48
|
+
console.log(`\nendpoint liveness passed: ${ENDPOINTS.length} endpoint(s) alive`)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// fix-dts.mjs — rewrite `.ts` relative specifiers to `.js` in emitted
|
|
2
|
+
// declarations (lib/**/*.d.ts). TypeScript 5.9's
|
|
3
|
+
// `rewriteRelativeImportExtensions` rewrites the JS emit but NOT the
|
|
4
|
+
// declaration emit (verified empirically), so declaration consumers under
|
|
5
|
+
// NodeNext resolution would fail on `.ts` specifiers. Node builtins only:
|
|
6
|
+
// this runs inside the git-install `prepare` with production deps alone.
|
|
7
|
+
import { existsSync, readdirSync, readFileSync, writeFileSync } from 'node:fs'
|
|
8
|
+
import { dirname, join } from 'node:path'
|
|
9
|
+
import { fileURLToPath } from 'node:url'
|
|
10
|
+
|
|
11
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), '..', 'lib')
|
|
12
|
+
if (!existsSync(root)) {
|
|
13
|
+
console.log('fix-dts: no lib to rewrite')
|
|
14
|
+
process.exit(0)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let files = 0
|
|
18
|
+
let rewrites = 0
|
|
19
|
+
const rewrite = (dir) => {
|
|
20
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
21
|
+
const full = join(dir, entry.name)
|
|
22
|
+
if (entry.isDirectory()) {
|
|
23
|
+
rewrite(full)
|
|
24
|
+
} else if (entry.name.endsWith('.d.ts')) {
|
|
25
|
+
const text = readFileSync(full, 'utf8')
|
|
26
|
+
const next = text.replace(
|
|
27
|
+
/((?:from\s+|import\()['"])(\.\.?\/[^'"]+?)(\.ts|\.tsx)(['"])/gu,
|
|
28
|
+
(match, prefix, specifier, ext, quote) => `${prefix}${specifier}.js${quote}`,
|
|
29
|
+
)
|
|
30
|
+
if (next !== text) {
|
|
31
|
+
writeFileSync(full, next)
|
|
32
|
+
files += 1
|
|
33
|
+
rewrites += (text.match(/(?:from\s+|import\()['"]\.\.?\/[^'"]+?\.tsx?['"]/gu) ?? []).length
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
rewrite(root)
|
|
39
|
+
console.log(`fix-dts: ${files} file(s), ${rewrites} specifier(s) rewritten to .js`)
|
package/scripts/prepare.mjs
CHANGED
|
@@ -22,6 +22,15 @@ if (existsSync(tsc)) {
|
|
|
22
22
|
if (result.status !== 0) {
|
|
23
23
|
process.exit(typeof result.status === 'number' ? result.status : 1)
|
|
24
24
|
}
|
|
25
|
+
// TS 5.9 does not rewrite `.ts` specifiers in declaration emit; fix them so
|
|
26
|
+
// NodeNext declaration consumers can resolve lib.
|
|
27
|
+
const fix = spawnSync(process.execPath, [join(root, 'scripts', 'fix-dts.mjs')], {
|
|
28
|
+
cwd: root,
|
|
29
|
+
stdio: 'inherit',
|
|
30
|
+
})
|
|
31
|
+
if (fix.status !== 0) {
|
|
32
|
+
process.exit(typeof fix.status === 'number' ? fix.status : 1)
|
|
33
|
+
}
|
|
25
34
|
process.exit(0)
|
|
26
35
|
}
|
|
27
36
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Verify the built artifacts after `pnpm run build`: the shipped files the
|
|
2
|
+
// plugin needs are present, the host bundle parses under plain Node, and the
|
|
3
|
+
// host face imports with the expected plugin contract (name === 'dsh-github',
|
|
4
|
+
// apply is a function, no default export). Guards against TypeScript-only
|
|
5
|
+
// syntax leaking into shipped output and against a tarball missing the
|
|
6
|
+
// bundle patch or the Action contract.
|
|
7
|
+
import { execFileSync } from 'node:child_process'
|
|
8
|
+
import { existsSync } from 'node:fs'
|
|
9
|
+
import path from 'node:path'
|
|
10
|
+
import { fileURLToPath, pathToFileURL } from 'node:url'
|
|
11
|
+
|
|
12
|
+
const root = path.dirname(path.dirname(fileURLToPath(import.meta.url)))
|
|
13
|
+
|
|
14
|
+
const required = [
|
|
15
|
+
'lib/index.js',
|
|
16
|
+
'lib/index.d.ts',
|
|
17
|
+
'action.yml',
|
|
18
|
+
'cordis.patch.yml',
|
|
19
|
+
]
|
|
20
|
+
for (const rel of required) {
|
|
21
|
+
if (!existsSync(path.join(root, rel))) throw new Error(`missing artifact: ${rel}`)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
execFileSync(process.execPath, ['--check', path.join(root, 'lib/index.js')], { stdio: 'inherit' })
|
|
25
|
+
|
|
26
|
+
const index = await import(pathToFileURL(path.join(root, 'lib/index.js')).href)
|
|
27
|
+
if ('default' in index) throw new Error('lib/index.js must not carry a default export')
|
|
28
|
+
if (index.name !== 'dsh-github' || typeof index.apply !== 'function') {
|
|
29
|
+
throw new Error('lib/index.js exports an unexpected plugin face')
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
console.log('artifacts OK: syntax + ESM import + bundle patch and action contract present')
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Rejects dependency specs that leave the repository root (file/link/portal/
|
|
2
|
+
// workspace/git/http paths) so the published package stays installable from
|
|
3
|
+
// the registry or a tarball with no external references.
|
|
4
|
+
import { readFileSync } from 'node:fs'
|
|
5
|
+
import path from 'node:path'
|
|
6
|
+
import { fileURLToPath } from 'node:url'
|
|
7
|
+
|
|
8
|
+
const root = path.dirname(path.dirname(fileURLToPath(import.meta.url)))
|
|
9
|
+
const pkg = JSON.parse(readFileSync(path.join(root, 'package.json'), 'utf8'))
|
|
10
|
+
|
|
11
|
+
const failures = []
|
|
12
|
+
const check = (deps, label) => {
|
|
13
|
+
for (const [name, spec] of Object.entries(deps ?? {})) {
|
|
14
|
+
if (/^(?:file|link|portal|workspace|git\+|https?):/iu.test(spec) || spec.startsWith('.') || path.isAbsolute(spec)) {
|
|
15
|
+
failures.push(`${label} "${name}" uses out-of-repo spec ${JSON.stringify(spec)}`)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
check(pkg.dependencies, 'dependencies')
|
|
20
|
+
check(pkg.devDependencies, 'devDependencies')
|
|
21
|
+
check(pkg.peerDependencies, 'peerDependencies')
|
|
22
|
+
|
|
23
|
+
if (failures.length > 0) {
|
|
24
|
+
console.error(failures.join('\n'))
|
|
25
|
+
process.exit(1)
|
|
26
|
+
}
|
|
27
|
+
console.log('self-contained: all dependency specs resolve from the registry')
|