@halcyonlabs/app 0.47.0-halcyon.143 → 0.47.0-halcyon.147

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 (118) hide show
  1. package/dist/index.d.ts +35 -35
  2. package/dist/index.js +1 -1
  3. package/host-daemon/dist/bb +1 -1
  4. package/host-daemon/dist/bb-chunks/{chunk-IXX2QKBH.js → chunk-ER46DNTR.js} +1 -1
  5. package/host-daemon/dist/bb-chunks/{guide-KGY72F4I.js → guide-2EVMHWEL.js} +1 -1
  6. package/host-daemon/dist/bb-chunks/{plugin-YWVWWQG6.js → plugin-BD2V5QKV.js} +1 -1
  7. package/host-daemon/dist/bb-chunks/{thread-T2LZF2OG.js → thread-VKVOFAYM.js} +12 -12
  8. package/host-daemon/dist/daemon-bundle.mjs +1 -1
  9. package/package.json +1 -1
  10. package/server/dist/builtin-plugins/account-pool/dist/app.meta.json +2 -2
  11. package/server/dist/builtin-plugins/account-pool/dist/server.meta.json +2 -2
  12. package/server/dist/builtin-plugins/agent-annotations/dist/app.meta.json +2 -2
  13. package/server/dist/builtin-plugins/agent-annotations/dist/server.meta.json +2 -2
  14. package/server/dist/builtin-plugins/ask-user-question/dist/app.meta.json +2 -2
  15. package/server/dist/builtin-plugins/ask-user-question/dist/server.meta.json +2 -2
  16. package/server/dist/builtin-plugins/automations/dist/app.meta.json +2 -2
  17. package/server/dist/builtin-plugins/automations/dist/server.meta.json +2 -2
  18. package/server/dist/builtin-plugins/bb-account/dist/app.meta.json +2 -2
  19. package/server/dist/builtin-plugins/bb-account/dist/server.meta.json +2 -2
  20. package/server/dist/builtin-plugins/bb-ai/dist/server.meta.json +2 -2
  21. package/server/dist/builtin-plugins/bb-guide/dist/app.meta.json +2 -2
  22. package/server/dist/builtin-plugins/bb-guide/dist/server.meta.json +2 -2
  23. package/server/dist/builtin-plugins/browser-automation/dist/app.meta.json +2 -2
  24. package/server/dist/builtin-plugins/browser-automation/dist/host.meta.json +2 -2
  25. package/server/dist/builtin-plugins/browser-automation/dist/server.meta.json +2 -2
  26. package/server/dist/builtin-plugins/composer/dist/app.meta.json +2 -2
  27. package/server/dist/builtin-plugins/composer/dist/server.meta.json +2 -2
  28. package/server/dist/builtin-plugins/concurrency-limit/dist/app.meta.json +2 -2
  29. package/server/dist/builtin-plugins/concurrency-limit/dist/host.meta.json +2 -2
  30. package/server/dist/builtin-plugins/concurrency-limit/dist/server.meta.json +2 -2
  31. package/server/dist/builtin-plugins/connect/dist/app.meta.json +2 -2
  32. package/server/dist/builtin-plugins/connect/dist/server.meta.json +2 -2
  33. package/server/dist/builtin-plugins/connect-next/dist/app.meta.json +2 -2
  34. package/server/dist/builtin-plugins/connect-next/dist/server.meta.json +2 -2
  35. package/server/dist/builtin-plugins/custom-instructions/dist/server.meta.json +2 -2
  36. package/server/dist/builtin-plugins/docs/dist/app.meta.json +2 -2
  37. package/server/dist/builtin-plugins/docs/dist/server.meta.json +2 -2
  38. package/server/dist/builtin-plugins/drafts/dist/app.meta.json +2 -2
  39. package/server/dist/builtin-plugins/drafts/dist/server.meta.json +2 -2
  40. package/server/dist/builtin-plugins/environment-git-worktree/dist/app.meta.json +2 -2
  41. package/server/dist/builtin-plugins/environment-git-worktree/dist/host.meta.json +2 -2
  42. package/server/dist/builtin-plugins/environment-git-worktree/dist/server.meta.json +2 -2
  43. package/server/dist/builtin-plugins/environment-modal-sandbox/dist/app.meta.json +2 -2
  44. package/server/dist/builtin-plugins/environment-modal-sandbox/dist/server.meta.json +2 -2
  45. package/server/dist/builtin-plugins/environment-personal-workspace/dist/host.meta.json +2 -2
  46. package/server/dist/builtin-plugins/environment-personal-workspace/dist/server.meta.json +2 -2
  47. package/server/dist/builtin-plugins/environment-project-checkout/dist/app.meta.json +2 -2
  48. package/server/dist/builtin-plugins/environment-project-checkout/dist/host.meta.json +2 -2
  49. package/server/dist/builtin-plugins/environment-project-checkout/dist/server.meta.json +2 -2
  50. package/server/dist/builtin-plugins/github/dist/app.meta.json +2 -2
  51. package/server/dist/builtin-plugins/github/dist/server.meta.json +2 -2
  52. package/server/dist/builtin-plugins/github-pr-status/dist/app.meta.json +2 -2
  53. package/server/dist/builtin-plugins/github-pr-status/dist/host.meta.json +2 -2
  54. package/server/dist/builtin-plugins/github-pr-status/dist/server.meta.json +2 -2
  55. package/server/dist/builtin-plugins/inline-vis/dist/app.meta.json +2 -2
  56. package/server/dist/builtin-plugins/inline-vis/dist/server.meta.json +2 -2
  57. package/server/dist/builtin-plugins/keep-awake/dist/app.meta.json +2 -2
  58. package/server/dist/builtin-plugins/keep-awake/dist/host.meta.json +2 -2
  59. package/server/dist/builtin-plugins/keep-awake/dist/server.meta.json +2 -2
  60. package/server/dist/builtin-plugins/library/dist/app.meta.json +2 -2
  61. package/server/dist/builtin-plugins/library/dist/server.meta.json +2 -2
  62. package/server/dist/builtin-plugins/mcp/dist/server.meta.json +2 -2
  63. package/server/dist/builtin-plugins/memory/dist/app.meta.json +2 -2
  64. package/server/dist/builtin-plugins/memory/dist/server.meta.json +2 -2
  65. package/server/dist/builtin-plugins/monaco-editor/dist/app.meta.json +2 -2
  66. package/server/dist/builtin-plugins/monaco-editor/dist/server.meta.json +2 -2
  67. package/server/dist/builtin-plugins/navigation/dist/app.meta.json +2 -2
  68. package/server/dist/builtin-plugins/navigation/dist/server.meta.json +2 -2
  69. package/server/dist/builtin-plugins/notify-feed/dist/app.meta.json +2 -2
  70. package/server/dist/builtin-plugins/notify-feed/dist/server.meta.json +2 -2
  71. package/server/dist/builtin-plugins/orbit/dist/app.meta.json +2 -2
  72. package/server/dist/builtin-plugins/orbit/dist/assets/orbit/revision +1 -1
  73. package/server/dist/builtin-plugins/orbit/dist/host.meta.json +2 -2
  74. package/server/dist/builtin-plugins/orbit/dist/server.js +245 -244
  75. package/server/dist/builtin-plugins/orbit/dist/server.meta.json +2 -2
  76. package/server/dist/builtin-plugins/orbit/package.json +1 -1
  77. package/server/dist/builtin-plugins/pdf-preview/dist/app.meta.json +2 -2
  78. package/server/dist/builtin-plugins/pdf-preview/dist/server.meta.json +2 -2
  79. package/server/dist/builtin-plugins/plugin-api-docs/dist/app.meta.json +2 -2
  80. package/server/dist/builtin-plugins/plugin-api-docs/dist/server.meta.json +2 -2
  81. package/server/dist/builtin-plugins/plugin-api-tester/dist/app.meta.json +2 -2
  82. package/server/dist/builtin-plugins/plugin-api-tester/dist/server.meta.json +2 -2
  83. package/server/dist/builtin-plugins/prompt-library/dist/app.meta.json +2 -2
  84. package/server/dist/builtin-plugins/prompt-library/dist/server.meta.json +2 -2
  85. package/server/dist/builtin-plugins/provider-acp/dist/app.meta.json +2 -2
  86. package/server/dist/builtin-plugins/provider-acp/dist/host.meta.json +2 -2
  87. package/server/dist/builtin-plugins/provider-acp/dist/server.meta.json +2 -2
  88. package/server/dist/builtin-plugins/provider-claude-code/dist/host.meta.json +2 -2
  89. package/server/dist/builtin-plugins/provider-claude-code/dist/server.meta.json +2 -2
  90. package/server/dist/builtin-plugins/provider-codex/dist/app.meta.json +2 -2
  91. package/server/dist/builtin-plugins/provider-codex/dist/host.meta.json +2 -2
  92. package/server/dist/builtin-plugins/provider-codex/dist/server.meta.json +2 -2
  93. package/server/dist/builtin-plugins/provider-pi/dist/app.meta.json +2 -2
  94. package/server/dist/builtin-plugins/provider-pi/dist/host.meta.json +2 -2
  95. package/server/dist/builtin-plugins/provider-pi/dist/server.meta.json +2 -2
  96. package/server/dist/builtin-plugins/provider-retry/dist/server.meta.json +2 -2
  97. package/server/dist/builtin-plugins/provider-usage/dist/app.meta.json +2 -2
  98. package/server/dist/builtin-plugins/provider-usage/dist/server.meta.json +2 -2
  99. package/server/dist/builtin-plugins/push-notifications/dist/app.meta.json +2 -2
  100. package/server/dist/builtin-plugins/push-notifications/dist/server.meta.json +2 -2
  101. package/server/dist/builtin-plugins/scheduled-send/dist/app.meta.json +2 -2
  102. package/server/dist/builtin-plugins/scheduled-send/dist/server.meta.json +2 -2
  103. package/server/dist/builtin-plugins/secrets/dist/app.meta.json +2 -2
  104. package/server/dist/builtin-plugins/secrets/dist/server.meta.json +2 -2
  105. package/server/dist/builtin-plugins/side-chat/dist/app.meta.json +2 -2
  106. package/server/dist/builtin-plugins/side-chat/dist/server.meta.json +2 -2
  107. package/server/dist/builtin-plugins/storage-retention/dist/app.meta.json +2 -2
  108. package/server/dist/builtin-plugins/storage-retention/dist/host.meta.json +2 -2
  109. package/server/dist/builtin-plugins/storage-retention/dist/server.meta.json +2 -2
  110. package/server/dist/builtin-plugins/tasks/dist/app.meta.json +2 -2
  111. package/server/dist/builtin-plugins/tasks/dist/server.meta.json +2 -2
  112. package/server/dist/builtin-plugins/theme-preview/dist/app.meta.json +2 -2
  113. package/server/dist/builtin-plugins/theme-preview/dist/server.meta.json +2 -2
  114. package/server/dist/builtin-plugins/thread-list/dist/app.meta.json +2 -2
  115. package/server/dist/builtin-plugins/thread-list/dist/server.meta.json +2 -2
  116. package/server/dist/builtin-plugins/workflows/dist/app.meta.json +2 -2
  117. package/server/dist/builtin-plugins/workflows/dist/server.meta.json +2 -2
  118. package/server/dist/start-server.js +9 -5
