dsh-plugin-github-issues 0.0.0-stage → 0.5.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 (58) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +153 -2
  3. package/assets/panel.png +0 -0
  4. package/cordis.patch.yml +20 -0
  5. package/docs/README.zh.md +138 -0
  6. package/icon.svg +9 -0
  7. package/lib/client.js +3348 -0
  8. package/lib/controller.js +296 -0
  9. package/lib/controller.js.map +1 -0
  10. package/lib/github/auth.js +249 -0
  11. package/lib/github/auth.js.map +1 -0
  12. package/lib/github/client.js +797 -0
  13. package/lib/github/client.js.map +1 -0
  14. package/lib/github/queries.js +508 -0
  15. package/lib/github/queries.js.map +1 -0
  16. package/lib/github/state.js +190 -0
  17. package/lib/github/state.js.map +1 -0
  18. package/lib/github/types.js +29 -0
  19. package/lib/github/types.js.map +1 -0
  20. package/lib/github/vm.js +362 -0
  21. package/lib/github/vm.js.map +1 -0
  22. package/lib/index.js +65 -0
  23. package/lib/index.js.map +1 -0
  24. package/lib/prompt.js +87 -0
  25. package/lib/prompt.js.map +1 -0
  26. package/lib/remote-methods.js +33 -0
  27. package/lib/remote-methods.js.map +1 -0
  28. package/lib/types/controller.d.ts +109 -0
  29. package/lib/types/controller.d.ts.map +1 -0
  30. package/lib/types/github/auth.d.ts +52 -0
  31. package/lib/types/github/auth.d.ts.map +1 -0
  32. package/lib/types/github/client.d.ts +40 -0
  33. package/lib/types/github/client.d.ts.map +1 -0
  34. package/lib/types/github/queries.d.ts +181 -0
  35. package/lib/types/github/queries.d.ts.map +1 -0
  36. package/lib/types/github/state.d.ts +51 -0
  37. package/lib/types/github/state.d.ts.map +1 -0
  38. package/lib/types/github/types.d.ts +83 -0
  39. package/lib/types/github/types.d.ts.map +1 -0
  40. package/lib/types/github/vm.d.ts +260 -0
  41. package/lib/types/github/vm.d.ts.map +1 -0
  42. package/lib/types/index.d.ts +46 -0
  43. package/lib/types/index.d.ts.map +1 -0
  44. package/lib/types/prompt.d.ts +30 -0
  45. package/lib/types/prompt.d.ts.map +1 -0
  46. package/lib/types/remote-methods.d.ts +32 -0
  47. package/lib/types/remote-methods.d.ts.map +1 -0
  48. package/lib/types/vm.d.ts +268 -0
  49. package/lib/types/vm.d.ts.map +1 -0
  50. package/lib/types/workspace.d.ts +43 -0
  51. package/lib/types/workspace.d.ts.map +1 -0
  52. package/lib/vm.js +43 -0
  53. package/lib/vm.js.map +1 -0
  54. package/lib/workspace.js +57 -0
  55. package/lib/workspace.js.map +1 -0
  56. package/locale/en.json +6 -0
  57. package/locale/zh.json +6 -0
  58. package/package.json +99 -4
