dsh-github-flow 0.1.0 → 0.1.2

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.
@@ -1,2 +1,2 @@
1
1
  import type { GhExecutor } from '../executor.js';
2
- export declare function registerGhCommand(ctx: any, executor: GhExecutor): void;
2
+ export declare function registerGhCommand(commandsService: any, executor: GhExecutor): void;
@@ -1,63 +1,48 @@
1
- export function registerGhCommand(ctx, executor) {
2
- const commandsService = ctx.get ? ctx.get('commands') : ctx.commands;
1
+ export function registerGhCommand(commandsService, executor) {
3
2
  if (!commandsService || typeof commandsService.register !== 'function')
4
3
  return;
5
- const doRegister = () => {
6
- return commandsService.register({
7
- name: 'gh',
8
- description: 'GitHub CLI 状态与诊断快捷指令',
9
- async handler({ rawInput }) {
10
- const trimmed = (rawInput || '').trim();
11
- if (!trimmed || trimmed === 'status') {
12
- const auth = await executor.checkAuth();
13
- const repo = await executor.getRepoMetadata();
14
- let md = `### GitHub 集成状态\n\n`;
15
- if (auth.loggedIn) {
16
- md += `- **登录账号**: \`${auth.user || '已登录'}\`\n`;
17
- md += `- **授权作用域**: ${auth.scopes?.map((s) => `\`${s}\``).join(', ') || '标准权限'}\n`;
18
- }
19
- else {
20
- md += `- **登录状态**: ❌ 未登录 GitHub\n`;
21
- md += `> 提示:请在系统终端执行 \`gh auth login\` 进行登录。\n`;
22
- }
23
- if (repo) {
24
- md += `\n**当前关联仓库**:\n`;
25
- md += `- 仓库名: [${repo.nameWithOwner}](${repo.url})\n`;
26
- md += `- 默认分支: \`${repo.defaultBranch}\`\n`;
27
- if (repo.description)
28
- md += `- 简介: ${repo.description}\n`;
29
- }
30
- else {
31
- md += `\n*当前目录尚未关联 Git 远程仓库或未托管在 GitHub。*\n`;
32
- }
33
- return {
34
- kind: 'markdown',
35
- text: md,
36
- };
4
+ commandsService.register({
5
+ name: 'gh',
6
+ description: 'GitHub CLI 状态与诊断快捷指令',
7
+ async handler({ rawInput }) {
8
+ const trimmed = (rawInput || '').trim();
9
+ if (!trimmed || trimmed === 'status') {
10
+ const auth = await executor.checkAuth();
11
+ const repo = await executor.getRepoMetadata();
12
+ let md = `### GitHub 集成状态\n\n`;
13
+ if (auth.loggedIn) {
14
+ md += `- **登录账号**: \`${auth.user || '已登录'}\`\n`;
15
+ md += `- **授权作用域**: ${auth.scopes?.map((s) => `\`${s}\``).join(', ') || '标准权限'}\n`;
37
16
  }
38
- if (trimmed === 'help') {
39
- return {
40
- kind: 'markdown',
41
- text: `### DSH GitHub Flow 帮助\n\n- \`/gh status\`: 检查当前 GitHub CLI 账号与仓库连接\n- \`/gh help\`: 显示此帮助信息\n\n可以在对话中直接让 Agent 操作 GitHub,如:\n- *"查看当前仓库有哪些开放的 PR"* \n- *"查看最近一次 CI 失败的原因"* \n- *"帮我给当前分支创建 PR"*`,
42
- };
17
+ else {
18
+ md += `- **登录状态**: ❌ 未登录 GitHub\n`;
19
+ md += `> 提示:请在系统终端执行 \`gh auth login\` 进行登录。\n`;
43
20
  }
21
+ if (repo) {
22
+ md += `\n**当前关联仓库**:\n`;
23
+ md += `- 仓库名: [${repo.nameWithOwner}](${repo.url})\n`;
24
+ md += `- 默认分支: \`${repo.defaultBranch}\`\n`;
25
+ if (repo.description)
26
+ md += `- 简介: ${repo.description}\n`;
27
+ }
28
+ else {
29
+ md += `\n*当前目录尚未关联 Git 远程仓库或未托管在 GitHub。*\n`;
30
+ }
31
+ return {
32
+ kind: 'success',
33
+ text: md,
34
+ };
35
+ }
36
+ if (trimmed === 'help') {
44
37
  return {
45
- kind: 'error',
46
- text: `未知命令选项: /gh ${trimmed}。可用用法: /gh status, /gh help`,
38
+ kind: 'success',
39
+ text: `### DSH GitHub Flow 帮助\n\n- \`/gh status\`: 检查当前 GitHub CLI 账号与仓库连接\n- \`/gh help\`: 显示此帮助信息\n\n可以在对话中直接让 Agent 操作 GitHub,如:\n- *"查看当前仓库有哪些开放的 PR"* \n- *"查看最近一次 CI 失败的原因"* \n- *"帮我给当前分支创建 PR"*`,
47
40
  };
48
- },
49
- });
50
- };
51
- if (ctx.effect) {
52
- ctx.effect(() => {
53
- const dispose = doRegister();
54
- return () => {
55
- if (typeof dispose === 'function')
56
- dispose();
41
+ }
42
+ return {
43
+ kind: 'error',
44
+ text: `未知命令选项: /gh ${trimmed}。可用用法: /gh status, /gh help`,
57
45
  };
58
- }, 'github-flow: gh command');
59
- }
60
- else {
61
- doRegister();
62
- }
46
+ },
47
+ });
63
48
  }
