@perrylink/dsh-github 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/LICENSE +201 -0
  2. package/README.es.md +256 -0
  3. package/README.hi.md +256 -0
  4. package/README.md +257 -0
  5. package/README.pt.md +256 -0
  6. package/README.zh-CN.md +254 -0
  7. package/cordis.patch.yml +9 -0
  8. package/lib/approval-gate.d.ts +25 -0
  9. package/lib/approval-gate.d.ts.map +1 -0
  10. package/lib/approval-gate.js +75 -0
  11. package/lib/approval-gate.js.map +1 -0
  12. package/lib/commands.d.ts +12 -0
  13. package/lib/commands.d.ts.map +1 -0
  14. package/lib/commands.js +228 -0
  15. package/lib/commands.js.map +1 -0
  16. package/lib/config.d.ts +60 -0
  17. package/lib/config.d.ts.map +1 -0
  18. package/lib/config.js +64 -0
  19. package/lib/config.js.map +1 -0
  20. package/lib/credential.d.ts +42 -0
  21. package/lib/credential.d.ts.map +1 -0
  22. package/lib/credential.js +80 -0
  23. package/lib/credential.js.map +1 -0
  24. package/lib/git.d.ts +52 -0
  25. package/lib/git.d.ts.map +1 -0
  26. package/lib/git.js +113 -0
  27. package/lib/git.js.map +1 -0
  28. package/lib/github.d.ts +66 -0
  29. package/lib/github.d.ts.map +1 -0
  30. package/lib/github.js +153 -0
  31. package/lib/github.js.map +1 -0
  32. package/lib/index.d.ts +55 -0
  33. package/lib/index.d.ts.map +1 -0
  34. package/lib/index.js +44 -0
  35. package/lib/index.js.map +1 -0
  36. package/lib/jobs.d.ts +34 -0
  37. package/lib/jobs.d.ts.map +1 -0
  38. package/lib/jobs.js +255 -0
  39. package/lib/jobs.js.map +1 -0
  40. package/lib/present.d.ts +254 -0
  41. package/lib/present.d.ts.map +1 -0
  42. package/lib/present.js +149 -0
  43. package/lib/present.js.map +1 -0
  44. package/lib/review.d.ts +53 -0
  45. package/lib/review.d.ts.map +1 -0
  46. package/lib/review.js +158 -0
  47. package/lib/review.js.map +1 -0
  48. package/lib/state.d.ts +96 -0
  49. package/lib/state.d.ts.map +1 -0
  50. package/lib/state.js +86 -0
  51. package/lib/state.js.map +1 -0
  52. package/lib/tools.d.ts +21 -0
  53. package/lib/tools.d.ts.map +1 -0
  54. package/lib/tools.js +937 -0
  55. package/lib/tools.js.map +1 -0
  56. package/lib/types.d.ts +147 -0
  57. package/lib/types.d.ts.map +1 -0
  58. package/lib/types.js +2 -0
  59. package/lib/types.js.map +1 -0
  60. package/package.json +78 -0
