@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,3 +1,33 @@
1
+ /**
2
+ * Lark / Feishu Docs skill — read / create / append Lark Docx documents.
3
+ *
4
+ * The document-world twin of googleDocs.js + notion.js, but for Lark/Feishu.
5
+ * It REUSES the already-connected Lark app (integration `lark`) — the SAME
6
+ * app that powers lark.js messaging — so there is nothing new to connect: the
7
+ * app just needs the docx (+ optional wiki/drive) scopes added in the Lark
8
+ * developer console. Auth is minted EXACTLY like lark.js:
9
+ * resolveIntegrationToken('lark') → { appId, appSecret, host } →
10
+ * tenant_access_token (cached ~2h) → Bearer on every Docx call.
11
+ *
12
+ * Design rules (mirrors notion.js / googleDocs.js):
13
+ * - resolveIntegrationToken('lark') is the SINGLE auth chokepoint (via the
14
+ * larkDocsApi() helper). Don't re-resolve at call sites.
15
+ * - handleToolCall() dispatches the tools and NEVER throws — any HTTP or
16
+ * parse failure is returned as { ok:false, error } so a missing/broken
17
+ * Lark connection can't crash the run.
18
+ * - Region-aware host: whatever resolveIntegrationToken('lark') returns as
19
+ * `host` (open.feishu.cn vs open.larksuite.com) is used verbatim, so the
20
+ * skill always matches the connected app's region. No baked host, no CLI,
21
+ * no heavy deps — pure `fetch`.
22
+ *
23
+ * Docx v1 API (host-relative):
24
+ * GET /open-apis/docx/v1/documents/{id} → { document:{title,...} }
25
+ * GET /open-apis/docx/v1/documents/{id}/raw_content?lang=0 → { content } (plain text)
26
+ * POST /open-apis/docx/v1/documents → { document:{document_id,title} }
27
+ * POST /open-apis/docx/v1/documents/{id}/blocks/{block}/children
28
+ * (block == document_id == the doc root) → append blocks at the end
29
+ * GET /open-apis/wiki/v2/spaces/get_node?token={t} → { node:{obj_token,obj_type} }
30
+ */
1
31
  /**
2
32
  * Derive the human-facing doc web URL from the open-api host + document id.
3
33
  * The open-api host (open.feishu.cn / open.larksuite.com) is region-specific;
@@ -5,7 +35,7 @@
5
35
  * canonical URL — a tenant with a vanity subdomain may render its own host, but
6
36
  * the product-domain URL still resolves for the user.
7
37
  */
8
- export function docWebUrl(host: any, id: any): string;
38
+ export declare function docWebUrl(host: any, id: any): string;
9
39
  /**
10
40
  * Parse a Lark/Feishu doc reference (raw token OR URL) into { type, token }.
11
41
  * - .../docx/<token> → { type:'docx', token }
@@ -13,7 +43,7 @@ export function docWebUrl(host: any, id: any): string;
13
43
  * - bare token → { type:'docx', token }
14
44
  * Returns null when nothing usable can be extracted. Pure + side-effect-free.
15
45
  */