package/lib/index.d.ts CHANGED
@@ -1,17 +1,4 @@
1
- import Schema from '@deepseek-ai/schemastery';
2
- import type { PluginConfig } from './types.js';
3
1
  export declare const name = "dsh-github-flow";
4
- /**
5
- * 仅将核心基础服务作为硬性依赖,解绑 webServer 与 commands。
6
- * 在无 Web 界面环境(如 Headless、纯终端、CI 自动化模式)下也能即刻激活,杜绝 PENDING 卡死。
7
- */
8
- export declare const inject: readonly ['tools'];
9
- /**
10
- * 遵循官方 Cordis 规范导出的强类型配置接口与运行时校验器
11
- */
12
- export interface Config extends PluginConfig {
13
- }
14
- export declare const Config: Schema<Config>;
15
- export declare function apply(ctx: any, config?: Config): void;
16
- export { GitHubService } from './service.js';
2
+ export declare const inject: readonly ['tools', 'commands', 'webServer', 'workspaceRegistry'];
3
+ export declare function apply(ctx: any): void;
17
4
  export * from './types.js';
package/lib/index.js CHANGED
@@ -1,6 +1,4 @@
1
- import Schema from '@deepseek-ai/schemastery';
2
1
  import { GhExecutor } from './executor.js';
3
- import { GitHubService } from './service.js';
4
2
  import { createPrTool } from './tools/pr.js';
5
3
  import { createIssueTool } from './tools/issue.js';
6
4
  import { createRunTool } from './tools/run.js';
@@ -9,49 +7,24 @@ import { createApiTool } from './tools/api.js';
9
7
  import { registerGhCommand } from './commands/gh.js';
10
8
  import { registerApiRoutes } from './api/routes.js';
11
9
  export const name = 'dsh-github-flow';
