@zibby/skills 0.1.96 → 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 (76) 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 -326
  17. package/dist/discord.d.ts +32 -68
  18. package/dist/figma.d.ts +5 -408
  19. package/dist/function-skill.d.ts +23 -135
  20. package/dist/function-skill.js +1 -1
  21. package/dist/gbrain.d.ts +46 -114
  22. package/dist/git-write.d.ts +45 -137
  23. package/dist/git-write.js +6 -6
  24. package/dist/git.d.ts +2 -73
  25. package/dist/github.d.ts +2 -1202
  26. package/dist/gitlab.d.ts +55 -1059
  27. package/dist/gitlab.js +2 -2
  28. package/dist/googleDocs.d.ts +39 -175
  29. package/dist/hubspot.d.ts +1 -381
  30. package/dist/index.d.ts +19 -12
  31. package/dist/index.js +135 -135
  32. package/dist/integrations.d.ts +2 -2
  33. package/dist/jira.d.ts +2 -532
  34. package/dist/jira.js +4 -4
  35. package/dist/kvMemory.d.ts +47 -78
  36. package/dist/lark.d.ts +2 -161
  37. package/dist/lark.js +1 -1
  38. package/dist/larkDocs.d.ts +35 -236
  39. package/dist/linear.d.ts +36 -343
  40. package/dist/linkedin.d.ts +10 -120
  41. package/dist/llm-billing.d.ts +92 -180
  42. package/dist/llm-billing.js +1 -1
  43. package/dist/memory.d.ts +11 -137
  44. package/dist/notion.d.ts +28 -276
  45. package/dist/notion.js +4 -4
  46. package/dist/opendesign.d.ts +24 -202
  47. package/dist/opendesign.js +2 -2
  48. package/dist/package.json +3 -2
  49. package/dist/plane.d.ts +40 -24
  50. package/dist/report.d.ts +153 -110
  51. package/dist/review-dedup.d.ts +8 -8
  52. package/dist/review.d.ts +12 -2
  53. package/dist/reviewMemoryIo.d.ts +37 -3
  54. package/dist/reviewRecord.d.ts +41 -47
  55. package/dist/sentry.d.ts +25 -22
  56. package/dist/skill-installer.d.ts +11 -86
  57. package/dist/slack.d.ts +1 -284
  58. package/dist/socialCard.d.ts +35 -89
  59. package/dist/test-runner.d.ts +1 -220
  60. package/dist/trackers/github-adapter.d.ts +39 -94
  61. package/dist/trackers/index.d.ts +25 -18
  62. package/dist/trackers/jira-adapter.d.ts +20 -88
  63. package/dist/trackers/linear-adapter.d.ts +24 -87
  64. package/dist/trackers/plane-adapter.d.ts +29 -85
  65. package/dist/trackers/plane-adapter.js +1 -1
  66. package/dist/trackers/types.d.ts +1 -186
  67. package/dist/triggerAgent.d.ts +26 -42
  68. package/dist/triggerAgent.js +1 -1
  69. package/dist/workflow-builder.d.ts +11 -245
  70. package/docs/concepts/designing-agents.md +201 -0
  71. package/docs/self-host/backup-restore.md +52 -0
  72. package/docs/self-host/index.md +75 -0
  73. package/docs/self-host/storage.md +50 -0
  74. package/docs/self-host/troubleshooting.md +48 -0
  75. package/docs/self-host/upgrade.md +81 -0
  76. package/package.json +3 -2