package/lib/jobs.js ADDED
@@ -0,0 +1,255 @@
1
+ /**
2
+ * Background review-job producer for `/review <pr>`.
3
+ *
4
+ * The job fetches the PR metadata (capturing the head-commit SHA for later
5
+ * inline review posting), the capped diff, and — when requested — the CI
6
+ * check runs and the existing review comments, then runs the deterministic
7
+ * multi-file analyzer and stores the report in the plugin's in-memory record
8
+ * map. Supplementary fetch failures (CI, comments) never fail the job; they
9
+ * are noted in the completion output. Completion notices are delivered by the
10
+ * host's tool-jobs consumer (followup for an idle owner, inject for a busy
11
+ * one); the model then reads the report with the existing job_output tool and
12
+ * posts it with review_post after approval. The job itself never writes to
13
+ * GitHub.
14
+ * @module dsh-github/jobs
15
+ */
16
+ import { analyzeDiff } from "./review.js";
17
+ /** Producer kind — also the `<kind>-N` id prefix; the host treats it as opaque. */
18
+ export const REVIEW_JOB_KIND = 'github-review';
19
+ /**
20
+ * Start one background review job and register its in-memory record.
21
+ *
22
+ * The token is resolved inside the run body (per-operation, per the
23
+ * credentials-seam contract); a missing token settles the job as `failed`
24
+ * with configuration guidance, never with a token value. `start` throws when
25
+ * no job controller serves the owner — callers surface that as a command
26
+ * error. With `reviewMode: "model"`, the subagent seam must be composed or
27
+ * this call fails loud before starting the job.
28
+ * @param registry - `ctx.jobs` of the hosting context.
29
+ * @param state - plugin state holding config, token resolution, and records.
30
+ * @param input - target PR, label, owning agent, and job options.
31
+ * @returns the registry-issued `<kind>-N` id.
32
+ */
33
+ export function startReviewJob(registry, state, input) {
34
+ if (state.config.reviewMode === 'model' && state.subagents === undefined) {
35
+ throw new Error('reviewMode "model" requires the subagent seam: load @deepseek-ai/dsh-subagent with an in-process provider '
36
+ + '(e.g. @deepseek-ai/dsh-subagent-spawn-in-process) in the agent composition, or set reviewMode to "static".');
37
+ }
38
+ const record = {
39
+ status: 'running',
40
+ repo: input.repo,
41
+ pr: input.pr,
42
+ report: null,
43
+ };
44
+ const jobInput = {
45
+ ...input,
46
+ timeoutMs: input.timeoutMs ?? state.config.reviewJobTimeoutMs,
47
+ maxDiffChars: input.maxDiffChars ?? state.config.maxDiffChars,
48
+ includeCi: input.includeCi ?? true,
49
+ includeComments: input.includeComments ?? true,
50
+ };
51
+ const spec = {
52
+ kind: REVIEW_JOB_KIND,
53
+ label: input.label,
54
+ owner: input.owner,
55
+ outputLimitBytes: 64 * 1024,
56
+ run: () => runReviewWork(state, record, jobInput),
57
+ };
58
+ const id = registry.start(spec);
59
+ state.rememberRecord(id, record);
60
+ return id;
61
+ }
62
+ /** Run the review work and settle exactly one terminal outcome. */
63
+ function runReviewWork(state, record, input) {
64
+ const controller = new AbortController();
65
+ let cancelReason;
66
+ const timer = setTimeout(() => {
67
+ cancelReason ??= 'timeout';
68
+ controller.abort(new Error('review job timed out'));
69
+ }, input.timeoutMs);
70
+ const done = (async () => {
71
+ try {
72
+ const token = await state.resolveToken(controller.signal);
73
+ const abortedAfterToken = abortedOutcome(controller, cancelReason);
74
+ if (abortedAfterToken !== null) {
75
+ record.status = abortedAfterToken.status === 'killed' ? 'killed' : 'failed';
76
+ return abortedAfterToken;
77
+ }
78
+ if (!token.ok) {
79
+ record.status = 'failed';
80
+ record.error = token.error.message;
81
+ return { status: 'failed', detail: 'no GitHub token', output: `${token.error.message}\n${token.error.guidance}` };
82
+ }
83
+ const client = state.client(token.token.value);
84
+ const metadata = await client.requestJson('GET', `/repos/${record.repo}/pulls/${record.pr}`, { signal: controller.signal });
85
+ const abortedAfterMetadata = abortedOutcome(controller, cancelReason);
86
+ if (abortedAfterMetadata !== null) {
87
+ record.status = abortedAfterMetadata.status === 'killed' ? 'killed' : 'failed';
88
+ return abortedAfterMetadata;
89
+ }
90
+ record.headSha = metadata.data.head?.sha;
91
+ const diff = await client.requestText('GET', `/repos/${record.repo}/pulls/${record.pr}`, { signal: controller.signal });
92
+ const abortedAfterDiff = abortedOutcome(controller, cancelReason);
93
+ if (abortedAfterDiff !== null) {
94
+ record.status = abortedAfterDiff.status === 'killed' ? 'killed' : 'failed';
95
+ return abortedAfterDiff;
96
+ }
97
+ const truncated = diff.text.length > input.maxDiffChars;
98
+ const capped = truncated ? diff.text.slice(0, input.maxDiffChars) : diff.text;
99
+ if (state.config.reviewMode === 'model') {
100
+ return runModelReview(state, record, input.owner, controller, cancelReason, capped, truncated);
101
+ }
102
+ const report = analyzeDiff(capped, input.maxDiffChars);
103
+ record.report = report;
104
+ const notes = [];
105
+ if (input.includeCi) {
106
+ try {
107
+ const ci = await client.requestJson('GET', `/repos/${record.repo}/commits/${record.headSha ?? ''}/check-runs`, { signal: controller.signal });
108
+ record.ciSummary = summarizeChecks(ci.data.check_runs ?? []);
109
+ notes.push(`CI: ${record.ciSummary}`);
110
+ }
111
+ catch {
112
+ notes.push('CI: unavailable');
113
+ }
114
+ }
115
+ if (input.includeComments) {
116
+ try {
117
+ const comments = await client.requestJson('GET', `/repos/${record.repo}/pulls/${record.pr}/comments?per_page=${state.config.maxComments}`, { signal: controller.signal });
118
+ record.commentsCount = comments.data.length;
119
+ notes.push(`existing review comments: ${comments.data.length}`);
120
+ }
121
+ catch {
122
+ notes.push('existing review comments: unavailable');
123
+ }
124
+ }
125
+ record.status = 'completed';
126
+ const detail = `${report.findings.length} finding(s)`;
127
+ const output = [report.summary, ...notes].join('\n');
128
+ return { status: 'completed', detail, output };
129
+ }
130
+ catch (error) {
131
+ const aborted = abortedOutcome(controller, cancelReason);
132
+ if (aborted !== null) {
133
+ record.status = aborted.status === 'killed' ? 'killed' : 'failed';
134
+ return aborted;
135
+ }
136
+ record.status = 'failed';
137
+ const message = error instanceof Error ? error.message : 'review failed';
138
+ record.error = message;
139
+ return { status: 'failed', detail: message };
140
+ }
141
+ finally {
142
+ clearTimeout(timer);
143
+ }
144
+ })();
145
+ return {
146
+ cancel: (reason) => {
147
+ cancelReason = reason ?? 'cancelled';
148
+ controller.abort();
149
+ },
150
+ done,
151
+ };
152
+ }
153
+ /** Review prompt for the one-shot subagent (model review). */
154
+ function modelReviewPrompt(record, diffText, truncated) {
155
+ return [
156
+ `Review the following GitHub pull request diff for PR #${record.pr} in ${record.repo}.`,
157
+ 'You are a careful code reviewer. Analyze correctness, security, style, and maintainability.',
158
+ 'Write the review as GitHub-flavored Markdown suitable for posting as a PR comment:',
159
+ '- a short overall verdict first,',
160
+ '- then concrete findings grouped by file with line numbers where possible.',
161
+ 'Report only actionable findings; do not praise or pad.',
162
+ 'This is a READ-ONLY review: do not modify files, do not create or comment on any issue or pull request.',
163
+ truncated ? 'Note: the diff below was truncated to the configured cap; the review covers only the examined range.' : '',
164
+ 'Diff:',
165
+ '```diff',
166
+ diffText,
167
+ '```',
168
+ ].join('\n');
169
+ }
170
+ /** Model-review branch: delegate the capped diff to a one-shot subagent. */
171
+ async function runModelReview(state, record, owner, controller, cancelReason, diffText, truncated) {
172
+ const subagents = state.subagents;
173
+ if (subagents === undefined) {
174
+ // startReviewJob fails loud first; this is unreachable in practice but keeps the type honest.
175
+ record.status = 'failed';
176
+ record.error = 'model review requires the subagent seam';
177
+ return { status: 'failed', detail: 'model review unavailable', output: 'Model review requires the subagent seam; set reviewMode to "static" or load @deepseek-ai/dsh-subagent with a provider.' };
178
+ }
179
+ const provider = state.config.modelReviewProvider ?? subagents.list()[0];
180
+ if (provider === undefined) {
181
+ record.status = 'failed';
182
+ record.error = 'no subagent provider registered';
183
+ return {
184
+ status: 'failed',
185
+ detail: 'no subagent provider',
186
+ output: 'No subagent provider is registered on the subagents seam. Load a provider package '
187
+ + '(e.g. @deepseek-ai/dsh-subagent-spawn-in-process), or set reviewMode to "static".',
188
+ };
189
+ }
190
+ try {
191
+ const run = await subagents.start(provider, {
192
+ label: `review PR #${record.pr} (${record.repo})`,
193
+ prompt: [{ type: 'text', text: modelReviewPrompt(record, diffText, truncated) }],
194
+ parent: owner,
195
+ signal: controller.signal,
196
+ });
197
+ try {
198
+ const result = await run.result;
199
+ if (result.stopReason !== 'completed') {
200
+ record.status = 'failed';
201
+ record.error = `model review stopped: ${result.stopReason}`;
202
+ return { status: 'failed', detail: `model review: ${result.stopReason}` };
203
+ }
204
+ const text = result.output.filter(block => block.type === 'text').map(block => block.text ?? '').join('\n').trim();
205
+ if (text.length === 0) {
206
+ record.status = 'failed';
207
+ record.error = 'model review produced no output';
208
+ return { status: 'failed', detail: 'model review produced no output' };
209
+ }
210
+ record.report = {
211
+ findings: [],
212
+ summary: `model review complete (provider ${provider})${truncated ? ' (diff truncated)' : ''}`,
213
+ postBody: text,
214
+ truncated,
215
+ };
216
+ record.status = 'completed';
217
+ return { status: 'completed', detail: `model review (${provider})`, output: text };
218
+ }
219
+ finally {
220
+ await run.dispose();
221
+ }
222
+ }
223
+ catch (error) {
224
+ const aborted = abortedOutcome(controller, cancelReason);
225
+ if (aborted !== null) {
226
+ record.status = aborted.status === 'killed' ? 'killed' : 'failed';
227
+ return aborted;
228
+ }
229
+ record.status = 'failed';
230
+ const message = error instanceof Error ? error.message : 'model review failed';
231
+ record.error = message;
232
+ return { status: 'failed', detail: message };
233
+ }
234
+ }
235
+ /** One-line CI check summary: counts, pending, and failed. */
236
+ function summarizeChecks(runs) {
237
+ if (runs.length === 0)
238
+ return 'no checks reported';
239
+ const pending = runs.filter(run => run.status !== 'completed').length;
240
+ const failed = runs.filter(run => run.conclusion !== undefined && run.conclusion !== 'success' && run.conclusion !== 'neutral' && run.conclusion !== 'skipped').length;
241
+ return `${runs.length} check(s), ${pending} pending, ${failed} failed`;
242
+ }
243
+ /** Terminal outcome for an aborted controller; null while still running. */
244
+ function abortedOutcome(controller, cancelReason) {
245
+ if (!controller.signal.aborted)
246
+ return null;
247
+ if (cancelReason === 'timeout') {
248
+ return { status: 'failed', detail: 'timeout' };
249
+ }
250
+ if (cancelReason !== undefined) {
251
+ return { status: 'killed', detail: cancelReason };
252
+ }
253
+ return { status: 'failed', detail: 'aborted' };
254
+ }
255
+ //# sourceMappingURL=jobs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jobs.js","sourceRoot":"","sources":["../src/jobs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,WAAW,EAAqB,MAAM,aAAa,CAAA;AAI5D,mFAAmF;AACnF,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAA;AA0B9C;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,cAAc,CAAC,QAAqB,EAAE,KAAkB,EAAE,KAA0B;IAClG,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,KAAK,OAAO,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QACzE,MAAM,IAAI,KAAK,CACb,4GAA4G;cAC1G,4GAA4G,CAC/G,CAAA;IACH,CAAC;IACD,MAAM,MAAM,GAAoB;QAC9B,MAAM,EAAE,SAAS;QACjB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,MAAM,EAAE,IAAI;KACb,CAAA;IACD,MAAM,QAAQ,GAAG;QACf,GAAG,KAAK;QACR,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,MAAM,CAAC,kBAAkB;QAC7D,YAAY,EAAE,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC,YAAY;QAC7D,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,IAAI;QAClC,eAAe,EAAE,KAAK,CAAC,eAAe,IAAI,IAAI;KAC/C,CAAA;IAED,MAAM,IAAI,GAAiB;QACzB,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,KAAK,CAA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,EAAE,CAAA;AAChD,CAAC"}
@@ -0,0 +1,254 @@
1
+ /**
2
+ * Pure UI-card presenters for the dsh-github tools.
3
+ *
4
+ * Presenters run on live streaming AND on session-log replay, so they must be
5
+ * pure functions of their arguments — no I/O, no clock, no random, no plugin
6
+ * state. The canonical value reaches `presentResult` through the persisted
7
+ * `result.meta` populated by each tool's pure `presentationMeta` projection.
8
+ * @module dsh-github/present
9
+ */
10
+ import type { ToolCallView, ToolResult, ToolResultView } from '@deepseek-ai/dsh-tools';
11
+ import type { JsonValue } from '@deepseek-ai/dsh-session';
12
+ /** Rate-limit facts shared by every canonical value. */
13
+ export interface RateLimitValueView {
14
+ remaining?: number | null;
15
+ resetAt?: number | null;
16
+ }
17
+ /** Narrow structural view of pr_create arguments. */
18
+ export interface PrCreateArgs {
19
+ title: string;
20
+ base?: string;
21
+ head?: string;
22
+ draft?: boolean;
23
+ ownerRepo?: string;
24
+ }
25
+ /** Narrow structural view of a created-PR canonical value. */
26
+ export interface CreatedPrValue {
27
+ status: 'created';
28
+ url: string;
29
+ number: number;
30
+ title: string;
31
+ state: string;
32
+ draft: boolean;
33
+ base: string;
34
+ head: string;
35
+ rateLimit: RateLimitValueView;
36
+ }
37
+ /** Narrow structural view of the shared error canonical value. */
38
+ export interface GithubErrorValue {
39
+ status: 'error';
40
+ code: string;
41
+ message: string;
42
+ guidance?: string;
43
+ rateLimit?: RateLimitValueView;
44
+ }
45
+ /** Pending card for pr_create. */
46
+ export declare function prCreateCall(args: PrCreateArgs): ToolCallView;
47
+ /** Completed card for pr_create: the PR link, or a readable failure. */
48
+ export declare function prCreateResult(_args: PrCreateArgs, result: ToolResult): ToolResultView | undefined;
49
+ /** Narrow structural view of review_post arguments. */
50
+ export interface ReviewPostArgs {
51
+ jobId: string;
52
+ mode?: 'summary' | 'inline';
53
+ body?: string;
54
+ }
55
+ /** Narrow structural view of a posted-review canonical value. */
56
+ export interface PostedReviewValue {
57
+ status: 'posted';
58
+ mode: 'summary' | 'inline';
59
+ url: string;
60
+ commentId?: number;
61
+ reviewId?: number;
62
+ findings: number;
63
+ rateLimit: RateLimitValueView;
64
+ }
65
+ /** Pending card for review_post. */
66
+ export declare function reviewPostCall(args: ReviewPostArgs): ToolCallView;
67
+ /** Completed card for review_post. */
68
+ export declare function reviewPostResult(_args: ReviewPostArgs, result: ToolResult): ToolResultView | undefined;
69
+ /** Narrow structural view of issue_open arguments. */
70
+ export interface IssueOpenArgs {
71
+ title: string;
72
+ body?: string;
73
+ labels?: string[];
74
+ ownerRepo?: string;
75
+ }
76
+ /** Narrow structural view of a created-issue canonical value. */
77
+ export interface CreatedIssueValue {
78
+ status: 'created';
79
+ url: string;
80
+ number: number;
81
+ title: string;
82
+ rateLimit: RateLimitValueView;
83
+ }
84
+ /** Pending card for issue_open. */
85
+ export declare function issueOpenCall(args: IssueOpenArgs): ToolCallView;
86
+ /** Completed card for issue_open. */
87
+ export declare function issueOpenResult(_args: IssueOpenArgs, result: ToolResult): ToolResultView | undefined;
88
+ /** Narrow structural view of issue_comment arguments. */
89
+ export interface IssueCommentArgs {
90
+ ownerRepo?: string;
91
+ issueNumber: number;
92
+ body: string;
93
+ }
94
+ /** Narrow structural view of an issue-comment canonical value. */
95
+ export interface IssueCommentValue {
96
+ status: 'commented';
97
+ url: string;
98
+ commentId: number;
99
+ issueNumber: number;
100
+ rateLimit: RateLimitValueView;
101
+ }
102
+ /** Pending card for issue_comment. */
103
+ export declare function issueCommentCall(args: IssueCommentArgs): ToolCallView;
104
+ /** Completed card for issue_comment. */
105
+ export declare function issueCommentResult(_args: IssueCommentArgs, result: ToolResult): ToolResultView | undefined;
106
+ /** Narrow structural view of issue_close arguments. */
107
+ export interface IssueCloseArgs {
108
+ ownerRepo?: string;
109
+ issueNumber: number;
110
+ stateReason?: 'completed' | 'not_planned';
111
+ }
112
+ /** Narrow structural view of a closed-issue canonical value. */
113
+ export interface IssueClosedValue {
114
+ status: 'closed';
115
+ url: string;
116
+ number: number;
117
+ title: string;
118
+ rateLimit: RateLimitValueView;
119
+ }
120
+ /** Pending card for issue_close. */
121
+ export declare function issueCloseCall(args: IssueCloseArgs): ToolCallView;
122
+ /** Completed card for issue_close. */
123
+ export declare function issueCloseResult(_args: IssueCloseArgs, result: ToolResult): ToolResultView | undefined;
124
+ /** Narrow structural view of gh_review arguments. */
125
+ export interface GhReviewArgs {
126
+ pr: string;
127
+ fields?: string[];
128
+ maxDiffChars?: number;
129
+ }
130
+ /** Narrow structural view of one gh_review finding. */
131
+ export interface FindingValue {
132
+ file: string;
133
+ line?: number | null;
134
+ severity: 'info' | 'warning' | 'error';
135
+ rule: string;
136
+ message: string;
137
+ }
138
+ /** Narrow structural view of the gh_review canonical value. */
139
+ export interface PrSummaryValue {
140
+ repo: string;
141
+ number: number;
142
+ title: string;
143
+ state: string;
144
+ author: string;
145
+ url: string;
146
+ additions: number;
147
+ deletions: number;
148
+ base: string;
149
+ head: string;
150
+ ci: {
151
+ summary: string;
152
+ status?: string;
153
+ conclusion?: string;
154
+ error?: string;
155
+ runs?: Array<{
156
+ name: string;
157
+ status: string;
158
+ conclusion?: string;
159
+ }>;
160
+ };
161
+ comments: {
162
+ items: Array<{
163
+ id: number;
164
+ user: string;
165
+ path?: string;
166
+ line?: number;
167
+ body: string;
168
+ }>;
169
+ error?: string;
170
+ };
171
+ findings?: FindingValue[];
172
+ diff: {
173
+ length: number;
174
+ truncated: boolean;
175
+ excerpt: string;
176
+ text: string;
177
+ error?: string;
178
+ files?: Array<{
179
+ path: string;
180
+ added: number;
181
+ removed: number;
182
+ }>;
183
+ };
184
+ rateLimit: RateLimitValueView;
185
+ }
186
+ /** Pending card for gh_review. */
187
+ export declare function ghReviewCall(args: GhReviewArgs): ToolCallView;
188
+ /** Completed card for gh_review: headline facts and CI state. */
189
+ export declare function ghReviewResult(_args: GhReviewArgs, result: ToolResult): ToolResultView | undefined;
190
+ /** Narrow structural view of gh_issue arguments. */
191
+ export interface GhIssueArgs {
192
+ action: 'list' | 'get' | 'comments';
193
+ ownerRepo?: string;
194
+ issueNumber?: number;
195
+ state?: string;
196
+ limit?: number;
197
+ }
198
+ /** Narrow structural view of one gh_issue item. */
199
+ export interface IssueItemValue {
200
+ number: number;
201
+ title: string;
202
+ state: string;
203
+ kind: 'issue' | 'pr' | 'comment';
204
+ author: string;
205
+ url: string;
206
+ comments: number;
207
+ createdAt: string;
208
+ body: string | null;
209
+ }
210
+ /** Narrow structural view of the gh_issue canonical value. */
211
+ export interface IssueListValue {
212
+ repo: string;
213
+ action: 'list' | 'get' | 'comments';
214
+ total: number;
215
+ items?: IssueItemValue[];
216
+ rateLimit: RateLimitValueView;
217
+ }
218
+ /** Pending card for gh_issue. */
219
+ export declare function ghIssueCall(args: GhIssueArgs): ToolCallView;
220
+ /** Completed card for gh_issue. */
221
+ export declare function ghIssueResult(_args: GhIssueArgs, result: ToolResult): ToolResultView | undefined;
222
+ /** Narrow structural view of gh_search arguments. */
223
+ export interface SearchArgs {
224
+ q: string;
225
+ sort?: 'comments' | 'reactions' | 'created' | 'updated';
226
+ order?: 'desc' | 'asc';
227
+ perPage?: number;
228
+ }
229
+ /** Narrow structural view of one gh_search item. */
230
+ export interface SearchItemValue {
231
+ number: number;
232
+ title: string;
233
+ state: string;
234
+ kind: 'issue' | 'pr';
235
+ author: string;
236
+ url: string;
237
+ repo: string;
238
+ comments: number;
239
+ createdAt: string;
240
+ }
241
+ /** Narrow structural view of the gh_search canonical value. */
242
+ export interface SearchValue {
243
+ query: string;
244
+ total: number;
245
+ items: SearchItemValue[];
246
+ rateLimit: RateLimitValueView;
247
+ }
248
+ /** Pending card for gh_search. */
249
+ export declare function ghSearchCall(args: SearchArgs): ToolCallView;
250
+ /** Completed card for gh_search. */
251
+ export declare function ghSearchResult(_args: SearchArgs, result: ToolResult): ToolResultView | undefined;
252
+ /** Identity projection: persist the whole canonical value for card replay. */
253
+ export declare function identityMeta(_args: unknown, value: JsonValue): JsonValue;
254
+ //# sourceMappingURL=present.d.ts.map
@@ -0,0 +1 @@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