@zibby/skills 0.2.22 → 0.2.24

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 (90) hide show
  1. package/dist/browser.js +3 -10
  2. package/dist/code-scan.d.ts +1 -1
  3. package/dist/index.js +81 -88
  4. package/dist/jira.d.ts +75 -9
  5. package/dist/jira.js +4 -4
  6. package/dist/package.json +1 -1
  7. package/dist/report.d.ts +51 -276
  8. package/dist/trackers/index.js +12 -12
  9. package/dist/trackers/jira-adapter.js +11 -11
  10. package/package.json +1 -1
  11. package/docs/analysis.md +0 -109
  12. package/docs/apps/agent-ops.md +0 -130
  13. package/docs/apps/auth.md +0 -158
  14. package/docs/apps/deploy.md +0 -207
  15. package/docs/apps/goal-mode.md +0 -175
  16. package/docs/apps/index.md +0 -149
  17. package/docs/apps/managing.md +0 -121
  18. package/docs/cli-reference.md +0 -494
  19. package/docs/cloning-repositories.md +0 -285
  20. package/docs/cloud/bundles.md +0 -92
  21. package/docs/cloud/dedicated-egress.md +0 -140
  22. package/docs/cloud/editing-prompts.md +0 -79
  23. package/docs/cloud/env-vars.md +0 -144
  24. package/docs/cloud/limits.md +0 -81
  25. package/docs/cloud/logs.md +0 -104
  26. package/docs/cloud/triggering.md +0 -128
  27. package/docs/concepts/agents.md +0 -112
  28. package/docs/concepts/designing-agents.md +0 -247
  29. package/docs/concepts/graph.md +0 -83
  30. package/docs/concepts/sessions.md +0 -70
  31. package/docs/concepts/skills.md +0 -86
  32. package/docs/concepts/state.md +0 -106
  33. package/docs/concepts/sub-graphs.md +0 -227
  34. package/docs/custom-workflows.md +0 -358
  35. package/docs/get-started/deploy.md +0 -75
  36. package/docs/get-started/install.md +0 -60
  37. package/docs/get-started/run-locally.md +0 -94
  38. package/docs/get-started/trigger-and-logs.md +0 -90
  39. package/docs/get-started/use-from-agents.md +0 -153
  40. package/docs/get-started/your-first-workflow.md +0 -69
  41. package/docs/getting-started.md +0 -108
  42. package/docs/installation.md +0 -127
  43. package/docs/integrations/github.md +0 -73
  44. package/docs/integrations/gitlab.md +0 -43
  45. package/docs/integrations/jira.md +0 -71
  46. package/docs/integrations/lark.md +0 -41
  47. package/docs/integrations/linear.md +0 -43
  48. package/docs/integrations/notion.md +0 -33
  49. package/docs/integrations/plane.md +0 -46
  50. package/docs/integrations/sentry.md +0 -42
  51. package/docs/integrations/slack.md +0 -33
  52. package/docs/intro.md +0 -86
  53. package/docs/legacy/test-automation.md +0 -111
  54. package/docs/packages/agent-workflow.md +0 -88
  55. package/docs/packages/cli.md +0 -73
  56. package/docs/packages/core.md +0 -72
  57. package/docs/packages/mcp-browser.md +0 -110
  58. package/docs/packages/mcp-cli.md +0 -176
  59. package/docs/packages/memory.md +0 -223
  60. package/docs/packages/skills.md +0 -218
  61. package/docs/packages/ui-memory.md +0 -245
  62. package/docs/recipes/bug-autofix.md +0 -85
  63. package/docs/recipes/github-ai-scout.md +0 -61
  64. package/docs/recipes/index.md +0 -68
  65. package/docs/recipes/pipeline-supervisor.md +0 -57
  66. package/docs/recipes/sentry-triage.md +0 -93
  67. package/docs/recipes/test.md +0 -190
  68. package/docs/reviewing-results.md +0 -114
  69. package/docs/running-tests.md +0 -134
  70. package/docs/self-host/backup-restore.md +0 -53
  71. package/docs/self-host/custom-sidecars.md +0 -136
  72. package/docs/self-host/index.md +0 -75
  73. package/docs/self-host/storage.md +0 -50
  74. package/docs/self-host/troubleshooting.md +0 -48
  75. package/docs/self-host/upgrade.md +0 -81
  76. package/docs/skills/browser.md +0 -97
  77. package/docs/skills/chat-memory.md +0 -122
  78. package/docs/skills/core-tools.md +0 -80
  79. package/docs/skills/function-skill.md +0 -93
  80. package/docs/skills/github.md +0 -91
  81. package/docs/skills/index.md +0 -46
  82. package/docs/skills/jira.md +0 -99
  83. package/docs/skills/lark.md +0 -85
  84. package/docs/skills/memory.md +0 -92
  85. package/docs/skills/sentry.md +0 -80
  86. package/docs/skills/slack.md +0 -89
  87. package/docs/tests/memory.md +0 -131
  88. package/docs/triggering-workflows.md +0 -552
  89. package/docs/workflow-artifact-layout-evaluation.md +0 -119
  90. package/docs/workflow.md +0 -558