12
- /**
13
- * 仅将核心基础服务作为硬性依赖,解绑 webServer 与 commands。
14
- * 在无 Web 界面环境(如 Headless、纯终端、CI 自动化模式)下也能即刻激活,杜绝 PENDING 卡死。
15
- */
16
- export const inject = ['tools'];
17
- export const Config = Schema.object({
18
- ghPath: Schema.string().default('gh').description('GitHub CLI (gh) 二进制可执行文件路径'),
19
- defaultTimeoutMs: Schema.number().default(30000).description('CLI 命令执行超时毫秒数'),
20
- maxOutputChars: Schema.number().default(24000).description('防止 Token 溢出的单次截断安全阈值字符数'),
21
- cacheTtlMs: Schema.number().default(15000).description('Web API 概览数据缓存有效时长 (ms)'),
22
- defaultListLimit: Schema.number().default(20).description('默认查询列表返回条数'),
23
- });
24
- export function apply(ctx, config = {}) {
25
- // 1. 初始化具备动态配置能力的执行引擎
26
- const executor = new GhExecutor(config);
27
- // 2. 将核心能力提升挂载为 Cordis 原生微内核服务 (ctx.github)
28
- new GitHubService(ctx, executor);
29
- // 3. 注册 Agent 模型工具集(5 大核心领域工具)
30
- if (ctx.tools && typeof ctx.tools.register === 'function') {
10
+ export const inject = ['tools', 'commands', 'webServer', 'workspaceRegistry'];
11
+ export function apply(ctx) {
12
+ const executor = new GhExecutor();
13
+ // 1. 注册人类 Slash 命令 (/gh status, /gh help)
14
+ if (ctx.commands) {
15
+ registerGhCommand(ctx.commands, executor);
16
+ }
17
+ // 2. 注册 Agent 模型工具集(5 大核心领域工具)
18
+ if (ctx.tools) {
31
19
  ctx.tools.register(createPrTool(executor));
32
20
  ctx.tools.register(createIssueTool(executor));
33
21
  ctx.tools.register(createRunTool(executor));
34
22
  ctx.tools.register(createRepoTool(executor));
35
23
  ctx.tools.register(createApiTool(executor));
36
24
  }
37
- // 4. 可选依赖:命令服务(存在时动态激活,不阻塞主流程)
38
- if (ctx.inject && typeof ctx.inject === 'function') {
39
- ctx.inject(['commands'], (innerCtx) => {
40
- registerGhCommand(innerCtx, executor);
41
- });
42
- }
43
- else if (ctx.commands) {
44
- registerGhCommand(ctx, executor);
45
- }
46
- // 5. 可选依赖:Web 界面服务(存在时动态注入路由并由 effect 管理生命周期)
47
- if (ctx.inject && typeof ctx.inject === 'function') {
48
- ctx.inject(['webServer'], (innerCtx) => {
49
- registerApiRoutes(innerCtx, executor, config);
50
- });
51
- }
52
- else if (ctx.webServer) {
53
- registerApiRoutes(ctx, executor, config);
25
+ // 3. 注册面向 Client 端的 WebServer HTTP 路由
26
+ if (ctx.webServer) {
27
+ registerApiRoutes(ctx.webServer, executor, ctx.workspaceRegistry);
54
28
  }
55
29
  }
56
- export { GitHubService } from './service.js';
57
30
  export * from './types.js';
package/lib/main.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export declare const name = "dsh-github-flow";
2
+ export declare const inject: readonly ['tools', 'commands', 'webServer', 'workspaceRegistry'];
3
+ export declare function apply(ctx: any): void;
4
+ export * from './types.js';
package/lib/main.js ADDED
@@ -0,0 +1,30 @@
1
+ import { GhExecutor } from './executor.js';
2
+ import { createPrTool } from './tools/pr.js';
3
+ import { createIssueTool } from './tools/issue.js';
4
+ import { createRunTool } from './tools/run.js';
5
+ import { createRepoTool } from './tools/repo.js';
6
+ import { createApiTool } from './tools/api.js';
7
+ import { registerGhCommand } from './commands/gh.js';
8
+ import { registerApiRoutes } from './api/routes.js';
9
+ export const name = 'dsh-github-flow';
10
+ export const inject = ['tools', 'commands', 'webServer', 'workspaceRegistry'];
11
+ export function apply(ctx) {
12
+ const executor = new GhExecutor();
13
+ // 1. 注册人类 Slash 命令 (/gh status, /gh help)
14
+ if (ctx.commands) {
15
+ registerGhCommand(ctx.commands, executor);
16
+ }
17
+ // 2. 注册 Agent 模型工具集(5 大核心领域工具)
18
+ if (ctx.tools) {
19
+ ctx.tools.register(createPrTool(executor));
20
+ ctx.tools.register(createIssueTool(executor));
21
+ ctx.tools.register(createRunTool(executor));
22
+ ctx.tools.register(createRepoTool(executor));
23
+ ctx.tools.register(createApiTool(executor));
24
+ }
25
+ // 3. 注册面向 Client 端的 WebServer HTTP 路由
26
+ if (ctx.webServer) {
27
+ registerApiRoutes(ctx.webServer, executor, ctx.workspaceRegistry);
28
+ }
29
+ }
30
+ export * from './types.js';
@@ -1,2 +1,38 @@
1
1
  import type { GhExecutor } from '../executor.js';
2
- export declare function createApiTool(executor: GhExecutor): any;
2
+ export declare function createApiTool(executor: GhExecutor): {
3
+ name: string;
4
+ description: string;
5
+ parameters: {
6
+ type: string;
7
+ properties: {
8
+ endpoint: {
9
+ type: string;
10
+ description: string;
11
+ };
12
+ method: {
13
+ type: string;
14
+ enum: string[];
15
+ description: string;
16
+ };
17
+ jq: {
18
+ type: string;
19
+ description: string;
20
+ };
21
+ fields: {
22
+ type: string;
23
+ description: string;
24
+ };
25
+ };
26
+ required: string[];
27
+ };
28
+ output: {
29
+ schema: {
30
+ type: string;
31
+ };
32
+ render(args: any, value: any): {
33
+ type: string;
34
+ text: string;
35
+ }[];
36
+ };
37
+ execute(args: any, execContext: any): Promise<{} | undefined>;
38
+ };
package/lib/tools/api.js CHANGED
@@ -1,6 +1,5 @@
1
- import { defineSafeTool } from './define.js';
2
1
  export function createApiTool(executor) {
3
- return defineSafeTool({
2
+ return {
4
3
  name: 'github_api',
5
4
  description: '通过 GitHub CLI 认证环境直接调用任意 GitHub REST 或 GraphQL API 端点(兜底逃生门)。支持 --jq 过滤。',
6
5
  parameters: {
@@ -51,5 +50,5 @@ export function createApiTool(executor) {
51
50
  throw new Error(res.error);
52
51
  return res.data || res.rawOutput;
53
52
  },
54
- });
53
+ };
55
54
  }
@@ -1,2 +1,56 @@
1
1
  import type { GhExecutor } from '../executor.js';
2
- export declare function createIssueTool(executor: GhExecutor): any;
2
+ export declare function createIssueTool(executor: GhExecutor): {
3
+ name: string;
4
+ description: string;
5
+ parameters: {
6
+ type: string;
7
+ properties: {
8
+ action: {
9
+ type: string;
10
+ enum: string[];
11
+ description: string;
12
+ };
13
+ issue_number: {
14
+ type: string;
15
+ description: string;
16
+ };
17
+ repo: {
18
+ type: string;
19
+ description: string;
20
+ };
21
+ title: {
22
+ type: string;
23
+ description: string;
24
+ };
25
+ body: {
26
+ type: string;
27
+ description: string;
28
+ };
29
+ labels: {
30
+ type: string;
31
+ items: {
32
+ type: string;
33
+ };
34
+ description: string;
35
+ };
36
+ assignees: {
37
+ type: string;
38
+ items: {
39
+ type: string;
40
+ };
41
+ description: string;
42
+ };
43
+ };
44
+ required: string[];
45
+ };
46
+ output: {
47
+ schema: {
48
+ type: string;
49
+ };
50
+ render(args: any, value: any): {
51
+ type: string;
52
+ text: string;
53
+ }[];
54
+ };
55
+ execute(args: any, execContext: any): Promise<{} | undefined>;
56
+ };
@@ -1,6 +1,5 @@
1
- import { defineSafeTool } from './define.js';
2
1
  export function createIssueTool(executor) {
3
- return defineSafeTool({
2
+ return {
4
3
  name: 'github_issue',
5
4
  description: '管理 GitHub Issues。支持查看 Issue 列表、详情、创建新 Issue、追加评论以及关闭 Issue。',
6
5
  parameters: {
@@ -105,5 +104,5 @@ export function createIssueTool(executor) {
105
104
  throw new Error(`未知的 Issue 操作: ${args.action}`);
106
105
  }
107
106
  },
108
- });
107
+ };
109
108
  }
package/lib/tools/pr.d.ts CHANGED
@@ -1,2 +1,60 @@
1
1
  import type { GhExecutor } from '../executor.js';
2
- export declare function createPrTool(executor: GhExecutor): any;
2
+ export declare function createPrTool(executor: GhExecutor): {
3
+ name: string;
4
+ description: string;
5
+ parameters: {
6
+ type: string;
7
+ properties: {
8
+ action: {
9
+ type: string;
10
+ enum: string[];
11
+ description: string;
12
+ };
13
+ pr_number: {
14
+ type: string;
15
+ description: string;
16
+ };
17
+ repo: {
18
+ type: string;
19
+ description: string;
20
+ };
21
+ title: {
22
+ type: string;
23
+ description: string;
24
+ };
25
+ body: {
26
+ type: string;
27
+ description: string;
28
+ };
29
+ base: {
30
+ type: string;
31
+ description: string;
32
+ };
33
+ draft: {
34
+ type: string;
35
+ description: string;
36
+ };
37
+ review_decision: {
38
+ type: string;
39
+ enum: string[];
40
+ description: string;
41
+ };
42
+ merge_method: {
43
+ type: string;
44
+ enum: string[];
45
+ description: string;
46
+ };
47
+ };
48
+ required: string[];
49
+ };
50
+ output: {
51
+ schema: {
52
+ type: string;
53
+ };
54
+ render(args: any, value: any): {
55
+ type: string;
56
+ text: string;
57
+ }[];
58
+ };
59
+ execute(args: any, execContext: any): Promise<{} | undefined>;
60
+ };
package/lib/tools/pr.js CHANGED
@@ -1,6 +1,5 @@
1
- import { defineSafeTool } from './define.js';
2
1
  export function createPrTool(executor) {
3
- return defineSafeTool({
2
+ return {
4
3
  name: 'github_pr',
5
4
  description: '管理与审查 GitHub Pull Request (PR)。支持查看列表、详情、差异比对、CI 检查状态、代码审查与合并操作。默认针对当前工作区关联的仓库。',
6
5
  parameters: {
@@ -126,5 +125,5 @@ export function createPrTool(executor) {
126
125
  throw new Error(`未知的 PR 操作: ${args.action}`);
127
126
  }
128
127
  },
129
- });
128
+ };
130
129
  }
@@ -1,2 +1,38 @@
1
1
  import type { GhExecutor } from '../executor.js';
2
- export declare function createRepoTool(executor: GhExecutor): any;
2
+ export declare function createRepoTool(executor: GhExecutor): {
3
+ name: string;
4
+ description: string;
5
+ parameters: {
6
+ type: string;
7
+ properties: {
8
+ action: {
9
+ type: string;
10
+ enum: string[];
11
+ description: string;
12
+ };
13
+ repo: {
14
+ type: string;
15
+ description: string;
16
+ };
17
+ query: {
18
+ type: string;
19
+ description: string;
20
+ };
21
+ limit: {
22
+ type: string;
23
+ description: string;
24
+ };
25
+ };
26
+ required: string[];
27
+ };
28
+ output: {
29
+ schema: {
30
+ type: string;
31
+ };
32
+ render(args: any, value: any): {
33
+ type: string;
34
+ text: string;
35
+ }[];
36
+ };
37
+ execute(args: any, execContext: any): Promise<{} | undefined>;
38
+ };
package/lib/tools/repo.js CHANGED
@@ -1,6 +1,5 @@
1
- import { defineSafeTool } from './define.js';
2
1
  export function createRepoTool(executor) {
3
- return defineSafeTool({
2
+ return {
4
3
  name: 'github_repo',
5
4
  description: '查看 GitHub 仓库元数据与跨仓库检索代码、Issue。默认查询当前工作区关联的仓库。',
6
5
  parameters: {
@@ -64,5 +63,5 @@ export function createRepoTool(executor) {
64
63
  throw new Error(`未知的 Repo 操作: ${args.action}`);
65
64
  }
66
65
  },
67
- });
66
+ };
68
67
  }
@@ -1,2 +1,38 @@
1
1
  import type { GhExecutor } from '../executor.js';
2
- export declare function createRunTool(executor: GhExecutor): any;
2
+ export declare function createRunTool(executor: GhExecutor): {
3
+ name: string;
4
+ description: string;
5
+ parameters: {
6
+ type: string;
7
+ properties: {
8
+ action: {
9
+ type: string;
10
+ enum: string[];
11
+ description: string;
12
+ };
13
+ run_id: {
14
+ type: string;
15
+ description: string;
16
+ };
17
+ repo: {
18
+ type: string;
19
+ description: string;
20
+ };
21
+ limit: {
22
+ type: string;
23
+ description: string;
24
+ };
25
+ };
26
+ required: string[];
27
+ };
28
+ output: {
29
+ schema: {
30
+ type: string;
31
+ };
32
+ render(args: any, value: any): {
33
+ type: string;
34
+ text: string;
35
+ }[];
36
+ };
37
+ execute(args: any, execContext: any): Promise<{} | undefined>;
38
+ };
package/lib/tools/run.js CHANGED
@@ -1,6 +1,5 @@
1
- import { defineSafeTool } from './define.js';
2
1
  export function createRunTool(executor) {
3
- return defineSafeTool({
2
+ return {
4
3
  name: 'github_run',
5
4
  description: '排查和诊断 GitHub Actions 工作流构建状态。特别优化了获取失败步骤日志能力(log_failed),专供 Agent 快速定位 CI 报错。',
6
5
  parameters: {
@@ -83,5 +82,5 @@ export function createRunTool(executor) {
83
82
  throw new Error(`未知的 Run 操作: ${args.action}`);
84
83
  }
85
84
  },
86
- });
85
+ };
87
86
  }
package/lib/types.d.ts CHANGED
@@ -152,16 +152,3 @@ export interface GlobalOverviewData {
152
152
  lastUpdated: string;
153
153
  error?: string;
154
154
  }
155
- declare module '@deepseek-ai/cordis' {
156
- interface Events {
157
- 'github/pr:create'(repo: string, pr: {
158
- title: string;
159
- url: string;
160
- }): void;
161
- 'github/pr:merge'(repo: string, prNumber: number): void;
162
- 'github/issue:create'(repo: string, issue: {
163
- title: string;
164
- url: string;
165
- }): void;
166
- }
167
- }
package/package.json CHANGED
@@ -1,12 +1,21 @@
1
1
  {
2
2
  "name": "dsh-github-flow",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "icon": "icon.svg",
5
5
  "description": "GitHub Flow: Native GitHub CLI (gh) integration for DeepSeek Harness — Agent Tools, Slash Commands, and Web UI Workspace",
6
6
  "type": "module",
7
- "main": "./lib/index.js",
7
+ "main": "./lib/main.js",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/ItQianChen/dsh-github-flow.git"
11
+ },
12
+ "homepage": "https://github.com/ItQianChen/dsh-github-flow#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/ItQianChen/dsh-github-flow/issues"
15
+ },
8
16
  "exports": {
9
- ".": "./lib/index.js",
17
+ ".": "./lib/main.js",
18
+ "./entry": "./lib/main.js",
10
19
  "./client": "./lib/client.js",
11
20
  "./package.json": "./package.json"
12
21
  },
@@ -14,7 +23,10 @@
14
23
  "lib",
15
24
  "icon.svg",
16
25
  "cordis.patch.yml",
17
- "README.md"
26
+ "README.md",
27
+ "README.en.md",
28
+ "LICENSE",
29
+ "docs"
18
30
  ],
19
31
  "scripts": {
20
32
  "build": "tsc && node scripts/build.mjs",
@@ -42,13 +54,6 @@
42
54
  "access": "public",
43
55
  "registry": "https://registry.npmjs.org/"
44
56
  },
45
- "peerDependencies": {
46
- "@deepseek-ai/cordis": "*",
47
- "@deepseek-ai/schemastery": "^3.18.4"
48
- },
49
- "dependencies": {
50
- "@deepseek-ai/schemastery": "^3.18.4"
51
- },
52
57
  "devDependencies": {
53
58
  "@types/node": "^26.6.3",
54
59
  "typescript": "^7.0.2"
package/lib/service.d.ts DELETED
@@ -1,28 +0,0 @@
1
- import type { GhExecutor } from './executor.js';
2
- import type { GhExecutionOptions, GhResult, AuthStatus, RepoMetadata } from './types.js';
3
- declare module '@deepseek-ai/cordis' {
4
- interface Context {
5
- github: GitHubService;
6
- }
7
- }
8
- /**
9
- * DSH GitHub 原生微内核服务
10
- * 允许生态内其他插件通过 ctx.github 或 inject: ['github'] 消费 GitHub CLI 能力
11
- */
12
- export declare class GitHubService {
13
- private ctx;
14
- executor: GhExecutor;
15
- constructor(ctx: any, executor: GhExecutor);
16
- /**
17
- * 执行原生 gh 命令
18
- */
19
- run<T = unknown>(args: string[], options?: GhExecutionOptions): Promise<GhResult<T>>;
20
- /**
21
- * 检查宿主机 GitHub CLI 认证状态
22
- */
23
- checkAuth(cwd?: string): Promise<AuthStatus>;
24
- /**
25
- * 获取指定工作区路径下的 Git 关联元数据
26
- */
27
- getRepoMetadata(cwd?: string): Promise<RepoMetadata | null>;
28
- }