@zibby/skills 0.1.95 → 0.2.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 (78) hide show
  1. package/README.md +1 -1
  2. package/dist/artifact.d.ts +1 -115
  3. package/dist/browser.d.ts +10 -19
  4. package/dist/chartRender.d.ts +46 -57
  5. package/dist/chartRender.js +1 -1
  6. package/dist/chat-memory.d.ts +26 -330
  7. package/dist/chat-notify.d.ts +30 -409
  8. package/dist/chat-notify.js +3 -3
  9. package/dist/chatProgress.d.ts +28 -47
  10. package/dist/code-scan.d.ts +52 -58
  11. package/dist/codeStats.d.ts +36 -136
  12. package/dist/codeStats.js +1 -1
  13. package/dist/codebaseMemory.d.ts +52 -32
  14. package/dist/codebaseMemory.js +2 -2
  15. package/dist/core-tools.d.ts +10 -131
  16. package/dist/datasetStore.d.ts +52 -179
  17. package/dist/datasetStore.js +12 -3
  18. package/dist/discord.d.ts +32 -68
  19. package/dist/figma.d.ts +5 -408
  20. package/dist/function-skill.d.ts +23 -135
  21. package/dist/function-skill.js +1 -1
  22. package/dist/gbrain.d.ts +46 -114
  23. package/dist/git-write.d.ts +45 -137
  24. package/dist/git-write.js +6 -6
  25. package/dist/git.d.ts +2 -73
  26. package/dist/github.d.ts +2 -1202
  27. package/dist/gitlab.d.ts +55 -1059
  28. package/dist/gitlab.js +2 -2
  29. package/dist/googleDocs.d.ts +39 -175
  30. package/dist/hubspot.d.ts +1 -381
  31. package/dist/index.d.ts +19 -12
  32. package/dist/index.js +157 -148
  33. package/dist/integrations.d.ts +2 -2
  34. package/dist/jira.d.ts +2 -532
  35. package/dist/jira.js +4 -4
  36. package/dist/kvMemory.d.ts +47 -78
  37. package/dist/lark.d.ts +2 -161
  38. package/dist/lark.js +1 -1
  39. package/dist/larkDocs.d.ts +35 -236
  40. package/dist/linear.d.ts +36 -343
  41. package/dist/linkedin.d.ts +10 -120
  42. package/dist/llm-billing.d.ts +92 -180
  43. package/dist/llm-billing.js +1 -1
  44. package/dist/memory.d.ts +11 -137
  45. package/dist/notion.d.ts +28 -276
  46. package/dist/notion.js +4 -4
  47. package/dist/opendesign.d.ts +24 -202
  48. package/dist/opendesign.js +2 -2
  49. package/dist/package.json +3 -2
  50. package/dist/plane.d.ts +40 -24
  51. package/dist/report.d.ts +153 -110
  52. package/dist/review-dedup.d.ts +8 -8
  53. package/dist/review.d.ts +12 -2
  54. package/dist/reviewMemoryIo.d.ts +37 -3
  55. package/dist/reviewRecord.d.ts +41 -47
  56. package/dist/sentry.d.ts +25 -22
  57. package/dist/skill-installer.d.ts +11 -86
  58. package/dist/slack.d.ts +1 -284
  59. package/dist/socialCard.d.ts +35 -89
  60. package/dist/test-runner.d.ts +1 -220
  61. package/dist/trackers/github-adapter.d.ts +39 -94
  62. package/dist/trackers/index.d.ts +25 -18
  63. package/dist/trackers/jira-adapter.d.ts +20 -88
  64. package/dist/trackers/linear-adapter.d.ts +24 -87
  65. package/dist/trackers/plane-adapter.d.ts +29 -85
  66. package/dist/trackers/plane-adapter.js +1 -1
  67. package/dist/trackers/types.d.ts +1 -186
  68. package/dist/triggerAgent.d.ts +26 -42
  69. package/dist/triggerAgent.js +1 -1
  70. package/dist/workflow-builder.d.ts +11 -245
  71. package/docs/cli-reference.md +33 -0
  72. package/docs/concepts/designing-agents.md +201 -0
  73. package/docs/self-host/backup-restore.md +52 -0
  74. package/docs/self-host/index.md +75 -0
  75. package/docs/self-host/storage.md +50 -0
  76. package/docs/self-host/troubleshooting.md +48 -0
  77. package/docs/self-host/upgrade.md +81 -0
  78. package/package.json +3 -2
