@ghx-dev/core 0.1.0-beta.0 → 0.1.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/README.md +181 -114
- package/dist/agent.d.ts +32 -7
- package/dist/agent.js +29 -12
- package/dist/agent.js.map +1 -1
- package/dist/cards/check_run.annotations.list.yaml +35 -0
- package/dist/cards/issue.assignees.update.yaml +27 -0
- package/dist/cards/issue.blocked_by.add.yaml +23 -0
- package/dist/cards/issue.blocked_by.remove.yaml +24 -0
- package/dist/cards/issue.close.yaml +24 -0
- package/dist/cards/issue.comments.create.yaml +24 -0
- package/dist/cards/issue.comments.list.yaml +48 -0
- package/dist/cards/issue.create.yaml +28 -0
- package/dist/cards/issue.delete.yaml +23 -0
- package/dist/cards/issue.labels.update.yaml +27 -0
- package/dist/cards/issue.linked_prs.list.yaml +34 -0
- package/dist/cards/issue.list.yaml +48 -0
- package/dist/cards/issue.milestone.set.yaml +23 -0
- package/dist/cards/issue.parent.remove.yaml +22 -0
- package/dist/cards/issue.parent.set.yaml +23 -0
- package/dist/cards/issue.relations.get.yaml +54 -0
- package/dist/cards/issue.reopen.yaml +24 -0
- package/dist/cards/issue.update.yaml +27 -0
- package/dist/cards/issue.view.yaml +32 -0
- package/dist/cards/pr.assignees.update.yaml +38 -0
- package/dist/cards/pr.branch.update.yaml +23 -0
- package/dist/cards/pr.checks.get_failed.yaml +42 -0
- package/dist/cards/pr.checks.rerun_all.yaml +26 -0
- package/dist/cards/pr.checks.rerun_failed.yaml +26 -0
- package/dist/cards/pr.comment.reply.yaml +23 -0
- package/dist/cards/pr.comment.resolve.yaml +22 -0
- package/dist/cards/pr.comment.unresolve.yaml +22 -0
- package/dist/cards/pr.comments.list.yaml +98 -0
- package/dist/cards/pr.diff.list_files.yaml +43 -0
- package/dist/cards/pr.list.yaml +48 -0
- package/dist/cards/pr.merge.execute.yaml +29 -0
- package/dist/cards/pr.mergeability.view.yaml +27 -0
- package/dist/cards/pr.ready_for_review.set.yaml +24 -0
- package/dist/cards/pr.review.submit_approve.yaml +26 -0
- package/dist/cards/pr.review.submit_comment.yaml +26 -0
- package/dist/cards/pr.review.submit_request_changes.yaml +26 -0
- package/dist/cards/pr.reviewers.request.yaml +31 -0
- package/dist/cards/pr.reviews.list.yaml +47 -0
- package/dist/cards/pr.status.checks.yaml +42 -0
- package/dist/cards/pr.view.yaml +32 -0
- package/dist/cards/project_v2.fields.list.yaml +37 -0
- package/dist/cards/project_v2.item.add_issue.yaml +23 -0
- package/dist/cards/project_v2.item.field.update.yaml +29 -0
- package/dist/cards/project_v2.items.list.yaml +39 -0
- package/dist/cards/project_v2.org.get.yaml +26 -0
- package/dist/cards/project_v2.user.get.yaml +26 -0
- package/dist/cards/release.create_draft.yaml +36 -0
- package/dist/cards/release.get.yaml +30 -0
- package/dist/cards/release.list.yaml +44 -0
- package/dist/cards/release.publish_draft.yaml +36 -0
- package/dist/cards/release.update.yaml +38 -0
- package/dist/cards/repo.issue_types.list.yaml +40 -0
- package/dist/cards/repo.labels.list.yaml +41 -0
- package/dist/cards/repo.view.yaml +34 -0
- package/dist/cards/workflow.get.yaml +30 -0
- package/dist/cards/workflow.list.yaml +40 -0
- package/dist/cards/workflow_dispatch.run.yaml +29 -0
- package/dist/cards/workflow_job.logs.analyze.yaml +33 -0
- package/dist/cards/workflow_job.logs.get.yaml +24 -0
- package/dist/cards/workflow_run.artifacts.list.yaml +40 -0
- package/dist/cards/workflow_run.cancel.yaml +23 -0
- package/dist/cards/workflow_run.get.yaml +33 -0
- package/dist/cards/workflow_run.jobs.list.yaml +35 -0
- package/dist/cards/workflow_run.rerun_all.yaml +23 -0
- package/dist/cards/workflow_run.rerun_failed.yaml +23 -0
- package/dist/cards/workflow_runs.list.yaml +45 -0
- package/dist/chunk-OL4ARD3R.js +242 -0
- package/dist/chunk-OL4ARD3R.js.map +1 -0
- package/dist/chunk-PJ2JKKQE.js +4148 -0
- package/dist/chunk-PJ2JKKQE.js.map +1 -0
- package/dist/{chunk-MMG6CIKK.js → chunk-SCIJMW5P.js} +14 -4
- package/dist/chunk-SCIJMW5P.js.map +1 -0
- package/dist/cli/assets/skills/ghx/SKILL.md +57 -0
- package/dist/cli/index.js +373 -41
- package/dist/cli/index.js.map +1 -1
- package/dist/core/registry/cards/issue.assignees.update.yaml +27 -0
- package/dist/core/registry/cards/issue.blocked_by.add.yaml +23 -0
- package/dist/core/registry/cards/issue.blocked_by.remove.yaml +24 -0
- package/dist/core/registry/cards/issue.close.yaml +24 -0
- package/dist/core/registry/cards/issue.comments.create.yaml +24 -0
- package/dist/core/registry/cards/issue.create.yaml +28 -0
- package/dist/core/registry/cards/issue.delete.yaml +23 -0
- package/dist/core/registry/cards/issue.labels.update.yaml +27 -0
- package/dist/core/registry/cards/issue.linked_prs.list.yaml +34 -0
- package/dist/core/registry/cards/issue.milestone.set.yaml +23 -0
- package/dist/core/registry/cards/issue.parent.remove.yaml +22 -0
- package/dist/core/registry/cards/issue.parent.set.yaml +23 -0
- package/dist/core/registry/cards/issue.relations.get.yaml +54 -0
- package/dist/core/registry/cards/issue.reopen.yaml +24 -0
- package/dist/core/registry/cards/issue.update.yaml +27 -0
- package/dist/core/registry/cards/pr.assignees.update.yaml +38 -0
- package/dist/core/registry/cards/pr.branch.update.yaml +23 -0
- package/dist/core/registry/cards/pr.checks.rerun_all.yaml +26 -0
- package/dist/core/registry/cards/pr.checks.rerun_failed.yaml +26 -0
- package/dist/core/registry/cards/pr.merge.execute.yaml +29 -0
- package/dist/core/registry/cards/pr.review.submit_approve.yaml +26 -0
- package/dist/core/registry/cards/pr.review.submit_comment.yaml +26 -0
- package/dist/core/registry/cards/pr.review.submit_request_changes.yaml +26 -0
- package/dist/core/registry/cards/pr.reviewers.request.yaml +31 -0
- package/dist/core/registry/cards/project_v2.fields.list.yaml +37 -0
- package/dist/core/registry/cards/project_v2.item.add_issue.yaml +23 -0
- package/dist/core/registry/cards/project_v2.item.field.update.yaml +29 -0
- package/dist/core/registry/cards/project_v2.items.list.yaml +39 -0
- package/dist/core/registry/cards/project_v2.org.get.yaml +26 -0
- package/dist/core/registry/cards/project_v2.user.get.yaml +26 -0
- package/dist/core/registry/cards/release.create_draft.yaml +36 -0
- package/dist/core/registry/cards/release.get.yaml +30 -0
- package/dist/core/registry/cards/release.list.yaml +44 -0
- package/dist/core/registry/cards/release.publish_draft.yaml +36 -0
- package/dist/core/registry/cards/release.update.yaml +38 -0
- package/dist/core/registry/cards/repo.issue_types.list.yaml +40 -0
- package/dist/core/registry/cards/repo.labels.list.yaml +41 -0
- package/dist/core/registry/cards/workflow.get.yaml +30 -0
- package/dist/core/registry/cards/workflow.list.yaml +40 -0
- package/dist/core/registry/cards/workflow_dispatch.run.yaml +29 -0
- package/dist/core/registry/cards/workflow_run.artifacts.list.yaml +40 -0
- package/dist/core/registry/cards/workflow_run.cancel.yaml +23 -0
- package/dist/core/registry/cards/workflow_run.get.yaml +33 -0
- package/dist/core/registry/cards/workflow_run.rerun_all.yaml +23 -0
- package/dist/core/registry/cards/workflow_run.rerun_failed.yaml +23 -0
- package/dist/{core/contracts/envelope.d.ts → envelope-BpF6MNCv.d.ts} +15 -3
- package/dist/index.d.ts +470 -22
- package/dist/index.js +7 -29
- package/package.json +49 -20
- package/dist/agent-interface/prompt/main-skill.d.ts +0 -3
- package/dist/agent-interface/prompt/main-skill.js +0 -7
- package/dist/agent-interface/prompt/main-skill.js.map +0 -1
- package/dist/agent-interface/tools/execute-tool.d.ts +0 -16
- package/dist/agent-interface/tools/execute-tool.js +0 -7
- package/dist/agent-interface/tools/execute-tool.js.map +0 -1
- package/dist/agent-interface/tools/explain-tool.d.ts +0 -11
- package/dist/agent-interface/tools/explain-tool.js +0 -9
- package/dist/agent-interface/tools/explain-tool.js.map +0 -1
- package/dist/agent-interface/tools/list-capabilities-tool.d.ts +0 -7
- package/dist/agent-interface/tools/list-capabilities-tool.js +0 -9
- package/dist/agent-interface/tools/list-capabilities-tool.js.map +0 -1
- package/dist/chunk-2W4L5YCC.js +0 -116
- package/dist/chunk-2W4L5YCC.js.map +0 -1
- package/dist/chunk-3RAT5BCB.js +0 -584
- package/dist/chunk-3RAT5BCB.js.map +0 -1
- package/dist/chunk-3RJCF42N.js +0 -16
- package/dist/chunk-3RJCF42N.js.map +0 -1
- package/dist/chunk-573MDG3I.js +0 -18
- package/dist/chunk-573MDG3I.js.map +0 -1
- package/dist/chunk-5JRLVOF2.js +0 -50
- package/dist/chunk-5JRLVOF2.js.map +0 -1
- package/dist/chunk-B6RLMKS4.js +0 -41
- package/dist/chunk-B6RLMKS4.js.map +0 -1
- package/dist/chunk-BJHVAFTN.js +0 -42
- package/dist/chunk-BJHVAFTN.js.map +0 -1
- package/dist/chunk-D746VR3B.js +0 -38
- package/dist/chunk-D746VR3B.js.map +0 -1
- package/dist/chunk-DJIEG6K7.js +0 -20
- package/dist/chunk-DJIEG6K7.js.map +0 -1
- package/dist/chunk-DLKIQBK6.js +0 -106
- package/dist/chunk-DLKIQBK6.js.map +0 -1
- package/dist/chunk-EBRDO4Y6.js +0 -31
- package/dist/chunk-EBRDO4Y6.js.map +0 -1
- package/dist/chunk-FXN6IIT5.js +0 -14
- package/dist/chunk-FXN6IIT5.js.map +0 -1
- package/dist/chunk-GPU4P7UG.js +0 -92
- package/dist/chunk-GPU4P7UG.js.map +0 -1
- package/dist/chunk-MMG6CIKK.js.map +0 -1
- package/dist/chunk-MT4U5DYD.js +0 -88
- package/dist/chunk-MT4U5DYD.js.map +0 -1
- package/dist/chunk-NFF5VF4U.js +0 -28
- package/dist/chunk-NFF5VF4U.js.map +0 -1
- package/dist/chunk-Q4RTT3DV.js +0 -209
- package/dist/chunk-Q4RTT3DV.js.map +0 -1
- package/dist/chunk-QEAMC4IJ.js +0 -34
- package/dist/chunk-QEAMC4IJ.js.map +0 -1
- package/dist/chunk-QX34GTH6.js +0 -30
- package/dist/chunk-QX34GTH6.js.map +0 -1
- package/dist/chunk-QZZC53HF.js +0 -38
- package/dist/chunk-QZZC53HF.js.map +0 -1
- package/dist/chunk-RUQXGZ35.js +0 -34
- package/dist/chunk-RUQXGZ35.js.map +0 -1
- package/dist/chunk-TCLMLVUQ.js +0 -38
- package/dist/chunk-TCLMLVUQ.js.map +0 -1
- package/dist/chunk-TDTKOJKN.js +0 -52
- package/dist/chunk-TDTKOJKN.js.map +0 -1
- package/dist/chunk-UGWIZ3RI.js +0 -7
- package/dist/chunk-UGWIZ3RI.js.map +0 -1
- package/dist/chunk-UOJWOHRM.js +0 -16
- package/dist/chunk-UOJWOHRM.js.map +0 -1
- package/dist/chunk-VD5NXQP7.js +0 -42
- package/dist/chunk-VD5NXQP7.js.map +0 -1
- package/dist/chunk-W2TKG2UL.js +0 -37
- package/dist/chunk-W2TKG2UL.js.map +0 -1
- package/dist/chunk-W6ROKCY5.js +0 -28
- package/dist/chunk-W6ROKCY5.js.map +0 -1
- package/dist/chunk-WYSY75U7.js +0 -156
- package/dist/chunk-WYSY75U7.js.map +0 -1
- package/dist/chunk-YNNDBMNR.js +0 -113
- package/dist/chunk-YNNDBMNR.js.map +0 -1
- package/dist/chunk-YNQNHCRS.js +0 -198
- package/dist/chunk-YNQNHCRS.js.map +0 -1
- package/dist/chunk-YQDQX4BT.js +0 -624
- package/dist/chunk-YQDQX4BT.js.map +0 -1
- package/dist/cli/commands/capabilities-explain.d.ts +0 -3
- package/dist/cli/commands/capabilities-explain.js +0 -10
- package/dist/cli/commands/capabilities-explain.js.map +0 -1
- package/dist/cli/commands/capabilities-list.d.ts +0 -3
- package/dist/cli/commands/capabilities-list.js +0 -10
- package/dist/cli/commands/capabilities-list.js.map +0 -1
- package/dist/cli/commands/doctor.d.ts +0 -3
- package/dist/cli/commands/doctor.js +0 -7
- package/dist/cli/commands/doctor.js.map +0 -1
- package/dist/cli/commands/routes.d.ts +0 -3
- package/dist/cli/commands/routes.js +0 -7
- package/dist/cli/commands/routes.js.map +0 -1
- package/dist/cli/commands/run.d.ts +0 -3
- package/dist/cli/commands/run.js +0 -31
- package/dist/cli/commands/run.js.map +0 -1
- package/dist/cli/commands/setup.d.ts +0 -3
- package/dist/cli/commands/setup.js +0 -7
- package/dist/cli/commands/setup.js.map +0 -1
- package/dist/cli/formatters/json.d.ts +0 -3
- package/dist/cli/formatters/json.js +0 -8
- package/dist/cli/formatters/json.js.map +0 -1
- package/dist/cli/formatters/table.d.ts +0 -3
- package/dist/cli/formatters/table.js +0 -8
- package/dist/cli/formatters/table.js.map +0 -1
- package/dist/core/contracts/envelope.js +0 -1
- package/dist/core/contracts/envelope.js.map +0 -1
- package/dist/core/contracts/task.d.ts +0 -7
- package/dist/core/contracts/task.js +0 -1
- package/dist/core/contracts/task.js.map +0 -1
- package/dist/core/contracts/tasks/check_run.annotations.list.d.ts +0 -5
- package/dist/core/contracts/tasks/check_run.annotations.list.js +0 -8
- package/dist/core/contracts/tasks/check_run.annotations.list.js.map +0 -1
- package/dist/core/contracts/tasks/issue.comments.list.d.ts +0 -5
- package/dist/core/contracts/tasks/issue.comments.list.js +0 -8
- package/dist/core/contracts/tasks/issue.comments.list.js.map +0 -1
- package/dist/core/contracts/tasks/issue.list.d.ts +0 -5
- package/dist/core/contracts/tasks/issue.list.js +0 -8
- package/dist/core/contracts/tasks/issue.list.js.map +0 -1
- package/dist/core/contracts/tasks/issue.view.d.ts +0 -5
- package/dist/core/contracts/tasks/issue.view.js +0 -8
- package/dist/core/contracts/tasks/issue.view.js.map +0 -1
- package/dist/core/contracts/tasks/pr.checks.get_failed.d.ts +0 -5
- package/dist/core/contracts/tasks/pr.checks.get_failed.js +0 -8
- package/dist/core/contracts/tasks/pr.checks.get_failed.js.map +0 -1
- package/dist/core/contracts/tasks/pr.comment.reply.d.ts +0 -5
- package/dist/core/contracts/tasks/pr.comment.reply.js +0 -8
- package/dist/core/contracts/tasks/pr.comment.reply.js.map +0 -1
- package/dist/core/contracts/tasks/pr.comment.resolve.d.ts +0 -5
- package/dist/core/contracts/tasks/pr.comment.resolve.js +0 -8
- package/dist/core/contracts/tasks/pr.comment.resolve.js.map +0 -1
- package/dist/core/contracts/tasks/pr.comment.unresolve.d.ts +0 -5
- package/dist/core/contracts/tasks/pr.comment.unresolve.js +0 -8
- package/dist/core/contracts/tasks/pr.comment.unresolve.js.map +0 -1
- package/dist/core/contracts/tasks/pr.comments.list.d.ts +0 -5
- package/dist/core/contracts/tasks/pr.comments.list.js +0 -8
- package/dist/core/contracts/tasks/pr.comments.list.js.map +0 -1
- package/dist/core/contracts/tasks/pr.diff.list_files.d.ts +0 -5
- package/dist/core/contracts/tasks/pr.diff.list_files.js +0 -8
- package/dist/core/contracts/tasks/pr.diff.list_files.js.map +0 -1
- package/dist/core/contracts/tasks/pr.list.d.ts +0 -5
- package/dist/core/contracts/tasks/pr.list.js +0 -8
- package/dist/core/contracts/tasks/pr.list.js.map +0 -1
- package/dist/core/contracts/tasks/pr.mergeability.view.d.ts +0 -5
- package/dist/core/contracts/tasks/pr.mergeability.view.js +0 -8
- package/dist/core/contracts/tasks/pr.mergeability.view.js.map +0 -1
- package/dist/core/contracts/tasks/pr.ready_for_review.set.d.ts +0 -5
- package/dist/core/contracts/tasks/pr.ready_for_review.set.js +0 -8
- package/dist/core/contracts/tasks/pr.ready_for_review.set.js.map +0 -1
- package/dist/core/contracts/tasks/pr.reviews.list.d.ts +0 -5
- package/dist/core/contracts/tasks/pr.reviews.list.js +0 -8
- package/dist/core/contracts/tasks/pr.reviews.list.js.map +0 -1
- package/dist/core/contracts/tasks/pr.status.checks.d.ts +0 -5
- package/dist/core/contracts/tasks/pr.status.checks.js +0 -8
- package/dist/core/contracts/tasks/pr.status.checks.js.map +0 -1
- package/dist/core/contracts/tasks/pr.view.d.ts +0 -5
- package/dist/core/contracts/tasks/pr.view.js +0 -8
- package/dist/core/contracts/tasks/pr.view.js.map +0 -1
- package/dist/core/contracts/tasks/repo.view.d.ts +0 -5
- package/dist/core/contracts/tasks/repo.view.js +0 -8
- package/dist/core/contracts/tasks/repo.view.js.map +0 -1
- package/dist/core/contracts/tasks/workflow_job.logs.analyze.d.ts +0 -5
- package/dist/core/contracts/tasks/workflow_job.logs.analyze.js +0 -8
- package/dist/core/contracts/tasks/workflow_job.logs.analyze.js.map +0 -1
- package/dist/core/contracts/tasks/workflow_job.logs.get.d.ts +0 -5
- package/dist/core/contracts/tasks/workflow_job.logs.get.js +0 -8
- package/dist/core/contracts/tasks/workflow_job.logs.get.js.map +0 -1
- package/dist/core/contracts/tasks/workflow_run.jobs.list.d.ts +0 -5
- package/dist/core/contracts/tasks/workflow_run.jobs.list.js +0 -8
- package/dist/core/contracts/tasks/workflow_run.jobs.list.js.map +0 -1
- package/dist/core/contracts/tasks/workflow_runs.list.d.ts +0 -5
- package/dist/core/contracts/tasks/workflow_runs.list.js +0 -8
- package/dist/core/contracts/tasks/workflow_runs.list.js.map +0 -1
- package/dist/core/errors/codes.d.ts +0 -13
- package/dist/core/errors/codes.js +0 -7
- package/dist/core/errors/codes.js.map +0 -1
- package/dist/core/errors/map-error.d.ts +0 -5
- package/dist/core/errors/map-error.js +0 -8
- package/dist/core/errors/map-error.js.map +0 -1
- package/dist/core/errors/retryability.d.ts +0 -3
- package/dist/core/errors/retryability.js +0 -8
- package/dist/core/errors/retryability.js.map +0 -1
- package/dist/core/execute/execute.d.ts +0 -28
- package/dist/core/execute/execute.js +0 -11
- package/dist/core/execute/execute.js.map +0 -1
- package/dist/core/execution/adapters/cli-adapter.d.ts +0 -22
- package/dist/core/execution/adapters/cli-adapter.js +0 -69
- package/dist/core/execution/adapters/cli-adapter.js.map +0 -1
- package/dist/core/execution/adapters/cli-capability-adapter.d.ts +0 -16
- package/dist/core/execution/adapters/cli-capability-adapter.js +0 -11
- package/dist/core/execution/adapters/cli-capability-adapter.js.map +0 -1
- package/dist/core/execution/adapters/graphql-adapter.d.ts +0 -25
- package/dist/core/execution/adapters/graphql-adapter.js +0 -44
- package/dist/core/execution/adapters/graphql-adapter.js.map +0 -1
- package/dist/core/execution/adapters/graphql-capability-adapter.d.ts +0 -20
- package/dist/core/execution/adapters/graphql-capability-adapter.js +0 -11
- package/dist/core/execution/adapters/graphql-capability-adapter.js.map +0 -1
- package/dist/core/execution/adapters/rest-adapter.d.ts +0 -3
- package/dist/core/execution/adapters/rest-adapter.js +0 -8
- package/dist/core/execution/adapters/rest-adapter.js.map +0 -1
- package/dist/core/execution/cli/safe-runner.d.ts +0 -12
- package/dist/core/execution/cli/safe-runner.js +0 -7
- package/dist/core/execution/cli/safe-runner.js.map +0 -1
- package/dist/core/execution/normalizer.d.ts +0 -13
- package/dist/core/execution/normalizer.js +0 -9
- package/dist/core/execution/normalizer.js.map +0 -1
- package/dist/core/execution/preflight.d.ts +0 -24
- package/dist/core/execution/preflight.js +0 -8
- package/dist/core/execution/preflight.js.map +0 -1
- package/dist/core/registry/index.d.ts +0 -15
- package/dist/core/registry/index.js +0 -12
- package/dist/core/registry/index.js.map +0 -1
- package/dist/core/registry/operation-card-schema.d.ts +0 -167
- package/dist/core/registry/operation-card-schema.js +0 -7
- package/dist/core/registry/operation-card-schema.js.map +0 -1
- package/dist/core/registry/schema-validator.d.ts +0 -16
- package/dist/core/registry/schema-validator.js +0 -9
- package/dist/core/registry/schema-validator.js.map +0 -1
- package/dist/core/registry/types.d.ts +0 -51
- package/dist/core/registry/types.js +0 -1
- package/dist/core/registry/types.js.map +0 -1
- package/dist/core/routing/capability-registry.d.ts +0 -8
- package/dist/core/routing/capability-registry.js +0 -15
- package/dist/core/routing/capability-registry.js.map +0 -1
- package/dist/core/routing/engine.d.ts +0 -32
- package/dist/core/routing/engine.js +0 -23
- package/dist/core/routing/engine.js.map +0 -1
- package/dist/core/routing/policy.d.ts +0 -3
- package/dist/core/routing/policy.js +0 -7
- package/dist/core/routing/policy.js.map +0 -1
- package/dist/core/routing/reason-codes.d.ts +0 -4
- package/dist/core/routing/reason-codes.js +0 -15
- package/dist/core/routing/reason-codes.js.map +0 -1
- package/dist/core/telemetry/logger.d.ts +0 -8
- package/dist/core/telemetry/logger.js +0 -9
- package/dist/core/telemetry/logger.js.map +0 -1
- package/dist/core/telemetry/metrics.d.ts +0 -7
- package/dist/core/telemetry/metrics.js +0 -1
- package/dist/core/telemetry/metrics.js.map +0 -1
- package/dist/gql/client.d.ts +0 -183
- package/dist/gql/client.js +0 -17
- package/dist/gql/client.js.map +0 -1
- package/dist/gql/generated/common-types.d.ts +0 -36
- package/dist/gql/generated/common-types.js +0 -1
- package/dist/gql/generated/common-types.js.map +0 -1
- package/dist/gql/operations/issue-comments-list.generated.d.ts +0 -59
- package/dist/gql/operations/issue-comments-list.generated.js +0 -9
- package/dist/gql/operations/issue-comments-list.generated.js.map +0 -1
- package/dist/gql/operations/issue-list.generated.d.ts +0 -40
- package/dist/gql/operations/issue-list.generated.js +0 -9
- package/dist/gql/operations/issue-list.generated.js.map +0 -1
- package/dist/gql/operations/issue-view.generated.d.ts +0 -31
- package/dist/gql/operations/issue-view.generated.js +0 -9
- package/dist/gql/operations/issue-view.generated.js.map +0 -1
- package/dist/gql/operations/pr-comment-reply.generated.d.ts +0 -26
- package/dist/gql/operations/pr-comment-reply.generated.js +0 -25
- package/dist/gql/operations/pr-comment-reply.generated.js.map +0 -1
- package/dist/gql/operations/pr-comment-resolve.generated.d.ts +0 -26
- package/dist/gql/operations/pr-comment-resolve.generated.js +0 -24
- package/dist/gql/operations/pr-comment-resolve.generated.js.map +0 -1
- package/dist/gql/operations/pr-comment-unresolve.generated.d.ts +0 -26
- package/dist/gql/operations/pr-comment-unresolve.generated.js +0 -24
- package/dist/gql/operations/pr-comment-unresolve.generated.js.map +0 -1
- package/dist/gql/operations/pr-comments-list.generated.d.ts +0 -84
- package/dist/gql/operations/pr-comments-list.generated.js +0 -58
- package/dist/gql/operations/pr-comments-list.generated.js.map +0 -1
- package/dist/gql/operations/pr-diff-list-files.generated.d.ts +0 -42
- package/dist/gql/operations/pr-diff-list-files.generated.js +0 -9
- package/dist/gql/operations/pr-diff-list-files.generated.js.map +0 -1
- package/dist/gql/operations/pr-list.generated.d.ts +0 -40
- package/dist/gql/operations/pr-list.generated.js +0 -9
- package/dist/gql/operations/pr-list.generated.js.map +0 -1
- package/dist/gql/operations/pr-reviews-list.generated.d.ts +0 -64
- package/dist/gql/operations/pr-reviews-list.generated.js +0 -9
- package/dist/gql/operations/pr-reviews-list.generated.js.map +0 -1
- package/dist/gql/operations/pr-view.generated.d.ts +0 -31
- package/dist/gql/operations/pr-view.generated.js +0 -9
- package/dist/gql/operations/pr-view.generated.js.map +0 -1
- package/dist/gql/operations/repo-view.generated.d.ts +0 -33
- package/dist/gql/operations/repo-view.generated.js +0 -9
- package/dist/gql/operations/repo-view.generated.js.map +0 -1
- package/dist/shared/constants.d.ts +0 -3
- package/dist/shared/constants.js +0 -6
- package/dist/shared/constants.js.map +0 -1
- package/dist/shared/types.d.ts +0 -3
- package/dist/shared/types.js +0 -1
- package/dist/shared/types.js.map +0 -1
- package/dist/shared/utils.d.ts +0 -3
- package/dist/shared/utils.js +0 -8
- package/dist/shared/utils.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,175 +1,178 @@
|
|
|
1
1
|
# @ghx-dev/core
|
|
2
2
|
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src="https://raw.githubusercontent.com/aryeko/ghx/main/assets/branding/social/ghx-social-dark-1280x640.png" alt="ghx social preview" width="480">
|
|
5
|
+
</p>
|
|
6
|
+
|
|
3
7
|
[](https://www.npmjs.com/package/@ghx-dev/core)
|
|
4
8
|
[](https://www.npmjs.com/package/@ghx-dev/core)
|
|
9
|
+
[](https://github.com/aryeko/ghx/actions/workflows/ci-main.yml)
|
|
10
|
+
[](https://codecov.io/gh/aryeko/ghx)
|
|
5
11
|
[](https://github.com/aryeko/ghx/blob/main/LICENSE)
|
|
6
12
|
|
|
7
|
-
|
|
13
|
+
Typed GitHub execution router for AI agents. Deterministic routing across CLI and GraphQL, runtime schema validation, and a stable result envelope -- so agents stop wasting tokens re-discovering GitHub API surfaces.
|
|
14
|
+
|
|
15
|
+
## Why ghx
|
|
8
16
|
|
|
9
|
-
|
|
17
|
+
Agents instructed to "use `gh` CLI" for common PR and issue operations waste significant tokens on research, trial-and-error, and output parsing. Benchmarked across 27 runs on standard PR workflows:
|
|
10
18
|
|
|
11
|
-
|
|
19
|
+
| Metric | Improvement |
|
|
20
|
+
|---|---|
|
|
21
|
+
| Active tokens | **-37%** fewer tokens consumed |
|
|
22
|
+
| Latency | **-32%** faster end-to-end |
|
|
23
|
+
| Tool calls | **-33%** fewer tool invocations |
|
|
24
|
+
| Success rate | **100%** (zero regressions) |
|
|
12
25
|
|
|
13
|
-
|
|
14
|
-
- **Route-aware execution**: preferred route + fallback routes per capability
|
|
15
|
-
- **Schema validation**: runtime validation for task input/output
|
|
16
|
-
- **Typed clients**: typed GraphQL/GitHub client helpers
|
|
17
|
-
- **Agent-ready tools**: subpath exports for capability listing/explanation/execution wrappers
|
|
26
|
+
ghx eliminates the discovery phase: agents call typed capabilities, get validated results back in a stable envelope.
|
|
18
27
|
|
|
19
28
|
## Installation
|
|
20
29
|
|
|
30
|
+
Requirements: Node.js `22+`, `gh` CLI authenticated (`gh auth status`).
|
|
31
|
+
|
|
21
32
|
```bash
|
|
22
|
-
|
|
33
|
+
npm install @ghx-dev/core
|
|
23
34
|
```
|
|
24
35
|
|
|
25
36
|
Alternative package managers:
|
|
26
37
|
|
|
27
38
|
```bash
|
|
28
|
-
|
|
39
|
+
pnpm add @ghx-dev/core
|
|
29
40
|
# or
|
|
30
41
|
yarn add @ghx-dev/core
|
|
31
42
|
```
|
|
32
43
|
|
|
33
|
-
|
|
44
|
+
Or run directly without installing:
|
|
34
45
|
|
|
35
|
-
```
|
|
36
|
-
|
|
46
|
+
```bash
|
|
47
|
+
npx @ghx-dev/core capabilities list
|
|
48
|
+
```
|
|
37
49
|
|
|
38
|
-
|
|
50
|
+
Global CLI install:
|
|
39
51
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
52
|
+
```bash
|
|
53
|
+
npm i -g @ghx-dev/core
|
|
54
|
+
```
|
|
43
55
|
|
|
44
|
-
|
|
45
|
-
async execute<TData>(query: string, variables?: Record<string, unknown>): Promise<TData> {
|
|
46
|
-
const response = await fetch("https://api.github.com/graphql", {
|
|
47
|
-
method: "POST",
|
|
48
|
-
headers: {
|
|
49
|
-
"content-type": "application/json",
|
|
50
|
-
authorization: `Bearer ${githubToken}`,
|
|
51
|
-
},
|
|
52
|
-
body: JSON.stringify({ query, variables: variables ?? {} }),
|
|
53
|
-
})
|
|
56
|
+
## Quick Start (CLI)
|
|
54
57
|
|
|
55
|
-
|
|
56
|
-
data?: TData
|
|
57
|
-
errors?: Array<{ message?: string }>
|
|
58
|
-
message?: string
|
|
59
|
-
}
|
|
58
|
+
Set `GITHUB_TOKEN` or `GH_TOKEN` in your environment, then:
|
|
60
59
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
```bash
|
|
61
|
+
npx @ghx-dev/core capabilities list
|
|
62
|
+
npx @ghx-dev/core capabilities explain repo.view
|
|
63
|
+
npx @ghx-dev/core run repo.view --input '{"owner":"aryeko","name":"ghx"}'
|
|
64
|
+
```
|
|
64
65
|
|
|
65
|
-
|
|
66
|
-
throw new Error(payload.errors[0]?.message ?? "GraphQL returned errors")
|
|
67
|
-
}
|
|
66
|
+
If installed globally, replace `npx @ghx-dev/core` with `ghx`.
|
|
68
67
|
|
|
69
|
-
|
|
70
|
-
throw new Error("GraphQL response missing data")
|
|
71
|
-
}
|
|
68
|
+
Every capability returns a stable envelope:
|
|
72
69
|
|
|
73
|
-
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"ok": true,
|
|
73
|
+
"data": {
|
|
74
|
+
"id": "R_kgDOOx...",
|
|
75
|
+
"name": "ghx",
|
|
76
|
+
"nameWithOwner": "aryeko/ghx"
|
|
74
77
|
},
|
|
75
|
-
|
|
78
|
+
"error": null,
|
|
79
|
+
"meta": {
|
|
80
|
+
"capability_id": "repo.view",
|
|
81
|
+
"route_used": "cli",
|
|
82
|
+
"reason": "CARD_PREFERRED"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Quick Start (Library API)
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
import { createGithubClientFromToken, executeTask } from "@ghx-dev/core"
|
|
91
|
+
|
|
92
|
+
const token = process.env.GITHUB_TOKEN!
|
|
93
|
+
const githubClient = createGithubClientFromToken(token)
|
|
76
94
|
|
|
77
95
|
const result = await executeTask(
|
|
78
|
-
{
|
|
79
|
-
|
|
80
|
-
input: {
|
|
81
|
-
owner: "aryeko",
|
|
82
|
-
name: "ghx",
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
githubClient,
|
|
87
|
-
githubToken,
|
|
88
|
-
},
|
|
96
|
+
{ task: "repo.view", input: { owner: "aryeko", name: "ghx" } },
|
|
97
|
+
{ githubClient, githubToken: token },
|
|
89
98
|
)
|
|
90
99
|
|
|
91
|
-
if (
|
|
92
|
-
|
|
100
|
+
if (result.ok) {
|
|
101
|
+
console.log(result.data)
|
|
102
|
+
} else {
|
|
103
|
+
console.error(result.error?.code, result.error?.message)
|
|
93
104
|
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Need a custom GraphQL transport? Use `createGithubClient(transport)` instead -- see the [advanced usage section](#custom-graphql-transport).
|
|
108
|
+
|
|
109
|
+
## Agent Onboarding
|
|
94
110
|
|
|
95
|
-
|
|
111
|
+
Install ghx as a project skill for Claude Code:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
npx @ghx-dev/core setup --scope project --yes
|
|
115
|
+
npx @ghx-dev/core setup --scope project --verify
|
|
96
116
|
```
|
|
97
117
|
|
|
118
|
+
### Setup Skill Source
|
|
119
|
+
|
|
120
|
+
The canonical setup skill content is stored in:
|
|
121
|
+
|
|
122
|
+
- `src/cli/assets/skills/ghx/SKILL.md`
|
|
123
|
+
|
|
124
|
+
During build/publish it is copied to:
|
|
125
|
+
|
|
126
|
+
- `dist/cli/assets/skills/ghx/SKILL.md`
|
|
127
|
+
|
|
128
|
+
`ghx setup` writes this content to `.agents/skills/ghx/SKILL.md` in user or project scope.
|
|
129
|
+
|
|
98
130
|
## Agent Tools (`@ghx-dev/core/agent`)
|
|
99
131
|
|
|
100
132
|
```ts
|
|
101
133
|
import {
|
|
102
134
|
createExecuteTool,
|
|
103
|
-
explainCapability,
|
|
104
135
|
listCapabilities,
|
|
136
|
+
explainCapability,
|
|
105
137
|
MAIN_SKILL_TEXT,
|
|
106
138
|
} from "@ghx-dev/core/agent"
|
|
139
|
+
import { createGithubClientFromToken, executeTask } from "@ghx-dev/core"
|
|
107
140
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
141
|
+
// Wire the execute tool to the real engine
|
|
142
|
+
const token = process.env.GITHUB_TOKEN!
|
|
143
|
+
const githubClient = createGithubClientFromToken(token)
|
|
144
|
+
|
|
145
|
+
const tool = createExecuteTool({
|
|
146
|
+
executeTask: (request) => executeTask(request, { githubClient, githubToken: token }),
|
|
113
147
|
})
|
|
114
148
|
|
|
115
|
-
|
|
149
|
+
// Discover and execute capabilities
|
|
116
150
|
console.log(listCapabilities())
|
|
117
151
|
console.log(explainCapability("repo.view"))
|
|
118
|
-
await
|
|
152
|
+
const result = await tool.execute("repo.view", { owner: "aryeko", name: "ghx" })
|
|
119
153
|
```
|
|
120
154
|
|
|
121
|
-
|
|
155
|
+
`MAIN_SKILL_TEXT` provides a ready-to-use system prompt describing all capabilities.
|
|
122
156
|
|
|
123
|
-
|
|
157
|
+
## 66 Capabilities
|
|
124
158
|
|
|
125
|
-
|
|
126
|
-
ghx run repo.view --input '{"owner":"aryeko","name":"ghx"}'
|
|
127
|
-
```
|
|
159
|
+
**Repository** -- `repo.view`, `repo.labels.list`, `repo.issue_types.list`
|
|
128
160
|
|
|
129
|
-
|
|
161
|
+
**Issues** -- `issue.view`, `issue.list`, `issue.comments.list`, `issue.create`, `issue.update`, `issue.close`, `issue.reopen`, `issue.delete`, `issue.labels.update`, `issue.assignees.update`, `issue.milestone.set`, `issue.comments.create`, `issue.linked_prs.list`, `issue.relations.get`, `issue.parent.set`, `issue.parent.remove`, `issue.blocked_by.add`, `issue.blocked_by.remove`
|
|
130
162
|
|
|
131
|
-
|
|
132
|
-
- `GITHUB_GRAPHQL_URL` (optional override)
|
|
133
|
-
- `GH_HOST` (optional; used to derive enterprise GraphQL endpoint)
|
|
134
|
-
|
|
135
|
-
## Built-in Capabilities
|
|
136
|
-
|
|
137
|
-
- `repo.view` - fetch repository metadata
|
|
138
|
-
- `issue.view` - fetch a single issue
|
|
139
|
-
- `issue.list` - list repository issues
|
|
140
|
-
- `issue.comments.list` - list issue comments with pagination
|
|
141
|
-
- `pr.view` - fetch a single pull request
|
|
142
|
-
- `pr.list` - list pull requests
|
|
143
|
-
- `pr.comments.list` - list pull request review threads/comments
|
|
144
|
-
- `pr.reviews.list` - list pull request reviews
|
|
145
|
-
- `pr.diff.list_files` - list changed files in a pull request
|
|
146
|
-
- `pr.status.checks` - list pull request checks and summary counts
|
|
147
|
-
- `pr.checks.get_failed` - list failed pull request checks
|
|
148
|
-
- `pr.mergeability.view` - fetch mergeability and review decision signals
|
|
149
|
-
- `pr.comment.reply` - reply to a pull request review thread
|
|
150
|
-
- `pr.comment.resolve` - resolve a pull request review thread
|
|
151
|
-
- `pr.comment.unresolve` - unresolve a pull request review thread
|
|
152
|
-
- `pr.ready_for_review.set` - mark draft/ready-for-review state
|
|
153
|
-
- `check_run.annotations.list` - list check run annotations
|
|
154
|
-
- `workflow_runs.list` - list workflow runs for a repository
|
|
155
|
-
- `workflow_run.jobs.list` - list jobs for a workflow run
|
|
156
|
-
- `workflow_job.logs.get` - fetch workflow job logs
|
|
157
|
-
- `workflow_job.logs.analyze` - analyze workflow job logs for error/warning summaries
|
|
163
|
+
**Pull Requests (read)** -- `pr.view`, `pr.list`, `pr.comments.list`, `pr.reviews.list`, `pr.diff.list_files`, `pr.status.checks`, `pr.checks.get_failed`, `pr.mergeability.view`
|
|
158
164
|
|
|
159
|
-
|
|
165
|
+
**Pull Requests (execute)** -- `pr.comment.reply`, `pr.comment.resolve`, `pr.comment.unresolve`, `pr.ready_for_review.set`, `pr.review.submit_approve`, `pr.review.submit_request_changes`, `pr.review.submit_comment`, `pr.merge.execute`, `pr.checks.rerun_failed`, `pr.checks.rerun_all`, `pr.reviewers.request`, `pr.assignees.update`, `pr.branch.update`
|
|
160
166
|
|
|
161
|
-
|
|
167
|
+
**CI Diagnostics** -- `check_run.annotations.list`, `workflow_runs.list`, `workflow_run.jobs.list`, `workflow_job.logs.get`, `workflow_job.logs.analyze`
|
|
162
168
|
|
|
163
|
-
|
|
164
|
-
- `createGithubClient`, `createGraphqlClient`
|
|
165
|
-
- `listOperationCards`, `getOperationCard`
|
|
166
|
-
- `createSafeCliCommandRunner`
|
|
167
|
-
- core result/task types (`TaskRequest`, `ResultEnvelope`, `ResultError`, `ResultMeta`, `AttemptMeta`, `RouteSource`, `RouteReasonCode`)
|
|
169
|
+
**Releases** -- `release.list`, `release.get`, `release.create_draft`, `release.update`, `release.publish_draft`
|
|
168
170
|
|
|
169
|
-
|
|
171
|
+
**Workflow Controls** -- `workflow.list`, `workflow.get`, `workflow_dispatch.run`, `workflow_run.get`, `workflow_run.rerun_failed`, `workflow_run.rerun_all`, `workflow_run.cancel`, `workflow_run.artifacts.list`
|
|
170
172
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
+
**Projects v2** -- `project_v2.org.get`, `project_v2.user.get`, `project_v2.fields.list`, `project_v2.items.list`, `project_v2.item.add_issue`, `project_v2.item.field.update`
|
|
174
|
+
|
|
175
|
+
For exact input/output contracts, see the [operation card registry](https://github.com/aryeko/ghx/tree/main/packages/core/src/core/registry/cards).
|
|
173
176
|
|
|
174
177
|
## Result Envelope
|
|
175
178
|
|
|
@@ -180,7 +183,7 @@ type ResultEnvelope<TData = unknown> = {
|
|
|
180
183
|
ok: boolean
|
|
181
184
|
data?: TData
|
|
182
185
|
error?: {
|
|
183
|
-
code: string
|
|
186
|
+
code: string // AUTH, NOT_FOUND, RATE_LIMIT, VALIDATION, ...
|
|
184
187
|
message: string
|
|
185
188
|
retryable: boolean
|
|
186
189
|
details?: Record<string, unknown>
|
|
@@ -199,13 +202,77 @@ type ResultEnvelope<TData = unknown> = {
|
|
|
199
202
|
}
|
|
200
203
|
```
|
|
201
204
|
|
|
205
|
+
## Environment Variables
|
|
206
|
+
|
|
207
|
+
- `GITHUB_TOKEN` or `GH_TOKEN` (required)
|
|
208
|
+
- `GITHUB_GRAPHQL_URL` (optional; override GraphQL endpoint)
|
|
209
|
+
- `GH_HOST` (optional; derives enterprise GraphQL endpoint)
|
|
210
|
+
|
|
211
|
+
## Security and Permissions
|
|
212
|
+
|
|
213
|
+
- Start with least privilege and grant only what your capability set needs.
|
|
214
|
+
- For quick local testing, a classic PAT with `repo` scope is the simplest route.
|
|
215
|
+
- For production agents, prefer fine-grained tokens with read permissions first (`Metadata`, `Contents`, `Pull requests`, `Issues`, `Actions`, `Projects`) and add writes only where needed.
|
|
216
|
+
|
|
217
|
+
## Compatibility
|
|
218
|
+
|
|
219
|
+
- Node.js `22+`
|
|
220
|
+
- GitHub Cloud and GitHub Enterprise hosts (`GH_HOST` supported)
|
|
221
|
+
- Route adapters: CLI and GraphQL
|
|
222
|
+
|
|
223
|
+
## Public Exports
|
|
224
|
+
|
|
225
|
+
Root (`@ghx-dev/core`):
|
|
226
|
+
|
|
227
|
+
- `executeTask` -- run a capability
|
|
228
|
+
- `createGithubClientFromToken` -- create a client from a token string
|
|
229
|
+
- `createGithubClient`, `createGraphqlClient` -- create clients from a custom transport
|
|
230
|
+
- `listOperationCards`, `getOperationCard` -- inspect capability registry
|
|
231
|
+
- `createSafeCliCommandRunner` -- custom CLI execution
|
|
232
|
+
- Types: `TaskRequest`, `ResultEnvelope`, `ResultError`, `ResultMeta`, `AttemptMeta`, `RouteSource`, `RouteReasonCode`, `TokenClientOptions`
|
|
233
|
+
|
|
234
|
+
Subpaths:
|
|
235
|
+
|
|
236
|
+
- `@ghx-dev/core/agent` -- `createExecuteTool`, `listCapabilities`, `explainCapability`, `MAIN_SKILL_TEXT`
|
|
237
|
+
- `@ghx-dev/core/cli` -- CLI entrypoint
|
|
238
|
+
|
|
239
|
+
## Custom GraphQL Transport
|
|
240
|
+
|
|
241
|
+
For full control over the GraphQL layer, pass your own transport to `createGithubClient`:
|
|
242
|
+
|
|
243
|
+
```ts
|
|
244
|
+
import { createGithubClient, executeTask } from "@ghx-dev/core"
|
|
245
|
+
|
|
246
|
+
const githubClient = createGithubClient({
|
|
247
|
+
async execute<TData>(query: string, variables?: Record<string, unknown>): Promise<TData> {
|
|
248
|
+
const response = await fetch("https://api.github.com/graphql", {
|
|
249
|
+
method: "POST",
|
|
250
|
+
headers: {
|
|
251
|
+
"content-type": "application/json",
|
|
252
|
+
authorization: `Bearer ${process.env.GITHUB_TOKEN}`,
|
|
253
|
+
},
|
|
254
|
+
body: JSON.stringify({ query, variables: variables ?? {} }),
|
|
255
|
+
})
|
|
256
|
+
const payload = (await response.json()) as { data?: TData; errors?: Array<{ message?: string }> }
|
|
257
|
+
if (payload.errors?.length) throw new Error(payload.errors[0]?.message ?? "GraphQL error")
|
|
258
|
+
if (payload.data === undefined) throw new Error("GraphQL response missing data")
|
|
259
|
+
return payload.data
|
|
260
|
+
},
|
|
261
|
+
})
|
|
262
|
+
|
|
263
|
+
const result = await executeTask(
|
|
264
|
+
{ task: "repo.view", input: { owner: "aryeko", name: "ghx" } },
|
|
265
|
+
{ githubClient, githubToken: process.env.GITHUB_TOKEN },
|
|
266
|
+
)
|
|
267
|
+
```
|
|
268
|
+
|
|
202
269
|
## Documentation
|
|
203
270
|
|
|
204
|
-
- Architecture overview
|
|
205
|
-
- Module map
|
|
206
|
-
- File map
|
|
207
|
-
-
|
|
208
|
-
- Publishing guide
|
|
271
|
+
- [Architecture overview](https://github.com/aryeko/ghx/blob/main/docs/CODEMAPS/ARCHITECTURE.md)
|
|
272
|
+
- [Module map](https://github.com/aryeko/ghx/blob/main/docs/CODEMAPS/MODULES.md)
|
|
273
|
+
- [File map](https://github.com/aryeko/ghx/blob/main/docs/CODEMAPS/FILES.md)
|
|
274
|
+
- [Operation card registry](https://github.com/aryeko/ghx/blob/main/docs/architecture/operation-card-registry.md)
|
|
275
|
+
- [Publishing guide](https://github.com/aryeko/ghx/blob/main/docs/guides/publishing.md)
|
|
209
276
|
|
|
210
277
|
## License
|
|
211
278
|
|
package/dist/agent.d.ts
CHANGED
|
@@ -1,7 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
CHANGED
|
@@ -1,17 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-DJIEG6K7.js";
|
|
4
|
-
import {
|
|
5
|
-
explainCapability
|
|
6
|
-
} from "./chunk-MMG6CIKK.js";
|
|
7
|
-
import {
|
|
2
|
+
explainCapability,
|
|
8
3
|
listCapabilities
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
} from "./chunk-SCIJMW5P.js";
|
|
5
|
+
import "./chunk-OL4ARD3R.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({
|
|
27
|
+
...request
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
15
32
|
export {
|
|
16
33
|
MAIN_SKILL_TEXT,
|
|
17
34
|
createExecuteTool,
|
package/dist/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
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({\n ...request,\n })\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;AAAA,QACtB,GAAG;AAAA,MACL,CAAC;AAAA,IACH;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
capability_id: issue.blocked_by.add
|
|
2
|
+
version: "1.0.0"
|
|
3
|
+
description: Add a blocked-by relation for an issue.
|
|
4
|
+
input_schema:
|
|
5
|
+
type: object
|
|
6
|
+
required: [issueId, blockedByIssueId]
|
|
7
|
+
properties:
|
|
8
|
+
issueId: { type: string, minLength: 1 }
|
|
9
|
+
blockedByIssueId: { type: string, minLength: 1 }
|
|
10
|
+
additionalProperties: false
|
|
11
|
+
output_schema:
|
|
12
|
+
type: object
|
|
13
|
+
required: [issueId, blockedByIssueId]
|
|
14
|
+
properties:
|
|
15
|
+
issueId: { type: string, minLength: 1 }
|
|
16
|
+
blockedByIssueId: { type: string, minLength: 1 }
|
|
17
|
+
additionalProperties: false
|
|
18
|
+
routing:
|
|
19
|
+
preferred: graphql
|
|
20
|
+
fallbacks: []
|
|
21
|
+
graphql:
|
|
22
|
+
operationName: IssueBlockedByAdd
|
|
23
|
+
documentPath: src/gql/operations/issue-blocked-by-add.graphql
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
capability_id: issue.blocked_by.remove
|
|
2
|
+
version: "1.0.0"
|
|
3
|
+
description: Remove a blocked-by relation for an issue.
|
|
4
|
+
input_schema:
|
|
5
|
+
type: object
|
|
6
|
+
required: [issueId, blockedByIssueId]
|
|
7
|
+
properties:
|
|
8
|
+
issueId: { type: string, minLength: 1 }
|
|
9
|
+
blockedByIssueId: { type: string, minLength: 1 }
|
|
10
|
+
additionalProperties: false
|
|
11
|
+
output_schema:
|
|
12
|
+
type: object
|
|
13
|
+
required: [issueId, blockedByIssueId, removed]
|
|
14
|
+
properties:
|
|
15
|
+
issueId: { type: string, minLength: 1 }
|
|
16
|
+
blockedByIssueId: { type: string, minLength: 1 }
|
|
17
|
+
removed: { type: boolean }
|
|
18
|
+
additionalProperties: false
|
|
19
|
+
routing:
|
|
20
|
+
preferred: graphql
|
|
21
|
+
fallbacks: []
|
|
22
|
+
graphql:
|
|
23
|
+
operationName: IssueBlockedByRemove
|
|
24
|
+
documentPath: src/gql/operations/issue-blocked-by-remove.graphql
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
capability_id: issue.close
|
|
2
|
+
version: "1.0.0"
|
|
3
|
+
description: Close an issue.
|
|
4
|
+
input_schema:
|
|
5
|
+
type: object
|
|
6
|
+
required: [issueId]
|
|
7
|
+
properties:
|
|
8
|
+
issueId: { type: string, minLength: 1 }
|
|
9
|
+
additionalProperties: false
|
|
10
|
+
output_schema:
|
|
11
|
+
type: object
|
|
12
|
+
required: [id, number, state, closed]
|
|
13
|
+
properties:
|
|
14
|
+
id: { type: string, minLength: 1 }
|
|
15
|
+
number: { type: integer, minimum: 1 }
|
|
16
|
+
state: { type: string }
|
|
17
|
+
closed: { type: boolean }
|
|
18
|
+
additionalProperties: false
|
|
19
|
+
routing:
|
|
20
|
+
preferred: graphql
|
|
21
|
+
fallbacks: []
|
|
22
|
+
graphql:
|
|
23
|
+
operationName: IssueClose
|
|
24
|
+
documentPath: src/gql/operations/issue-close.graphql
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
capability_id: issue.comments.create
|
|
2
|
+
version: "1.0.0"
|
|
3
|
+
description: Create an issue comment.
|
|
4
|
+
input_schema:
|
|
5
|
+
type: object
|
|
6
|
+
required: [issueId, body]
|
|
7
|
+
properties:
|
|
8
|
+
issueId: { type: string, minLength: 1 }
|
|
9
|
+
body: { type: string, minLength: 1 }
|
|
10
|
+
additionalProperties: false
|
|
11
|
+
output_schema:
|
|
12
|
+
type: object
|
|
13
|
+
required: [id, body, url]
|
|
14
|
+
properties:
|
|
15
|
+
id: { type: string, minLength: 1 }
|
|
16
|
+
body: { type: string }
|
|
17
|
+
url: { type: string }
|
|
18
|
+
additionalProperties: false
|
|
19
|
+
routing:
|
|
20
|
+
preferred: graphql
|
|
21
|
+
fallbacks: []
|
|
22
|
+
graphql:
|
|
23
|
+
operationName: IssueCommentCreate
|
|
24
|
+
documentPath: src/gql/operations/issue-comment-create.graphql
|