package/dist/index.d.ts CHANGED
@@ -487,8 +487,8 @@ declare const environmentSchema: z$1.ZodObject<{
487
487
  retireAt: z$1.ZodNullable<z$1.ZodNumber>;
488
488
  teardown: z$1.ZodNullable<z$1.ZodObject<{
489
489
  status: z$1.ZodEnum<{
490
- failed: "failed";
491
490
  running: "running";
491
+ failed: "failed";
492
492
  removed: "removed";
493
493
  }>;
494
494
  attempt: z$1.ZodNumber;
@@ -583,8 +583,8 @@ declare const hostSchema: z$1.ZodObject<{
583
583
  pendingLog: z$1.ZodString;
584
584
  teardown: z$1.ZodNullable<z$1.ZodObject<{
585
585
  status: z$1.ZodEnum<{
586
- failed: "failed";
587
586
  running: "running";
587
+ failed: "failed";
588
588
  removed: "removed";
589
589
  }>;
590
590
  attempt: z$1.ZodNumber;
@@ -685,8 +685,8 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
685
685
  providerThreadId: z$1.ZodString;
686
686
  objective: z$1.ZodString;
687
687
  status: z$1.ZodEnum<{
688
- active: "active";
689
688
  paused: "paused";
689
+ active: "active";
690
690
  budgetLimited: "budgetLimited";
691
691
  complete: "complete";
692
692
  }>;
@@ -1257,9 +1257,9 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
1257
1257
  step: z$1.ZodString;
1258
1258
  status: z$1.ZodOptional<z$1.ZodEnum<{
1259
1259
  pending: "pending";
1260
- active: "active";
1261
1260
  completed: "completed";
1262
1261
  failed: "failed";
1262
+ active: "active";
1263
1263
  }>>;
1264
1264
  }, z$1.core.$strip>>;
1265
1265
  explanation: z$1.ZodOptional<z$1.ZodString>;
@@ -1338,10 +1338,10 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
1338
1338
  }>;
1339
1339
  taskStatus: z$1.ZodEnum<{
1340
1340
  pending: "pending";
1341
+ running: "running";
1342
+ paused: "paused";
1341
1343
  completed: "completed";
1342
1344
  failed: "failed";
1343
- paused: "paused";
1344
- running: "running";
1345
1345
  killed: "killed";
1346
1346
  stopped: "stopped";
1347
1347
  }>;
@@ -1358,8 +1358,8 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
1358
1358
  index: z$1.ZodNumber;
1359
1359
  label: z$1.ZodString;
1360
1360
  state: z$1.ZodEnum<{
1361
- failed: "failed";
1362
1361
  running: "running";
1362
+ failed: "failed";
1363
1363
  queued: "queued";
1364
1364
  done: "done";
1365
1365
  skipped: "skipped";
@@ -2029,9 +2029,9 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
2029
2029
  step: z$1.ZodString;
2030
2030
  status: z$1.ZodOptional<z$1.ZodEnum<{
2031
2031
  pending: "pending";
2032
- active: "active";
2033
2032
  completed: "completed";
2034
2033
  failed: "failed";
2034
+ active: "active";
2035
2035
  }>>;
2036
2036
  }, z$1.core.$strip>>;
2037
2037
  explanation: z$1.ZodOptional<z$1.ZodString>;
@@ -2110,10 +2110,10 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
2110
2110
  }>;
2111
2111
  taskStatus: z$1.ZodEnum<{
2112
2112
  pending: "pending";
2113
+ running: "running";
2114
+ paused: "paused";
2113
2115
  completed: "completed";
2114
2116
  failed: "failed";
2115
- paused: "paused";
2116
- running: "running";
2117
2117
  killed: "killed";
2118
2118
  stopped: "stopped";
2119
2119
  }>;
@@ -2130,8 +2130,8 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
2130
2130
  index: z$1.ZodNumber;
2131
2131
  label: z$1.ZodString;
2132
2132
  state: z$1.ZodEnum<{
2133
- failed: "failed";
2134
2133
  running: "running";
2134
+ failed: "failed";
2135
2135
  queued: "queued";
2136
2136
  done: "done";
2137
2137
  skipped: "skipped";
@@ -2342,10 +2342,10 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
2342
2342
  }>;
2343
2343
  taskStatus: z$1.ZodEnum<{
2344
2344
  pending: "pending";
2345
+ running: "running";
2346
+ paused: "paused";
2345
2347
  completed: "completed";
2346
2348
  failed: "failed";
2347
- paused: "paused";
2348
- running: "running";
2349
2349
  killed: "killed";
2350
2350
  stopped: "stopped";
2351
2351
  }>;
@@ -2362,8 +2362,8 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
2362
2362
  index: z$1.ZodNumber;
2363
2363
  label: z$1.ZodString;
2364
2364
  state: z$1.ZodEnum<{
2365
- failed: "failed";
2366
2365
  running: "running";
2366
+ failed: "failed";
2367
2367
  queued: "queued";
2368
2368
  done: "done";
2369
2369
  skipped: "skipped";
@@ -2441,10 +2441,10 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
2441
2441
  }>;
2442
2442
  taskStatus: z$1.ZodEnum<{
2443
2443
  pending: "pending";
2444
+ running: "running";
2445
+ paused: "paused";
2444
2446
  completed: "completed";
2445
2447
  failed: "failed";
2446
- paused: "paused";
2447
- running: "running";
2448
2448
  killed: "killed";
2449
2449
  stopped: "stopped";
2450
2450
  }>;
@@ -2461,8 +2461,8 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
2461
2461
  index: z$1.ZodNumber;
2462
2462
  label: z$1.ZodString;
2463
2463
  state: z$1.ZodEnum<{
2464
- failed: "failed";
2465
2464
  running: "running";
2465
+ failed: "failed";
2466
2466
  queued: "queued";
2467
2467
  done: "done";
2468
2468
  skipped: "skipped";
@@ -2657,9 +2657,9 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
2657
2657
  step: z$1.ZodString;
2658
2658
  status: z$1.ZodOptional<z$1.ZodEnum<{
2659
2659
  pending: "pending";
2660
- active: "active";
2661
2660
  completed: "completed";
2662
2661
  failed: "failed";
2662
+ active: "active";
2663
2663
  }>>;
2664
2664
  }, z$1.core.$strip>>;
2665
2665
  explanation: z$1.ZodOptional<z$1.ZodString>;
@@ -2668,8 +2668,8 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
2668
2668
  threadId: z$1.ZodString;
2669
2669
  providerThreadId: z$1.ZodString;
2670
2670
  state: z$1.ZodEnum<{
2671
- idle: "idle";
2672
2671
  running: "running";
2672
+ idle: "idle";
2673
2673
  }>;
2674
2674
  }, z$1.core.$strip>, z$1.ZodObject<{
2675
2675
  type: z$1.ZodLiteral<"turn/diff/updated">;
@@ -3531,9 +3531,9 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
3531
3531
  threadId: z$1.ZodString;
3532
3532
  provisioningId: z$1.ZodString;
3533
3533
  status: z$1.ZodEnum<{
3534
- active: "active";
3535
3534
  completed: "completed";
3536
3535
  failed: "failed";
3536
+ active: "active";
3537
3537
  cancelled: "cancelled";
3538
3538
  }>;
3539
3539
  environmentId: z$1.ZodNullable<z$1.ZodString>;
@@ -7456,8 +7456,8 @@ declare const hostDaemonCommandRegistry: {
7456
7456
  skillFilePath: z$1.ZodString;
7457
7457
  }, z$1.core.$strict>], "kind">>;
7458
7458
  instructionMode: z$1.ZodEnum<{
7459
- replace: "replace";
7460
7459
  append: "append";
7460
+ replace: "replace";
7461
7461
  }>;
7462
7462
  type: z$1.ZodLiteral<"thread.rewind.prepare">;
7463
7463
  leaseId: z$1.ZodString;
@@ -7605,8 +7605,8 @@ declare const hostDaemonCommandRegistry: {
7605
7605
  skillFilePath: z$1.ZodString;
7606
7606
  }, z$1.core.$strict>], "kind">>;
7607
7607
  instructionMode: z$1.ZodEnum<{
7608
- replace: "replace";
7609
7608
  append: "append";
7609
+ replace: "replace";
7610
7610
  }>;
7611
7611
  type: z$1.ZodLiteral<"thread.start">;
7612
7612
  requestId: z$1.ZodString;