@@ -1,552 +0,0 @@
1
- ---
2
- sidebar_position: 6
3
- title: Triggering Workflows
4
- ---
5
-
6
- # Triggering Workflows
7
-
8
- Learn how to trigger Zibby workflows using the API, CLI, webhooks, cron jobs, and third-party integrations.
9
-
10
- ## Overview
11
-
12
- Once deployed, workflows can be triggered from anywhere via HTTP API. Every trigger spawns an isolated execution in Zibby Cloud (ECS Fargate), with full logging and quota tracking.
13
-
14
- ### Execution Flow
15
-
16
- 1. Client triggers workflow via API
17
- 2. Backend validates quota & permissions
18
- 3. ECS Fargate task spawned with `zibby run-workflow`
19
- 4. Workflow sources fetched from S3
20
- 5. Graph executes in isolated container
21
- 6. Results uploaded to cloud
22
- 7. Logs streamed to CloudWatch
23
-
24
- ## Trigger Methods
25
-
26
- ### 1. CLI (Local Development)
27
-
28
- Trigger workflows directly from your terminal using workflow UUID (project auto-discovered):
29
-
30
- ```bash
31
- # Trigger by workflow UUID (simplest - no project needed)
32
- zibby trigger 562e48d7-ef67-4900-96b7-0d7b51a33405
33
-
34
- # With input data
35
- zibby trigger 562e48d7-ef67-4900-96b7-0d7b51a33405 \
36
- --input '{"ticket":"JIRA-123"}'
37
-
38
- # By workflow name (requires project ID)
39
- zibby trigger custom-flow --project <id> \
40
- --input '{"key":"value"}'
41
-
42
- # With idempotency key (prevents duplicate runs)
43
- zibby trigger 562e48d7-ef67-4900-96b7-0d7b51a33405 \
44
- --idempotency-key "daily-scan-2026-04-27"
45
-
46
- # Stream logs immediately after triggering
47
- zibby trigger 562e48d7-ef67-4900-96b7-0d7b51a33405 && \
48
- zibby logs 562e48d7-ef67-4900-96b7-0d7b51a33405 -t
49
- ```
50
-
51
- ### 2. HTTP API
52
-
53
- #### Standard Endpoint
54
-
55
- Always available for all workflows:
56
-
57
- ```bash
58
- curl -X POST https://api.zibby.app/projects/{projectId}/workflows/{type}/trigger \
59
- -H "Authorization: Bearer zby_xxx" \
60
- -H "Content-Type: application/json" \
61
- -d '{"input": {"ticket": "JIRA-123"}}'
62
- ```
63
-
64
- **Request Body:**
65
- ```json
66
- {
67
- "input": {
68
- "ticket": "JIRA-123",
69
- "branch": "main"
70
- },
71
- "idempotencyKey": "optional-unique-key-for-deduplication"
72
- }
73
- ```
74
-
75
- **Response (202 Accepted):**
76
- ```json
77
- {
78
- "jobId": "job-...",
79
- "status": "accepted",
80
- "workflow": "custom-flow",
81
- "version": 2,
82
- "projectId": "...",
83
- "triggeredAt": "2026-04-24T..."
84
- }
85
- ```
86
-
87
- #### Custom Subdomain (Optional)
88
-
89
- Each deployed workflow gets a unique subdomain URL for cleaner integration:
90
-
91
- ```bash
92
- curl -X POST https://my-security-scan.workflows.zibby.app/trigger \
93
- -H "Authorization: Bearer zby_xxx" \
94
- -H "Content-Type: application/json" \
95
- -d '{"input": {"branch": "main"}}'
96
- ```
97
-
98
- The subdomain maps to a specific `{projectId, workflowType}` pair, ideal for:
99
- - Webhooks (cleaner URLs)
100
- - Public APIs
101
- - Third-party integrations
102
- - Branded endpoints
103
-
104
- ### 3. Scheduled Execution
105
-
106
- #### AWS EventBridge (Serverless)
107
-
108
- ```yaml
109
- # CloudFormation
110
- EventBridgeRule:
111
- Type: AWS::Events::Rule
112
- Properties:
113
- ScheduleExpression: 'cron(0 9 * * ? *)' # Daily 9am
114
- Targets:
115
- - Arn: !GetAtt TriggerFunction.Arn
116
- Input: |
117
- {
118
- "projectId": "6b60049d-...",
119
- "workflowType": "custom-flow",
120
- "input": {"source": "cron"}
121
- }
122
- ```
123
-
124
- #### GitHub Actions
125
-
126
- ```yaml
127
- name: Daily Security Scan
128
- on:
129
- schedule:
130
- - cron: '0 0 * * *' # Daily midnight
131
-
132
- jobs:
133
- trigger:
134
- runs-on: ubuntu-latest
135
- steps:
136
- - name: Trigger Zibby Workflow
137
- run: |
138
- curl -X POST https://api.zibby.app/projects/$PROJECT_ID/workflows/security-scan/trigger \
139
- -H "Authorization: Bearer $ZIBBY_API_KEY" \
140
- -d '{"input": {"branch": "${{ github.ref }}"}}'
141
- env:
142
- ZIBBY_API_KEY: ${{ secrets.ZIBBY_API_KEY }}
143
- PROJECT_ID: ${{ vars.ZIBBY_PROJECT_ID }}
144
- ```
145
-
146
- #### Traditional Cron (Linux)
147
-
148
- ```bash
149
- # /etc/crontab or crontab -e
150
- 0 9 * * * zibby trigger custom-flow --project <id> >> /var/log/zibby.log 2>&1
151
- ```
152
-
153
- ### 4. Webhooks
154
-
155
- #### Jira Webhook Integration
156
-
157
- ```javascript
158
- // AWS Lambda or Express endpoint
159
- app.post('/webhooks/jira', async (req, res) => {
160
- const { issue } = req.body;
161
-
162
- if (issue.fields.status === 'Ready for Testing') {
163
- await fetch('https://api.zibby.app/projects/{projectId}/workflows/test-gen/trigger', {
164
- method: 'POST',
165
- headers: {
166
- 'Authorization': `Bearer ${process.env.ZIBBY_API_KEY}`,
167
- 'Content-Type': 'application/json',
168
- },
169
- body: JSON.stringify({
170
- input: {
171
- ticketKey: issue.key,
172
- title: issue.fields.summary,
173
- description: issue.fields.description,
174
- },
175
- idempotencyKey: `jira-${issue.key}-${issue.updated}`,
176
- }),
177
- });
178
- }
179
-
180
- res.sendStatus(200);
181
- });
182
- ```
183
-
184
- #### GitHub Pull Request Trigger
185
-
186
- ```yaml
187
- # .github/workflows/zibby-analyze.yml
188
- name: Zibby Code Analysis
189
- on:
190
- pull_request:
191
- types: [opened, synchronize]
192
-
193
- jobs:
194
- analyze:
195
- runs-on: ubuntu-latest
196
- steps:
197
- - name: Trigger Zibby Analysis
198
- run: |
199
- curl -X POST https://api.zibby.app/projects/$PROJECT_ID/workflows/code-review/trigger \
200
- -H "Authorization: Bearer $ZIBBY_API_KEY" \
201
- -d '{
202
- "input": {
203
- "prNumber": "${{ github.event.pull_request.number }}",
204
- "repo": "${{ github.repository }}",
205
- "branch": "${{ github.head_ref }}"
206
- },
207
- "idempotencyKey": "pr-${{ github.event.pull_request.number }}-${{ github.sha }}"
208
- }'
209
- env:
210
- ZIBBY_API_KEY: ${{ secrets.ZIBBY_API_KEY }}
211
- PROJECT_ID: ${{ vars.ZIBBY_PROJECT_ID }}
212
- ```
213
-
214
- ### 5. Third-Party Integrations
215
-
216
- #### No-Code Platforms (Zapier/Make.com)
217
-
218
- Configure an action to POST to the Zibby API:
219
- - **Trigger**: Google Sheets row added, Slack message, etc.
220
- - **Action**: HTTP POST to `https://api.zibby.app/projects/{id}/workflows/{type}/trigger`
221
- - **Headers**: Add `Authorization: Bearer {your-token}`
222
- - **Body**: JSON with `input` field
223
-
224
- #### AWS Step Functions
225
-
226
- ```json
227
- {
228
- "StartAt": "CheckCode",
229
- "States": {
230
- "CheckCode": {
231
- "Type": "Task",
232
- "Resource": "arn:aws:lambda:...:TriggerZibbyWorkflow",
233
- "Parameters": {
234
- "workflow": "security-scan"
235
- },
236
- "Next": "WaitForCompletion"
237
- },
238
- "WaitForCompletion": {
239
- "Type": "Wait",
240
- "Seconds": 300,
241
- "Next": "CheckResults"
242
- }
243
- }
244
- }
245
- ```
246
-
247
- ## Authentication
248
-
249
- Zibby uses two types of authentication tokens:
250
-
251
- ### Personal Access Tokens (PAT)
252
-
253
- For programmatic access (API, CLI, webhooks, CI/CD):
254
-
255
- ```
256
- Format: zby_pat_xxxxx
257
- Scope: All projects user has access to
258
- ```
259
-
260
- **Create a PAT:**
261
- 1. Go to Settings > API Tokens
262
- 2. Click "Create Token"
263
- 3. Name it (e.g., "Production Webhook")
264
- 4. Optionally set expiration
265
- 5. Copy token (shown only once!)
266
-
267
- **Usage:**
268
-
269
- ```bash
270
- # CLI
271
- export ZIBBY_API_KEY=zby_pat_xxxxx
272
- zibby trigger custom-flow --project <id>
273
-
274
- # API Request
275
- curl -X POST https://api.zibby.app/projects/<id>/workflows/custom-flow/trigger \
276
- -H "Authorization: Bearer zby_pat_xxxxx" \
277
- -d '{"input": {"ticket": "JIRA-123"}}'
278
-
279
- # GitHub Actions
280
- env:
281
- ZIBBY_API_KEY: ${{ secrets.ZIBBY_PAT }}
282
- ```
283
-
284
- **Characteristics:**
285
- - User creates in UI (Settings > API Tokens)
286
- - Long-lived (or custom expiration)
287
- - Can be revoked individually
288
- - Named tokens for tracking
289
- - User's access controls apply
290
-
291
- ### JWT Tokens
292
-
293
- For web UI sessions only (automatic):
294
-
295
- ```
296
- Format: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
297
- Scope: Full user access
298
- Usage: Web UI only (automatic)
299
- ```
300
-
301
- **Characteristics:**
302
- - Short-lived (24 hours)
303
- - Created automatically via OAuth login
304
- - Auto-refreshed by frontend
305
- - Not for API/CLI use
306
-
307
- ## Security Best Practices
308
-
309
- ### 1. Use PAT for All Programmatic Access
310
-
311
- ```bash
312
- # ✅ Correct - Use PAT
313
- export ZIBBY_API_KEY=zby_pat_xxxxx
314
-
315
- # ❌ Wrong - Don't try to extract JWT from browser
316
- ```
317
-
318
- ### 2. Create Separate PATs per Use Case
319
-
320
- In the UI, create multiple tokens:
321
- - "Production Webhooks" (never expires, heavily monitored)
322
- - "CI/CD Pipeline" (expires yearly)
323
- - "Development Testing" (expires monthly)
324
- - "Partner Integration - Acme Corp" (expires quarterly)
325
-
326
- ### 3. Token Rotation
327
-
328
- Best practice: Rotate annually or when compromised
329
-
330
- 1. Create new PAT: "CI/CD Pipeline v2"
331
- 2. Update CI/CD secrets
332
- 3. Test with new token
333
- 4. Revoke old PAT after grace period
334
-
335
- ### 4. Monitor Token Usage
336
-
337
- In UI: Settings > API Tokens
338
- - View last used timestamp
339
- - Track execution count
340
- - Monitor for unusual activity
341
-
342
- ### 5. Webhook Signatures
343
-
344
- Verify webhook authenticity:
345
-
346
- ```javascript
347
- const crypto = require('crypto');
348
- const signature = crypto
349
- .createHmac('sha256', WEBHOOK_SECRET)
350
- .update(JSON.stringify(req.body))
351
- .digest('hex');
352
-
353
- if (signature !== req.headers['x-zibby-signature']) {
354
- return res.status(401).send('Invalid signature');
355
- }
356
- ```
357
-
358
- ### 6. Network Restrictions
359
-
360
- ```yaml
361
- # AWS Security Group
362
- Ingress:
363
- - IpProtocol: tcp
364
- FromPort: 443
365
- ToPort: 443
366
- CidrIp: 52.89.214.238/32
367
- Description: GitHub Actions webhook
368
- ```
369
-
370
- ## Quota & Billing
371
-
372
- ### Tiers
373
-
374
- - **Free Tier**: 100 workflow executions/month
375
- - **Pro Tier**: 1,000 executions/month
376
- - **Enterprise**: Unlimited
377
-
378
- ### Metering
379
-
380
- - Each trigger = 1 execution
381
- - Idempotency: Same key within 24h = no charge
382
- - CloudWatch logs for audit trail
383
-
384
- ### Quota Exceeded Response
385
-
386
- ```json
387
- {
388
- "error": "Quota exceeded",
389
- "statusCode": 429,
390
- "limit": 1000,
391
- "used": 1000,
392
- "resetDate": "2026-05-01T00:00:00Z"
393
- }
394
- ```
395
-
396
- ## Best Practices
397
-
398
- ### 1. Use Idempotency Keys
399
-
400
- Prevent duplicate executions:
401
-
402
- ```bash
403
- zibby trigger custom-flow \
404
- --idempotency-key "daily-scan-2026-04-24"
405
- ```
406
-
407
- Same key within 24 hours = no additional charge, returns existing job ID.
408
-
409
- ### 2. Input Validation
410
-
411
- Validate input in your workflow:
412
-
413
- ```javascript
414
- // In workflow graph.mjs
415
- buildGraph() {
416
- const graph = new WorkflowGraph();
417
-
418
- graph.addNode('validate_input', async (state) => {
419
- const { ticketKey } = state.input;
420
- if (!ticketKey) {
421
- throw new Error('ticketKey required');
422
- }
423
- return { valid: true };
424
- });
425
-
426
- // ...
427
- }
428
- ```
429
-
430
- ### 3. Error Handling & Retries
431
-
432
- Client-side retry logic:
433
-
434
- ```javascript
435
- async function triggerWithRetry(workflow, input, maxRetries = 3) {
436
- for (let i = 0; i < maxRetries; i++) {
437
- try {
438
- const response = await fetch(`${API_URL}/workflows/${workflow}/trigger`, {
439
- method: 'POST',
440
- headers: { 'Authorization': `Bearer ${API_KEY}` },
441
- body: JSON.stringify({ input }),
442
- });
443
-
444
- if (response.status === 429) {
445
- await new Promise(r => setTimeout(r, 60000 * (i + 1)));
446
- continue;
447
- }
448
-
449
- return await response.json();
450
- } catch (err) {
451
- if (i === maxRetries - 1) throw err;
452
- }
453
- }
454
- }
455
- ```
456
-
457
- ## Monitoring
458
-
459
- ### View Logs
460
-
461
- ```bash
462
- # Fetch complete logs from latest execution (one-time)
463
- zibby logs 562e48d7-ef67-4900-96b7-0d7b51a33405
464
-
465
- # Stream logs in real-time (like "heroku logs -t")
466
- zibby logs 562e48d7-ef67-4900-96b7-0d7b51a33405 -t
467
-
468
- # By workflow name
469
- zibby logs --workflow custom-flow --project <id> -t
470
- ```
471
-
472
- **Log Architecture:**
473
-
474
- - **Without `-t`**: Fetches from CloudWatch (permanent storage). Shows complete historical logs from any execution, even old ones.
475
- - **With `-t`**: Streams in real-time via SSE from DynamoDB hot cache (24h TTL). Only works for active/recent executions.
476
-
477
- ```
478
- CloudWatch Logs (permanent) ──────────> CLI (without -t)
479
-
480
- └──> Kinesis ──> Lambda ──> DynamoDB (24h TTL) ──> SSE ──> CLI (with -t)
481
- ```
482
-
483
- ### CloudWatch Dashboards
484
-
485
- Monitor:
486
- - Execution count by workflow
487
- - Success/failure rates
488
- - P50/P95/P99 latencies
489
- - Quota utilization
490
-
491
- ### Alerts
492
-
493
- ```yaml
494
- # EventBridge Rule → SNS → Email/Slack
495
- Pattern:
496
- source: [zibby.workflows]
497
- detail-type: [WorkflowFailed]
498
- detail:
499
- workflow: [security-scan]
500
- ```
501
-
502
- ## Common Patterns
503
-
504
- ### Pattern 1: Daily Report Generation
505
-
506
- ```bash
507
- # Cron job that triggers workflow by UUID and streams logs
508
- WORKFLOW_UUID="562e48d7-ef67-4900-96b7-0d7b51a33405"
509
-
510
- 0 9 * * * zibby trigger $WORKFLOW_UUID \
511
- --input '{"date":"'$(date +%Y-%m-%d)'"}' \
512
- --idempotency-key "daily-report-$(date +%Y-%m-%d)" \
513
- && sleep 5 \
514
- && zibby logs $WORKFLOW_UUID | mail -s "Daily Report" team@company.com
515
- ```
516
-
517
- ### Pattern 2: Event-Driven Testing
518
-
519
- ```javascript
520
- // GitHub webhook → test generation → PR comment
521
- app.post('/webhook/github', async (req, res) => {
522
- const { pull_request } = req.body;
523
-
524
- const { jobId } = await triggerWorkflow('test-gen', {
525
- prNumber: pull_request.number,
526
- repo: pull_request.base.repo.full_name,
527
- });
528
-
529
- await postComment(pull_request.number, `Generating tests... [Job ${jobId}]`);
530
- res.sendStatus(200);
531
- });
532
- ```
533
-
534
- ### Pattern 3: Conditional Execution
535
-
536
- ```javascript
537
- // Only trigger if conditions are met
538
- const shouldTrigger = await checkConditions();
539
- if (shouldTrigger) {
540
- await fetch('https://api.zibby.app/projects/.../workflows/deploy/trigger', {
541
- method: 'POST',
542
- headers: { 'Authorization': `Bearer ${PAT}` },
543
- body: JSON.stringify({ input: { environment: 'production' } }),
544
- });
545
- }
546
- ```
547
-
548
- ## Next Steps
549
-
550
- - [Custom Workflows](custom-workflows.md) - Build your own workflows
551
- - [CLI Reference](cli-reference.md) - Full command documentation
552
- - [Integrations](integrations/github.md) - Connect with GitHub, Jira, etc.
@@ -1,119 +0,0 @@
1
- # Workflow Artifact Layout Evaluation
2
-
3
- ## Context
4
-
5
- Current workflow authoring is centered on hidden project files under `.zibby/`:
6
-
7
- - `.zibby/graph.mjs`
8
- - `.zibby/nodes/*`
9
- - `.zibby/chat.mjs`
10
- - `.zibby/result-handler.mjs`
11
- - runtime output in `.zibby/output/sessions/*`
12
-
13
- The product direction is to support live workflow creation via `zibby chat` and local/remote arbitrary workflow execution, while keeping user-authored workflow code commit-friendly.
14
-
15
- ## Options
16
-
17
- ### Option A: Keep everything in hidden `.zibby/`
18
-
19
- Pros:
20
- - No migration needed.
21
- - Fully compatible with current Studio/CLI assumptions.
22
-
23
- Cons:
24
- - User-authored workflow source remains hidden and less discoverable.
25
- - Weaker commit ergonomics for user-owned workflow code.
26
-
27
- ### Option B: Move everything to visible `zibby/`
28
-
29
- Pros:
30
- - Clear, commit-friendly source-of-truth for workflow code.
31
- - Better UX for editing workflow artifacts directly.
32
-
33
- Cons:
34
- - High migration cost.
35
- - Breaks many path assumptions in Studio bridge, Electron, docs, and integrations.
36
- - Requires dual-path compatibility window to avoid immediate breakage.
37
-
38
- ### Option C: Hybrid (recommended)
39
-
40
- Store user-authored workflow source in visible `zibby/`, keep runtime/output in hidden `.zibby/output`.
41
-
42
- Pros:
43
- - Commit-friendly source artifacts.
44
- - Preserves hidden runtime/cache/output behavior.
45
- - Smaller migration blast radius than full move.
46
-
47
- Cons:
48
- - Requires resolver precedence logic and migration tooling.
49
- - Transitional complexity (legacy `.zibby` source + new `zibby` source).
50
-
51
- ### Option D: Hybrid + configurable path in `.zibby.config.mjs`
52
-
53
- Same as Option C, but adds explicit config override for source workflow path.
54
-
55
- Pros:
56
- - Flexible for monorepos and custom project conventions.
57
- - Future-proofs enterprise setups.
58
-
59
- Cons:
60
- - Slightly larger surface area and testing burden.
61
-
62
- ## Impact Map (Current Coupling)
63
-
64
- Key areas that currently assume hidden-source and/or hidden-output conventions:
65
-
66
- - `studio/electron/main.js`
67
- - project-root detection uses `.zibby/graph.mjs`
68
- - default sessions root uses `.zibby/output/sessions`
69
- - `studio/vite.config.js`
70
- - bridge fallbacks for session/output discovery
71
- - `studio/src/adapters/platform.js`
72
- - APIs and comments assume `.zibby/output/sessions`
73
- - `docsite/docs/*`
74
- - user docs describe hidden `.zibby` workflow/source model
75
-
76
- Secondary impacts:
77
-
78
- - integrations under `integrations/*` referencing current command/path patterns
79
- - helper comments and UI command snippets across Studio/frontend
80
-
81
- ## Recommended Migration Strategy
82
-
83
- ### Phase 1 (compatibility, no breakage)
84
-
85
- - Keep `.zibby/` source loading as primary behavior.
86
- - Add support for visible `zibby/` source layout in resolvers.
87
- - Resolver precedence:
88
- 1. explicit config path (if set)
89
- 2. `zibby/` source
90
- 3. legacy `.zibby/` source
91
- - Keep runtime output in `.zibby/output`.
92
-
93
- ### Phase 2 (opt-in default shift)
94
-
95
- - New projects scaffold workflow source under `zibby/`.
96
- - Existing projects continue to work with `.zibby/`.
97
- - Add migration helper command to copy/move source artifacts safely.
98
-
99
- ### Phase 3 (deprecation)
100
-
101
- - Emit warnings for legacy hidden-source layouts.
102
- - After a compatibility window, finalize the preferred source layout.
103
- - Continue hidden runtime/output unless there is strong product need to change it.
104
-
105
- ## Suggested Source/Runtime Split
106
-
107
- - User-authored source (commit-friendly):
108
- - `zibby/graph.mjs`
109
- - `zibby/nodes/*`
110
- - `zibby/chat.mjs`
111
- - `zibby/result-handler.mjs`
112
- - Runtime/cache/output (hidden):
113
- - `.zibby/output/*`
114
- - `.zibby/scratch/*`
115
- - `.zibby/memory/*`
116
-
117
- ## Why this recommendation
118
-
119
- Hybrid with configuration gives the best balance: user-visible source for authoring and version control, while preserving stable hidden runtime/output semantics already used by Studio, CLI, and integrations.