@@ -1,89 +1,35 @@
1
- export namespace socialCardSkill {
2
- let id: string;
3
- let serverName: string;
4
- let allowedTools: string[];
5
- let description: string;
6
- let promptFragment: string;
7
- function resolve({ sessionPath, nodeName }?: {}): {
8
- command: any;
9
- args: any[];
10
- env: {};
11
- description: string;
12
- type?: undefined;
13
- alwaysLoad?: undefined;
14
- } | {
15
- type: string;
16
- command: string;
17
- args: any[];
18
- env: {
19
- ZIBBY_NODE_SESSION_PATH: any;
20
- ZIBBY_SESSION_PATH: any;
21
- };
22
- description: string;
23
- alwaysLoad: boolean;
24
- };
25
- function handleToolCall(name: any, args: any): Promise<string>;
26
- let tools: {
27
- name: string;
28
- description: string;
29
- input_schema: {
30
- type: string;
31
- properties: {
32
- headline: {
33
- type: string;
34
- description: string;
35
- };
36
- eyebrow: {
37
- type: string;
38
- description: string;
39
- };
40
- subhead: {
41
- type: string;
42
- description: string;
43
- };
44
- stat: {
45
- type: string;
46
- description: string;
47
- };
48
- footer: {
49
- type: string;
50
- description: string;
51
- };
52
- diagram: {
53
- type: string;
54
- items: {
55
- type: string;
56
- };
57
- description: string;
58
- };
59
- theme: {
60
- type: string;
61
- enum: string[];
62
- description: string;
63
- };
64
- accent: {
65
- type: string;
66
- description: string;
67
- };
68
- width: {
69
- type: string;
70
- description: string;
71
- };
72
- height: {
73
- type: string;
74
- description: string;
75
- };
76
- filename: {
77
- type: string;
78
- description: string;
79
- };
80
- output: {
81
- type: string;
82
- enum: string[];
83
- description: string;
84
- };
85
- };
86
- required: string[];
87
- };
88
- }[];
89
- }
1
+ /**
2
+ * socialCard.js — local, server-side "concept card" renderer (tier ①: API-only,
3
+ * fully local — nothing leaves the box; no browser, no external service).
4
+ *
5
+ * WHAT IT IS
6
+ * ──────────
7
+ * A hand-written single-tool skill (same shape as chartRender.js / kvMemory.js:
8
+ * `serverName`, `allowedTools`, `tools[]`, `handleToolCall`, and a `resolve()`
9
+ * that spawns the GENERIC bin/mcp-skill.mjs). One tool — `social_card_render` —
10
+ * takes STRUCTURED, agent-supplied fields (headline, eyebrow, subhead, stat,
11
+ * footer, diagram, theme, accent) and renders a branded LinkedIn "concept card"
12
+ * PNG in the Darren-Bounds style (bold headline + small uppercase eyebrow +
13
+ * optional stat/footer + optional A—✓—B diagram).
14
+ *
15
+ * RENDER PIPELINE
16
+ * ───────────────
17
+ * A HAND-AUTHORED SVG string (NOT ECharts) → rasterized to PNG via
18
+ * @resvg/resvg-js, EXACTLY like chartRender's renderPng() helper. No echarts
19
+ * dependency — the composition is laid out here in plain SVG.
20
+ *
21
+ * FONTS — the agent container may ship NO fonts, and resvg renders EMPTY text
22
+ * without one. We reuse the bundled Noto Sans Regular + Bold faces (the same
23
+ * assets/fonts chartRender bundles) and set 'Noto Sans' as the default family.
24
+ * `loadSystemFonts:true` stays on so a host WITH fonts can still satisfy exotic
25
+ * glyphs (e.g. a in a caller's stat) the bundled faces may lack. The one
26
+ * glyph WE draw (the diagram checkmark) is a vector <path>, never a font glyph,
27
+ * so it renders regardless of available fonts.
28
+ *
29
+ * OUTPUT FILES — same convention as chartRender: the PNG lands under the run's
30
+ * session output dir (ZIBBY_NODE_SESSION_PATH / ZIBBY_SESSION_PATH) so the CLI
31
+ * session-uploader auto-attaches it; local dev falls back to
32
+ * <cwd>/.zibby/output/social-cards. The returned `path` can be passed to a
33
+ * LinkedIn post's `imagePath`.
34
+ */
35
+ export declare const socialCardSkill: any;
@@ -1,220 +1 @@
1
- export namespace testRunnerSkill {
2
- let id: string;
3
- let description: string;
4
- let envKeys: any[];
5
- let promptFragment: string;
6
- function resolve(): any;
7
- function handleToolCall(name: any, args: any, context: any): Promise<any>;
8
- let tools: ({
9
- name: string;
10
- description: string;
11
- input_schema: {
12
- type: string;
13
- properties: {
14
- ticket: {
15
- type: string;
16
- description: string;
17
- };
18
- description: {
19
- type: string;
20
- description: string;
21
- };
22
- input: {
23
- type: string;
24
- description: string;
25
- };
26
- repo: {
27
- type: string;
28
- description: string;
29
- };
30
- agent: {
31
- type: string;
32
- description: string;
33
- };
34
- output: {
35
- type: string;
36
- description: string;
37
- };
38
- spec?: undefined;
39
- ticketKey?: undefined;
40
- headless?: undefined;
41
- workflow?: undefined;
42
- runId?: undefined;
43
- type?: undefined;
44
- node?: undefined;
45
- query?: undefined;
46
- tail?: undefined;
47
- directory?: undefined;
48
- };
49
- required?: undefined;
50
- };
51
- } | {
52
- name: string;
53
- description: string;
54
- input_schema: {
55
- type: string;
56
- properties: {
57
- spec: {
58
- type: string;
59
- description: string;
60
- };
61
- ticketKey: {
62
- type: string;
63
- description: string;
64
- };
65
- agent: {
66
- type: string;
67
- description: string;
68
- };
69
- headless: {
70
- type: string;
71
- description: string;
72
- };
73
- workflow: {
74
- type: string;
75
- description: string;
76
- };
77
- ticket?: undefined;
78
- description?: undefined;
79
- input?: undefined;
80
- repo?: undefined;
81
- output?: undefined;
82
- runId?: undefined;
83
- type?: undefined;
84
- node?: undefined;
85
- query?: undefined;
86
- tail?: undefined;
87
- directory?: undefined;
88
- };
89
- required: string[];
90
- };
91
- } | {
92
- name: string;
93
- description: string;
94
- input_schema: {
95
- type: string;
96
- properties: {
97
- runId: {
98
- type: string;
99
- description: string;
100
- };
101
- ticket?: undefined;
102
- description?: undefined;
103
- input?: undefined;
104
- repo?: undefined;
105
- agent?: undefined;
106
- output?: undefined;
107
- spec?: undefined;
108
- ticketKey?: undefined;
109
- headless?: undefined;
110
- workflow?: undefined;
111
- type?: undefined;
112
- node?: undefined;
113
- query?: undefined;
114
- tail?: undefined;
115
- directory?: undefined;
116
- };
117
- required: string[];
118
- };
119
- } | {
120
- name: string;
121
- description: string;
122
- input_schema: {
123
- type: string;
124
- properties: {
125
- runId: {
126
- type: string;
127
- description: string;
128
- };
129
- type: {
130
- type: string;
131
- enum: string[];
132
- description: string;
133
- };
134
- node: {
135
- type: string;
136
- description: string;
137
- };
138
- query: {
139
- type: string;
140
- description: string;
141
- };
142
- tail: {
143
- type: string;
144
- description: string;
145
- };
146
- ticket?: undefined;
147
- description?: undefined;
148
- input?: undefined;
149
- repo?: undefined;
150
- agent?: undefined;
151
- output?: undefined;
152
- spec?: undefined;
153
- ticketKey?: undefined;
154
- headless?: undefined;
155
- workflow?: undefined;
156
- directory?: undefined;
157
- };
158
- required: string[];
159
- };
160
- } | {
161
- name: string;
162
- description: string;
163
- input_schema: {
164
- type: string;
165
- properties: {
166
- runId: {
167
- type: string;
168
- description: string;
169
- };
170
- tail: {
171
- type: string;
172
- description: string;
173
- };
174
- ticket?: undefined;
175
- description?: undefined;
176
- input?: undefined;
177
- repo?: undefined;
178
- agent?: undefined;
179
- output?: undefined;
180
- spec?: undefined;
181
- ticketKey?: undefined;
182
- headless?: undefined;
183
- workflow?: undefined;
184
- type?: undefined;
185
- node?: undefined;
186
- query?: undefined;
187
- directory?: undefined;
188
- };
189
- required?: undefined;
190
- };
191
- } | {
192
- name: string;
193
- description: string;
194
- input_schema: {
195
- type: string;
196
- properties: {
197
- directory: {
198
- type: string;
199
- description: string;
200
- };
201
- ticket?: undefined;
202
- description?: undefined;
203
- input?: undefined;
204
- repo?: undefined;
205
- agent?: undefined;
206
- output?: undefined;
207
- spec?: undefined;
208
- ticketKey?: undefined;
209
- headless?: undefined;
210
- workflow?: undefined;
211
- runId?: undefined;
212
- type?: undefined;
213
- node?: undefined;
214
- query?: undefined;
215
- tail?: undefined;
216
- };
217
- required?: undefined;
218
- };
219
- })[];
220
- }
1
+ export declare const testRunnerSkill: any;
@@ -1,96 +1,41 @@
1
- export namespace githubAdapter {
2
- export let id: string;
3
- export { toStateCategory };
4
- export { toNeutral };
5
- export { IN_PROGRESS_LABEL };
6
- export { BLOCKED_LABEL };
7
- /**
8
- * listCandidates — list a repo's issues by state/labels/since cursor.
9
- * Needs {owner, repo} via opts.ctx or env. `opts.query` is ignored (GitHub
10
- * issue search is a separate endpoint; the contract's listCandidates is the
11
- * repo-scoped poll).
12
- * @param {import('./types.js').ListCandidatesOptions & {ctx?: object}} [opts]
13
- * @returns {Promise<import('./types.js').NeutralTicket[]>}
14
- */
15
- export function listCandidates(opts?: import("./types.js").ListCandidatesOptions & {
16
- ctx?: object;
17
- }): Promise<import("./types.js").NeutralTicket[]>;
18
- /** getTicket — one issue by number (key may be `owner/repo#N` or just `N`). */
19
- export function getTicket(key: any, ctx?: {}): Promise<{
20
- id: string;
21
- key: string;
22
- title: any;
23
- body: any;
24
- state: any;
25
- stateCategory: "unknown" | "todo" | "in_progress" | "done" | "blocked";
26
- assignee: any;
27
- url: any;
28
- _raw: any;
29
- }>;
30
- /** getComments — chronological; we reverse to newest-first for contract parity. */
31
- export function getComments(key: any, ctx?: {}): Promise<any>;
32
- /** addComment — markdown body. */
33
- export function addComment(key: any, body: any, ctx?: {}): Promise<{
34
- ok: boolean;
35
- id: string;
36
- }>;
37
- /**
38
- * transition — map a neutral target NAME onto GitHub's open/close + labels
39
- * convention (see the file header). Returns ok:false for names GitHub can't
40
- * represent — that's a real seam, not a swallowed error.
41
- */
42
- export function transition(key: any, targetStateName: any, ctx?: {}): Promise<{
43
- ok: boolean;
44
- stateAfter: any;
45
- stateCategoryAfter: string;
46
- _raw: any;
47
- via?: undefined;
48
- error?: undefined;
49
- } | {
50
- ok: boolean;
51
- stateAfter: string;
52
- stateCategoryAfter: string;
53
- via: string;
54
- _raw: any;
55
- error?: undefined;
56
- } | {
57
- ok: boolean;
58
- error: string;
59
- stateAfter?: undefined;
60
- stateCategoryAfter?: undefined;
61
- _raw?: undefined;
62
- via?: undefined;
63
- }>;
64
- /**
65
- * linkPullRequest — post a comment with the PR link. GitHub's native issue↔PR
66
- * association is driven by closing keywords in the PR body, not an issue API
67
- * write, so a comment is the portable, always-works path.
68
- */
69
- export function linkPullRequest(key: any, prUrl: any, title: any, ctx?: {}): Promise<{
70
- ok: boolean;
71
- via: string;
72
- }>;
73
- }
74
- export default githubAdapter;
75
1
  /**
76
- * Map a GitHub issue's open|closed state + its labels onto a neutral bucket.
77
- * @param {string} state 'open' | 'closed'
78
- * @param {string[]} [labels] label names on the issue
79
- * @returns {'todo'|'in_progress'|'done'|'blocked'|'unknown'}
2
+ * GitHub Issues tracker adapter projects GitHub onto the neutral
3
+ * TrackerAdapter contract.
4
+ * ============================================================================
5
+ *
6
+ * Thin wrapper over github.js. GitHub Issues are the awkward provider for a
7
+ * tracker abstraction, because GitHub has NO workflow/transition model: an
8
+ * issue is just open|closed. Everything richer (todo vs in-progress, blocked)
9
+ * is a labelling CONVENTION, not a native state. This adapter makes that
10
+ * convention explicit and keeps it documented in one place.
11
+ *
12
+ * SCOPING: GitHub issues live in a repo, so every method needs {owner, repo}.
13
+ * That comes from `ctx` (per-call) or env GITHUB_OWNER / GITHUB_REPO. There is
14
+ * no global "list all my issues" call here on purpose — it would not map.
15
+ *
16
+ * STATE MODEL (the real seam — read this):
17
+ * - closed → 'done'
18
+ * - open + a blocked label → 'blocked' (label matches BLOCKED_NAME_RE)
19
+ * - open + an in-progress label→ 'in_progress' (label matches IN_PROGRESS_RE,
20
+ * e.g. "in progress", "in-progress", "wip",
21
+ * "doing", "started")
22
+ * - open + (none of the above) → 'todo'
23
+ * The labels are a CONVENTION: GitHub has no concept of them being "states".
24
+ * A repo that doesn't use them simply shows every open issue as 'todo'.
25
+ *
26
+ * transition (NO native equivalent) maps the target name onto this convention:
27
+ * - a done/closed-ish name → close the issue (state_reason 'completed')
28
+ * - a todo/open-ish name → reopen + clear progress/blocked labels
29
+ * - 'in progress'-ish name → ensure open + ADD the in-progress label
30
+ * - 'blocked'-ish name → ensure open + ADD the blocked label
31
+ * - anything else → ok:false (unrepresentable on GitHub) — this is a
32
+ * genuine contract seam, surfaced honestly.
33
+ *
34
+ * linkPullRequest: a comment carrying the PR URL (GitHub's native issue↔PR link
35
+ * requires a closing keyword IN the PR body / a cross-ref event, not an issue
36
+ * API write, so the portable, always-works path is a comment).
37
+ *
38
+ * Auth/config is inherited from github.js (resolveIntegrationToken('github')).
80
39
  */