@@ -1,326 +1,52 @@
1
- export function __clearEnsuredStores(): void;
2
- export namespace datasetStoreSkill {
3
- let id: string;
4
- let serverName: string;
5
- let allowedTools: string[];
6
- let description: string;
7
- let promptFragment: string;
8
- function resolve(): {
9
- command: any;
10
- args: any[];
11
- env: {};
12
- description: string;
13
- type?: undefined;
14
- alwaysLoad?: undefined;
15
- } | {
16
- type: string;
17
- command: string;
18
- args: any[];
19
- env: {};
20
- description: string;
21
- alwaysLoad: boolean;
22
- };
23
- function handleToolCall(name: any, args: any): Promise<string>;
24
- let tools: ({
25
- name: string;
26
- description: string;
27
- input_schema: {
28
- type: string;
29
- properties: {
30
- store: {
31
- type: string;
32
- description: string;
33
- };
34
- record: {
35
- type: string;
36
- description: string;
37
- };
38
- description: {
39
- type: string;
40
- description: string;
41
- };
42
- agent: {
43
- type: string;
44
- description: string;
45
- };
46
- select?: undefined;
47
- where?: undefined;
48
- groupBy?: undefined;
49
- orderBy?: undefined;
50
- limit?: undefined;
51
- since?: undefined;
52
- until?: undefined;
53
- name?: undefined;
54
- type?: undefined;
55
- sql?: undefined;
56
- params?: undefined;
57
- path?: undefined;
58
- content?: undefined;
59
- contentBase64?: undefined;
60
- contentType?: undefined;
61
- prefix?: undefined;
62
- cursor?: undefined;
63
- };
64
- required: string[];
65
- };
66
- } | {
67
- name: string;
68
- description: string;
69
- input_schema: {
70
- type: string;
71
- properties: {
72
- store: {
73
- type: string;
74
- description: string;
75
- };
76
- select: {
77
- type: string;
78
- description: string;
79
- };
80
- where: {
81
- type: string;
82
- description: string;
83
- };
84
- groupBy: {
85
- type: string;
86
- description: string;
87
- };
88
- orderBy: {
89
- type: string;
90
- description: string;
91
- };
92
- limit: {
93
- type: string;
94
- description: string;
95
- };
96
- since: {
97
- type: string;
98
- description: string;
99
- };
100
- until: {
101
- type: string;
102
- description: string;
103
- };
104
- agent: {
105
- type: string;
106
- description: string;
107
- };
108
- record?: undefined;
109
- description?: undefined;
110
- name?: undefined;
111
- type?: undefined;
112
- sql?: undefined;
113
- params?: undefined;
114
- path?: undefined;
115
- content?: undefined;
116
- contentBase64?: undefined;
117
- contentType?: undefined;
118
- prefix?: undefined;
119
- cursor?: undefined;
120
- };
121
- required: any[];
122
- };
123
- } | {
124
- name: string;
125
- description: string;
126
- input_schema: {
127
- type: string;
128
- properties: {
129
- name: {
130
- type: string;
131
- description: string;
132
- };
133
- type: {
134
- type: string;
135
- enum: string[];
136
- description: string;
137
- };
138
- description: {
139
- type: string;
140
- description: string;
141
- };
142
- store?: undefined;
143
- record?: undefined;
144
- agent?: undefined;
145
- select?: undefined;
146
- where?: undefined;
147
- groupBy?: undefined;
148
- orderBy?: undefined;
149
- limit?: undefined;
150
- since?: undefined;
151
- until?: undefined;
152
- sql?: undefined;
153
- params?: undefined;
154
- path?: undefined;
155
- content?: undefined;
156
- contentBase64?: undefined;
157
- contentType?: undefined;
158
- prefix?: undefined;
159
- cursor?: undefined;
160
- };
161
- required: string[];
162
- };
163
- } | {
164
- name: string;
165
- description: string;
166
- input_schema: {
167
- type: string;
168
- properties: {
169
- store: {
170
- type: string;
171
- description: string;
172
- };
173
- sql: {
174
- type: string;
175
- description: string;
176
- };
177
- params: {
178
- type: string;
179
- description: string;
180
- };
181
- record?: undefined;
182
- description?: undefined;
183
- agent?: undefined;
184
- select?: undefined;
185
- where?: undefined;
186
- groupBy?: undefined;
187
- orderBy?: undefined;
188
- limit?: undefined;
189
- since?: undefined;
190
- until?: undefined;
191
- name?: undefined;
192
- type?: undefined;
193
- path?: undefined;
194
- content?: undefined;
195
- contentBase64?: undefined;
196
- contentType?: undefined;
197
- prefix?: undefined;
198
- cursor?: undefined;
199
- };
200
- required: string[];
201
- };
202
- } | {
203
- name: string;
204
- description: string;
205
- input_schema: {
206
- type: string;
207
- properties: {
208
- store: {
209
- type: string;
210
- description: string;
211
- };
212
- path: {
213
- type: string;
214
- description: string;
215
- };
216
- content: {
217
- type: string;
218
- description: string;
219
- };
220
- contentBase64: {
221
- type: string;
222
- description: string;
223
- };
224
- contentType: {
225
- type: string;
226
- description: string;
227
- };
228
- record?: undefined;
229
- description?: undefined;
230
- agent?: undefined;
231
- select?: undefined;
232
- where?: undefined;
233
- groupBy?: undefined;
234
- orderBy?: undefined;
235
- limit?: undefined;
236
- since?: undefined;
237
- until?: undefined;
238
- name?: undefined;
239
- type?: undefined;
240
- sql?: undefined;
241
- params?: undefined;
242
- prefix?: undefined;
243
- cursor?: undefined;
244
- };
245
- required: string[];
246
- };
247
- } | {
248
- name: string;
249
- description: string;
250
- input_schema: {
251
- type: string;
252
- properties: {
253
- store: {
254
- type: string;
255
- description: string;
256
- };
257
- path: {
258
- type: string;
259
- description: string;
260
- };
261
- record?: undefined;
262
- description?: undefined;
263
- agent?: undefined;
264
- select?: undefined;
265
- where?: undefined;
266
- groupBy?: undefined;
267
- orderBy?: undefined;
268
- limit?: undefined;
269
- since?: undefined;
270
- until?: undefined;
271
- name?: undefined;
272
- type?: undefined;
273
- sql?: undefined;
274
- params?: undefined;
275
- content?: undefined;
276
- contentBase64?: undefined;
277
- contentType?: undefined;
278
- prefix?: undefined;
279
- cursor?: undefined;
280
- };
281
- required: string[];
282
- };
283
- } | {
284
- name: string;
285
- description: string;
286
- input_schema: {
287
- type: string;
288
- properties: {
289
- store: {
290
- type: string;
291
- description: string;
292
- };
293
- prefix: {
294
- type: string;
295
- description: string;
296
- };
297
- limit: {
298
- type: string;
299
- description: string;
300
- };
301
- cursor: {
302
- type: string;
303
- description: string;
304
- };
305
- record?: undefined;
306
- description?: undefined;
307
- agent?: undefined;
308
- select?: undefined;
309
- where?: undefined;
310
- groupBy?: undefined;
311
- orderBy?: undefined;
312
- since?: undefined;
313
- until?: undefined;
314
- name?: undefined;
315
- type?: undefined;
316
- sql?: undefined;
317
- params?: undefined;
318
- path?: undefined;
319
- content?: undefined;
320
- contentBase64?: undefined;
321
- contentType?: undefined;
322
- };
323
- required: any[];
324
- };
325
- })[];
326
- }
1
+ /**
2
+ * datasetStore.js — durable, queryable structured-artifact store skill.
3
+ *
4
+ * WHAT IT IS
5
+ * ──────────
6
+ * A hand-written multi-tool skill (same shape as kvMemory.js / reviewMemory.js /
7
+ * github.js): `serverName`, `allowedTools`, `tools[]`, `handleToolCall`, and a
8
+ * `resolve()` that spawns the GENERIC bin/mcp-skill.mjs. Unlike kv-memory (a
9
+ * key→value MEMORY for picking up where a prior run left off), this is a durable
10
+ * STRUCTURED-RECORD store: an agent appends arbitrary JSON records to a named
11
+ * store and later runs SQL-style queries/aggregations over them — e.g. to
12
+ * accumulate metrics across runs and produce a report.
13
+ *
14
+ * STORES v2 — NAME-BASED RESOLUTION (the shared contract)
15
+ * ────────────────────────────────────────────────────────
16
+ * Stores are auto-provisioned at DEPLOY and resolved at runtime BY NAME via env:
17
+ * - The run carries one `ZIBBY_STORE__<name> = <storeId>` per bound store.
18
+ * - The agent reads the injected "AVAILABLE STORES" prompt catalog (name +
19
+ * description), picks one, and passes the chosen logical `name` to the tool.
20
+ * - This name→storeId env map is BOTH the allowlist AND the resolver: the
21
+ * agent can only ever write to a declared/bound name (anti-fragmentation).
22
+ *
23
+ * BACKEND (already built NO change here)
24
+ * ─────────────────────────────────────────
25
+ * Two routes on the SAME base URL kv-memory uses (getAccountApiUrl(), prod
26
+ * https://api-prod.zibby.app), authed with the SAME Bearer project token
27
+ * (getSessionToken()):
28
+ * - POST {base}/datasets/stores/{storeId}/append body { record, agent }
29
+ * → { ok, id, ts }
30
+ * - POST {base}/datasets/stores/{storeId}/query body { select?, where?,
31
+ * groupBy?, orderBy?, limit?, since?, until?, agent? }
32
+ * → { ok, rowCount, columns, rows }
33
+ * Plus the per-type data routes on the same base: /sql (sqlite stores) and
34
+ * /put /get /list /delete (file stores — blob storage by relative path).
35
+ * The `storeId` lives in the URL path. Tenancy (account + project) is enforced
36
+ * SERVER-SIDE from the Bearer token — the skill NEVER sends account/project.
37
+ *
38
+ * AUTOMATIC PER-AGENT TAGGING
39
+ * ────────────────────────────
40
+ * Appends default `agent` to the writing agent's namespace (WORKFLOW_TYPE,
41
+ * falling back to the literal 'agent'), so records are auto-tagged with who
42
+ * wrote them and `query`'s optional `agent` filter can scope to one writer.
43
+ *
44
+ * AUTH — identical to kvMemory.js / reviewMemory.js
45
+ * ──────────────────────────────────────────────────
46
+ * Calls ZIBBY'S OWN backend with PROJECT_API_TOKEN (Bearer) against
47
+ * ZIBBY_ACCOUNT_API_URL (default api-prod.zibby.app). Mirrors
48
+ * @zibby/core/backend-client.js getSessionToken()/getAccountApiUrl() rather than
49
+ * importing a non-existent helper, so the auth model stays identical.
50
+ */
51
+ export declare function __clearEnsuredStores(): void;
52
+ export declare const datasetStoreSkill: any;
package/dist/discord.d.ts CHANGED
@@ -1,3 +1,33 @@
1
+ /**
2
+ * Discord integration — low-level API-wrapper skill.
3
+ *
4
+ * Lets an agent post messages into a Discord server the user's bot has been
5
+ * invited to, and discover the channels it can post to. Talks the Discord
6
+ * REST API (v10) directly with a static BOT token — no MCP server of its own;
7
+ * served over the GENERIC skill MCP binary (bin/mcp-skill.mjs), exactly like
8
+ * linear.js / github.js.
9
+ *
10
+ * AUTH (single chokepoint: resolveDiscordAuth):
11
+ * 1. resolveIntegrationToken('discord') — the Zibby-cloud path. The backend
12
+ * stores the bot token on the account's provider='discord' integration
13
+ * row (paste-based connect) and returns { token, guildId } from
14
+ * GET /integrations/token/discord.
15
+ * 2. DISCORD_BOT_TOKEN env — the self-host / local fallback (same pattern
16
+ * as linear.js's LINEAR_API_KEY): when the env token is present it wins,
17
+ * so a self-hosted run never needs the Zibby cloud at all.
18
+ *
19
+ * Discord auth header semantics (https://discord.com/developers/docs):
20
+ * Authorization: Bot <token>
21
+ * A raw token pasted without the "Bot " prefix gets it added here.
22
+ *
23
+ * FAIL-SOFT: handleToolCall never throws — every error path returns
24
+ * JSON.stringify({ ok:false, error }) so a notify step can't crash a workflow.
25
+ *
26
+ * Discord hard limit: message `content` is capped at 2000 chars — longer text
27
+ * is CHUNKED into sequential messages (split on line boundaries when possible)
28
+ * rather than truncated or rejected.
29
+ */
30
+ export declare const DISCORD_MAX_CONTENT = 2000;
1
31
  /**
2
32
  * Split `text` into Discord-postable chunks of <= DISCORD_MAX_CONTENT chars.
3
33
  * Prefers newline boundaries so code blocks / paragraphs stay readable; falls
@@ -7,71 +37,5 @@
7
37
  * @param {number} [max=DISCORD_MAX_CONTENT]
8
38
  * @returns {string[]} non-empty chunks (empty input → []).
9
39
  */