16
- export function parseLarkDocRef(ref: any): {
46
+ export declare function parseLarkDocRef(ref: any): {
17
47
  type: string;
18
48
  token: string;
19
49
  };
@@ -25,237 +55,6 @@ export function parseLarkDocRef(ref: any): {
25
55
  * styles — honest + robust). Empty lines are skipped (Lark rejects empty text
26
56
  * blocks). Bounded by the caller's chunking to MAX_BLOCK_CHILDREN per request.
27
57
  */
28
- export function markdownToLarkBlocks(markdown: any): {
29
- [x: string]: number | {
30
- elements: {
31
- text_run: {
32
- content: string;
33
- };
34
- }[];
35
- style: {};
36
- };
37
- block_type: number;
38
- }[];
39
- export function _resetLarkDocsTokenCache(): void;
40
- export namespace larkDocsSkill {
41
- let id: string;
42
- let serverName: string;
43
- let allowedTools: string[];
44
- let requiresIntegration: "lark";
45
- let description: string;
46
- let envKeys: any[];
47
- let promptFragment: string;
48
- /**
49
- * Spawn the GENERIC skill MCP server (bin/mcp-skill.mjs) pointing at this
50
- * module's larkDocsSkill export, so the AGENT gets real mcp__larkdocs__*
51
- * tools. Auth flows through the INHERITED env (PROJECT_API_TOKEN →
52
- * resolveIntegrationToken('lark')), so no provider-specific env keys are
53
- * needed here. When unconnected, handleToolCall returns { ok:false, error }.
54
- */
55
- function resolve(): {
56
- type: string;
57
- command: string;
58
- args: any[];
59
- env: {};
60
- description: string;
61
- alwaysLoad: boolean;
62
- };
63
- function handleToolCall(name: any, args: any): Promise<string>;
64
- let tools: ({
65
- name: string;
66
- description: string;
67
- input_schema: {
68
- type: string;
69
- properties: {
70
- documentId: {
71
- type: string;
72
- description: string;
73
- };
74
- title?: undefined;
75
- markdown?: undefined;
76
- text?: undefined;
77
- folderToken?: undefined;
78
- imagePath?: undefined;
79
- width?: undefined;
80
- height?: undefined;
81
- fileType?: undefined;
82
- commentId?: undefined;
83
- };
84
- required: string[];
85
- };
86
- } | {
87
- name: string;
88
- description: string;
89
- input_schema: {
90
- type: string;
91
- properties: {
92
- title: {
93
- type: string;
94
- description: string;
95
- };
96
- markdown: {
97
- type: string;
98
- description: string;
99
- };
100
- text: {
101
- type: string;
102
- description: string;
103
- };
104
- folderToken: {
105
- type: string;
106
- description: string;
107
- };
108
- documentId?: undefined;
109
- imagePath?: undefined;
110
- width?: undefined;
111
- height?: undefined;
112
- fileType?: undefined;
113
- commentId?: undefined;
114
- };
115
- required: string[];
116
- };
117
- } | {
118
- name: string;
119
- description: string;
120
- input_schema: {
121
- type: string;
122
- properties: {
123
- documentId: {
124
- type: string;
125
- description: string;
126
- };
127
- markdown: {
128
- type: string;
129
- description: string;
130
- };
131
- text: {
132
- type: string;
133
- description: string;
134
- };
135
- title?: undefined;
136
- folderToken?: undefined;
137
- imagePath?: undefined;
138
- width?: undefined;
139
- height?: undefined;
140
- fileType?: undefined;
141
- commentId?: undefined;
142
- };
143
- required: string[];
144
- };
145
- } | {
146
- name: string;
147
- description: string;
148
- input_schema: {
149
- type: string;
150
- properties: {
151
- documentId: {
152
- type: string;
153
- description: string;
154
- };
155
- imagePath: {
156
- type: string;
157
- description: string;
158
- };
159
- width: {
160
- type: string;
161
- description: string;
162
- };
163
- height: {
164
- type: string;
165
- description: string;
166
- };
167
- title?: undefined;
168
- markdown?: undefined;
169
- text?: undefined;
170
- folderToken?: undefined;
171
- fileType?: undefined;
172
- commentId?: undefined;
173
- };
174
- required: string[];
175
- };
176
- } | {
177
- name: string;
178
- description: string;
179
- input_schema: {
180
- type: string;
181
- properties: {
182
- documentId: {
183
- type: string;
184
- description: string;
185
- };
186
- fileType: {
187
- type: string;
188
- description: string;
189
- };
190
- title?: undefined;
191
- markdown?: undefined;
192
- text?: undefined;
193
- folderToken?: undefined;
194
- imagePath?: undefined;
195
- width?: undefined;
196
- height?: undefined;
197
- commentId?: undefined;
198
- };
199
- required: string[];
200
- };
201
- } | {
202
- name: string;
203
- description: string;
204
- input_schema: {
205
- type: string;
206
- properties: {
207
- documentId: {
208
- type: string;
209
- description: string;
210
- };
211
- text: {
212
- type: string;
213
- description: string;
214
- };
215
- fileType: {
216
- type: string;
217
- description: string;
218
- };
219
- title?: undefined;
220
- markdown?: undefined;
221
- folderToken?: undefined;
222
- imagePath?: undefined;
223
- width?: undefined;
224
- height?: undefined;
225
- commentId?: undefined;
226
- };
227
- required: string[];
228
- };
229
- } | {
230
- name: string;
231
- description: string;
232
- input_schema: {
233
- type: string;
234
- properties: {
235
- documentId: {
236
- type: string;
237
- description: string;
238
- };
239
- commentId: {
240
- type: string;
241
- description: string;
242
- };
243
- text: {
244
- type: string;
245
- description: string;
246
- };
247
- fileType: {
248
- type: string;
249
- description: string;
250
- };
251
- title?: undefined;
252
- markdown?: undefined;
253
- folderToken?: undefined;
254
- imagePath?: undefined;
255
- width?: undefined;
256
- height?: undefined;
257
- };
258
- required: string[];
259
- };
260
- })[];
261
- }
58
+ export declare function markdownToLarkBlocks(markdown: any): any[];
59
+ export declare const larkDocsSkill: any;
60
+ export declare function _resetLarkDocsTokenCache(): void;
package/dist/linear.d.ts CHANGED
@@ -1,3 +1,37 @@
1
+ /**
2
+ * Linear integration — low-level API-wrapper skill.
3
+ *
4
+ * Linear exposes a single GraphQL endpoint (https://api.linear.app/graphql).
5
+ * Auth is a static API key (or an OAuth bearer). Unlike Jira/GitHub — whose
6
+ * OAuth tokens are minted by the Zibby backend and fetched via
7
+ * resolveIntegrationToken() — Linear has no backend integration handler yet,
8
+ * so this skill reads the key straight from the environment (LINEAR_API_KEY).
9
+ * That matches the task spec ("Auth/config via env, same pattern as jira.js's
10
+ * envKeys"). When a backend Linear OAuth handler + an INTEGRATIONS.LINEAR
11
+ * constant land, swap linearFetch's auth header to resolveIntegrationToken
12
+ * ('linear') and add `requiresIntegration: INTEGRATIONS.LINEAR` below — the
13
+ * tool surface does not need to change.
14
+ *
15
+ * Linear auth header semantics (https://developers.linear.app/docs):
16
+ * - Personal API key: Authorization: <key> (NO "Bearer " prefix)
17
+ * - OAuth access token: Authorization: Bearer <token>
18
+ * We pass the key verbatim. Power users who paste an OAuth token should
19
+ * include the "Bearer " prefix themselves, or set LINEAR_OAUTH_TOKEN.
20
+ *
21
+ * Tracker quirks the neutral adapter must know (Linear-specific):
22
+ * - Workflow STATES are per-team, not global. A "state" is a WorkflowState
23
+ * node {id,name,type} scoped to a team. There is no Jira-style
24
+ * "transition" object — you update issue.stateId directly to ANY state
25
+ * in the same team. So "transition" == resolve target state-name -> the
26
+ * team's matching WorkflowState id -> issueUpdate(stateId). We do that
27
+ * resolution here with the same fuzzy matching jira.js uses.
28
+ * - state.type is one of: backlog | unstarted | started | completed |
29
+ * canceled | triage. Useful for mapping neutral statuses.
30
+ * - Linear has native ATTACHMENTS (attachmentLinkURL / attachmentCreate)
31
+ * which is the first-class way to link a PR to an issue. See
32
+ * linear_link_attachment below. The adapter's linkPullRequest should
33
+ * prefer it and fall back to linear_add_comment.
34
+ */
1
35
  /**
2
36
  * Low-level Linear GraphQL helper. POSTs { query, variables }, throws on
3
37
  * transport or GraphQL errors, returns the `data` object.
@@ -10,346 +44,5 @@
10
44
  * @param {object} [variables]
11
45
  * @returns {Promise<any>} the GraphQL `data` payload
12
46
  */
13
- export function linearFetch(query: string, variables?: object): Promise<any>;
14
- export namespace linearSkill {
15
- let id: string;
16
- let serverName: string;
17
- let allowedTools: string[];
18
- let requiresIntegration: "linear";
19
- let envKeys: string[];
20
- let description: string;
21
- let promptFragment: string;
22
- function resolve(): {
23
- command: any;
24
- args: any[];
25
- env: {
26
- LINEAR_API_URL: any;
27
- };
28
- description: string;
29
- type?: undefined;
30
- alwaysLoad?: undefined;
31
- } | {
32
- type: string;
33
- command: string;
34
- args: any[];
35
- env: {
36
- LINEAR_API_URL: any;
37
- };
38
- description: string;
39
- alwaysLoad: boolean;
40
- };
41
- function handleToolCall(name: any, args: any): Promise<string>;
42
- let tools: ({
43
- name: string;
44
- description: string;
45
- input_schema: {
46
- type: string;
47
- properties: {
48
- limit: {
49
- type: string;
50
- description: string;
51
- };
52
- teamId?: undefined;
53
- teamKey?: undefined;
54
- stateId?: undefined;
55
- stateName?: undefined;
56
- label?: undefined;
57
- assigneeId?: undefined;
58
- updatedAfter?: undefined;
59
- identifier?: undefined;
60
- issueId?: undefined;
61
- body?: undefined;
62
- toStatus?: undefined;
63
- url?: undefined;
64
- title?: undefined;
65
- subtitle?: undefined;
66
- };
67
- required?: undefined;
68
- };
69
- } | {
70
- name: string;
71
- description: string;
72
- input_schema: {
73
- type: string;
74
- properties: {
75
- teamId: {
76
- type: string;
77
- description: string;
78
- };
79
- teamKey: {
80
- type: string;
81
- description: string;
82
- };
83
- limit: {
84
- type: string;
85
- description: string;
86
- };
87
- stateId?: undefined;
88
- stateName?: undefined;
89
- label?: undefined;
90
- assigneeId?: undefined;
91
- updatedAfter?: undefined;
92
- identifier?: undefined;
93
- issueId?: undefined;
94
- body?: undefined;
95
- toStatus?: undefined;
96
- url?: undefined;
97
- title?: undefined;
98
- subtitle?: undefined;
99
- };
100
- required?: undefined;
101
- };
102
- } | {
103
- name: string;
104
- description: string;
105
- input_schema: {
106
- type: string;
107
- properties: {
108
- teamId: {
109
- type: string;
110
- description: string;
111
- };
112
- limit: {
113
- type: string;
114
- description: string;
115
- };
116
- teamKey?: undefined;
117
- stateId?: undefined;
118
- stateName?: undefined;
119
- label?: undefined;
120
- assigneeId?: undefined;
121
- updatedAfter?: undefined;
122
- identifier?: undefined;
123
- issueId?: undefined;
124
- body?: undefined;
125
- toStatus?: undefined;
126
- url?: undefined;
127
- title?: undefined;
128
- subtitle?: undefined;
129
- };
130
- required?: undefined;
131
- };
132
- } | {
133
- name: string;
134
- description: string;
135
- input_schema: {
136
- type: string;
137
- properties: {
138
- teamId: {
139
- type: string;
140
- description: string;
141
- };
142
- teamKey: {
143
- type: string;
144
- description: string;
145
- };
146
- stateId: {
147
- type: string;
148
- description: string;
149
- };
150
- stateName: {
151
- type: string;
152
- description: string;
153
- };
154
- label: {
155
- type: string;
156
- description: string;
157
- };
158
- assigneeId: {
159
- type: string;
160
- description: string;
161
- };
162
- updatedAfter: {
163
- type: string;
164
- description: string;
165
- };
166
- limit: {
167
- type: string;
168
- description: string;
169
- };
170
- identifier?: undefined;
171
- issueId?: undefined;
172
- body?: undefined;
173
- toStatus?: undefined;
174
- url?: undefined;
175
- title?: undefined;
176
- subtitle?: undefined;
177
- };
178
- required?: undefined;
179
- };
180
- } | {
181
- name: string;
182
- description: string;
183
- input_schema: {
184
- type: string;
185
- properties: {
186
- identifier: {
187
- type: string;
188
- description: string;
189
- };
190
- issueId: {
191
- type: string;
192
- description: string;
193
- };
194
- limit?: undefined;
195
- teamId?: undefined;
196
- teamKey?: undefined;
197
- stateId?: undefined;
198
- stateName?: undefined;
199
- label?: undefined;
200
- assigneeId?: undefined;
201
- updatedAfter?: undefined;
202
- body?: undefined;
203
- toStatus?: undefined;
204
- url?: undefined;
205
- title?: undefined;
206
- subtitle?: undefined;
207
- };
208
- required?: undefined;
209
- };
210
- } | {
211
- name: string;
212
- description: string;
213
- input_schema: {
214
- type: string;
215
- properties: {
216
- identifier: {
217
- type: string;
218
- description: string;
219
- };
220
- issueId: {
221
- type: string;
222
- description: string;
223
- };
224
- limit: {
225
- type: string;
226
- description: string;
227
- };
228
- teamId?: undefined;
229
- teamKey?: undefined;
230
- stateId?: undefined;
231
- stateName?: undefined;
232
- label?: undefined;
233
- assigneeId?: undefined;
234
- updatedAfter?: undefined;
235
- body?: undefined;
236
- toStatus?: undefined;
237
- url?: undefined;
238
- title?: undefined;
239
- subtitle?: undefined;
240
- };
241
- required?: undefined;
242
- };
243
- } | {
244
- name: string;
245
- description: string;
246
- input_schema: {
247
- type: string;
248
- properties: {
249
- identifier: {
250
- type: string;
251
- description: string;
252
- };
253
- issueId: {
254
- type: string;
255
- description: string;
256
- };
257
- body: {
258
- type: string;
259
- description: string;
260
- };
261
- limit?: undefined;
262
- teamId?: undefined;
263
- teamKey?: undefined;
264
- stateId?: undefined;
265
- stateName?: undefined;
266
- label?: undefined;
267
- assigneeId?: undefined;
268
- updatedAfter?: undefined;
269
- toStatus?: undefined;
270
- url?: undefined;
271
- title?: undefined;
272
- subtitle?: undefined;
273
- };
274
- required: string[];
275
- };
276
- } | {
277
- name: string;
278
- description: string;
279
- input_schema: {
280
- type: string;
281
- properties: {
282
- identifier: {
283
- type: string;
284
- description: string;
285
- };
286
- issueId: {
287
- type: string;
288
- description: string;
289
- };
290
- stateId: {
291
- type: string;
292
- description: string;
293
- };
294
- stateName: {
295
- type: string;
296
- description: string;
297
- };
298
- toStatus: {
299
- type: string;
300
- description: string;
301
- };
302
- limit?: undefined;
303
- teamId?: undefined;
304
- teamKey?: undefined;
305
- label?: undefined;
306
- assigneeId?: undefined;
307
- updatedAfter?: undefined;
308
- body?: undefined;
309
- url?: undefined;
310
- title?: undefined;
311
- subtitle?: undefined;
312
- };
313
- required?: undefined;
314
- };
315
- } | {
316
- name: string;
317
- description: string;
318
- input_schema: {
319
- type: string;
320
- properties: {
321
- identifier: {
322
- type: string;
323
- description: string;
324
- };
325
- issueId: {
326
- type: string;
327
- description: string;
328
- };
329
- url: {
330
- type: string;
331
- description: string;
332
- };
333
- title: {
334
- type: string;
335
- description: string;
336
- };
337
- subtitle: {
338
- type: string;
339
- description: string;
340
- };
341
- limit?: undefined;
342
- teamId?: undefined;
343
- teamKey?: undefined;
344
- stateId?: undefined;
345
- stateName?: undefined;
346
- label?: undefined;
347
- assigneeId?: undefined;
348
- updatedAfter?: undefined;
349
- body?: undefined;
350
- toStatus?: undefined;
351
- };
352
- required: string[];
353
- };
354
- })[];
355
- }
47
+ export declare function linearFetch(query: any, variables?: any): Promise<any>;
48
+ export declare const linearSkill: any;