81
- declare function toStateCategory(state: string, labels?: string[]): "todo" | "in_progress" | "done" | "blocked" | "unknown";
82
- /** Build a NeutralTicket from the github.js issue tool projection. */
83
- declare function toNeutral(issue: any, ctx?: {}): {
84
- id: string;
85
- key: string;
86
- title: any;
87
- body: any;
88
- state: any;
89
- stateCategory: "unknown" | "todo" | "in_progress" | "done" | "blocked";
90
- assignee: any;
91
- url: any;
92
- _raw: any;
93
- };
94
- /** Conventional label names this adapter writes for the two open sub-states. */
95
- declare const IN_PROGRESS_LABEL: "in progress";
96
- declare const BLOCKED_LABEL: "blocked";
40
+ export declare const githubAdapter: any;
41
+ export default githubAdapter;
@@ -1,3 +1,27 @@
1
+ /**
2
+ * Neutral tracker adapter registry.
3
+ * ============================================================================
4
+ *
5
+ * The "neutrality" entry point: pick a tracker by provider id (or by the
6
+ * TRACKER_PROVIDER env var) and drive ANY of Jira / Linear / GitHub / Plane
7
+ * through the same 6-method TrackerAdapter contract. A pipeline that talks to
8
+ * `getAdapter()` is provider-agnostic — switching trackers is a config change,
9
+ * not a code change.
10
+ *
11
+ * See ./types.js for the NeutralTicket / NeutralComment / TrackerAdapter docs.
12
+ */
13
+ export { jiraAdapter } from './jira-adapter.js';
14
+ export { linearAdapter } from './linear-adapter.js';
15
+ export { githubAdapter } from './github-adapter.js';
16
+ export { planeAdapter } from './plane-adapter.js';
17
+ export { TRACKER_STATE_CATEGORIES } from './types.js';
18
+ /**
19
+ * Provider id → adapter. Keys are the canonical provider ids; each value is a
20
+ * {@link import('./types.js').TrackerAdapter}.
21
+ */
22
+ export declare const TRACKER_ADAPTERS: any;
23
+ /** Default provider when none is specified and TRACKER_PROVIDER is unset. */
24
+ export declare const DEFAULT_TRACKER_PROVIDER = "jira";
1
25
  /**
2
26
  * Resolve a tracker adapter.
3
27
  *
@@ -7,21 +31,4 @@
7
31
  * @returns {import('./types.js').TrackerAdapter}
8
32
  * @throws {Error} if the resolved provider is not registered.
9
33
  */