@@ -0,0 +1,51 @@
1
+ /**
2
+ * The plugin's non-secret state file.
3
+ *
4
+ * Preferences (which repo or project the panel shows, the pinned issue, the
5
+ * handoff template) are not credentials, so they live in the plugin's own
6
+ * directory instead of the DSH settings profile: the profile patch is rewritten
7
+ * by upgrades and its `.bak` copies would duplicate whatever is written there.
8
+ *
9
+ * @module dsh-plugin-github-issues/github/state
10
+ */
11
+ import { type IssueLinkRecord, type IssueSessionLinkVM, type Prefs } from '../vm.ts';
12
+ /**
13
+ * Apply a browser-supplied preference patch onto the current preferences.
14
+ * @param current - the preferences currently stored.
15
+ * @param patch - the untrusted patch.
16
+ * @returns the next preferences, with every field validated.
17
+ */
18
+ export declare function applyPrefsPatch(current: Prefs, patch: unknown): Prefs;
19
+ /** File-backed preference storage for one installation. */
20
+ export declare class PrefsStore {
21
+ private readonly stateDir;
22
+ private readonly configureHandoff;
23
+ private readonly configureTemplate;
24
+ private readonly file;
25
+ private readonly directory;
26
+ private cached;
27
+ private cachedLinks;
28
+ /**
29
+ * @param stateDir - owner-only directory this installation's state lives in.
30
+ * @param configureHandoff - the deployment's default handoff mode.
31
+ * @param configureTemplate - the deployment's default prompt template.
32
+ */
33
+ constructor(stateDir: string, configureHandoff: string | undefined, configureTemplate: string | undefined);
34
+ /** Read the current preferences, creating defaults on first use. */
35
+ load(): Prefs;
36
+ /** Every recorded issue → session link, oldest first. */
37
+ links(): IssueLinkRecord[];
38
+ /** The links recorded for one issue, newest last. */
39
+ linksFor(repo: string, number: number): IssueSessionLinkVM[];
40
+ /** Record one issue → session handoff, idempotently. */
41
+ link(repo: string, number: number, sessionId: string): IssueLinkRecord[];
42
+ /** Remove one link (or every link for the issue when `sessionId` is omitted). */
43
+ unlink(repo: string, number: number, sessionId?: string): IssueLinkRecord[];
44
+ /** Read the state file once, tolerating absence, v1 files, and corruption. */
45
+ private readFile;
46
+ /** Merge one patch into the stored preferences and persist them. */
47
+ save(patch: unknown): Prefs;
48
+ /** Write the whole state document atomically with owner-only permissions. */
49
+ private writeFile;
50
+ }
51
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/github/state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,kBAAkB,EAAE,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AAwBhG;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,CAmCrE;AAED,2DAA2D;AAC3D,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAoB;IACrD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAoB;IACtD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAQ;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAQ;IAClC,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,WAAW,CAA+B;IAElD;;;;OAIG;gBACS,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,SAAS,EAAE,iBAAiB,EAAE,MAAM,GAAG,SAAS;IAQzG,oEAAoE;IACpE,IAAI,IAAI,KAAK;IAOb,yDAAyD;IACzD,KAAK,IAAI,eAAe,EAAE;IAc1B,qDAAqD;IACrD,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,kBAAkB,EAAE;IAM5D,wDAAwD;IACxD,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,eAAe,EAAE;IAUxE,iFAAiF;IACjF,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,eAAe,EAAE;IAU3E,8EAA8E;IAC9E,OAAO,CAAC,QAAQ;IAkBhB,oEAAoE;IACpE,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK;IAO3B,6EAA6E;IAC7E,OAAO,CAAC,SAAS;CAYlB"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * The Host-side GitHub contract.
3
+ *
4
+ * Pure data in and pure data out: no Cordis types, no transport, no Node imports
5
+ * beyond the standard library, so the implementation is testable with a fake
6
+ * fetch and the Remote controller stays a thin forwarding layer.
7
+ *
8
+ * @module dsh-plugin-github-issues/github/types
9
+ */
10
+ import type { IssueBodyVM, IssueCardVM, IssueListPage, IssueListRequest, LinkedPRVM, ProjectRefVM, RepoPageVM, ScopeCatalog } from '../vm.ts';
11
+ /** A token resolved from the machine's `gh` CLI. */
12
+ export interface ResolvedAuth {
13
+ token: string;
14
+ /** Where the token came from, for the settings card. */
15
+ source: 'gh';
16
+ host: string;
17
+ login?: string;
18
+ scopes: string[];
19
+ }
20
+ /** What `gh auth status` says about this machine, without ever exposing the token. */
21
+ export interface GhProbe {
22
+ installed: boolean;
23
+ path?: string;
24
+ signedIn: boolean;
25
+ login?: string;
26
+ host?: string;
27
+ tokenSource?: string;
28
+ scopes: string[];
29
+ error?: string;
30
+ }
31
+ /** Options both the probe and the token resolver share. */
32
+ export interface GitHubAuthOptions {
33
+ host: string;
34
+ /** Explicit `gh` executable path from Config, when the default lookup fails. */
35
+ ghPath?: string;
36
+ signal?: AbortSignal;
37
+ }
38
+ /** Options for one GitHub API session. */
39
+ export interface GitHubApiOptions extends GitHubAuthOptions {
40
+ token: string;
41
+ }
42
+ /** A classified failure, so the UI can tell "missing scope" from "network down". */
43
+ export declare class GitHubApiError extends Error {
44
+ readonly code: string;
45
+ readonly status: number | undefined;
46
+ constructor(message: string, code: string, status?: number);
47
+ }
48
+ /** The GitHub operations the panel needs. */
49
+ export interface GitHubApi {
50
+ readonly host: string;
51
+ /** Repositories, organizations, and the signed-in viewer. */
52
+ scopes(signal?: AbortSignal): Promise<ScopeCatalog>;
53
+ /** Projects v2 for one organization; a missing scope degrades to `blocked`. */
54
+ orgProjects(org: string, signal?: AbortSignal): Promise<{
55
+ projects: ProjectRefVM[];
56
+ blocked: boolean;
57
+ error?: string;
58
+ }>;
59
+ /** The organization's repositories (forks included, capped in the implementation). */
60
+ orgRepos(org: string, signal?: AbortSignal): Promise<RepoPageVM>;
61
+ /** One page of issues for a list view. */
62
+ listIssues(request: IssueListRequest, signal?: AbortSignal): Promise<IssueListPage>;
63
+ /** One repository's milestone titles, for the milestone picker. */
64
+ repoMilestones(repo: string, signal?: AbortSignal): Promise<{
65
+ milestones: string[];
66
+ }>;
67
+ /** One issue with its body and linked pull requests (no timeline). */
68
+ issueDetail(repo: string, number: number, signal?: AbortSignal): Promise<IssueBodyVM>;
69
+ /** The issue's cross-referenced pull requests; the lazy slow leg of the detail. */
70
+ issueMentionedPRs(repo: string, number: number, signal?: AbortSignal): Promise<{
71
+ mentionedPRs: LinkedPRVM[];
72
+ }>;
73
+ /** Drop cached responses for the next call to refetch. */
74
+ invalidate(scope?: 'list' | 'detail' | 'all'): void;
75
+ }
76
+ /** Split `owner/name` and reject malformed values before they reach GraphQL. */
77
+ export declare function splitRepo(repo: string): {
78
+ owner: string;
79
+ name: string;
80
+ };
81
+ /** The subset of an issue card the prompt formatter needs. */
82
+ export type PromptIssue = Pick<IssueCardVM, 'repo' | 'number' | 'title' | 'url' | 'state' | 'stateReason' | 'labels' | 'milestone' | 'assignees' | 'priority' | 'linkedPRs'>;
83
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/github/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,WAAW,EAAE,WAAW,EAAiB,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAC1E,YAAY,EAAE,UAAU,EAAE,YAAY,EACjD,MAAM,UAAU,CAAA;AAEjB,oDAAoD;AACpD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,wDAAwD;IACxD,MAAM,EAAE,IAAI,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB;AAED,sFAAsF;AACtF,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,2DAA2D;AAC3D,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAED,0CAA0C;AAC1C,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,KAAK,EAAE,MAAM,CAAA;CACd;AAED,oFAAoF;AACpF,qBAAa,cAAe,SAAQ,K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,OAAO,CAAC;QAAE,YAAY,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC,CAAA;IAC9G,0DAA0D;IAC1D,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,IAAI,CAAA;CACpD;AAED,gFAAgF;AAChF,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAMvE;AAED,8DAA8D;AAC9D,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,WAAW,EACX,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,GAAG,OAAO,GAAG,aAAa,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,CAChI,CAAA"}
@@ -0,0 +1,260 @@
1
+ /**
2
+ * Pure mapping from GitHub's GraphQL wire shapes to the shared view models.
3
+ *
4
+ * Nothing here performs I/O or touches a transport: a raw node goes in, a
5
+ * renderable value comes out. Keeping the mapping pure is what lets the layout
6
+ * rules (priority precedence, check glyphs, excerpt length) be tested against
7
+ * the trimmed JSON captured in the research notes instead of a live API.
8
+ *
9
+ * Raw shapes are deliberately loose — every field is optional and nullable — so
10
+ * a partial or aliased response maps to something sensible rather than crashing
11
+ * the panel.
12
+ *
13
+ * @module dsh-plugin-github-issues/github/vm
14
+ */
15
+ import type { AssigneeVM, CheckState, IssueCardVM, IssueDetailVM, LabelVM, LinkedPRVM, MilestoneVM, PriorityVM } from '../vm.ts';
16
+ /** The repository reference embedded in an issue or pull request node. */
17
+ export interface RawRepositoryRef {
18
+ /** `owner/name`. */
19
+ nameWithOwner?: string | null;
20
+ /** Whether the repository is private (drives the lock glyph). */
21
+ isPrivate?: boolean | null;
22
+ }
23
+ /** One label as GraphQL returns it. */
24
+ export interface RawLabel {
25
+ name?: string | null;
26
+ /** Bare hex color, no leading `#`. */
27
+ color?: string | null;
28
+ }
29
+ /** One assignee as GraphQL returns it. */
30
+ export interface RawAssignee {
31
+ login?: string | null;
32
+ /** Avatar URL, requested at 32 px. */
33
+ avatarUrl?: string | null;
34
+ }
35
+ /** One milestone as GraphQL returns it. */
36
+ export interface RawMilestone {
37
+ title?: string | null;
38
+ dueOn?: string | null;
39
+ state?: string | null;
40
+ progressPercentage?: number | null;
41
+ }
42
+ /** GitHub's org-defined issue type. */
43
+ export interface RawIssueType {
44
+ name?: string | null;
45
+ /** A `IssueTypeColor` enum name, e.g. `RED`; not a hex value. */
46
+ color?: string | null;
47
+ }
48
+ /** One check-run entry of a pull request's status rollup. */
49
+ export interface RawCheckRun {
50
+ __typename?: string | null;
51
+ name?: string | null;
52
+ status?: string | null;
53
+ conclusion?: string | null;
54
+ }
55
+ /** One legacy commit-status entry of a pull request's status rollup. */
56
+ export interface RawStatusContext {
57
+ __typename?: string | null;
58
+ context?: string | null;
59
+ state?: string | null;
60
+ }
61
+ /** Either kind of entry in `statusCheckRollup.contexts.nodes`. */
62
+ export type RawCheckContext = RawCheckRun | RawStatusContext;
63
+ /** A pull request's rolled-up check state and its individual contexts. */
64
+ export interface RawStatusCheckRollup {
65
+ state?: string | null;
66
+ contexts?: {
67
+ nodes?: (RawCheckContext | null)[] | null;
68
+ } | null;
69
+ }
70
+ /** A pull request linked to an issue, from either a closing link or a cross-reference. */
71
+ export interface RawLinkedPR {
72
+ number?: number | null;
73
+ title?: string | null;
74
+ url?: string | null;
75
+ state?: string | null;
76
+ isDraft?: boolean | null;
77
+ merged?: boolean | null;
78
+ reviewDecision?: string | null;
79
+ updatedAt?: string | null;
80
+ author?: {
81
+ login?: string | null;
82
+ } | null;
83
+ statusCheckRollup?: RawStatusCheckRollup | null;
84
+ }
85
+ /** One org Issue Field value on an issue (`issueFieldValues.nodes`). */
86
+ export interface RawIssueFieldValue {
87
+ __typename?: string | null;
88
+ name?: string | null;
89
+ /** A `IssueFieldSingleSelectValue` color enum name, e.g. `RED`. */
90
+ color?: string | null;
91
+ /** The field definition this value belongs to; only its name is requested. */
92
+ field?: {
93
+ name?: string | null;
94
+ } | null;
95
+ }
96
+ /** The `issueFieldValues` connection embedded in an issue node. */
97
+ export interface RawIssueFieldValues {
98
+ nodes?: (RawIssueFieldValue | null)[] | null;
99
+ }
100
+ /** An issue node as the list and detail queries select it. */
101
+ export interface RawIssue {
102
+ /** GraphQL type name, selected where a union has to be told apart. */
103
+ __typename?: string | null;
104
+ id?: string | null;
105
+ number?: number | null;
106
+ title?: string | null;
107
+ url?: string | null;
108
+ state?: string | null;
109
+ stateReason?: string | null;
110
+ createdAt?: string | null;
111
+ updatedAt?: string | null;
112
+ issueType?: RawIssueType | null;
113
+ repository?: RawRepositoryRef | null;
114
+ labels?: {
115
+ nodes?: (RawLabel | null)[] | null;
116
+ } | null;
117
+ milestone?: RawMilestone | null;
118
+ assignees?: {
119
+ nodes?: (RawAssignee | null)[] | null;
120
+ } | null;
121
+ comments?: {
122
+ totalCount?: number | null;
123
+ } | null;
124
+ body?: string | null;
125
+ closedByPullRequestsReferences?: {
126
+ nodes?: (RawLinkedPR | null)[] | null;
127
+ } | null;
128
+ issueFieldValues?: RawIssueFieldValues | null;
129
+ }
130
+ /** One `timelineItems` entry; only cross-referenced events are requested. */
131
+ export interface RawTimelineItem {
132
+ __typename?: string | null;
133
+ /** The referencing object; only a `PullRequest` source becomes a mentioned PR. */
134
+ source?: (RawLinkedPR & {
135
+ __typename?: string | null;
136
+ }) | null;
137
+ }
138
+ /** A project item's `Priority` field value (`fieldValueByName`). */
139
+ export interface RawProjectFieldValue {
140
+ __typename?: string | null;
141
+ /** Single-select option name. */
142
+ name?: string | null;
143
+ /** Single-select option color enum, e.g. `RED`. */
144
+ color?: string | null;
145
+ /** Text field value. */
146
+ text?: string | null;
147
+ /** Number field value. */
148
+ number?: number | null;
149
+ /** Date field value. */
150
+ date?: string | null;
151
+ }
152
+ /**
153
+ * Project item content, selected through the `Issue | PullRequest | DraftIssue`
154
+ * union. Fields that only one branch owns are optional, and a stale pull
155
+ * request's `state` can be `MERGED`; drafts are skipped by the mapper.
156
+ */
157
+ export interface RawProjectItemContent extends RawIssue {
158
+ isDraft?: boolean | null;
159
+ merged?: boolean | null;
160
+ }
161
+ /** One Projects v2 item. */
162
+ export interface RawProjectItem {
163
+ id?: string | null;
164
+ /** `ISSUE | PULL_REQUEST | DRAFT_ISSUE | REDACTED`. */
165
+ type?: string | null;
166
+ content?: RawProjectItemContent | null;
167
+ priority?: RawProjectFieldValue | null;
168
+ /** The project's `Status` single-select value, when defined on the board. */
169
+ status?: RawProjectFieldValue | null;
170
+ }
171
+ /** Map a raw milestone to its view model, or `undefined` when the issue has none. */
172
+ export declare function toMilestoneVM(node: RawMilestone | null | undefined): MilestoneVM | undefined;
173
+ /** Map a label connection to view models, dropping malformed entries. */
174
+ export declare function toLabelVMs(nodes: readonly (RawLabel | null)[] | null | undefined): LabelVM[];
175
+ /** Map an assignee connection to view models, dropping entries without a login. */
176
+ export declare function toAssigneeVMs(nodes: readonly (RawAssignee | null)[] | null | undefined): AssigneeVM[];
177
+ /** Map the rolled-up check state, or `null` when GitHub reports none. */
178
+ export declare function checkStateOf(rollup: RawStatusCheckRollup | null | undefined): CheckState;
179
+ /**
180
+ * The names of checks that failed, at most five.
181
+ * Check runs fail on a terminal bad conclusion; legacy statuses fail on
182
+ * `FAILURE` or `ERROR`. Pending checks are not counted as failing.
183
+ */
184
+ export declare function failingChecksOf(rollup: RawStatusCheckRollup | null | undefined): string[];
185
+ /** Map one linked pull request, including its check glyph inputs. */
186
+ export declare function toLinkedPRVM(node: RawLinkedPR): LinkedPRVM;
187
+ /**
188
+ * Read the `Priority` value out of a project item's `fieldValueByName` answer.
189
+ * Single-select values carry a name and a color enum; text and number fields
190
+ * are accepted as names too, because a project may model priority either way.
191
+ */
192
+ export declare function priorityFromProjectValue(value: RawProjectFieldValue | null | undefined): PriorityVM | undefined;
193
+ /** Read the org-level Issue Field named `Priority`, when the issue has a value. */
194
+ export declare function priorityFromIssueFields(values: RawIssueFieldValues | null | undefined): PriorityVM | undefined;
195
+ /**
196
+ * Fall back to a `P0`..`P4` label.
197
+ * When a repository somehow carries several such labels, the lowest number wins
198
+ * (P0 is the highest priority); the label's own bare hex color is carried along.
199
+ */
200
+ export declare function priorityFromLabels(labels: readonly (RawLabel | null)[] | null | undefined): PriorityVM | undefined;
201
+ /**
202
+ * Pick the rendered priority by source precedence:
203
+ * project field, then org Issue Field, then label.
204
+ * @param project - priority read from the containing project item.
205
+ * @param issueField - priority read from the issue's org fields.
206
+ * @param label - priority read from `P0`..`P4` labels.
207
+ * @returns the first defined value, or `undefined` when no source has one.
208
+ */
209
+ export declare function pickPriority(project?: PriorityVM | undefined, issueField?: PriorityVM | undefined, label?: PriorityVM | undefined): PriorityVM | undefined;
210
+ /**
211
+ * Turn an issue body into a one-line preview.
212
+ * Headings, images, links, and fences are reduced to their text, whitespace is
213
+ * collapsed, and the result is cut at `max` characters with an ellipsis.
214
+ * @param body - the issue body as returned by the API.
215
+ * @param max - the excerpt budget in characters.
216
+ * @returns the excerpt, or `undefined` when the body has no text.
217
+ */
218
+ export declare function bodyExcerpt(body: string, max?: number): string | undefined;
219
+ /** Options the containing surface adds to the generic issue card mapping. */
220
+ export interface IssueCardOptions {
221
+ /**
222
+ * Priority read from the containing project item.
223
+ * It outranks the issue's own org fields and labels.
224
+ */
225
+ projectPriority?: PriorityVM | undefined;
226
+ }
227
+ /**
228
+ * Map one issue node to the list-row view model.
229
+ * @param node - an issue node from a search, repository, or project query.
230
+ * @param options - project context, when the node came from a project item.
231
+ * @returns the card the panel renders.
232
+ */
233
+ export declare function toIssueCardVM(node: RawIssue, options?: IssueCardOptions): IssueCardVM;
234
+ /**
235
+ * Map a `timelineItems` connection to mentioned PRs.
236
+ * Closing references are not filtered here (the caller owns the card); duplicates
237
+ * are dropped. The panel filters out PRs already listed as closing references.
238
+ * @param crossRefs - `timelineItems.nodes` from the cross-reference request.
239
+ * @param closingNumbers - PR numbers already rendered as closing references.
240
+ * @returns mentioned pull requests in timeline order.
241
+ */
242
+ export declare function toMentionedPRsVM(crossRefs: readonly (RawTimelineItem | null)[] | null | undefined, closingNumbers?: ReadonlySet<number>): LinkedPRVM[];
243
+ /**
244
+ * Map one issue node plus its cross-references to the detail view.
245
+ * `mentionedPRs` excludes PRs that already appear as closing references, since
246
+ * the panel renders those separately.
247
+ * @param node - the issue node from the detail query.
248
+ * @param crossRefs - the issue's `timelineItems.nodes` (cross-referenced events).
249
+ * @returns the detail the composer dock renders.
250
+ */
251
+ export declare function toIssueDetailVM(node: RawIssue, crossRefs: readonly (RawTimelineItem | null)[] | null | undefined): IssueDetailVM;
252
+ /**
253
+ * Map one Projects v2 item to a card.
254
+ * Draft issues and redacted items have no repository or number and are
255
+ * skipped; pull requests are rendered as issue-like cards, closed when merged.
256
+ * @param item - one node of a project's `items` connection.
257
+ * @returns the card, or `undefined` when the item is not renderable.
258
+ */
259
+ export declare function toProjectItemCardVM(item: RawProjectItem | null | undefined): IssueCardVM | undefined;
260
+ //# sourceMappingURL=vm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vm.d.ts","sourceRoot":"","sources":["../../../src/github/vm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACV,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAA2B,OAAO,EACpF,UAAU,EAAE,WAAW,EAAE,UAAU,EACpC,MAAM,UAAU,CAAA;AAEjB,0EAA0E;AAC1E,MAAM,WAAW,gBAAgB;IAC/B,oBAAoB;IACpB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,iEAAiE;IACjE,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;CAC3B;AAED,uCAAuC;AACvC,MAAM,WAAW,QAAQ;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI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SAAS,CAAA;CACzC;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAE,gBAAqB,GAAG,WAAW,CA6BzF;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,SAAS,CAAC,eAAe,GAAG,IAAI,CAAC,EAAE,GAAG,IAAI,GAAG,SAAS,EACjE,cAAc,GAAE,WAAW,CAAC,MAAM,CAAa,GAC9C,UAAU,EAAE,CAcd;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,QAAQ,EACd,SAAS,EAAE,SAAS,CAAC,eAAe,GAAG,IAAI,CAAC,EAAE,GAAG,IAAI,GAAG,SAAS,GAChE,aAAa,CAQf;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAkBpG"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The bundle's Host entry point.
3
+ *
4
+ * A bundle is a configuration layer, so this module exists to do the one thing a
5
+ * layer cannot: own the live GitHub service and the machine-local preferences, and
6
+ * expose them to the browser through the plugin's own Remote namespace.
7
+ *
8
+ * @module dsh-plugin-github-issues
9
+ */
10
+ import type { Context } from '@deepseek-ai/cordis';
11
+ /** What this plugin calls itself in diagnostics. */
12
+ export declare const name = "github-issues";
13
+ /**
14
+ * Everything an installation may tune.
15
+ *
16
+ * No token lives here on purpose: the deployment's patch and its `.bak` copies
17
+ * would duplicate it. The token is read from the machine's `gh` CLI at call time.
18
+ */
19
+ export declare const Config: import("@deepseek-ai/schemastery").Schema<{
20
+ authMode: string;
21
+ host: string;
22
+ ghPath: string;
23
+ handoffMode: string;
24
+ pollSeconds: number;
25
+ stateDir: string;
26
+ promptTemplate: string;
27
+ }> & {
28
+ toJSON(): unknown;
29
+ };
30
+ /** The configuration one installation supplies, as the harness resolves it. */
31
+ export type Config = {
32
+ authMode: string;
33
+ host: string;
34
+ ghPath: string;
35
+ handoffMode: string;
36
+ pollSeconds: number;
37
+ stateDir: string;
38
+ promptTemplate: string;
39
+ };
40
+ /**
41
+ * Register the GitHub service.
42
+ * @param ctx - the plugin context.
43
+ * @param config - the installation's configuration.
44
+ */
45
+ export declare function apply(ctx: Context, config: Config): void;
46
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAQlD,oDAAoD;AACpD,eAAO,MAAM,IAAI,kBAAkB,CAAA;AAEnC;;;;;GAKG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;CAejB,CAAA;AAEF,+EAA+E;AAC/E,MAAM,MAAM,MAAM,GAAG;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAmBxD"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Turning one issue into the prompt a handoff writes into the composer.
3
+ *
4
+ * Kept apart from the UI so the exact wording is testable, and so the Host can
5
+ * reuse it when it needs to describe an issue without the browser.
6
+ *
7
+ * @module dsh-plugin-github-issues/prompt
8
+ */
9
+ import type { PromptIssue } from './github/types.ts';
10
+ /**
11
+ * Render the handoff prompt for one issue.
12
+ * @param issue - the card the user dragged or clicked.
13
+ * @param template - the configured template; `{{token}}` placeholders are replaced.
14
+ * @returns the prompt text, trimmed to a size the composer handles comfortably.
15
+ */
16
+ export declare function renderPrompt(issue: PromptIssue, template: string): string;
17
+ /** The invisible draft placeholder that keeps the native send enabled. */
18
+ export declare const EMPTY_DRAFT_HOLD = "\u200B\n";
19
+ /**
20
+ * Compose the message a pending issue card sends.
21
+ *
22
+ * The card carries the issue prompt; the user's own words are optional and are
23
+ * appended after a blank line. The invisible composer placeholder is stripped.
24
+ *
25
+ * @param prompt - the rendered issue prompt from the card.
26
+ * @param memo - the user's text from the composer (may contain the placeholder).
27
+ * @returns the text to submit.
28
+ */
29
+ export declare function composeHandoffPrompt(prompt: string, memo: string): string;
30
+ //# sourceMappingURL=prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AA0CpD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAezE;AAED,0EAA0E;AAC1E,eAAO,MAAM,gBAAgB,aAAa,CAAA;AAE1C;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAGzE"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * The Remote surface, described once for both halves.
3
+ *
4
+ * The browser half cannot use the generated `ctx.remote.*` aggregate: that is
5
+ * assembled at build time from a fixed list of shipped packages. So the client
6
+ * mounts its own contribution (see `src/client/remote.ts`) built from this table,
7
+ * and the Host half decorates exactly these methods with `@Remote`. A method added
8
+ * to one side and forgotten here fails only when a user clicks.
9
+ *
10
+ * @module dsh-plugin-github-issues/remote-methods
11
+ */
12
+ /** One argument of a Remote method. */
13
+ export interface RemoteParameter {
14
+ /** Wire name the Gateway builds the call from. */
15
+ wire: string;
16
+ /** Whether the Host declares this argument optional (still sent as explicit `undefined`). */
17
+ optional?: boolean;
18
+ }
19
+ /** One method the Host exposes, with the wire name of each argument. */
20
+ export interface RemoteMethod {
21
+ /** Method name on the controller. */
22
+ method: string;
23
+ /** Arguments, in call order. */
24
+ parameters: readonly RemoteParameter[];
25
+ }
26
+ /** Every method the browser may call. */
27
+ export declare const REMOTE_METHODS: readonly RemoteMethod[];
28
+ /** The Cordis service key the controller registers, and the descriptor's `service` field. */
29
+ export declare const REMOTE_SERVICE_KEY = "githubIssuesController";
30
+ /** The wire namespace both halves address this surface by. */
31
+ export declare const REMOTE_NAMESPACE = "githubIssues";
32
+ //# sourceMappingURL=remote-methods.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-methods.d.ts","sourceRoot":"","sources":["../../src/remote-methods.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,uCAAuC;AACvC,MAAM,WAAW,eAAe;IAC9B,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAA;IACZ,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,wEAAwE;AACxE,MAAM,WAAW,YAAY;IAC3B,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAA;IACd,gCAAgC;IAChC,UAAU,EAAE,SAAS,eAAe,EAAE,CAAA;CACvC;AAED,yCAAyC;AACzC,eAAO,MAAM,cAAc,EAAE,SAAS,YAAY,EAejD,CAAA;AAED,6FAA6F;AAC7F,eAAO,MAAM,kBAAkB,2BAA2B,CAAA;AAE1D,8DAA8D;AAC9D,eAAO,MAAM,gBAAgB,iBAAiB,CAAA"}