10
- export function chunkDiscordContent(text: string, max?: number): string[];
11
- export const DISCORD_MAX_CONTENT: 2000;
12
- export namespace discordSkill {
13
- let id: string;
14
- let serverName: string;
15
- let allowedTools: string[];
16
- let requiresIntegration: "discord";
17
- let envKeys: string[];
18
- let description: string;
19
- let promptFragment: string;
20
- /**
21
- * Spawn spec for the GENERIC skill MCP server (bin/mcp-skill.mjs) pointed at
22
- * this module's discordSkill export — the model gets real mcp__discord__*
23
- * tools. Mirrors linear.js resolve() (see its docblock for the dist-relative
24
- * module-path rationale). Env allow-list: the self-host token/guild vars +
25
- * the backend-client vars resolveIntegrationToken needs in the child.
26
- */
27
- function resolve(): {
28
- command: any;
29
- args: any[];
30
- env: {};
31
- description: string;
32
- type?: undefined;
33
- alwaysLoad?: undefined;
34
- } | {
35
- type: string;
36
- command: string;
37
- args: any[];
38
- env: {};
39
- description: string;
40
- alwaysLoad: boolean;
41
- };
42
- function handleToolCall(name: any, args?: {}): Promise<string>;
43
- let tools: ({
44
- name: string;
45
- description: string;
46
- input_schema: {
47
- type: string;
48
- properties: {
49
- channelId: {
50
- type: string;
51
- description: string;
52
- };
53
- text: {
54
- type: string;
55
- description: string;
56
- };
57
- guildId?: undefined;
58
- };
59
- required: string[];
60
- };
61
- } | {
62
- name: string;
63
- description: string;
64
- input_schema: {
65
- type: string;
66
- properties: {
67
- guildId: {
68
- type: string;
69
- description: string;
70
- };
71
- channelId?: undefined;
72
- text?: undefined;
73
- };
74
- required?: undefined;
75
- };
76
- })[];
77
- }
40
+ export declare function chunkDiscordContent(text: any, max?: number): any[];
41
+ export declare const discordSkill: any;