10
- export function getAdapter(provider?: string): import("./types.js").TrackerAdapter;
11
- export { jiraAdapter } from "./jira-adapter.js";
12
- export { linearAdapter } from "./linear-adapter.js";
13
- export { githubAdapter } from "./github-adapter.js";
14
- export { planeAdapter } from "./plane-adapter.js";
15
- export { TRACKER_STATE_CATEGORIES } from "./types.js";
16
- export namespace TRACKER_ADAPTERS {
17
- export { jiraAdapter as jira };
18
- export { linearAdapter as linear };
19
- export { githubAdapter as github };
20
- export { planeAdapter as plane };
21
- }
22
- /** Default provider when none is specified and TRACKER_PROVIDER is unset. */
23
- export const DEFAULT_TRACKER_PROVIDER: "jira";
24
- import { jiraAdapter } from './jira-adapter.js';
25
- import { linearAdapter } from './linear-adapter.js';
26
- import { githubAdapter } from './github-adapter.js';
27
- import { planeAdapter } from './plane-adapter.js';
34
+ export declare function getAdapter(provider: any): any;
@@ -1,90 +1,22 @@
1
- export namespace jiraAdapter {
2
- export let id: string;
3
- export { toStateCategory };
4
- export { toNeutral };
5
- /**
6
- * listCandidates — JQL search. `opts.query` is the JQL; if omitted we build a
7
- * bounded default. Returns newest-updated first.
8
- * @param {import('./types.js').ListCandidatesOptions} [opts]
9
- * @returns {Promise<import('./types.js').NeutralTicket[]>}
10
- */
11
- export function listCandidates(opts?: import("./types.js").ListCandidatesOptions): Promise<import("./types.js").NeutralTicket[]>;
12
- /**
13
- * getTicket — one issue by key. Uses jiraFetch (not jira_get_issue) so the
14
- * full status object incl. statusCategory is present for bucketing.
15
- */
16
- export function getTicket(key: any): Promise<{
17
- id: string;
18
- key: any;
19
- title: any;
20
- body: any;
21
- state: any;
22
- stateCategory: "unknown" | "todo" | "in_progress" | "done" | "blocked";
23
- assignee: any;
24
- url: string;
25
- _raw: any;
26
- }>;
27
- /** getComments — newest first (jira_get_comments already flattens ADF). */
28
- export function getComments(key: any): Promise<any>;
29
- /** addComment — delegates to jira_add_comment (wraps text in ADF). */
30
- export function addComment(key: any, body: any): Promise<{
31
- ok: boolean;
32
- id: any;
33
- }>;
34
- /**
35
- * transition — reuse jira_transition_issue's fuzzy matching (exact → core →
36
- * dice). Returns ok + the resulting raw state name and its bucket.
37
- */
38
- export function transition(key: any, targetStateName: any): Promise<{
39
- ok: boolean;
40
- error: any;
41
- _raw: any;
42
- stateAfter?: undefined;
43
- stateCategoryAfter?: undefined;
44
- } | {
45
- ok: boolean;
46
- stateAfter: any;
47
- stateCategoryAfter: "unknown" | "todo" | "in_progress" | "done" | "blocked";
48
- _raw: any;
49
- error?: undefined;
50
- }>;
51
- /**
52
- * linkPullRequest — try Jira's remote-link API; fall back to a comment.
53
- * Remote-link needs the granular `write:issue.remote-link:jira` scope; if it
54
- * 403s (or anything else), we still record the PR via a comment so the link
55
- * is never silently lost.
56
- */
57
- export function linkPullRequest(key: any, prUrl: any, title: any): Promise<{
58
- ok: boolean;
59
- via: string;
60
- error?: undefined;
61
- } | {
62
- ok: boolean;
63
- via: string;
64
- error: string;
65
- }>;
66
- }
67
- export default jiraAdapter;
68
1
  /**
69
- * Map a Jira status into the neutral 5-bucket category.
70
- * @param {{name?: string, statusCategory?: {key?: string}}} [status]
71
- * @returns {'todo'|'in_progress'|'done'|'blocked'|'unknown'}
2
+ * Jira tracker adapter — projects Jira onto the neutral TrackerAdapter contract.
3
+ * ============================================================================
4
+ *
5
+ * Thin wrapper over jira.js. ~90% of the work is the toNeutral mapping; the
6
+ * write methods mostly delegate to the JIRA skill's first-class tools
7
+ * (jira_transition_issue already does the fuzzy status matching we want, so we
8
+ * do NOT re-implement it). The single gap with no tool is attaching a PR remote
9
+ * link, which we issue against the exported `jiraFetch` chokepoint directly,
10
+ * with a comment fallback.
11
+ *
12
+ * State mapping: Jira's `statusCategory.key` is a 3-value enum — `new` /
13
+ * `indeterminate` / `done` (see backend/.../jira-tickets-service.js:70). That
14
+ * maps cleanly onto three of the five neutral buckets. Jira has no native
15
+ * "blocked" category, so 'blocked' is only ever derived from a status NAME
16
+ * match (best-effort), matching how the other adapters surface it.
17
+ *
18
+ * Auth/config is inherited from jira.js (resolveIntegrationToken('jira')); this
19
+ * file adds no new env keys.
72
20
  */
73
- declare function toStateCategory(status?: {
74
- name?: string;
75
- statusCategory?: {
76
- key?: string;
77
- };
78
- }): "todo" | "in_progress" | "done" | "blocked" | "unknown";
79
- /** Build a NeutralTicket from a full Jira issue REST payload. */
80
- declare function toNeutral(issue: any, instanceUrl: any): {
81
- id: string;
82
- key: any;
83
- title: any;
84
- body: any;
85
- state: any;
86
- stateCategory: "unknown" | "todo" | "in_progress" | "done" | "blocked";
87
- assignee: any;
88
- url: string;
89
- _raw: any;
90
- };
21
+ export declare const jiraAdapter: any;
22
+ export default jiraAdapter;