@@ -7656,9 +7656,9 @@ declare const hostDaemonCommandRegistry: {
7656
7656
  skill: "skill";
7657
7657
  }>;
7658
7658
  origin: z$1.ZodEnum<{
7659
- builtin: "builtin";
7660
7659
  user: "user";
7661
7660
  project: "project";
7661
+ builtin: "builtin";
7662
7662
  }>;
7663
7663
  label: z$1.ZodString;
7664
7664
  argumentHint: z$1.ZodNullable<z$1.ZodString>;
@@ -7746,9 +7746,9 @@ declare const hostDaemonCommandRegistry: {
7746
7746
  skill: "skill";
7747
7747
  }>;
7748
7748
  origin: z$1.ZodEnum<{
7749
- builtin: "builtin";
7750
7749
  user: "user";
7751
7750
  project: "project";
7751
+ builtin: "builtin";
7752
7752
  }>;
7753
7753
  label: z$1.ZodString;
7754
7754
  argumentHint: z$1.ZodNullable<z$1.ZodString>;
@@ -7849,9 +7849,9 @@ declare const hostDaemonCommandRegistry: {
7849
7849
  skill: "skill";
7850
7850
  }>;
7851
7851
  origin: z$1.ZodEnum<{
7852
- builtin: "builtin";
7853
7852
  user: "user";
7854
7853
  project: "project";
7854
+ builtin: "builtin";
7855
7855
  }>;
7856
7856
  label: z$1.ZodString;
7857
7857
  argumentHint: z$1.ZodNullable<z$1.ZodString>;
@@ -7939,9 +7939,9 @@ declare const hostDaemonCommandRegistry: {
7939
7939
  skill: "skill";
7940
7940
  }>;
7941
7941
  origin: z$1.ZodEnum<{
7942
- builtin: "builtin";
7943
7942
  user: "user";
7944
7943
  project: "project";
7944
+ builtin: "builtin";
7945
7945
  }>;
7946
7946
  label: z$1.ZodString;
7947
7947
  argumentHint: z$1.ZodNullable<z$1.ZodString>;
@@ -8072,8 +8072,8 @@ declare const hostDaemonCommandRegistry: {
8072
8072
  envPassthrough: z$1.ZodArray<z$1.ZodString>;
8073
8073
  }, z$1.core.$strict>;
8074
8074
  instructionMode: z$1.ZodEnum<{
8075
- replace: "replace";
8076
8075
  append: "append";
8076
+ replace: "replace";
8077
8077
  }>;
8078
8078
  instructions: z$1.ZodString;
