@ghx-dev/core 0.1.2 → 0.2.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/.claude-plugin/plugin.json +21 -0
- package/README.md +49 -45
- package/dist/cards/issue.assignees.add.yaml +51 -0
- package/dist/cards/issue.assignees.remove.yaml +51 -0
- package/dist/cards/issue.assignees.set.yaml +48 -0
- package/dist/cards/issue.close.yaml +17 -2
- package/dist/cards/issue.comments.create.yaml +17 -2
- package/dist/cards/issue.comments.list.yaml +1 -0
- package/dist/cards/issue.create.yaml +12 -0
- package/dist/cards/issue.delete.yaml +17 -2
- package/dist/cards/issue.labels.add.yaml +49 -0
- package/dist/cards/issue.labels.remove.yaml +51 -0
- package/dist/cards/issue.labels.set.yaml +48 -0
- package/dist/cards/issue.list.yaml +1 -0
- package/dist/cards/issue.milestone.clear.yaml +41 -0
- package/dist/cards/issue.milestone.set.yaml +24 -4
- package/dist/{core/registry/cards/issue.blocked_by.add.yaml → cards/issue.relations.blocked_by.add.yaml} +4 -2
- package/dist/cards/{issue.blocked_by.remove.yaml → issue.relations.blocked_by.remove.yaml} +2 -1
- package/dist/cards/{issue.parent.remove.yaml → issue.relations.parent.remove.yaml} +12 -1
- package/dist/{core/registry/cards/issue.parent.set.yaml → cards/issue.relations.parent.set.yaml} +4 -2
- package/dist/{core/registry/cards/issue.linked_prs.list.yaml → cards/issue.relations.prs.list.yaml} +2 -1
- package/dist/cards/{issue.relations.get.yaml → issue.relations.view.yaml} +2 -1
- package/dist/cards/issue.reopen.yaml +17 -2
- package/dist/cards/issue.update.yaml +17 -2
- package/dist/cards/issue.view.yaml +8 -5
- package/dist/cards/pr.assignees.add.yaml +33 -0
- package/dist/cards/pr.assignees.remove.yaml +33 -0
- package/dist/cards/pr.branch.update.yaml +6 -2
- package/dist/{core/registry/cards/pr.status.checks.yaml → cards/pr.checks.list.yaml} +15 -2
- package/dist/{core/registry/cards/pr.checks.rerun_all.yaml → cards/pr.checks.rerun.all.yaml} +2 -4
- package/dist/{core/registry/cards/pr.checks.rerun_failed.yaml → cards/pr.checks.rerun.failed.yaml} +3 -5
- package/dist/cards/pr.create.yaml +34 -0
- package/dist/cards/{pr.diff.list_files.yaml → pr.diff.files.yaml} +2 -1
- package/dist/cards/{pr.ready_for_review.set.yaml → pr.diff.view.yaml} +6 -8
- package/dist/cards/pr.list.yaml +1 -0
- package/dist/{core/registry/cards/pr.mergeability.view.yaml → cards/pr.merge.status.yaml} +7 -3
- package/dist/{core/registry/cards/pr.merge.execute.yaml → cards/pr.merge.yaml} +10 -4
- package/dist/cards/pr.reviews.list.yaml +2 -1
- package/dist/cards/{pr.reviewers.request.yaml → pr.reviews.request.yaml} +7 -4
- package/dist/cards/pr.reviews.submit.yaml +68 -0
- package/dist/cards/{pr.comments.list.yaml → pr.threads.list.yaml} +3 -2
- package/dist/cards/{pr.comment.reply.yaml → pr.threads.reply.yaml} +5 -2
- package/dist/{core/registry/cards/pr.comment.resolve.yaml → cards/pr.threads.resolve.yaml} +2 -1
- package/dist/cards/{pr.comment.unresolve.yaml → pr.threads.unresolve.yaml} +2 -1
- package/dist/cards/pr.update.yaml +34 -0
- package/dist/cards/pr.view.yaml +8 -5
- package/dist/cards/project_v2.fields.list.yaml +18 -2
- package/dist/cards/{project_v2.item.field.update.yaml → project_v2.items.field.update.yaml} +9 -6
- package/dist/cards/{project_v2.item.add_issue.yaml → project_v2.items.issue.add.yaml} +10 -6
- package/dist/cards/project_v2.items.issue.remove.yaml +26 -0
- package/dist/cards/project_v2.items.list.yaml +8 -2
- package/dist/{core/registry/cards/project_v2.org.get.yaml → cards/project_v2.org.view.yaml} +7 -3
- package/dist/cards/{project_v2.user.get.yaml → project_v2.user.view.yaml} +7 -3
- package/dist/{core/registry/cards/release.create_draft.yaml → cards/release.create.yaml} +1 -1
- package/dist/cards/release.list.yaml +8 -3
- package/dist/cards/{release.publish_draft.yaml → release.publish.yaml} +1 -1
- package/dist/cards/{release.get.yaml → release.view.yaml} +9 -5
- package/dist/cards/repo.issue_types.list.yaml +7 -3
- package/dist/cards/repo.labels.list.yaml +7 -2
- package/dist/cards/repo.view.yaml +3 -4
- package/dist/cards/{workflow_dispatch.run.yaml → workflow.dispatch.yaml} +1 -1
- package/dist/cards/{workflow_job.logs.get.yaml → workflow.job.logs.raw.yaml} +2 -2
- package/dist/{core/registry/cards/workflow_job.logs.analyze.yaml → cards/workflow.job.logs.view.yaml} +1 -1
- package/dist/{core/registry/cards/workflow_run.artifacts.list.yaml → cards/workflow.run.artifacts.list.yaml} +1 -1
- package/dist/cards/{workflow_run.cancel.yaml → workflow.run.cancel.yaml} +1 -1
- package/dist/cards/{workflow_run.rerun_all.yaml → workflow.run.rerun.all.yaml} +3 -3
- package/dist/{core/registry/cards/workflow_run.rerun_failed.yaml → cards/workflow.run.rerun.failed.yaml} +3 -3
- package/dist/{core/registry/cards/workflow_run.get.yaml → cards/workflow.run.view.yaml} +19 -4
- package/dist/cards/{workflow_runs.list.yaml → workflow.runs.list.yaml} +1 -1
- package/dist/cards/{workflow.get.yaml → workflow.view.yaml} +2 -2
- package/dist/chunk-3DU2WHXF.js +15 -0
- package/dist/chunk-3DU2WHXF.js.map +1 -0
- package/dist/chunk-7HUKYNI2.js +536 -0
- package/dist/chunk-7HUKYNI2.js.map +1 -0
- package/dist/chunk-GQO6BHJV.js +98 -0
- package/dist/chunk-GQO6BHJV.js.map +1 -0
- package/dist/chunk-H7CLZHRO.js +280 -0
- package/dist/chunk-H7CLZHRO.js.map +1 -0
- package/dist/chunk-HEHONZTO.js +121 -0
- package/dist/chunk-HEHONZTO.js.map +1 -0
- package/dist/chunk-M5PJLKL5.js +6132 -0
- package/dist/chunk-M5PJLKL5.js.map +1 -0
- package/dist/chunk-NQ53ETYV.js +128 -0
- package/dist/chunk-NQ53ETYV.js.map +1 -0
- package/dist/chunk-OQWLEFAH.js +436 -0
- package/dist/chunk-OQWLEFAH.js.map +1 -0
- package/dist/chunk-Q2NW7DJE.js +878 -0
- package/dist/chunk-Q2NW7DJE.js.map +1 -0
- package/dist/chunk-QRHKAMRY.js +211 -0
- package/dist/chunk-QRHKAMRY.js.map +1 -0
- package/dist/chunk-R3CBGJZX.js +12 -0
- package/dist/chunk-R3CBGJZX.js.map +1 -0
- package/dist/chunk-TGL33GEA.js +132 -0
- package/dist/chunk-TGL33GEA.js.map +1 -0
- package/dist/chunk-TPQYVCAS.js +15 -0
- package/dist/chunk-TPQYVCAS.js.map +1 -0
- package/dist/chunk-ZGBVX2VG.js +32 -0
- package/dist/chunk-ZGBVX2VG.js.map +1 -0
- package/dist/cli/index.js +268 -22
- package/dist/cli/index.js.map +1 -1
- package/dist/core/registry/cards/issue.assignees.add.yaml +51 -0
- package/dist/core/registry/cards/issue.assignees.remove.yaml +51 -0
- package/dist/core/registry/cards/issue.assignees.set.yaml +48 -0
- package/dist/core/registry/cards/issue.close.yaml +17 -2
- package/dist/core/registry/cards/issue.comments.create.yaml +17 -2
- package/dist/core/registry/cards/issue.comments.list.yaml +1 -0
- package/dist/core/registry/cards/issue.create.yaml +12 -0
- package/dist/core/registry/cards/issue.delete.yaml +17 -2
- package/dist/core/registry/cards/issue.labels.add.yaml +49 -0
- package/dist/core/registry/cards/issue.labels.remove.yaml +51 -0
- package/dist/core/registry/cards/issue.labels.set.yaml +48 -0
- package/dist/core/registry/cards/issue.list.yaml +1 -0
- package/dist/core/registry/cards/issue.milestone.clear.yaml +41 -0
- package/dist/core/registry/cards/issue.milestone.set.yaml +24 -4
- package/dist/{cards/issue.blocked_by.add.yaml → core/registry/cards/issue.relations.blocked_by.add.yaml} +4 -2
- package/dist/core/registry/cards/{issue.blocked_by.remove.yaml → issue.relations.blocked_by.remove.yaml} +2 -1
- package/dist/core/registry/cards/{issue.parent.remove.yaml → issue.relations.parent.remove.yaml} +12 -1
- package/dist/{cards/issue.parent.set.yaml → core/registry/cards/issue.relations.parent.set.yaml} +4 -2
- package/dist/{cards/issue.linked_prs.list.yaml → core/registry/cards/issue.relations.prs.list.yaml} +2 -1
- package/dist/core/registry/cards/{issue.relations.get.yaml → issue.relations.view.yaml} +2 -1
- package/dist/core/registry/cards/issue.reopen.yaml +17 -2
- package/dist/core/registry/cards/issue.update.yaml +17 -2
- package/dist/core/registry/cards/issue.view.yaml +8 -5
- package/dist/core/registry/cards/pr.assignees.add.yaml +33 -0
- package/dist/core/registry/cards/pr.assignees.remove.yaml +33 -0
- package/dist/core/registry/cards/pr.branch.update.yaml +6 -2
- package/dist/{cards/pr.status.checks.yaml → core/registry/cards/pr.checks.list.yaml} +15 -2
- package/dist/{cards/pr.checks.rerun_all.yaml → core/registry/cards/pr.checks.rerun.all.yaml} +2 -4
- package/dist/{cards/pr.checks.rerun_failed.yaml → core/registry/cards/pr.checks.rerun.failed.yaml} +3 -5
- package/dist/core/registry/cards/pr.create.yaml +34 -0
- package/dist/core/registry/cards/{pr.diff.list_files.yaml → pr.diff.files.yaml} +2 -1
- package/dist/core/registry/cards/{pr.ready_for_review.set.yaml → pr.diff.view.yaml} +6 -8
- package/dist/core/registry/cards/pr.list.yaml +1 -0
- package/dist/{cards/pr.mergeability.view.yaml → core/registry/cards/pr.merge.status.yaml} +7 -3
- package/dist/{cards/pr.merge.execute.yaml → core/registry/cards/pr.merge.yaml} +10 -4
- package/dist/core/registry/cards/pr.reviews.list.yaml +2 -1
- package/dist/core/registry/cards/{pr.reviewers.request.yaml → pr.reviews.request.yaml} +7 -4
- package/dist/core/registry/cards/pr.reviews.submit.yaml +68 -0
- package/dist/core/registry/cards/{pr.comments.list.yaml → pr.threads.list.yaml} +3 -2
- package/dist/core/registry/cards/{pr.comment.reply.yaml → pr.threads.reply.yaml} +5 -2
- package/dist/{cards/pr.comment.resolve.yaml → core/registry/cards/pr.threads.resolve.yaml} +2 -1
- package/dist/core/registry/cards/{pr.comment.unresolve.yaml → pr.threads.unresolve.yaml} +2 -1
- package/dist/core/registry/cards/pr.update.yaml +34 -0
- package/dist/core/registry/cards/pr.view.yaml +8 -5
- package/dist/core/registry/cards/project_v2.fields.list.yaml +18 -2
- package/dist/core/registry/cards/{project_v2.item.field.update.yaml → project_v2.items.field.update.yaml} +9 -6
- package/dist/core/registry/cards/{project_v2.item.add_issue.yaml → project_v2.items.issue.add.yaml} +10 -6
- package/dist/core/registry/cards/project_v2.items.issue.remove.yaml +26 -0
- package/dist/core/registry/cards/project_v2.items.list.yaml +8 -2
- package/dist/{cards/project_v2.org.get.yaml → core/registry/cards/project_v2.org.view.yaml} +7 -3
- package/dist/core/registry/cards/{project_v2.user.get.yaml → project_v2.user.view.yaml} +7 -3
- package/dist/{cards/release.create_draft.yaml → core/registry/cards/release.create.yaml} +1 -1
- package/dist/core/registry/cards/release.list.yaml +8 -3
- package/dist/core/registry/cards/{release.publish_draft.yaml → release.publish.yaml} +1 -1
- package/dist/core/registry/cards/{release.get.yaml → release.view.yaml} +9 -5
- package/dist/core/registry/cards/repo.issue_types.list.yaml +7 -3
- package/dist/core/registry/cards/repo.labels.list.yaml +7 -2
- package/dist/core/registry/cards/repo.view.yaml +3 -4
- package/dist/core/registry/cards/{workflow_dispatch.run.yaml → workflow.dispatch.yaml} +1 -1
- package/dist/core/registry/cards/{workflow_job.logs.get.yaml → workflow.job.logs.raw.yaml} +2 -2
- package/dist/{cards/workflow_job.logs.analyze.yaml → core/registry/cards/workflow.job.logs.view.yaml} +1 -1
- package/dist/{cards/workflow_run.artifacts.list.yaml → core/registry/cards/workflow.run.artifacts.list.yaml} +1 -1
- package/dist/core/registry/cards/{workflow_run.cancel.yaml → workflow.run.cancel.yaml} +1 -1
- package/dist/core/registry/cards/{workflow_run.rerun_all.yaml → workflow.run.rerun.all.yaml} +3 -3
- package/dist/{cards/workflow_run.rerun_failed.yaml → core/registry/cards/workflow.run.rerun.failed.yaml} +3 -3
- package/dist/{cards/workflow_run.get.yaml → core/registry/cards/workflow.run.view.yaml} +19 -4
- package/dist/core/registry/cards/{workflow_runs.list.yaml → workflow.runs.list.yaml} +1 -1
- package/dist/core/registry/cards/{workflow.get.yaml → workflow.view.yaml} +2 -2
- package/dist/index.d.ts +671 -35
- package/dist/index.js +41 -5
- package/dist/index.js.map +1 -1
- package/dist/issue-mutations-OW464JP3.js +645 -0
- package/dist/issue-mutations-OW464JP3.js.map +1 -0
- package/dist/issue-queries-ORG3VPK4.js +93 -0
- package/dist/issue-queries-ORG3VPK4.js.map +1 -0
- package/dist/pr-mutations-WOTG6FAB.js +484 -0
- package/dist/pr-mutations-WOTG6FAB.js.map +1 -0
- package/dist/pr-queries-6CJJW7BT.js +143 -0
- package/dist/pr-queries-6CJJW7BT.js.map +1 -0
- package/dist/project-QFSCYDDW.js +429 -0
- package/dist/project-QFSCYDDW.js.map +1 -0
- package/dist/release-33236BBA.js +57 -0
- package/dist/release-33236BBA.js.map +1 -0
- package/dist/repo-M6DKCWBG.js +82 -0
- package/dist/repo-M6DKCWBG.js.map +1 -0
- package/package.json +19 -16
- package/skills/using-ghx/SKILL.md +127 -0
- package/dist/agent.d.ts +0 -32
- package/dist/agent.js +0 -36
- package/dist/agent.js.map +0 -1
- package/dist/cards/check_run.annotations.list.yaml +0 -35
- package/dist/cards/issue.assignees.update.yaml +0 -27
- package/dist/cards/issue.labels.update.yaml +0 -27
- package/dist/cards/pr.assignees.update.yaml +0 -38
- package/dist/cards/pr.checks.get_failed.yaml +0 -42
- package/dist/cards/pr.review.submit_approve.yaml +0 -26
- package/dist/cards/pr.review.submit_comment.yaml +0 -26
- package/dist/cards/pr.review.submit_request_changes.yaml +0 -26
- package/dist/cards/workflow_run.jobs.list.yaml +0 -35
- package/dist/chunk-2FCPR3XZ.js +0 -54
- package/dist/chunk-2FCPR3XZ.js.map +0 -1
- package/dist/chunk-RDUPMVHG.js +0 -4139
- package/dist/chunk-RDUPMVHG.js.map +0 -1
- package/dist/chunk-UN5YHUNK.js +0 -245
- package/dist/chunk-UN5YHUNK.js.map +0 -1
- package/dist/cli/assets/skills/ghx/SKILL.md +0 -57
- package/dist/core/registry/cards/check_run.annotations.list.yaml +0 -35
- package/dist/core/registry/cards/issue.assignees.update.yaml +0 -27
- package/dist/core/registry/cards/issue.labels.update.yaml +0 -27
- package/dist/core/registry/cards/pr.assignees.update.yaml +0 -38
- package/dist/core/registry/cards/pr.checks.get_failed.yaml +0 -42
- package/dist/core/registry/cards/pr.review.submit_approve.yaml +0 -26
- package/dist/core/registry/cards/pr.review.submit_comment.yaml +0 -26
- package/dist/core/registry/cards/pr.review.submit_request_changes.yaml +0 -26
- package/dist/core/registry/cards/workflow_run.jobs.list.yaml +0 -35
- package/dist/envelope-BpF6MNCv.d.ts +0 -55
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getSdk,
|
|
3
|
+
getSdk2
|
|
4
|
+
} from "./chunk-GQO6BHJV.js";
|
|
5
|
+
import "./chunk-R3CBGJZX.js";
|
|
6
|
+
import {
|
|
7
|
+
assertReleaseViewInput,
|
|
8
|
+
assertRepoAndPaginationInput
|
|
9
|
+
} from "./chunk-OQWLEFAH.js";
|
|
10
|
+
import {
|
|
11
|
+
createGraphqlRequestClient
|
|
12
|
+
} from "./chunk-HEHONZTO.js";
|
|
13
|
+
|
|
14
|
+
// src/gql/domains/release.ts
|
|
15
|
+
function mapReleaseNode(r) {
|
|
16
|
+
return {
|
|
17
|
+
id: r.databaseId ?? null,
|
|
18
|
+
tagName: r.tagName,
|
|
19
|
+
name: r.name ?? null,
|
|
20
|
+
isDraft: r.isDraft,
|
|
21
|
+
isPrerelease: r.isPrerelease,
|
|
22
|
+
url: r.url != null ? String(r.url) : null,
|
|
23
|
+
targetCommitish: r.tagCommit?.oid != null ? String(r.tagCommit.oid) : null,
|
|
24
|
+
createdAt: r.createdAt != null ? String(r.createdAt) : null,
|
|
25
|
+
publishedAt: r.publishedAt != null ? String(r.publishedAt) : null
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
async function runReleaseView(transport, input) {
|
|
29
|
+
assertReleaseViewInput(input);
|
|
30
|
+
const sdk = getSdk2(createGraphqlRequestClient(transport));
|
|
31
|
+
const result = await sdk.ReleaseView(input);
|
|
32
|
+
if (!result.repository?.release) {
|
|
33
|
+
throw new Error("Release not found");
|
|
34
|
+
}
|
|
35
|
+
return mapReleaseNode(result.repository.release);
|
|
36
|
+
}
|
|
37
|
+
async function runReleaseList(transport, input) {
|
|
38
|
+
assertRepoAndPaginationInput(input);
|
|
39
|
+
const sdk = getSdk(createGraphqlRequestClient(transport));
|
|
40
|
+
const result = await sdk.ReleaseList(input);
|
|
41
|
+
if (!result.repository) {
|
|
42
|
+
throw new Error(`Repository ${input.owner}/${input.name} not found`);
|
|
43
|
+
}
|
|
44
|
+
const conn = result.repository.releases;
|
|
45
|
+
return {
|
|
46
|
+
items: (conn?.nodes ?? []).flatMap((n) => n ? [mapReleaseNode(n)] : []),
|
|
47
|
+
pageInfo: {
|
|
48
|
+
hasNextPage: conn?.pageInfo.hasNextPage ?? false,
|
|
49
|
+
endCursor: conn?.pageInfo.endCursor ?? null
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
runReleaseList,
|
|
55
|
+
runReleaseView
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=release-33236BBA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/gql/domains/release.ts"],"sourcesContent":["import { assertReleaseViewInput, assertRepoAndPaginationInput } from \"../assertions.js\"\nimport type { ReleaseListQuery } from \"../operations/release-list.generated.js\"\nimport { getSdk as getReleaseListSdk } from \"../operations/release-list.generated.js\"\nimport type { ReleaseViewQuery } from \"../operations/release-view.generated.js\"\nimport { getSdk as getReleaseViewSdk } from \"../operations/release-view.generated.js\"\nimport type { GraphqlTransport } from \"../transport.js\"\nimport { createGraphqlRequestClient } from \"../transport.js\"\nimport type {\n ReleaseItemData,\n ReleaseListData,\n ReleaseListInput,\n ReleaseViewData,\n ReleaseViewInput,\n} from \"../types.js\"\n\ntype ReleaseNode = {\n databaseId?: number | null\n tagName: string\n name?: string | null\n isDraft: boolean\n isPrerelease: boolean\n url: unknown\n createdAt: unknown\n publishedAt?: unknown\n tagCommit?: { oid: unknown } | null\n}\n\nfunction mapReleaseNode(r: ReleaseNode): ReleaseItemData {\n return {\n id: r.databaseId ?? null,\n tagName: r.tagName,\n name: r.name ?? null,\n isDraft: r.isDraft,\n isPrerelease: r.isPrerelease,\n url: r.url != null ? String(r.url) : null,\n targetCommitish: r.tagCommit?.oid != null ? String(r.tagCommit.oid) : null,\n createdAt: r.createdAt != null ? String(r.createdAt) : null,\n publishedAt: r.publishedAt != null ? String(r.publishedAt) : null,\n }\n}\n\nexport async function runReleaseView(\n transport: GraphqlTransport,\n input: ReleaseViewInput,\n): Promise<ReleaseViewData> {\n assertReleaseViewInput(input)\n const sdk = getReleaseViewSdk(createGraphqlRequestClient(transport))\n const result: ReleaseViewQuery = await sdk.ReleaseView(input)\n if (!result.repository?.release) {\n throw new Error(\"Release not found\")\n }\n return mapReleaseNode(result.repository.release)\n}\n\nexport async function runReleaseList(\n transport: GraphqlTransport,\n input: ReleaseListInput,\n): Promise<ReleaseListData> {\n assertRepoAndPaginationInput(input)\n const sdk = getReleaseListSdk(createGraphqlRequestClient(transport))\n const result: ReleaseListQuery = await sdk.ReleaseList(input)\n if (!result.repository) {\n throw new Error(`Repository ${input.owner}/${input.name} not found`)\n }\n const conn = result.repository.releases\n return {\n items: (conn?.nodes ?? []).flatMap((n) => (n ? [mapReleaseNode(n)] : [])),\n pageInfo: {\n hasNextPage: conn?.pageInfo.hasNextPage ?? false,\n endCursor: conn?.pageInfo.endCursor ?? null,\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AA2BA,SAAS,eAAe,GAAiC;AACvD,SAAO;AAAA,IACL,IAAI,EAAE,cAAc;AAAA,IACpB,SAAS,EAAE;AAAA,IACX,MAAM,EAAE,QAAQ;AAAA,IAChB,SAAS,EAAE;AAAA,IACX,cAAc,EAAE;AAAA,IAChB,KAAK,EAAE,OAAO,OAAO,OAAO,EAAE,GAAG,IAAI;AAAA,IACrC,iBAAiB,EAAE,WAAW,OAAO,OAAO,OAAO,EAAE,UAAU,GAAG,IAAI;AAAA,IACtE,WAAW,EAAE,aAAa,OAAO,OAAO,EAAE,SAAS,IAAI;AAAA,IACvD,aAAa,EAAE,eAAe,OAAO,OAAO,EAAE,WAAW,IAAI;AAAA,EAC/D;AACF;AAEA,eAAsB,eACpB,WACA,OAC0B;AAC1B,yBAAuB,KAAK;AAC5B,QAAM,MAAMA,QAAkB,2BAA2B,SAAS,CAAC;AACnE,QAAM,SAA2B,MAAM,IAAI,YAAY,KAAK;AAC5D,MAAI,CAAC,OAAO,YAAY,SAAS;AAC/B,UAAM,IAAI,MAAM,mBAAmB;AAAA,EACrC;AACA,SAAO,eAAe,OAAO,WAAW,OAAO;AACjD;AAEA,eAAsB,eACpB,WACA,OAC0B;AAC1B,+BAA6B,KAAK;AAClC,QAAM,MAAM,OAAkB,2BAA2B,SAAS,CAAC;AACnE,QAAM,SAA2B,MAAM,IAAI,YAAY,KAAK;AAC5D,MAAI,CAAC,OAAO,YAAY;AACtB,UAAM,IAAI,MAAM,cAAc,MAAM,KAAK,IAAI,MAAM,IAAI,YAAY;AAAA,EACrE;AACA,QAAM,OAAO,OAAO,WAAW;AAC/B,SAAO;AAAA,IACL,QAAQ,MAAM,SAAS,CAAC,GAAG,QAAQ,CAAC,MAAO,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,CAAE;AAAA,IACxE,UAAU;AAAA,MACR,aAAa,MAAM,SAAS,eAAe;AAAA,MAC3C,WAAW,MAAM,SAAS,aAAa;AAAA,IACzC;AAAA,EACF;AACF;","names":["getSdk"]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getSdk,
|
|
3
|
+
getSdk2,
|
|
4
|
+
getSdk3
|
|
5
|
+
} from "./chunk-NQ53ETYV.js";
|
|
6
|
+
import "./chunk-R3CBGJZX.js";
|
|
7
|
+
import {
|
|
8
|
+
assertRepoAndPaginationInput,
|
|
9
|
+
assertRepoInput
|
|
10
|
+
} from "./chunk-OQWLEFAH.js";
|
|
11
|
+
import {
|
|
12
|
+
createGraphqlRequestClient
|
|
13
|
+
} from "./chunk-HEHONZTO.js";
|
|
14
|
+
|
|
15
|
+
// src/gql/domains/repo.ts
|
|
16
|
+
async function runRepoView(transport, input) {
|
|
17
|
+
assertRepoInput(input);
|
|
18
|
+
const sdk = getSdk3(createGraphqlRequestClient(transport));
|
|
19
|
+
const result = await sdk.RepoView(input);
|
|
20
|
+
if (!result.repository) {
|
|
21
|
+
throw new Error("Repository not found");
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
id: result.repository.id,
|
|
25
|
+
name: result.repository.name,
|
|
26
|
+
nameWithOwner: result.repository.nameWithOwner,
|
|
27
|
+
isPrivate: result.repository.isPrivate,
|
|
28
|
+
stargazerCount: result.repository.stargazerCount,
|
|
29
|
+
forkCount: result.repository.forkCount,
|
|
30
|
+
url: result.repository.url,
|
|
31
|
+
defaultBranch: result.repository.defaultBranchRef?.name ?? null
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
async function runRepoLabelsList(transport, input) {
|
|
35
|
+
assertRepoAndPaginationInput(input);
|
|
36
|
+
const sdk = getSdk2(createGraphqlRequestClient(transport));
|
|
37
|
+
const result = await sdk.RepoLabelsList(input);
|
|
38
|
+
if (!result.repository) {
|
|
39
|
+
throw new Error(`Repository ${input.owner}/${input.name} not found`);
|
|
40
|
+
}
|
|
41
|
+
const conn = result.repository?.labels;
|
|
42
|
+
return {
|
|
43
|
+
items: (conn?.nodes ?? []).map((n) => ({
|
|
44
|
+
id: n?.id ?? null,
|
|
45
|
+
name: n?.name ?? null,
|
|
46
|
+
description: n?.description ?? null,
|
|
47
|
+
color: n?.color ?? null,
|
|
48
|
+
isDefault: n?.isDefault ?? null
|
|
49
|
+
})),
|
|
50
|
+
pageInfo: {
|
|
51
|
+
hasNextPage: conn?.pageInfo.hasNextPage ?? false,
|
|
52
|
+
endCursor: conn?.pageInfo.endCursor ?? null
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
async function runRepoIssueTypesList(transport, input) {
|
|
57
|
+
assertRepoAndPaginationInput(input);
|
|
58
|
+
const sdk = getSdk(createGraphqlRequestClient(transport));
|
|
59
|
+
const result = await sdk.RepoIssueTypesList(input);
|
|
60
|
+
if (!result.repository) {
|
|
61
|
+
throw new Error(`Repository ${input.owner}/${input.name} not found`);
|
|
62
|
+
}
|
|
63
|
+
const conn = result.repository?.issueTypes;
|
|
64
|
+
return {
|
|
65
|
+
items: (conn?.nodes ?? []).map((n) => ({
|
|
66
|
+
id: n?.id ?? null,
|
|
67
|
+
name: n?.name ?? null,
|
|
68
|
+
color: n?.color != null ? String(n.color) : null,
|
|
69
|
+
isEnabled: n?.isEnabled ?? null
|
|
70
|
+
})),
|
|
71
|
+
pageInfo: {
|
|
72
|
+
hasNextPage: conn?.pageInfo.hasNextPage ?? false,
|
|
73
|
+
endCursor: conn?.pageInfo.endCursor ?? null
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
runRepoIssueTypesList,
|
|
79
|
+
runRepoLabelsList,
|
|
80
|
+
runRepoView
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=repo-M6DKCWBG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/gql/domains/repo.ts"],"sourcesContent":["import { assertRepoAndPaginationInput, assertRepoInput } from \"../assertions.js\"\nimport type { RepoIssueTypesListQuery } from \"../operations/repo-issue-types-list.generated.js\"\nimport { getSdk as getRepoIssueTypesListSdk } from \"../operations/repo-issue-types-list.generated.js\"\nimport type { RepoLabelsListQuery } from \"../operations/repo-labels-list.generated.js\"\nimport { getSdk as getRepoLabelsListSdk } from \"../operations/repo-labels-list.generated.js\"\nimport type { RepoViewQuery } from \"../operations/repo-view.generated.js\"\nimport { getSdk } from \"../operations/repo-view.generated.js\"\nimport type { GraphqlTransport } from \"../transport.js\"\nimport { createGraphqlRequestClient } from \"../transport.js\"\nimport type {\n RepoIssueTypesListData,\n RepoIssueTypesListInput,\n RepoLabelsListData,\n RepoLabelsListInput,\n RepoViewData,\n RepoViewInput,\n} from \"../types.js\"\n\nexport async function runRepoView(\n transport: GraphqlTransport,\n input: RepoViewInput,\n): Promise<RepoViewData> {\n assertRepoInput(input)\n const sdk = getSdk(createGraphqlRequestClient(transport))\n const result: RepoViewQuery = await sdk.RepoView(input)\n if (!result.repository) {\n throw new Error(\"Repository not found\")\n }\n\n return {\n id: result.repository.id,\n name: result.repository.name,\n nameWithOwner: result.repository.nameWithOwner,\n isPrivate: result.repository.isPrivate,\n stargazerCount: result.repository.stargazerCount,\n forkCount: result.repository.forkCount,\n url: result.repository.url,\n defaultBranch: result.repository.defaultBranchRef?.name ?? null,\n }\n}\n\nexport async function runRepoLabelsList(\n transport: GraphqlTransport,\n input: RepoLabelsListInput,\n): Promise<RepoLabelsListData> {\n assertRepoAndPaginationInput(input)\n const sdk = getRepoLabelsListSdk(createGraphqlRequestClient(transport))\n const result: RepoLabelsListQuery = await sdk.RepoLabelsList(input)\n if (!result.repository) {\n throw new Error(`Repository ${input.owner}/${input.name} not found`)\n }\n const conn = result.repository?.labels\n return {\n items: (conn?.nodes ?? []).map((n) => ({\n id: n?.id ?? null,\n name: n?.name ?? null,\n description: n?.description ?? null,\n color: n?.color ?? null,\n isDefault: n?.isDefault ?? null,\n })),\n pageInfo: {\n hasNextPage: conn?.pageInfo.hasNextPage ?? false,\n endCursor: conn?.pageInfo.endCursor ?? null,\n },\n }\n}\n\nexport async function runRepoIssueTypesList(\n transport: GraphqlTransport,\n input: RepoIssueTypesListInput,\n): Promise<RepoIssueTypesListData> {\n assertRepoAndPaginationInput(input)\n const sdk = getRepoIssueTypesListSdk(createGraphqlRequestClient(transport))\n const result: RepoIssueTypesListQuery = await sdk.RepoIssueTypesList(input)\n if (!result.repository) {\n throw new Error(`Repository ${input.owner}/${input.name} not found`)\n }\n const conn = result.repository?.issueTypes\n return {\n items: (conn?.nodes ?? []).map((n) => ({\n id: n?.id ?? null,\n name: n?.name ?? null,\n color: n?.color != null ? String(n.color) : null,\n isEnabled: n?.isEnabled ?? null,\n })),\n pageInfo: {\n hasNextPage: conn?.pageInfo.hasNextPage ?? false,\n endCursor: conn?.pageInfo.endCursor ?? null,\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,eAAsB,YACpB,WACA,OACuB;AACvB,kBAAgB,KAAK;AACrB,QAAM,MAAMA,QAAO,2BAA2B,SAAS,CAAC;AACxD,QAAM,SAAwB,MAAM,IAAI,SAAS,KAAK;AACtD,MAAI,CAAC,OAAO,YAAY;AACtB,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AAEA,SAAO;AAAA,IACL,IAAI,OAAO,WAAW;AAAA,IACtB,MAAM,OAAO,WAAW;AAAA,IACxB,eAAe,OAAO,WAAW;AAAA,IACjC,WAAW,OAAO,WAAW;AAAA,IAC7B,gBAAgB,OAAO,WAAW;AAAA,IAClC,WAAW,OAAO,WAAW;AAAA,IAC7B,KAAK,OAAO,WAAW;AAAA,IACvB,eAAe,OAAO,WAAW,kBAAkB,QAAQ;AAAA,EAC7D;AACF;AAEA,eAAsB,kBACpB,WACA,OAC6B;AAC7B,+BAA6B,KAAK;AAClC,QAAM,MAAMA,QAAqB,2BAA2B,SAAS,CAAC;AACtE,QAAM,SAA8B,MAAM,IAAI,eAAe,KAAK;AAClE,MAAI,CAAC,OAAO,YAAY;AACtB,UAAM,IAAI,MAAM,cAAc,MAAM,KAAK,IAAI,MAAM,IAAI,YAAY;AAAA,EACrE;AACA,QAAM,OAAO,OAAO,YAAY;AAChC,SAAO;AAAA,IACL,QAAQ,MAAM,SAAS,CAAC,GAAG,IAAI,CAAC,OAAO;AAAA,MACrC,IAAI,GAAG,MAAM;AAAA,MACb,MAAM,GAAG,QAAQ;AAAA,MACjB,aAAa,GAAG,eAAe;AAAA,MAC/B,OAAO,GAAG,SAAS;AAAA,MACnB,WAAW,GAAG,aAAa;AAAA,IAC7B,EAAE;AAAA,IACF,UAAU;AAAA,MACR,aAAa,MAAM,SAAS,eAAe;AAAA,MAC3C,WAAW,MAAM,SAAS,aAAa;AAAA,IACzC;AAAA,EACF;AACF;AAEA,eAAsB,sBACpB,WACA,OACiC;AACjC,+BAA6B,KAAK;AAClC,QAAM,MAAM,OAAyB,2BAA2B,SAAS,CAAC;AAC1E,QAAM,SAAkC,MAAM,IAAI,mBAAmB,KAAK;AAC1E,MAAI,CAAC,OAAO,YAAY;AACtB,UAAM,IAAI,MAAM,cAAc,MAAM,KAAK,IAAI,MAAM,IAAI,YAAY;AAAA,EACrE;AACA,QAAM,OAAO,OAAO,YAAY;AAChC,SAAO;AAAA,IACL,QAAQ,MAAM,SAAS,CAAC,GAAG,IAAI,CAAC,OAAO;AAAA,MACrC,IAAI,GAAG,MAAM;AAAA,MACb,MAAM,GAAG,QAAQ;AAAA,MACjB,OAAO,GAAG,SAAS,OAAO,OAAO,EAAE,KAAK,IAAI;AAAA,MAC5C,WAAW,GAAG,aAAa;AAAA,IAC7B,EAAE;AAAA,IACF,UAAU;AAAA,MACR,aAAa,MAAM,SAAS,eAAe;AAAA,MAC3C,WAAW,MAAM,SAAS,aAAa;AAAA,IACzC;AAAA,EACF;AACF;","names":["getSdk"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ghx-dev/core",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "GitHub execution router for AI agents with deterministic routing and normalized output.",
|
|
5
5
|
"author": "Arye Kogan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,16 +37,14 @@
|
|
|
37
37
|
"import": "./dist/index.js",
|
|
38
38
|
"types": "./dist/index.d.ts"
|
|
39
39
|
},
|
|
40
|
-
"./agent": {
|
|
41
|
-
"import": "./dist/agent.js",
|
|
42
|
-
"types": "./dist/agent.d.ts"
|
|
43
|
-
},
|
|
44
40
|
"./cli": {
|
|
45
41
|
"import": "./dist/cli/index.js"
|
|
46
42
|
}
|
|
47
43
|
},
|
|
48
44
|
"files": [
|
|
49
45
|
"dist",
|
|
46
|
+
".claude-plugin",
|
|
47
|
+
"skills",
|
|
50
48
|
"LICENSE",
|
|
51
49
|
"README.md"
|
|
52
50
|
],
|
|
@@ -59,7 +57,7 @@
|
|
|
59
57
|
"ci": {},
|
|
60
58
|
"ci:extra": {
|
|
61
59
|
"dependsOn": [
|
|
62
|
-
"
|
|
60
|
+
"plugin:sync:check"
|
|
63
61
|
]
|
|
64
62
|
},
|
|
65
63
|
"test:e2e": {}
|
|
@@ -68,27 +66,30 @@
|
|
|
68
66
|
"dependencies": {
|
|
69
67
|
"ajv": "^8.18.0",
|
|
70
68
|
"graphql": "^16.11.0",
|
|
71
|
-
"graphql-tag": "^2.12.6",
|
|
72
69
|
"graphql-request": "^7.3.1",
|
|
70
|
+
"graphql-tag": "^2.12.6",
|
|
73
71
|
"js-yaml": "^4.1.0"
|
|
74
72
|
},
|
|
75
73
|
"devDependencies": {
|
|
76
|
-
"@
|
|
77
|
-
"@vitest/coverage-v8": "^2.1.8",
|
|
78
|
-
"@graphql-codegen/cli": "^6.1.1",
|
|
74
|
+
"@graphql-codegen/cli": "^6.1.2",
|
|
79
75
|
"@graphql-codegen/near-operation-file-preset": "^4.0.0",
|
|
80
|
-
"@graphql-codegen/
|
|
76
|
+
"@graphql-codegen/schema-ast": "^5.0.0",
|
|
77
|
+
"@graphql-codegen/typescript": "^5.0.8",
|
|
81
78
|
"@graphql-codegen/typescript-graphql-request": "^6.3.0",
|
|
82
|
-
"@graphql-codegen/typescript-operations": "^5.0.
|
|
79
|
+
"@graphql-codegen/typescript-operations": "^5.0.8",
|
|
80
|
+
"@opencode-ai/sdk": "^1.2.10",
|
|
83
81
|
"@types/js-yaml": "^4.0.9",
|
|
84
82
|
"@types/node": "^25.2.3",
|
|
83
|
+
"@vitest/coverage-v8": "^2.1.8",
|
|
85
84
|
"tsup": "^8.5.0",
|
|
86
85
|
"tsx": "^4.21.0",
|
|
87
86
|
"typescript": "^5.9.3",
|
|
87
|
+
"vite-tsconfig-paths": "^6.1.1",
|
|
88
88
|
"vitest": "^2.1.8"
|
|
89
89
|
},
|
|
90
90
|
"scripts": {
|
|
91
|
-
"
|
|
91
|
+
"ghx": "tsx src/cli/index.ts",
|
|
92
|
+
"build": "tsup",
|
|
92
93
|
"format": "biome check --write .",
|
|
93
94
|
"format:check": "biome check .",
|
|
94
95
|
"lint": "eslint . --max-warnings=0",
|
|
@@ -98,8 +99,10 @@
|
|
|
98
99
|
"test:coverage": "vitest run --project unit --coverage",
|
|
99
100
|
"test:e2e:local": "vitest run --project e2e:local",
|
|
100
101
|
"test:e2e:sdk": "if [ -n \"$OPENAI_API_KEY\" ]; then vitest run --project e2e:sdk; else echo 'Skipping core SDK E2E: OPENAI_API_KEY not set'; fi",
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"gql:
|
|
102
|
+
"plugin:sync": "node scripts/sync-plugin-manifests.mjs",
|
|
103
|
+
"plugin:sync:check": "node scripts/sync-plugin-manifests.mjs --check",
|
|
104
|
+
"gql:generate": "node scripts/generate-gql-artifacts.mjs && biome check --write --no-errors-on-unmatched src/gql/generated src/gql/operations",
|
|
105
|
+
"gql:schema:refresh": "GITHUB_TOKEN=\"$(gh auth token)\" graphql-codegen --config codegen-schema.ts",
|
|
106
|
+
"gql:verify": "pnpm run gql:generate && git diff --exit-code -- ':(glob)src/gql/**/*.generated.ts'"
|
|
104
107
|
}
|
|
105
108
|
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Execute GitHub operations via ghx — deterministic routing, normalized output, 70 capabilities
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# ghx CLI Skill
|
|
6
|
+
|
|
7
|
+
**CRITICAL:** Use `ghx` for ALL GitHub operations. Do not use `gh api` or any other raw `gh` commands unless no matching ghx capability exists.
|
|
8
|
+
|
|
9
|
+
## Capabilities
|
|
10
|
+
|
|
11
|
+
All available capabilities (`id - description [inputs]`, `?` = optional):
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
repo.view - Fetch repository metadata. [owner, name]
|
|
15
|
+
repo.labels.list - List repository labels. [owner, name, first?, after?]
|
|
16
|
+
repo.issue_types.list - List repository issue types. [owner, name, first?, after?]
|
|
17
|
+
issue.view - Fetch one issue by number. [owner, name, issueNumber]
|
|
18
|
+
issue.list - List repository issues. [owner, name, state?, first?, after?]
|
|
19
|
+
issue.comments.list - List comments for one issue. [owner, name, issueNumber, first, after?]
|
|
20
|
+
issue.create - Create a new issue. [owner, name, title, body?]
|
|
21
|
+
issue.update - Update issue title and/or body. [owner, name, issueNumber, title?, body?]
|
|
22
|
+
issue.close - Close an issue. [owner, name, issueNumber]
|
|
23
|
+
issue.reopen - Reopen a closed issue. [owner, name, issueNumber]
|
|
24
|
+
issue.delete - Delete an issue. [owner, name, issueNumber]
|
|
25
|
+
issue.labels.set - Replace issue labels. [owner, name, issueNumber, labels]
|
|
26
|
+
issue.labels.add - Add labels to an issue without removing existing labels. [owner, name, issueNumber, labels]
|
|
27
|
+
issue.labels.remove - Remove specific labels from an issue. [owner, name, issueNumber, labels]
|
|
28
|
+
issue.assignees.set - Replace issue assignees. [owner, name, issueNumber, assignees]
|
|
29
|
+
issue.assignees.add - Add assignees to an issue without replacing existing ones. [owner, name, issueNumber, assignees]
|
|
30
|
+
issue.assignees.remove - Remove specific assignees from an issue. [owner, name, issueNumber, assignees]
|
|
31
|
+
issue.milestone.set - Set issue milestone number or clear with null. [owner, name, issueNumber, milestoneNumber]
|
|
32
|
+
issue.milestone.clear - Remove the milestone from an issue. [owner, name, issueNumber]
|
|
33
|
+
issue.comments.create - Create an issue comment. [owner, name, issueNumber, body]
|
|
34
|
+
issue.relations.prs.list - List pull requests linked to an issue. [owner, name, issueNumber]
|
|
35
|
+
issue.relations.view - Get issue parent/children/blocking relations. [owner, name, issueNumber]
|
|
36
|
+
issue.relations.parent.set - Set an issue parent relation. [issueId, parentIssueId]
|
|
37
|
+
issue.relations.parent.remove - Remove an issue parent relation. [issueId]
|
|
38
|
+
issue.relations.blocked_by.add - Add a blocked-by relation for an issue. [issueId, blockedByIssueId]
|
|
39
|
+
issue.relations.blocked_by.remove - Remove a blocked-by relation for an issue. [issueId, blockedByIssueId]
|
|
40
|
+
pr.view - Fetch one pull request by number. [owner, name, prNumber]
|
|
41
|
+
pr.list - List repository pull requests. [owner, name, state?, first?, after?]
|
|
42
|
+
pr.create - Create a pull request. [owner, name, title, head, base, body?, draft?]
|
|
43
|
+
pr.update - Update pull request metadata (title, body, draft status). [owner, name, prNumber, title?, body?, draft?]
|
|
44
|
+
pr.threads.list - List PR review threads. [owner, name, prNumber, first?, after?, unresolvedOnly? (default true), includeOutdated? default false]
|
|
45
|
+
pr.threads.reply - Reply to a PR review thread. [threadId, body]
|
|
46
|
+
pr.threads.resolve - Resolve a PR review thread. [threadId]
|
|
47
|
+
pr.threads.unresolve - Unresolve a PR review thread. [threadId]
|
|
48
|
+
pr.reviews.list - List PR reviews (state, author, body). Review-level only — use pr.threads.list for inline comments. [owner, name, prNumber, first?, after?]
|
|
49
|
+
pr.reviews.request - Request PR reviewers. [owner, name, prNumber, reviewers]
|
|
50
|
+
pr.reviews.submit - Submit a PR review (approve/request-changes/comment). Non-empty body required for COMMENT and REQUEST_CHANGES. [owner, name, prNumber, event, body?, comments?[path, body, line, side?, startLine?, startSide?]]
|
|
51
|
+
pr.diff.files - List changed files in a PR diff. [owner, name, prNumber, first?, after?]
|
|
52
|
+
pr.diff.view - View the unified diff for a PR. [owner, name, prNumber]
|
|
53
|
+
pr.checks.list - List PR check statuses with summary counts. [owner, name, prNumber, state?]
|
|
54
|
+
pr.checks.rerun.failed - Rerun failed PR workflow checks for a selected run. [owner, name, prNumber, runId]
|
|
55
|
+
pr.checks.rerun.all - Rerun all PR workflow checks for a selected run. [owner, name, prNumber, runId]
|
|
56
|
+
pr.merge.status - View PR mergeability and readiness signals. [owner, name, prNumber]
|
|
57
|
+
pr.merge - Execute a PR merge. [owner, name, prNumber, method?, deleteBranch?]
|
|
58
|
+
pr.assignees.add - Add assignees to a PR without replacing existing ones. [owner, name, prNumber, assignees]
|
|
59
|
+
pr.assignees.remove - Remove specific assignees from a PR. [owner, name, prNumber, assignees]
|
|
60
|
+
pr.branch.update - Update PR branch with latest base branch changes. [owner, name, prNumber]
|
|
61
|
+
workflow.list - List repository workflows. [owner, name, first?]
|
|
62
|
+
workflow.view - View one repository workflow. [owner, name, workflowId]
|
|
63
|
+
workflow.dispatch - Trigger a workflow dispatch event. [owner, name, workflowId, ref, inputs?]
|
|
64
|
+
workflow.runs.list - List workflow runs for a repository. [owner, name, first?, branch?, event?, status?]
|
|
65
|
+
workflow.run.view - View a workflow run with its jobs. [owner, name, runId]
|
|
66
|
+
workflow.run.cancel - Cancel a workflow run. [owner, name, runId]
|
|
67
|
+
workflow.run.rerun.all - Rerun all jobs in a workflow run. [owner, name, runId]
|
|
68
|
+
workflow.run.rerun.failed - Rerun failed jobs for a workflow run. [owner, name, runId]
|
|
69
|
+
workflow.run.artifacts.list - List artifacts for a workflow run. [owner, name, runId]
|
|
70
|
+
workflow.job.logs.view - Fetch and analyze workflow job logs. [owner, name, jobId]
|
|
71
|
+
workflow.job.logs.raw - Fetch raw (unprocessed) logs for a workflow job. [owner, name, jobId]
|
|
72
|
+
project_v2.org.view - Get an organization Projects v2 project. [org, projectNumber]
|
|
73
|
+
project_v2.user.view - Get a user Projects v2 project. [user, projectNumber]
|
|
74
|
+
project_v2.fields.list - List fields for a Projects v2 project. [owner, projectNumber, first?, after?]
|
|
75
|
+
project_v2.items.list - List items in a Projects v2 project. [owner, projectNumber, first?, after?]
|
|
76
|
+
project_v2.items.issue.add - Add an issue to a Projects v2 project. [owner, projectNumber, issueUrl]
|
|
77
|
+
project_v2.items.issue.remove - Remove an issue from a Projects v2 project. [owner, projectNumber, itemId]
|
|
78
|
+
project_v2.items.field.update - Update a field on a Projects v2 project item. [projectId, itemId, fieldId, valueText?, valueNumber?, valueDate?, valueSingleSelectOptionId?, valueIterationId?, clear?]
|
|
79
|
+
release.list - List releases for a repository. [owner, name, first?, after?]
|
|
80
|
+
release.view - Get release details by tag name. [owner, name, tagName]
|
|
81
|
+
release.create - Create a draft release. [owner, name, tagName, title?, notes?, targetCommitish?, prerelease?]
|
|
82
|
+
release.update - Update a draft release without publishing it. [owner, name, releaseId, tagName?, title?, notes?, targetCommitish?, prerelease?, draft?]
|
|
83
|
+
release.publish - Publish an existing draft release. [owner, name, releaseId, title?, notes?, prerelease?]
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Only if the full input/output schema of a specific capability needed:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
ghx capabilities explain <capability_id>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Execute
|
|
93
|
+
|
|
94
|
+
**Always use heredoc — never inline `--input '...'`.** Inline form breaks with nested quotes and trailing commas in model-generated JSON.
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
ghx run <capability_id> --input - <<'EOF'
|
|
98
|
+
{...}
|
|
99
|
+
EOF
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Example (submitting a review with inline comments):
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
ghx run pr.reviews.submit --input - <<'EOF'
|
|
106
|
+
{"owner": "acme", "name": "my-repo", "prNumber": 42, "event": "REQUEST_CHANGES", "body": "Please fix the issues.", "comments": [{"path": "src/index.ts", "line": 10, "body": "Off-by-one error here."}]}
|
|
107
|
+
EOF
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Result (compact, default):** `{ ok, data?, pagination? }` on success — `{ ok, error: { code, message } }` on failure.
|
|
111
|
+
|
|
112
|
+
## Chain
|
|
113
|
+
|
|
114
|
+
**Always use `ghx chain` when you have two or more operations to execute in a single call.** It batches steps into as few GraphQL round-trips as possible (typically one) — reducing latency and avoiding mid-sequence failures. Steps are not transactional; a `"partial"` result is possible if one step fails after another has already succeeded.
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
ghx chain --steps - <<'EOF'
|
|
118
|
+
[
|
|
119
|
+
{"task":"<capability_id>","input":{...}},
|
|
120
|
+
{"task":"<capability_id>","input":{...}}
|
|
121
|
+
]
|
|
122
|
+
EOF
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Result:** `{ status, results[] }`. Each result: `{ task, ok, data? }` on success — `{ task, ok, error: { code, message } }` on failure.
|
|
126
|
+
|
|
127
|
+
**CRITICAL:** Do not use `gh api` or any other raw `gh` commands unless no matching ghx capability exists. Always try `ghx` first.
|
package/dist/agent.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { R as ResultEnvelope } from './envelope-BpF6MNCv.js';
|
|
2
|
-
|
|
3
|
-
declare const MAIN_SKILL_TEXT: string;
|
|
4
|
-
|
|
5
|
-
type ExecuteTaskFn = (request: {
|
|
6
|
-
task: string;
|
|
7
|
-
input: Record<string, unknown>;
|
|
8
|
-
options?: Record<string, unknown>;
|
|
9
|
-
}) => Promise<ResultEnvelope>;
|
|
10
|
-
declare function createExecuteTool(deps: {
|
|
11
|
-
executeTask: ExecuteTaskFn;
|
|
12
|
-
}): {
|
|
13
|
-
execute(capabilityId: string, params: Record<string, unknown>, options?: Record<string, unknown>): Promise<ResultEnvelope>;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
type CapabilityExplanation = {
|
|
17
|
-
capability_id: string;
|
|
18
|
-
purpose: string;
|
|
19
|
-
required_inputs: string[];
|
|
20
|
-
preferred_route: "cli" | "graphql" | "rest";
|
|
21
|
-
fallback_routes: Array<"cli" | "graphql" | "rest">;
|
|
22
|
-
output_fields: string[];
|
|
23
|
-
};
|
|
24
|
-
declare function explainCapability(capabilityId: string): CapabilityExplanation;
|
|
25
|
-
|
|
26
|
-
type CapabilityListItem = {
|
|
27
|
-
capability_id: string;
|
|
28
|
-
description: string;
|
|
29
|
-
};
|
|
30
|
-
declare function listCapabilities(): CapabilityListItem[];
|
|
31
|
-
|
|
32
|
-
export { MAIN_SKILL_TEXT, createExecuteTool, explainCapability, listCapabilities };
|
package/dist/agent.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
explainCapability,
|
|
3
|
-
listCapabilities
|
|
4
|
-
} from "./chunk-2FCPR3XZ.js";
|
|
5
|
-
import "./chunk-UN5YHUNK.js";
|
|
6
|
-
|
|
7
|
-
// src/agent-interface/prompt/main-skill.ts
|
|
8
|
-
var MAIN_SKILL_TEXT = `
|
|
9
|
-
Use execute(capability_id, params) for all GitHub actions.
|
|
10
|
-
Never call gh help and never fetch GraphQL schema/introspection.
|
|
11
|
-
If required params are unknown, call explain(capability_id) or ask the user.
|
|
12
|
-
Treat ResultEnvelope.ok=false as a failure.
|
|
13
|
-
If error.retryable=true, retry once unless user requested otherwise.
|
|
14
|
-
Only reason about ResultEnvelope.data and ResultEnvelope.error.
|
|
15
|
-
`.trim();
|
|
16
|
-
|
|
17
|
-
// src/agent-interface/tools/execute-tool.ts
|
|
18
|
-
function createExecuteTool(deps) {
|
|
19
|
-
return {
|
|
20
|
-
execute(capabilityId, params, options) {
|
|
21
|
-
const request = {
|
|
22
|
-
task: capabilityId,
|
|
23
|
-
input: params,
|
|
24
|
-
...options ? { options } : {}
|
|
25
|
-
};
|
|
26
|
-
return deps.executeTask(request);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export {
|
|
31
|
-
MAIN_SKILL_TEXT,
|
|
32
|
-
createExecuteTool,
|
|
33
|
-
explainCapability,
|
|
34
|
-
listCapabilities
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=agent.js.map
|
package/dist/agent.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/agent-interface/prompt/main-skill.ts","../src/agent-interface/tools/execute-tool.ts"],"sourcesContent":["export const MAIN_SKILL_TEXT = `\nUse execute(capability_id, params) for all GitHub actions.\nNever call gh help and never fetch GraphQL schema/introspection.\nIf required params are unknown, call explain(capability_id) or ask the user.\nTreat ResultEnvelope.ok=false as a failure.\nIf error.retryable=true, retry once unless user requested otherwise.\nOnly reason about ResultEnvelope.data and ResultEnvelope.error.\n`.trim()\n","import type { ResultEnvelope } from \"../../core/contracts/envelope.js\"\n\ntype ExecuteTaskFn = (request: {\n task: string\n input: Record<string, unknown>\n options?: Record<string, unknown>\n}) => Promise<ResultEnvelope>\n\nexport function createExecuteTool(deps: { executeTask: ExecuteTaskFn }) {\n return {\n execute(\n capabilityId: string,\n params: Record<string, unknown>,\n options?: Record<string, unknown>,\n ): Promise<ResultEnvelope> {\n const request = {\n task: capabilityId,\n input: params,\n ...(options ? { options } : {}),\n }\n\n return deps.executeTask(request)\n },\n }\n}\n"],"mappings":";;;;;;;AAAO,IAAM,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO7B,KAAK;;;ACCA,SAAS,kBAAkB,MAAsC;AACtE,SAAO;AAAA,IACL,QACE,cACA,QACA,SACyB;AACzB,YAAM,UAAU;AAAA,QACd,MAAM;AAAA,QACN,OAAO;AAAA,QACP,GAAI,UAAU,EAAE,QAAQ,IAAI,CAAC;AAAA,MAC/B;AAEA,aAAO,KAAK,YAAY,OAAO;AAAA,IACjC;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
capability_id: check_run.annotations.list
|
|
2
|
-
version: "1.0.0"
|
|
3
|
-
description: List annotations for one check run.
|
|
4
|
-
input_schema:
|
|
5
|
-
type: object
|
|
6
|
-
required: [owner, name, checkRunId]
|
|
7
|
-
properties:
|
|
8
|
-
owner: { type: string, minLength: 1 }
|
|
9
|
-
name: { type: string, minLength: 1 }
|
|
10
|
-
checkRunId: { type: integer, minimum: 1 }
|
|
11
|
-
additionalProperties: false
|
|
12
|
-
output_schema:
|
|
13
|
-
type: object
|
|
14
|
-
required: [items]
|
|
15
|
-
properties:
|
|
16
|
-
items:
|
|
17
|
-
type: array
|
|
18
|
-
items:
|
|
19
|
-
type: object
|
|
20
|
-
required: [path, startLine, endLine, level, message, title, details]
|
|
21
|
-
properties:
|
|
22
|
-
path: { type: [string, "null"] }
|
|
23
|
-
startLine: { type: [integer, "null"] }
|
|
24
|
-
endLine: { type: [integer, "null"] }
|
|
25
|
-
level: { type: [string, "null"] }
|
|
26
|
-
message: { type: [string, "null"] }
|
|
27
|
-
title: { type: [string, "null"] }
|
|
28
|
-
details: { type: [string, "null"] }
|
|
29
|
-
additionalProperties: false
|
|
30
|
-
additionalProperties: false
|
|
31
|
-
routing:
|
|
32
|
-
preferred: cli
|
|
33
|
-
fallbacks: []
|
|
34
|
-
cli:
|
|
35
|
-
command: api
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
capability_id: issue.assignees.update
|
|
2
|
-
version: "1.0.0"
|
|
3
|
-
description: Replace issue assignees.
|
|
4
|
-
input_schema:
|
|
5
|
-
type: object
|
|
6
|
-
required: [issueId, assignees]
|
|
7
|
-
properties:
|
|
8
|
-
issueId: { type: string, minLength: 1 }
|
|
9
|
-
assignees:
|
|
10
|
-
type: array
|
|
11
|
-
items: { type: string, minLength: 1 }
|
|
12
|
-
additionalProperties: false
|
|
13
|
-
output_schema:
|
|
14
|
-
type: object
|
|
15
|
-
required: [id, assignees]
|
|
16
|
-
properties:
|
|
17
|
-
id: { type: string, minLength: 1 }
|
|
18
|
-
assignees:
|
|
19
|
-
type: array
|
|
20
|
-
items: { type: string, minLength: 1 }
|
|
21
|
-
additionalProperties: false
|
|
22
|
-
routing:
|
|
23
|
-
preferred: graphql
|
|
24
|
-
fallbacks: []
|
|
25
|
-
graphql:
|
|
26
|
-
operationName: IssueAssigneesUpdate
|
|
27
|
-
documentPath: src/gql/operations/issue-assignees-update.graphql
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
capability_id: issue.labels.update
|
|
2
|
-
version: "1.0.0"
|
|
3
|
-
description: Replace issue labels.
|
|
4
|
-
input_schema:
|
|
5
|
-
type: object
|
|
6
|
-
required: [issueId, labels]
|
|
7
|
-
properties:
|
|
8
|
-
issueId: { type: string, minLength: 1 }
|
|
9
|
-
labels:
|
|
10
|
-
type: array
|
|
11
|
-
items: { type: string, minLength: 1 }
|
|
12
|
-
additionalProperties: false
|
|
13
|
-
output_schema:
|
|
14
|
-
type: object
|
|
15
|
-
required: [id, labels]
|
|
16
|
-
properties:
|
|
17
|
-
id: { type: string, minLength: 1 }
|
|
18
|
-
labels:
|
|
19
|
-
type: array
|
|
20
|
-
items: { type: string, minLength: 1 }
|
|
21
|
-
additionalProperties: false
|
|
22
|
-
routing:
|
|
23
|
-
preferred: graphql
|
|
24
|
-
fallbacks: []
|
|
25
|
-
graphql:
|
|
26
|
-
operationName: IssueLabelsUpdate
|
|
27
|
-
documentPath: src/gql/operations/issue-labels-update.graphql
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
capability_id: pr.assignees.update
|
|
2
|
-
version: "1.0.0"
|
|
3
|
-
description: Update pull request assignees.
|
|
4
|
-
input_schema:
|
|
5
|
-
type: object
|
|
6
|
-
required: [owner, name, prNumber]
|
|
7
|
-
properties:
|
|
8
|
-
owner: { type: string, minLength: 1 }
|
|
9
|
-
name: { type: string, minLength: 1 }
|
|
10
|
-
prNumber: { type: integer, minimum: 1 }
|
|
11
|
-
add:
|
|
12
|
-
type: array
|
|
13
|
-
items: { type: string, minLength: 1 }
|
|
14
|
-
remove:
|
|
15
|
-
type: array
|
|
16
|
-
items: { type: string, minLength: 1 }
|
|
17
|
-
anyOf:
|
|
18
|
-
- required: [add]
|
|
19
|
-
- required: [remove]
|
|
20
|
-
additionalProperties: false
|
|
21
|
-
output_schema:
|
|
22
|
-
type: object
|
|
23
|
-
required: [prNumber, add, remove, updated]
|
|
24
|
-
properties:
|
|
25
|
-
prNumber: { type: integer, minimum: 1 }
|
|
26
|
-
add:
|
|
27
|
-
type: array
|
|
28
|
-
items: { type: string, minLength: 1 }
|
|
29
|
-
remove:
|
|
30
|
-
type: array
|
|
31
|
-
items: { type: string, minLength: 1 }
|
|
32
|
-
updated: { type: boolean }
|
|
33
|
-
additionalProperties: false
|
|
34
|
-
routing:
|
|
35
|
-
preferred: cli
|
|
36
|
-
fallbacks: []
|
|
37
|
-
cli:
|
|
38
|
-
command: pr edit
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
capability_id: pr.checks.get_failed
|
|
2
|
-
version: "1.0.0"
|
|
3
|
-
description: List failed pull request checks.
|
|
4
|
-
input_schema:
|
|
5
|
-
type: object
|
|
6
|
-
required: [owner, name, prNumber]
|
|
7
|
-
properties:
|
|
8
|
-
owner: { type: string, minLength: 1 }
|
|
9
|
-
name: { type: string, minLength: 1 }
|
|
10
|
-
prNumber: { type: integer, minimum: 1 }
|
|
11
|
-
additionalProperties: false
|
|
12
|
-
output_schema:
|
|
13
|
-
type: object
|
|
14
|
-
required: [items, summary]
|
|
15
|
-
properties:
|
|
16
|
-
items:
|
|
17
|
-
type: array
|
|
18
|
-
items:
|
|
19
|
-
type: object
|
|
20
|
-
required: [name, state, workflow, link]
|
|
21
|
-
properties:
|
|
22
|
-
name: { type: [string, "null"] }
|
|
23
|
-
state: { type: [string, "null"] }
|
|
24
|
-
workflow: { type: [string, "null"] }
|
|
25
|
-
link: { type: [string, "null"] }
|
|
26
|
-
additionalProperties: false
|
|
27
|
-
summary:
|
|
28
|
-
type: object
|
|
29
|
-
required: [total, failed, pending, passed]
|
|
30
|
-
properties:
|
|
31
|
-
total: { type: integer, minimum: 0 }
|
|
32
|
-
failed: { type: integer, minimum: 0 }
|
|
33
|
-
pending: { type: integer, minimum: 0 }
|
|
34
|
-
passed: { type: integer, minimum: 0 }
|
|
35
|
-
additionalProperties: false
|
|
36
|
-
additionalProperties: false
|
|
37
|
-
routing:
|
|
38
|
-
preferred: cli
|
|
39
|
-
fallbacks: []
|
|
40
|
-
cli:
|
|
41
|
-
command: pr checks
|
|
42
|
-
jsonFields: [name, state, workflow, link]
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
capability_id: pr.review.submit_approve
|
|
2
|
-
version: "1.0.0"
|
|
3
|
-
description: Submit an approving pull request review.
|
|
4
|
-
input_schema:
|
|
5
|
-
type: object
|
|
6
|
-
required: [owner, name, prNumber]
|
|
7
|
-
properties:
|
|
8
|
-
owner: { type: string, minLength: 1 }
|
|
9
|
-
name: { type: string, minLength: 1 }
|
|
10
|
-
prNumber: { type: integer, minimum: 1 }
|
|
11
|
-
body: { type: string, minLength: 1 }
|
|
12
|
-
additionalProperties: false
|
|
13
|
-
output_schema:
|
|
14
|
-
type: object
|
|
15
|
-
required: [prNumber, event, submitted, body]
|
|
16
|
-
properties:
|
|
17
|
-
prNumber: { type: integer, minimum: 1 }
|
|
18
|
-
event: { type: string, const: APPROVE }
|
|
19
|
-
submitted: { type: boolean }
|
|
20
|
-
body: { type: [string, "null"] }
|
|
21
|
-
additionalProperties: false
|
|
22
|
-
routing:
|
|
23
|
-
preferred: cli
|
|
24
|
-
fallbacks: []
|
|
25
|
-
cli:
|
|
26
|
-
command: pr review
|