8079
8079
  dynamicTools: z$1.ZodArray<z$1.ZodObject<{
@@ -8288,8 +8288,8 @@ declare const hostDaemonCommandRegistry: {
8288
8288
  envPassthrough: z$1.ZodArray<z$1.ZodString>;
8289
8289
  }, z$1.core.$strict>;
8290
8290
  instructionMode: z$1.ZodEnum<{
8291
- replace: "replace";
8292
8291
  append: "append";
8292
+ replace: "replace";
8293
8293
  }>;
8294
8294
  instructions: z$1.ZodString;
8295
8295
  dynamicTools: z$1.ZodArray<z$1.ZodObject<{
@@ -9187,13 +9187,13 @@ declare const hostDaemonCommandRegistry: {
9187
9187
  modifiedAtMs: z$1.ZodOptional<z$1.ZodNumber>;
9188
9188
  sha256: z$1.ZodString;
9189
9189
  }, z$1.core.$strip>, z$1.ZodObject<{
9190
- path: z$1.ZodString;
9191
9190
  contentEncoding: z$1.ZodEnum<{
9192
9191
  base64: "base64";
9193
9192
  utf8: "utf8";
9194
9193
  }>;
9195
9194
  sha256: z$1.ZodString;
9196
9195
  sizeBytes: z$1.ZodNumber;
9196
+ path: z$1.ZodString;
9197
9197
  mimeType: z$1.ZodOptional<z$1.ZodString>;
9198
9198
  modifiedAtMs: z$1.ZodOptional<z$1.ZodNumber>;
9199
9199
  notModified: z$1.ZodLiteral<true>;
@@ -9510,9 +9510,9 @@ declare const hostDaemonCommandRegistry: {
9510
9510
  executablePath: z$1.ZodNullable<z$1.ZodString>;
9511
9511
  installed: z$1.ZodBoolean;
9512
9512
  installSource: z$1.ZodEnum<{
9513
+ external: "external";
9513
9514
  notInstalled: "notInstalled";
9514
9515
  npmGlobal: "npmGlobal";
9515
- external: "external";
9516
9516
  }>;
9517
9517
  currentVersion: z$1.ZodNullable<z$1.ZodString>;
9518
9518
  latestVersion: z$1.ZodNullable<z$1.ZodString>;
@@ -9521,8 +9521,8 @@ declare const hostDaemonCommandRegistry: {
9521
9521
  npmGlobalPackageVersion: z$1.ZodNullable<z$1.ZodString>;
9522
9522
  installAction: z$1.ZodNullable<z$1.ZodObject<{
9523
9523
  kind: z$1.ZodEnum<{
9524
- install: "install";
9525
9524
  update: "update";
9525
+ install: "install";
9526
9526
  }>;
9527
9527
  label: z$1.ZodEnum<{
9528
9528
  Install: "Install";
@@ -9537,8 +9537,8 @@ declare const hostDaemonCommandRegistry: {
9537
9537
  type: z$1.ZodLiteral<"provider.installation.run">;
9538
9538
  providerId: z$1.ZodString;
9539
9539
  action: z$1.ZodEnum<{
9540
- install: "install";
9541
9540
  update: "update";
9541
+ install: "install";
9542
9542
  }>;
9543
9543
  bridgeLaunch: z$1.ZodObject<{
9544
9544
  pluginId: z$1.ZodString;
@@ -10061,9 +10061,9 @@ declare const providerCliStatusResponseSchema: z$1.ZodRecord<z$1.ZodString, z$1.
10061
10061
  executablePath: z$1.ZodNullable<z$1.ZodString>;
10062
10062
  installed: z$1.ZodBoolean;
10063
10063
  installSource: z$1.ZodEnum<{
10064
+ external: "external";
10064
10065
  notInstalled: "notInstalled";
10065
10066
  npmGlobal: "npmGlobal";
10066
- external: "external";
10067
10067
  }>;
10068
10068
  currentVersion: z$1.ZodNullable<z$1.ZodString>;
10069
10069
  latestVersion: z$1.ZodNullable<z$1.ZodString>;
@@ -10072,8 +10072,8 @@ declare const providerCliStatusResponseSchema: z$1.ZodRecord<z$1.ZodString, z$1.
10072
10072
  npmGlobalPackageVersion: z$1.ZodNullable<z$1.ZodString>;
10073
10073
  installAction: z$1.ZodNullable<z$1.ZodObject<{
10074
10074
  kind: z$1.ZodEnum<{
10075
- install: "install";
10076
10075
  update: "update";
10076
+ install: "install";
10077
10077
  }>;
10078
10078
  label: z$1.ZodEnum<{
10079
10079
  Install: "Install";
@@ -10088,8 +10088,8 @@ type ProviderCliStatusResponse = z$1.infer<typeof providerCliStatusResponseSchem
10088
10088
  declare const providerCliInstallRequestSchema: z$1.ZodObject<{
10089
10089
  provider: z$1.ZodString;
10090
10090
  actionKind: z$1.ZodEnum<{
10091
- install: "install";
10092
10091
  update: "update";
10092
+ install: "install";
10093
10093
  }>;
10094
10094
  }, z$1.core.$strip>;
10095
10095
  type ProviderCliInstallRequest = z$1.infer<typeof providerCliInstallRequestSchema>;
package/dist/index.js CHANGED
@@ -16088,7 +16088,7 @@ var PLUGIN_SDK_VERSION, PLUGIN_SDK_MAJOR;
16088
16088
  var init_plugin_sdk_version = __esm({
16089
16089
  "../domain/src/plugin-sdk-version.ts"() {
16090
16090
  "use strict";
16091
- PLUGIN_SDK_VERSION = "0.6.78";
16091
+ PLUGIN_SDK_VERSION = "0.6.79";
16092
16092
  PLUGIN_SDK_MAJOR = Number(PLUGIN_SDK_VERSION.split(".", 1)[0]);
16093
16093
  }
16094
16094
  });
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module";import { dirname as __pathDirname } from "node:path";import { fileURLToPath as __fileURLToPath } from "node:url";const require = __createRequire(import.meta.url);const __filename = __fileURLToPath(import.meta.url);const __dirname = __pathDirname(__filename);
3
- import{a as g,b as v,c as C}from"./bb-chunks/chunk-IXX2QKBH.js";import{a as d,b as p,d as u}from"./bb-chunks/chunk-NCQMSH7M.js";import"./bb-chunks/chunk-5PWLIQO6.js";import{spawnSync as _}from"node:child_process";import{realpathSync as R}from"node:fs";import{resolve as S,win32 as B}from"node:path";var f="BB_CLI_REEXEC";function I(e){return e.platform==="win32"&&B.extname(e.target)===""?{command:e.nodePath,args:[e.target,...e.argv]}:{command:e.target,args:e.argv}}function x(e){try{return R(S(e))}catch{return null}}function b(e={}){let n=e.env??process.env;if(n[f]==="1")return;let r=n.BB_CLI?.trim();if(!r)return;let t=e.currentExecutablePath??process.argv[1];if(!t)return;let o=x(r),a=x(t);if(o===null||a===null||o===a)return;let i=e.argv??process.argv.slice(2),c={...n,[f]:"1"};if(e.reexec){e.reexec({target:o,argv:i,env:c});return}let l=I({argv:i,nodePath:process.execPath,platform:process.platform,target:o}),s=_(l.command,l.args,{env:c,stdio:"inherit"});if(s.error){process.stderr.write(`bb: failed to re-exec BB_CLI=${o}: ${s.error.message}
3
+ import{a as g,b as v,c as C}from"./bb-chunks/chunk-ER46DNTR.js";import{a as d,b as p,d as u}from"./bb-chunks/chunk-NCQMSH7M.js";import"./bb-chunks/chunk-5PWLIQO6.js";import{spawnSync as _}from"node:child_process";import{realpathSync as R}from"node:fs";import{resolve as S,win32 as B}from"node:path";var f="BB_CLI_REEXEC";function I(e){return e.platform==="win32"&&B.extname(e.target)===""?{command:e.nodePath,args:[e.target,...e.argv]}:{command:e.target,args:e.argv}}function x(e){try{return R(S(e))}catch{return null}}function b(e={}){let n=e.env??process.env;if(n[f]==="1")return;let r=n.BB_CLI?.trim();if(!r)return;let t=e.currentExecutablePath??process.argv[1];if(!t)return;let o=x(r),a=x(t);if(o===null||a===null||o===a)return;let i=e.argv??process.argv.slice(2),c={...n,[f]:"1"};if(e.reexec){e.reexec({target:o,argv:i,env:c});return}let l=I({argv:i,nodePath:process.execPath,platform:process.platform,target:o}),s=_(l.command,l.args,{env:c,stdio:"inherit"});if(s.error){process.stderr.write(`bb: failed to re-exec BB_CLI=${o}: ${s.error.message}
4
4
  `),process.exitCode=1;return}process.exit(s.status===null?1:s.status)}process.env.FORCE_COLOR!==void 0&&delete process.env.NO_COLOR;b();var m=new p;m.name("bb").description("BB CLI - manage your AI coding agents").enablePositionalOptions().exitOverride().showSuggestionAfterError(!1).version(u());var O=new Set([...g.map(e=>e.name),"help"]);function A(e){let n,r=()=>n??=e.createCliRuntimeContext();return{getUrl:()=>e.resolveServerUrl(r()),getContext:()=>e.resolveContextSnapshot(r())}}async function L(e,n,r){let t=await import("./bb-chunks/plugin-cli-proxy-DVR2UZ2H.js"),o=await t.fetchPluginCliContributions(n());if(o.outcome==="unreachable"){if(r)return;let s=t.describeUnreachableServer(n(),o.cause,o.lastTimeoutMs,o.attempts);console.error(s);let{isJsonInvocation:E,writeCliErrorEnvelope:y}=await import("./bb-chunks/cli-error-output-KERMGTKZ.js");y({code:"server_unreachable",hint:null,message:s},E(process.argv)),process.exit(1)}if(o.outcome==="invalid")return;let a=t.findPluginCliCommand(o.contributions,e);if(a===void 0){let s=await t.findDisabledPluginForCommand(n(),e);s!==null&&(console.error(`bb ${e} is provided by the "${s}" plugin, which is disabled \u2014 run \`bb plugin enable ${s}\` or enable it in Plugins.`),process.exit(1));return}let i=process.argv.slice(3),c=a.commands.find(s=>s.name===i[0]);c!==void 0&&a.rendersHelp!==!0&&i.slice(1).some(s=>s==="--help"||s==="-h")&&(console.log(c.usage),process.exit(0));let l=await t.runPluginCliCommand(n(),a.pluginId,i);l!==0&&await w({code:"plugin_command_failed",command:t.pluginCommandLabel(a,i),exitCode:l,token:null}),process.exit(l)}async function w(e){let[{appendCliErrorLogEntry:n},{commandPathLabel:r}]=await Promise.all([import("./bb-chunks/cli-error-log-PHJFENHA.js"),import("./bb-chunks/commander-errors-32JXRGRD.js")]);n({at:new Date().toISOString(),cliVersion:u(),code:e.code,command:e.command??r(m,process.argv),exitCode:e.exitCode,threadId:process.env.BB_THREAD_ID??null,token:e.token})}async function P(e,n){e.exitCode===0&&process.exit(0);let[r,t]=await Promise.all([import("./bb-chunks/commander-errors-32JXRGRD.js"),import("./bb-chunks/context-hints-EXGBAHBP.js")]),o=await r.summarizeCommanderError({argv:process.argv,error:e,program:m,resolveHostId:n===null?async()=>null:t.createContextHostIdResolver(n)});r.writeCommanderErrorSummary(o,process.argv),await w({code:o.code,command:null,exitCode:e.exitCode,token:o.logToken}),process.exit(e.exitCode)}async function h(e){try{await m.parseAsync(process.argv)}catch(n){throw n instanceof d&&await P(n,e),n}}async function k(e){let n=await import("./bb-chunks/command-resolution-U7GVB5KQ.js");if(!n.hasHelpFlag(process.argv))return;let r=n.resolveInvocation(m,process.argv);if(r.unknownSubcommand===null)return;let t=`error: unknown command '${r.unknownSubcommand}'`;console.error(t),await P(new d(1,"commander.unknownCommand",t),e)}async function D(){let[{JSON_SHAPE_BY_COMMAND_PATH:e,jsonShapeHelp:n},r]=await Promise.all([import("./bb-chunks/json-shapes-TGDCNQZQ.js"),import("./bb-chunks/command-resolution-U7GVB5KQ.js")]);for(let t of Object.keys(e)){let o=r.resolveInvocation(m,["node","bb",...t.split(" ")]),a=n(t);a===null||o.path.join(" ")!==t||o.command.addHelpText("after",a)}}async function H(){let e=process.argv[2],n=v(e);if(n.length===0){await h(null);return}let[r,...t]=await Promise.all([import("./bb-chunks/context-env-6CUQJXI7.js"),...n.map(i=>i.load())]),o=A(r);m.addHelpText("after",()=>{let i=o.getContext(),c=i.projectId??"<unset>",l=i.threadId??"<unset>";return`
5
5
 
6
6
  Current context:
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __createRequire } from "node:module";import { dirname as __pathDirname } from "node:path";import { fileURLToPath as __fileURLToPath } from "node:url";const require = __createRequire(import.meta.url);const __filename = __fileURLToPath(import.meta.url);const __dirname = __pathDirname(__filename);
2
- function o(e,r,t){return{name:e,load:()=>r().then(t)}}var m=[o("browser",()=>import("./browser-YPHFBSVB.js"),e=>(r,t)=>e.registerBrowserCommands(r,t.getUrl)),o("status",()=>import("./status-FBZ7QAO7.js"),e=>(r,t)=>e.registerStatusCommand(r,t.getUrl,t.getContext)),o("settings",()=>import("./settings-Z3W7VN6M.js"),e=>(r,t)=>e.registerSettingsCommands(r,t.getUrl)),o("project",()=>import("./project-SFF34VFX.js"),e=>(r,t)=>e.registerProjectCommands(r,t.getUrl)),o("prompt-history",()=>import("./prompt-history-QPAZVRGL.js"),e=>(r,t)=>e.registerPromptHistoryCommands(r,t.getUrl)),o("provider",()=>import("./provider-7EX5JKW6.js"),e=>(r,t)=>e.registerProviderCommands(r,t.getUrl)),o("machine",()=>import("./machine-53J3POIB.js"),e=>(r,t)=>e.registerMachineCommands(r,t.getUrl)),o("server",()=>import("./server-6XKNMUGR.js"),e=>(r,t)=>e.registerServerCommands(r,t.getUrl)),o("updates",()=>import("./updates-FF4UHDLN.js"),e=>(r,t)=>e.registerUpdatesCommands(r,t.getUrl)),o("terminal",()=>import("./terminal-7N5CXPEK.js"),e=>(r,t)=>e.registerTerminalCommands(r,t.getUrl)),o("thread",()=>import("./thread-T2LZF2OG.js"),e=>(r,t)=>e.registerThreadCommands(r,t.getUrl)),o("environment",()=>import("./environment-6E2VT767.js"),e=>(r,t)=>e.registerEnvironmentCommands(r,t.getUrl)),o("file",()=>import("./file-OM3MGTJZ.js"),e=>(r,t)=>e.registerFileCommands(r,t.getUrl)),o("theme",()=>import("./theme-OOZ4YUIP.js"),e=>(r,t)=>e.registerThemeCommands(r,t.getUrl)),o("plugin",()=>import("./plugin-YWVWWQG6.js"),e=>(r,t)=>e.registerPluginCommands(r,t.getUrl)),o("marketplace",()=>import("./marketplace-CYKOR6QO.js"),e=>(r,t)=>e.registerMarketplaceCommands(r,t.getUrl)),o("skill",()=>import("./skill-Z4C767WB.js"),e=>(r,t)=>e.registerSkillCommands(r,t.getUrl,t.getContext)),o("guide",()=>import("./guide-KGY72F4I.js"),e=>r=>e.registerGuideCommand(r)),o("diagnostics",()=>import("./diagnostics-U6HI5G5V.js"),e=>r=>e.registerDiagnosticsCommands(r)),o("voice",()=>import("./voice-J2G4CECQ.js"),e=>(r,t)=>e.registerVoiceCommands(r,t.getUrl))];function n(e){if(e==="--version"||e==="-V")return[];let r=m.find(t=>t.name===e);return r===void 0?m:[r]}function i(e,r){return e===void 0||e.length===0||e.startsWith("-")||r.has(e)?null:e}export{m as a,n as b,i as c};
2
+ function o(e,r,t){return{name:e,load:()=>r().then(t)}}var m=[o("browser",()=>import("./browser-YPHFBSVB.js"),e=>(r,t)=>e.registerBrowserCommands(r,t.getUrl)),o("status",()=>import("./status-FBZ7QAO7.js"),e=>(r,t)=>e.registerStatusCommand(r,t.getUrl,t.getContext)),o("settings",()=>import("./settings-Z3W7VN6M.js"),e=>(r,t)=>e.registerSettingsCommands(r,t.getUrl)),o("project",()=>import("./project-SFF34VFX.js"),e=>(r,t)=>e.registerProjectCommands(r,t.getUrl)),o("prompt-history",()=>import("./prompt-history-QPAZVRGL.js"),e=>(r,t)=>e.registerPromptHistoryCommands(r,t.getUrl)),o("provider",()=>import("./provider-7EX5JKW6.js"),e=>(r,t)=>e.registerProviderCommands(r,t.getUrl)),o("machine",()=>import("./machine-53J3POIB.js"),e=>(r,t)=>e.registerMachineCommands(r,t.getUrl)),o("server",()=>import("./server-6XKNMUGR.js"),e=>(r,t)=>e.registerServerCommands(r,t.getUrl)),o("updates",()=>import("./updates-FF4UHDLN.js"),e=>(r,t)=>e.registerUpdatesCommands(r,t.getUrl)),o("terminal",()=>import("./terminal-7N5CXPEK.js"),e=>(r,t)=>e.registerTerminalCommands(r,t.getUrl)),o("thread",()=>import("./thread-VKVOFAYM.js"),e=>(r,t)=>e.registerThreadCommands(r,t.getUrl)),o("environment",()=>import("./environment-6E2VT767.js"),e=>(r,t)=>e.registerEnvironmentCommands(r,t.getUrl)),o("file",()=>import("./file-OM3MGTJZ.js"),e=>(r,t)=>e.registerFileCommands(r,t.getUrl)),o("theme",()=>import("./theme-OOZ4YUIP.js"),e=>(r,t)=>e.registerThemeCommands(r,t.getUrl)),o("plugin",()=>import("./plugin-BD2V5QKV.js"),e=>(r,t)=>e.registerPluginCommands(r,t.getUrl)),o("marketplace",()=>import("./marketplace-CYKOR6QO.js"),e=>(r,t)=>e.registerMarketplaceCommands(r,t.getUrl)),o("skill",()=>import("./skill-Z4C767WB.js"),e=>(r,t)=>e.registerSkillCommands(r,t.getUrl,t.getContext)),o("guide",()=>import("./guide-2EVMHWEL.js"),e=>r=>e.registerGuideCommand(r)),o("diagnostics",()=>import("./diagnostics-U6HI5G5V.js"),e=>r=>e.registerDiagnosticsCommands(r)),o("voice",()=>import("./voice-J2G4CECQ.js"),e=>(r,t)=>e.registerVoiceCommands(r,t.getUrl))];function n(e){if(e==="--version"||e==="-V")return[];let r=m.find(t=>t.name===e);return r===void 0?m:[r]}function i(e,r){return e===void 0||e.length===0||e.startsWith("-")||r.has(e)?null:e}export{m as a,n as b,i as c};
@@ -1,4 +1,4 @@
1
1
  import { createRequire as __createRequire } from "node:module";import { dirname as __pathDirname } from "node:path";import { fileURLToPath as __fileURLToPath } from "node:url";const require = __createRequire(import.meta.url);const __filename = __fileURLToPath(import.meta.url);const __dirname = __pathDirname(__filename);
2
- import{a}from"./chunk-IXX2QKBH.js";import{a as s,j as p}from"./chunk-BKBU62SF.js";import{b as d}from"./chunk-NCQMSH7M.js";import"./chunk-WWZ7D6EQ.js";import{G as u}from"./chunk-X63QVO5F.js";import"./chunk-VLWNZSJS.js";import{a as c}from"./chunk-A5EPBP3W.js";import"./chunk-H7ZMW3KO.js";import"./chunk-LH4TBBGQ.js";import"./chunk-E7J2DJY7.js";import"./chunk-BNG7SSF7.js";import"./chunk-5PWLIQO6.js";function f(e){return e.registeredArguments.map(t=>{let o=`${t.name()}${t.variadic?"...":""}`;return t.required?`<${o}>`:`[${o}]`}).join(" ")}function g(e,t){return e.commands.flatMap(o=>{if(o.name()==="help")return[];let r=[...t,o.name()],i=g(o,r);return i.length>0?i:[{aliases:o.aliases(),arguments:f(o),description:o.description(),options:o.options.filter(n=>!n.hidden).map(n=>n.flags.replace(/^-\w, /u,"")),path:r.join(" ")}]})}async function C(e){let t=new d,o={getUrl:()=>"",getContext:()=>({serverUrl:""})};for(let n of a)(await n.load())(t,o);let r=g(t,[]);if(e===void 0)return r;let i=r.filter(n=>n.path===e||n.path.startsWith(`${e} `));if(i.length===0)throw new c({code:"invalid_value",hint:`Command groups: ${a.map(n=>n.name).join(", ")}`,message:`Unknown command group '${e}'.`});return i}function b(e,t){let r=[`bb ${[e.path,...e.aliases.map(n=>`|${n}`)].join("")}`,e.arguments].filter(n=>n.length>0).join(" "),i=t&&e.options.length>0?` ${e.options.map(n=>`[${n}]`).join(" ")}`:"";return`${r}${i}
2
+ import{a}from"./chunk-ER46DNTR.js";import{a as s,j as p}from"./chunk-BKBU62SF.js";import{b as d}from"./chunk-NCQMSH7M.js";import"./chunk-WWZ7D6EQ.js";import{G as u}from"./chunk-X63QVO5F.js";import"./chunk-VLWNZSJS.js";import{a as c}from"./chunk-A5EPBP3W.js";import"./chunk-H7ZMW3KO.js";import"./chunk-LH4TBBGQ.js";import"./chunk-E7J2DJY7.js";import"./chunk-BNG7SSF7.js";import"./chunk-5PWLIQO6.js";function f(e){return e.registeredArguments.map(t=>{let o=`${t.name()}${t.variadic?"...":""}`;return t.required?`<${o}>`:`[${o}]`}).join(" ")}function g(e,t){return e.commands.flatMap(o=>{if(o.name()==="help")return[];let r=[...t,o.name()],i=g(o,r);return i.length>0?i:[{aliases:o.aliases(),arguments:f(o),description:o.description(),options:o.options.filter(n=>!n.hidden).map(n=>n.flags.replace(/^-\w, /u,"")),path:r.join(" ")}]})}async function C(e){let t=new d,o={getUrl:()=>"",getContext:()=>({serverUrl:""})};for(let n of a)(await n.load())(t,o);let r=g(t,[]);if(e===void 0)return r;let i=r.filter(n=>n.path===e||n.path.startsWith(`${e} `));if(i.length===0)throw new c({code:"invalid_value",hint:`Command groups: ${a.map(n=>n.name).join(", ")}`,message:`Unknown command group '${e}'.`});return i}function b(e,t){let r=[`bb ${[e.path,...e.aliases.map(n=>`|${n}`)].join("")}`,e.arguments].filter(n=>n.length>0).join(" "),i=t&&e.options.length>0?` ${e.options.map(n=>`[${n}]`).join(" ")}`:"";return`${r}${i}
3
3
  ${e.description}`}function j(e){e.command("guide [chapter] [group]").description("Show the BB system overview and CLI guide; `bb guide commands [group]` lists every core command on one page").option("--json","Print machine-readable JSON output").action(p(async(t,o,r)=>{if(t==="commands"){let n=await C(o);if(s(r,{chapter:t,commands:n}))return;let m=n.map(l=>b(l,o!==void 0));console.log(m.join(`
4
4
  `)),o===void 0&&console.log("\nRun `bb guide commands <group>` (for example `bb guide commands thread`) to include every option. Commands contributed by plugins are listed by `bb plugin list`.");return}let i=u().render({chapter:t});if(t){if(s(r,i))return;console.log(i.content);return}s(r,{overview:i.content})||console.log(i.content)}))}export{C as buildCommandIndex,j as registerGuideCommand};
@@ -7,7 +7,7 @@ import{g as li}from"./chunk-4LTU3BZP.js";import{a as Lt,b as ai}from"./chunk-ZXU
7
7
  `,n=this.i,o=oe;break;case P:return this.text+=i.slice(n),!1;default:}if(o===e)return this.text+=i.slice(n,this.prevI),!0}}captureNameChars(){let{chunk:e,i:n}=this;for(;;){let i=this.getCode();if(i===P)return this.name+=e.slice(n),P;if(!_o(i))return this.name+=e.slice(n,this.prevI),i===ae?oe:i}}skipSpaces(){for(;;){let e=this.getCodeNorm();if(e===P||!X(e))return e}}setXMLVersion(e){this.currentXMLVersion=e,e==="1.0"?(this.isChar=ml,this.getCode=this.getCode10):(this.isChar=fl,this.getCode=this.getCode11)}sBegin(){this.chunk.charCodeAt(0)===65279&&(this.i++,this.column++),this.state=vl}sBeginWhitespace(){let e=this.i,n=this.skipSpaces();switch(this.prevI!==e&&(this.xmlDeclPossible=!1),n){case he:if(this.state=An,this.text.length!==0)throw new Error("no-empty text at start");break;case P:break;default:this.unget(),this.state=V,this.xmlDeclPossible=!1}}sDoctype(){var e;let n=this.captureTo(Jl);switch(n){case M:{(e=this.doctypeHandler)===null||e===void 0||e.call(this,this.text),this.text="",this.state=V,this.doctype=!0;break}case P:break;default:this.text+=String.fromCodePoint(n),n===zo?this.state=Ie:ft(n)&&(this.state=yl,this.q=n)}}sDoctypeQuote(){let e=this.q;this.captureToChar(e)&&(this.text+=String.fromCodePoint(e),this.q=null,this.state=gn)}sDTD(){let e=this.captureTo(Vl);e!==P&&(this.text+=String.fromCodePoint(e),e===Re?this.state=gn:e===he?this.state=xl:ft(e)&&(this.state=Il,this.q=e))}sDTDQuoted(){let e=this.q;this.captureToChar(e)&&(this.text+=String.fromCodePoint(e),this.state=Ie,this.q=null)}sDTDOpenWaka(){let e=this.getCodeNorm();switch(this.text+=String.fromCodePoint(e),e){case Ho:this.state=Rl,this.openWakaBang="";break;case H:this.state=Bl;break;default:this.state=Ie}}sDTDOpenWakaBang(){let e=String.fromCodePoint(this.getCodeNorm()),n=this.openWakaBang+=e;this.text+=e,n!=="-"&&(this.state=n==="--"?mn:Ie,this.openWakaBang="")}sDTDComment(){this.captureToChar(mt)&&(this.text+="-",this.state=Sl)}sDTDCommentEnding(){let e=this.getCodeNorm();this.text+=String.fromCodePoint(e),this.state=e===mt?Dl:mn}sDTDCommentEnded(){let e=this.getCodeNorm();this.text+=String.fromCodePoint(e),e===M?this.state=Ie:(this.fail("malformed comment."),this.state=mn)}sDTDPI(){this.captureToChar(H)&&(this.text+="?",this.state=Nl)}sDTDPIEnding(){let e=this.getCodeNorm();this.text+=String.fromCodePoint(e),e===M&&(this.state=Ie)}sText(){this.tags.length!==0?this.handleTextInRoot():this.handleTextOutsideRoot()}sEntity(){let{i:e}=this,{chunk:n}=this;e:for(;;)switch(this.getCode()){case ae:this.entity+=`${n.slice(e,this.prevI)}
8
8
  `,e=this.i;break;case ql:{let{entityReturnState:i}=this,o=this.entity+n.slice(e,this.prevI);this.state=i;let r;o===""?(this.fail("empty entity name."),r="&;"):(r=this.parseEntity(o),this.entity=""),(i!==V||this.textHandler!==void 0)&&(this.text+=r);break e}case P:this.entity+=n.slice(e);break e;default:}}sOpenWaka(){let e=this.getCode();if(je(e))this.state=Ul,this.unget(),this.xmlDeclPossible=!1;else switch(e){case At:this.state=Hl,this.xmlDeclPossible=!1;break;case Ho:this.state=Tl,this.openWakaBang="",this.xmlDeclPossible=!1;break;case H:this.state=Ol;break;default:this.fail("disallowed character in tag name"),this.state=V,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0),this.state=hn,this.openWakaBang="";break;case"--":this.state=fn,this.openWakaBang="";break;case"DOCTYPE":this.state=gn,(this.doctype||this.sawRoot)&&this.fail("inappropriately located doctype declaration."),this.openWakaBang="";break;default:this.openWakaBang.length>=7&&this.fail("incorrect syntax.")}}sComment(){this.captureToChar(mt)&&(this.state=Pl)}sCommentEnding(){var e;let n=this.getCodeNorm();n===mt?(this.state=kl,(e=this.commentHandler)===null||e===void 0||e.call(this,this.text),this.text=""):(this.text+=`-${String.fromCodePoint(n)}`,this.state=fn)}sCommentEnded(){let e=this.getCodeNorm();e!==M?(this.fail("malformed comment."),this.text+=`--${String.fromCodePoint(e)}`,this.state=fn):this.state=V}sCData(){this.captureToChar(Re)&&(this.state=Ql)}sCDataEnding(){let e=this.getCodeNorm();e===Re?this.state=_l:(this.text+=`]${String.fromCodePoint(e)}`,this.state=hn)}sCDataEnding2(){var e;let n=this.getCodeNorm();switch(n){case M:{(e=this.cdataHandler)===null||e===void 0||e.call(this,this.text),this.text="",this.state=V;break}case Re:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(n)}`,this.state=hn}}sPIFirstChar(){let e=this.getCodeNorm();this.nameStartCheck(e)?(this.piTarget+=String.fromCodePoint(e),this.state=Lo):e===H||X(e)?(this.fail("processing instruction without a target."),this.state=e===H?gt:En):(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(e),this.state=Lo)}sPIRest(){let{chunk:e,i:n}=this;for(;;){let i=this.getCodeNorm();if(i===P){this.piTarget+=e.slice(n);return}if(!this.nameCheck(i)){this.piTarget+=e.slice(n,this.prevI);let o=i===H;o||X(i)?this.piTarget==="xml"?(this.xmlDeclPossible||this.fail("an XML declaration must be at the start of the document."),this.state=o?Ee:$o):this.state=o?gt:En:(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(i));break}}}sPIBody(){if(this.text.length===0){let e=this.getCodeNorm();e===H?this.state=gt:X(e)||(this.text=String.fromCodePoint(e))}else this.captureToChar(H)&&(this.state=gt)}sPIEnding(){var e;let n=this.getCodeNorm();if(n===M){let{piTarget:i}=this;i.toLowerCase()==="xml"&&this.fail("the XML declaration must appear at the start of the document."),(e=this.piHandler)===null||e===void 0||e.call(this,{target:i,body:this.text}),this.piTarget=this.text="",this.state=V}else n===H?this.text+="?":(this.text+=`?${String.fromCodePoint(n)}`,this.state=En);this.xmlDeclPossible=!1}sXMLDeclNameStart(){let e=this.skipSpaces();if(e===H){this.state=Ee;return}e!==P&&(this.state=Ll,this.name=String.fromCodePoint(e))}sXMLDeclName(){let e=this.captureTo(Wl);if(e===H){this.state=Ee,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(X(e)||e===xe){if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=e===xe?Fo:$l}}sXMLDeclEq(){let e=this.getCodeNorm();if(e===H){this.state=Ee,this.fail("XML declaration is incomplete.");return}X(e)||(e!==xe&&this.fail("value required."),this.state=Fo)}sXMLDeclValueStart(){let e=this.getCodeNorm();if(e===H){this.state=Ee,this.fail("XML declaration is incomplete.");return}X(e)||(ft(e)?this.q=e:(this.fail("value must be quoted."),this.q=Ko),this.state=Fl)}sXMLDeclValue(){let e=this.captureTo([this.q,H]);if(e===H){this.state=Ee,this.text="",this.fail("XML declaration is incomplete.");return}if(e===P)return;let n=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let i=n;this.xmlDecl.version=i,/^1\.[0-9]+$/.test(i)?this.opt.forceXMLVersion||this.setXMLVersion(i):this.fail("version number must match /^1\\.[0-9]+$/.");break}case"encoding":/^[A-Za-z][A-Za-z0-9._-]*$/.test(n)||this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."),this.xmlDeclExpects=["standalone"],this.xmlDecl.encoding=n;break;case"standalone":n!=="yes"&&n!=="no"&&this.fail('standalone value must match "yes" or "no".'),this.xmlDeclExpects=[],this.xmlDecl.standalone=n;break;default:}this.name="",this.state=Ml}sXMLDeclSeparator(){let e=this.getCodeNorm();if(e===H){this.state=Ee;return}X(e)||(this.fail("whitespace required."),this.unget()),this.state=$o}sXMLDeclEnding(){var e;this.getCodeNorm()===M?(this.piTarget!=="xml"?this.fail("processing instructions are not allowed before root."):this.name!=="version"&&this.xmlDeclExpects.includes("version")&&this.fail("XML declaration must contain a version."),(e=this.xmldeclHandler)===null||e===void 0||e.call(this,this.xmlDecl),this.name="",this.piTarget=this.text="",this.state=V):this.fail("The character ? is disallowed anywhere in XML declarations."),this.xmlDeclPossible=!1}sOpenTag(){var e;let n=this.captureNameChars();if(n===P)return;let i=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name="",this.xmlnsOpt&&(this.topNS=i.ns=Object.create(null)),(e=this.openTagStartHandler)===null||e===void 0||e.call(this,i),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail("documents may contain only one root."),n){case M:this.openTag();break;case At:this.state=bn;break;default:X(n)||this.fail("disallowed character in tag name."),this.state=Ke}}sOpenTagSlash(){this.getCode()===M?this.openSelfClosingTag():(this.fail("forward-slash in opening tag not followed by >."),this.state=Ke)}sAttrib(){let e=this.skipSpaces();e!==P&&(je(e)?(this.unget(),this.state=Cn):e===M?this.openTag():e===At?this.state=bn:this.fail("disallowed character in attribute name."))}sAttribName(){let e=this.captureNameChars();e===xe?this.state=Mo:X(e)?this.state=jl:e===M?(this.fail("attribute without value."),this.pushAttrib(this.name,this.name),this.name=this.text="",this.openTag()):e!==P&&this.fail("disallowed character in attribute name.")}sAttribNameSawWhite(){let e=this.skipSpaces();switch(e){case P:return;case xe:this.state=Mo;break;default:this.fail("attribute without value."),this.text="",this.name="",e===M?this.openTag():je(e)?(this.unget(),this.state=Cn):(this.fail("disallowed character in attribute name."),this.state=Ke)}}sAttribValue(){let e=this.getCodeNorm();ft(e)?(this.q=e,this.state=Uo):X(e)||(this.fail("unquoted attribute value."),this.state=jo,this.unget())}sAttribValueQuoted(){let{q:e,chunk:n}=this,{i}=this;for(;;)switch(this.getCode()){case e:this.pushAttrib(this.name,this.text+n.slice(i,this.prevI)),this.name=this.text="",this.q=null,this.state=Kl;return;case He:this.text+=n.slice(i,this.prevI),this.state=pt,this.entityReturnState=Uo;return;case oe:case ae:case wn:this.text+=`${n.slice(i,this.prevI)} `,i=this.i;break;case he:this.text+=n.slice(i,this.prevI),this.fail("disallowed character.");return;case P:this.text+=n.slice(i);return;default:}}sAttribValueClosed(){let e=this.getCodeNorm();X(e)?this.state=Ke:e===M?this.openTag():e===At?this.state=bn:je(e)?(this.fail("no whitespace between attributes."),this.unget(),this.state=Cn):this.fail("disallowed character in attribute name.")}sAttribValueUnquoted(){let e=this.captureTo(Yl);switch(e){case He:this.state=pt,this.entityReturnState=jo;break;case he:this.fail("disallowed character.");break;case P:break;default:this.text.includes("]]>")&&this.fail('the string "]]>" is disallowed in char data.'),this.pushAttrib(this.name,this.text),this.name=this.text="",e===M?this.openTag():this.state=Ke}}sCloseTag(){let e=this.captureNameChars();e===M?this.closeTag():X(e)?this.state=Gl:e!==P&&this.fail("disallowed character in closing tag.")}sCloseTagSawWhite(){switch(this.skipSpaces()){case M:this.closeTag();break;case P:break;default:this.fail("disallowed character in closing tag.")}}handleTextInRoot(){let{i:e,forbiddenState:n}=this,{chunk:i,textHandler:o}=this;e:for(;;)switch(this.getCode()){case he:{if(this.state=An,o!==void 0){let{text:r}=this,s=i.slice(e,this.prevI);r.length!==0?(o(r+s),this.text=""):s.length!==0&&o(s)}n=be;break e}case He:this.state=pt,this.entityReturnState=V,o!==void 0&&(this.text+=i.slice(e,this.prevI)),n=be;break e;case Re:switch(n){case be:n=Jo;break;case Jo:n=yn;break;case yn:break;default:throw new Error("impossible state")}break;case M:n===yn&&this.fail('the string "]]>" is disallowed in char data.'),n=be;break;case ae:o!==void 0&&(this.text+=`${i.slice(e,this.prevI)}
9
9
  `),e=this.i,n=be;break;case P:o!==void 0&&(this.text+=i.slice(e));break e;default:n=be}this.forbiddenState=n}handleTextOutsideRoot(){let{i:e}=this,{chunk:n,textHandler:i}=this,o=!1;e:for(;;){let r=this.getCode();switch(r){case he:{if(this.state=An,i!==void 0){let{text:s}=this,a=n.slice(e,this.prevI);s.length!==0?(i(s+a),this.text=""):a.length!==0&&i(a)}break e}case He:this.state=pt,this.entityReturnState=V,i!==void 0&&(this.text+=n.slice(e,this.prevI)),o=!0;break e;case ae:i!==void 0&&(this.text+=`${n.slice(e,this.prevI)}
10
- `),e=this.i;break;case P:i!==void 0&&(this.text+=n.slice(e));break e;default:X(r)||(o=!0)}}o&&(!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0))}pushAttribNS(e,n){var i;let{prefix:o,local:r}=this.qname(e),s={name:e,prefix:o,local:r,value:n};if(this.attribList.push(s),(i=this.attributeHandler)===null||i===void 0||i.call(this,s),o==="xmlns"){let a=n.trim();this.currentXMLVersion==="1.0"&&a===""&&this.fail("invalid attempt to undefine prefix in XML 1.0"),this.topNS[r]=a,In(this,r,a)}else if(e==="xmlns"){let a=n.trim();this.topNS[""]=a,In(this,"",a)}}pushAttribPlain(e,n){var i;let o={name:e,value:n};this.attribList.push(o),(i=this.attributeHandler)===null||i===void 0||i.call(this,o)}end(){var e,n;this.sawRoot||this.fail("document must contain a root element.");let{tags:i}=this;for(;i.length>0;){let r=i.pop();this.fail(`unclosed tag: ${r.name}`)}this.state!==Oo&&this.state!==V&&this.fail("unexpected end.");let{text:o}=this;return o.length!==0&&((e=this.textHandler)===null||e===void 0||e.call(this,o),this.text=""),this._closed=!0,(n=this.endHandler)===null||n===void 0||n.call(this),this._init(),this}resolve(e){var n,i;let o=this.topNS[e];if(o!==void 0)return o;let{tags:r}=this;for(let s=r.length-1;s>=0;s--)if(o=r[s].ns[e],o!==void 0)return o;return o=this.ns[e],o!==void 0?o:(i=(n=this.opt).resolvePrefix)===null||i===void 0?void 0:i.call(n,e)}qname(e){let n=e.indexOf(":");if(n===-1)return{prefix:"",local:e};let i=e.slice(n+1),o=e.slice(0,n);return(o===""||i===""||i.includes(":"))&&this.fail(`malformed name: ${e}.`),{prefix:o,local:i}}processAttribsNS(){var e;let{attribList:n}=this,i=this.tag;{let{prefix:s,local:a}=this.qname(i.name);i.prefix=s,i.local=a;let l=i.uri=(e=this.resolve(s))!==null&&e!==void 0?e:"";s!==""&&(s==="xmlns"&&this.fail('tags may not have "xmlns" as prefix.'),l===""&&(this.fail(`unbound namespace prefix: ${JSON.stringify(s)}.`),i.uri=s))}if(n.length===0)return;let{attributes:o}=i,r=new Set;for(let s of n){let{name:a,prefix:l,local:c}=s,u,d;l===""?(u=a==="xmlns"?Se:"",d=a):(u=this.resolve(l),u===void 0&&(this.fail(`unbound namespace prefix: ${JSON.stringify(l)}.`),u=l),d=`{${u}}${c}`),r.has(d)&&this.fail(`duplicate attribute: ${d}.`),r.add(d),s.uri=u,o[a]=s}this.attribList=[]}processAttribsPlain(){let{attribList:e}=this,n=this.tag.attributes;for(let{name:i,value:o}of e)n[i]!==void 0&&this.fail(`duplicate attribute: ${i}.`),n[i]=o;this.attribList=[]}openTag(){var e;this.processAttribs();let{tags:n}=this,i=this.tag;i.isSelfClosing=!1,(e=this.openTagHandler)===null||e===void 0||e.call(this,i),n.push(i),this.state=V,this.name=""}openSelfClosingTag(){var e,n,i;this.processAttribs();let{tags:o}=this,r=this.tag;r.isSelfClosing=!0,(e=this.openTagHandler)===null||e===void 0||e.call(this,r),(n=this.closeTagHandler)===null||n===void 0||n.call(this,r),(this.tag=(i=o[o.length-1])!==null&&i!==void 0?i:null)===null&&(this.closedRoot=!0),this.state=V,this.name=""}closeTag(){let{tags:e,name:n}=this;if(this.state=V,this.name="",n===""){this.fail("weird empty close tag."),this.text+="</>";return}let i=this.closeTagHandler,o=e.length;for(;o-- >0;){let r=this.tag=e.pop();if(this.topNS=r.ns,i?.(r),r.name===n)break;this.fail("unexpected close tag.")}o===0?this.closedRoot=!0:o<0&&(this.fail(`unmatched closing tag: ${n}.`),this.text+=`</${n}>`)}parseEntity(e){if(e[0]!=="#"){let i=this.ENTITIES[e];return i!==void 0?i:(this.fail(this.isName(e)?"undefined entity.":"disallowed character in entity name."),`&${e};`)}let n=NaN;return e[1]==="x"&&/^#x[0-9a-f]+$/i.test(e)?n=parseInt(e.slice(2),16):/^#[0-9]+$/.test(e)&&(n=parseInt(e.slice(1),10)),this.isChar(n)?String.fromCodePoint(n):(this.fail("malformed character entity."),`&${e};`)}};De.SaxesParser=xn});import{watch as qu}from"node:fs";import{homedir as Wr}from"node:os";import{access as is,readFile as kt,realpath as Ju}from"node:fs/promises";import{dirname as Vu,join as Qe,relative as Wu,resolve as me}from"node:path";import{createInterface as Yu}from"node:readline/promises";import{setTimeout as Xu}from"node:timers/promises";function $e(t){return t.startsWith("./")}var ci=/^[a-z0-9][a-z0-9-]*$/u,$t=48,Ft=32*1024,Mt=64,cs=/^[a-z0-9-]+\/[a-z0-9][a-z0-9-]*$/u;function ui(t){return cs.test(t)}var $=A.string().trim().min(1),us=A.record(A.string().max($t,`icon names are at most ${$t} characters`).regex(ci,'icon names use lowercase letters, digits and "-", starting with a letter or digit'),$.refine(t=>$e(t)&&t.toLowerCase().endsWith(".svg"),{message:'icon paths are plugin-relative .svg files starting with "./" (for example "./icons/receipt.svg")'})).refine(t=>Object.keys(t).length<=Mt,{message:`a plugin declares at most ${Mt} icons`}),ds=A.object({icon:$.optional(),logo:A.object({light:$,dark:$.optional()}).strict().optional(),experimental_icons:us.optional()}).strict().superRefine((t,e)=>{t.icon!==void 0&&$e(t.icon)&&!t.icon.toLowerCase().endsWith(".svg")&&e.addIssue({code:"custom",path:["icon"],message:'plugin-owned branding.icon paths must point at an .svg file (for example "./assets/icon.svg")'}),t.icon!==void 0&&ui(t.icon)&&e.addIssue({code:"custom",path:["icon"],message:`"${t.icon}" is a namespaced glyph ("<pluginId>/<name>"), which names a declared icon from a tool presentation or a provider declaration; branding.icon is the plugin's own mark, so name a host glyph ("Zap") or the SVG file itself ("./icons/logo.svg")`})}).refine(t=>t.icon!==void 0||t.logo!==void 0,{message:"must declare at least branding.icon or branding.logo.light"}),ps=A.object({name:$,description:$,branding:ds,experimental_providers:A.array(A.object({kind:A.enum(["agent"]),id:$,displayName:$}).strict()).optional(),server:$,app:$.optional(),host:$.optional(),skills:A.array($).optional(),themes:A.array(A.object({id:A.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/).max(64),name:$,description:$.optional(),css:$,codeTheme:ni.optional()}).strict()).optional()}).strict(),di=A.object({name:$,version:$,engines:A.object({bb:$.optional(),bbPluginSdk:$.optional()}).optional(),bb:ps}).passthrough();var T="0.6.78",pi=Number(T.split(".",1)[0]);var tt=["browser","diagnostics","environment","file","guide","help","machine","marketplace","plugin","project","prompt-history","provider","server","settings","skill","status","terminal","theme","thread","updates","voice"];function gi(t,e){return tt.includes(e)?`bb plugin run ${t}`:`bb ${e}`}function mi(t,e){if(t.installedByDefault)return{kind:"builtin"};let{installs:n}=t;if(n!==null&&n>=25)return{kind:"count",installs:n};let i=t.publishedAt===void 0?NaN:Date.parse(t.publishedAt);return e-i<2592e6?{kind:"new"}:n===null?null:{kind:"count",installs:n}}var po=Qt(Ae(),1),go=Qt(to(),1);import{randomBytes as Ra}from"node:crypto";import{lstat as ro,mkdir as tn,readdir as so,readFile as ve,realpath as ct,rename as Sa,rm as ao,rmdir as Da,writeFile as ie}from"node:fs/promises";import{dirname as lo,isAbsolute as co,join as B,relative as uo}from"node:path";var no=[{target:"components/ui/button.tsx",content:`import * as React from "react";
10
+ `),e=this.i;break;case P:i!==void 0&&(this.text+=n.slice(e));break e;default:X(r)||(o=!0)}}o&&(!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0))}pushAttribNS(e,n){var i;let{prefix:o,local:r}=this.qname(e),s={name:e,prefix:o,local:r,value:n};if(this.attribList.push(s),(i=this.attributeHandler)===null||i===void 0||i.call(this,s),o==="xmlns"){let a=n.trim();this.currentXMLVersion==="1.0"&&a===""&&this.fail("invalid attempt to undefine prefix in XML 1.0"),this.topNS[r]=a,In(this,r,a)}else if(e==="xmlns"){let a=n.trim();this.topNS[""]=a,In(this,"",a)}}pushAttribPlain(e,n){var i;let o={name:e,value:n};this.attribList.push(o),(i=this.attributeHandler)===null||i===void 0||i.call(this,o)}end(){var e,n;this.sawRoot||this.fail("document must contain a root element.");let{tags:i}=this;for(;i.length>0;){let r=i.pop();this.fail(`unclosed tag: ${r.name}`)}this.state!==Oo&&this.state!==V&&this.fail("unexpected end.");let{text:o}=this;return o.length!==0&&((e=this.textHandler)===null||e===void 0||e.call(this,o),this.text=""),this._closed=!0,(n=this.endHandler)===null||n===void 0||n.call(this),this._init(),this}resolve(e){var n,i;let o=this.topNS[e];if(o!==void 0)return o;let{tags:r}=this;for(let s=r.length-1;s>=0;s--)if(o=r[s].ns[e],o!==void 0)return o;return o=this.ns[e],o!==void 0?o:(i=(n=this.opt).resolvePrefix)===null||i===void 0?void 0:i.call(n,e)}qname(e){let n=e.indexOf(":");if(n===-1)return{prefix:"",local:e};let i=e.slice(n+1),o=e.slice(0,n);return(o===""||i===""||i.includes(":"))&&this.fail(`malformed name: ${e}.`),{prefix:o,local:i}}processAttribsNS(){var e;let{attribList:n}=this,i=this.tag;{let{prefix:s,local:a}=this.qname(i.name);i.prefix=s,i.local=a;let l=i.uri=(e=this.resolve(s))!==null&&e!==void 0?e:"";s!==""&&(s==="xmlns"&&this.fail('tags may not have "xmlns" as prefix.'),l===""&&(this.fail(`unbound namespace prefix: ${JSON.stringify(s)}.`),i.uri=s))}if(n.length===0)return;let{attributes:o}=i,r=new Set;for(let s of n){let{name:a,prefix:l,local:c}=s,u,d;l===""?(u=a==="xmlns"?Se:"",d=a):(u=this.resolve(l),u===void 0&&(this.fail(`unbound namespace prefix: ${JSON.stringify(l)}.`),u=l),d=`{${u}}${c}`),r.has(d)&&this.fail(`duplicate attribute: ${d}.`),r.add(d),s.uri=u,o[a]=s}this.attribList=[]}processAttribsPlain(){let{attribList:e}=this,n=this.tag.attributes;for(let{name:i,value:o}of e)n[i]!==void 0&&this.fail(`duplicate attribute: ${i}.`),n[i]=o;this.attribList=[]}openTag(){var e;this.processAttribs();let{tags:n}=this,i=this.tag;i.isSelfClosing=!1,(e=this.openTagHandler)===null||e===void 0||e.call(this,i),n.push(i),this.state=V,this.name=""}openSelfClosingTag(){var e,n,i;this.processAttribs();let{tags:o}=this,r=this.tag;r.isSelfClosing=!0,(e=this.openTagHandler)===null||e===void 0||e.call(this,r),(n=this.closeTagHandler)===null||n===void 0||n.call(this,r),(this.tag=(i=o[o.length-1])!==null&&i!==void 0?i:null)===null&&(this.closedRoot=!0),this.state=V,this.name=""}closeTag(){let{tags:e,name:n}=this;if(this.state=V,this.name="",n===""){this.fail("weird empty close tag."),this.text+="</>";return}let i=this.closeTagHandler,o=e.length;for(;o-- >0;){let r=this.tag=e.pop();if(this.topNS=r.ns,i?.(r),r.name===n)break;this.fail("unexpected close tag.")}o===0?this.closedRoot=!0:o<0&&(this.fail(`unmatched closing tag: ${n}.`),this.text+=`</${n}>`)}parseEntity(e){if(e[0]!=="#"){let i=this.ENTITIES[e];return i!==void 0?i:(this.fail(this.isName(e)?"undefined entity.":"disallowed character in entity name."),`&${e};`)}let n=NaN;return e[1]==="x"&&/^#x[0-9a-f]+$/i.test(e)?n=parseInt(e.slice(2),16):/^#[0-9]+$/.test(e)&&(n=parseInt(e.slice(1),10)),this.isChar(n)?String.fromCodePoint(n):(this.fail("malformed character entity."),`&${e};`)}};De.SaxesParser=xn});import{watch as qu}from"node:fs";import{homedir as Wr}from"node:os";import{access as is,readFile as kt,realpath as Ju}from"node:fs/promises";import{dirname as Vu,join as Qe,relative as Wu,resolve as me}from"node:path";import{createInterface as Yu}from"node:readline/promises";import{setTimeout as Xu}from"node:timers/promises";function $e(t){return t.startsWith("./")}var ci=/^[a-z0-9][a-z0-9-]*$/u,$t=48,Ft=32*1024,Mt=64,cs=/^[a-z0-9-]+\/[a-z0-9][a-z0-9-]*$/u;function ui(t){return cs.test(t)}var $=A.string().trim().min(1),us=A.record(A.string().max($t,`icon names are at most ${$t} characters`).regex(ci,'icon names use lowercase letters, digits and "-", starting with a letter or digit'),$.refine(t=>$e(t)&&t.toLowerCase().endsWith(".svg"),{message:'icon paths are plugin-relative .svg files starting with "./" (for example "./icons/receipt.svg")'})).refine(t=>Object.keys(t).length<=Mt,{message:`a plugin declares at most ${Mt} icons`}),ds=A.object({icon:$.optional(),logo:A.object({light:$,dark:$.optional()}).strict().optional(),experimental_icons:us.optional()}).strict().superRefine((t,e)=>{t.icon!==void 0&&$e(t.icon)&&!t.icon.toLowerCase().endsWith(".svg")&&e.addIssue({code:"custom",path:["icon"],message:'plugin-owned branding.icon paths must point at an .svg file (for example "./assets/icon.svg")'}),t.icon!==void 0&&ui(t.icon)&&e.addIssue({code:"custom",path:["icon"],message:`"${t.icon}" is a namespaced glyph ("<pluginId>/<name>"), which names a declared icon from a tool presentation or a provider declaration; branding.icon is the plugin's own mark, so name a host glyph ("Zap") or the SVG file itself ("./icons/logo.svg")`})}).refine(t=>t.icon!==void 0||t.logo!==void 0,{message:"must declare at least branding.icon or branding.logo.light"}),ps=A.object({name:$,description:$,branding:ds,experimental_providers:A.array(A.object({kind:A.enum(["agent"]),id:$,displayName:$}).strict()).optional(),server:$,app:$.optional(),host:$.optional(),skills:A.array($).optional(),themes:A.array(A.object({id:A.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/).max(64),name:$,description:$.optional(),css:$,codeTheme:ni.optional()}).strict()).optional()}).strict(),di=A.object({name:$,version:$,engines:A.object({bb:$.optional(),bbPluginSdk:$.optional()}).optional(),bb:ps}).passthrough();var T="0.6.79",pi=Number(T.split(".",1)[0]);var tt=["browser","diagnostics","environment","file","guide","help","machine","marketplace","plugin","project","prompt-history","provider","server","settings","skill","status","terminal","theme","thread","updates","voice"];function gi(t,e){return tt.includes(e)?`bb plugin run ${t}`:`bb ${e}`}function mi(t,e){if(t.installedByDefault)return{kind:"builtin"};let{installs:n}=t;if(n!==null&&n>=25)return{kind:"count",installs:n};let i=t.publishedAt===void 0?NaN:Date.parse(t.publishedAt);return e-i<2592e6?{kind:"new"}:n===null?null:{kind:"count",installs:n}}var po=Qt(Ae(),1),go=Qt(to(),1);import{randomBytes as Ra}from"node:crypto";import{lstat as ro,mkdir as tn,readdir as so,readFile as ve,realpath as ct,rename as Sa,rm as ao,rmdir as Da,writeFile as ie}from"node:fs/promises";import{dirname as lo,isAbsolute as co,join as B,relative as uo}from"node:path";var no=[{target:"components/ui/button.tsx",content:`import * as React from "react";
11
11
  import { Slot } from "@radix-ui/react-slot";
12
12
  import { cva, type VariantProps } from "class-variance-authority";
13
13