@kmmao/happy-wire 0.16.0 → 0.16.1

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.
package/dist/index.cjs CHANGED
@@ -273,7 +273,16 @@ const MessageMetaSchema = z__namespace.object({
273
273
  * an assistant turn. Requires @anthropic-ai/claude-agent-sdk 0.2.110+ on CLI.
274
274
  * Defaults to true when unset (normal turn-triggering message).
275
275
  */
276
- shouldQuery: z__namespace.boolean().optional()
276
+ shouldQuery: z__namespace.boolean().optional(),
277
+ /**
278
+ * Worktree context for sessions running in a git worktree branch.
279
+ * Injected by the CLI when the session directory is inside a git worktree.
280
+ * Used by the server to enrich push notification titles with branch info.
281
+ */
282
+ worktree: z__namespace.object({
283
+ branch: z__namespace.string(),
284
+ path: z__namespace.string().optional()
285
+ }).optional()
277
286
  });
278
287
 
279
288
  const UserMessageSchema = z__namespace.object({
package/dist/index.d.cts CHANGED
@@ -22,6 +22,10 @@ declare const MessageMetaSchema: z.ZodObject<{
22
22
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
23
23
  displayText: z.ZodOptional<z.ZodString>;
24
24
  shouldQuery: z.ZodOptional<z.ZodBoolean>;
25
+ worktree: z.ZodOptional<z.ZodObject<{
26
+ branch: z.ZodString;
27
+ path: z.ZodOptional<z.ZodString>;
28
+ }, z.core.$strip>>;
25
29
  }, z.core.$strip>;
26
30
  type MessageMeta = z.infer<typeof MessageMetaSchema>;
27
31
 
@@ -177,8 +181,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
177
181
  }, z.core.$strip>, z.ZodObject<{
178
182
  t: z.ZodLiteral<"session-state-changed">;
179
183
  state: z.ZodEnum<{
180
- idle: "idle";
181
184
  running: "running";
185
+ idle: "idle";
182
186
  requires_action: "requires_action";
183
187
  }>;
184
188
  }, z.core.$strip>, z.ZodObject<{
@@ -230,6 +234,10 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
230
234
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
231
235
  displayText: z.ZodOptional<z.ZodString>;
232
236
  shouldQuery: z.ZodOptional<z.ZodBoolean>;
237
+ worktree: z.ZodOptional<z.ZodObject<{
238
+ branch: z.ZodString;
239
+ path: z.ZodOptional<z.ZodString>;
240
+ }, z.core.$strip>>;
233
241
  }, z.core.$strip>>;
234
242
  }, z.core.$strip>;
235
243
  type SessionProtocolMessage = z.infer<typeof SessionProtocolMessageSchema>;
@@ -261,6 +269,10 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
261
269
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
262
270
  displayText: z.ZodOptional<z.ZodString>;
263
271
  shouldQuery: z.ZodOptional<z.ZodBoolean>;
272
+ worktree: z.ZodOptional<z.ZodObject<{
273
+ branch: z.ZodString;
274
+ path: z.ZodOptional<z.ZodString>;
275
+ }, z.core.$strip>>;
264
276
  }, z.core.$strip>>;
265
277
  }, z.core.$strip>, z.ZodObject<{
266
278
  role: z.ZodLiteral<"agent">;
@@ -288,6 +300,10 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
288
300
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
289
301
  displayText: z.ZodOptional<z.ZodString>;
290
302
  shouldQuery: z.ZodOptional<z.ZodBoolean>;
303
+ worktree: z.ZodOptional<z.ZodObject<{
304
+ branch: z.ZodString;
305
+ path: z.ZodOptional<z.ZodString>;
306
+ }, z.core.$strip>>;
291
307
  }, z.core.$strip>>;
292
308
  }, z.core.$strip>, z.ZodObject<{
293
309
  role: z.ZodLiteral<"session">;
@@ -423,8 +439,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
423
439
  }, z.core.$strip>, z.ZodObject<{
424
440
  t: z.ZodLiteral<"session-state-changed">;
425
441
  state: z.ZodEnum<{
426
- idle: "idle";
427
442
  running: "running";
443
+ idle: "idle";
428
444
  requires_action: "requires_action";
429
445
  }>;
430
446
  }, z.core.$strip>, z.ZodObject<{
@@ -476,6 +492,10 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
476
492
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
477
493
  displayText: z.ZodOptional<z.ZodString>;
478
494
  shouldQuery: z.ZodOptional<z.ZodBoolean>;
495
+ worktree: z.ZodOptional<z.ZodObject<{
496
+ branch: z.ZodString;
497
+ path: z.ZodOptional<z.ZodString>;
498
+ }, z.core.$strip>>;
479
499
  }, z.core.$strip>>;
480
500
  }, z.core.$strip>], "role">;
481
501
  type MessageContent = z.infer<typeof MessageContentSchema>;
@@ -789,6 +809,10 @@ declare const UserMessageSchema: z.ZodObject<{
789
809
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
790
810
  displayText: z.ZodOptional<z.ZodString>;
791
811
  shouldQuery: z.ZodOptional<z.ZodBoolean>;
812
+ worktree: z.ZodOptional<z.ZodObject<{
813
+ branch: z.ZodString;
814
+ path: z.ZodOptional<z.ZodString>;
815
+ }, z.core.$strip>>;
792
816
  }, z.core.$strip>>;
793
817
  }, z.core.$strip>;
794
818
  type UserMessage = z.infer<typeof UserMessageSchema>;
@@ -818,6 +842,10 @@ declare const AgentMessageSchema: z.ZodObject<{
818
842
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
819
843
  displayText: z.ZodOptional<z.ZodString>;
820
844
  shouldQuery: z.ZodOptional<z.ZodBoolean>;
845
+ worktree: z.ZodOptional<z.ZodObject<{
846
+ branch: z.ZodString;
847
+ path: z.ZodOptional<z.ZodString>;
848
+ }, z.core.$strip>>;
821
849
  }, z.core.$strip>>;
822
850
  }, z.core.$strip>;
823
851
  type AgentMessage = z.infer<typeof AgentMessageSchema>;
@@ -849,6 +877,10 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
849
877
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
850
878
  displayText: z.ZodOptional<z.ZodString>;
851
879
  shouldQuery: z.ZodOptional<z.ZodBoolean>;
880
+ worktree: z.ZodOptional<z.ZodObject<{
881
+ branch: z.ZodString;
882
+ path: z.ZodOptional<z.ZodString>;
883
+ }, z.core.$strip>>;
852
884
  }, z.core.$strip>>;
853
885
  }, z.core.$strip>, z.ZodObject<{
854
886
  role: z.ZodLiteral<"agent">;
@@ -876,6 +908,10 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
876
908
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
877
909
  displayText: z.ZodOptional<z.ZodString>;
878
910
  shouldQuery: z.ZodOptional<z.ZodBoolean>;
911
+ worktree: z.ZodOptional<z.ZodObject<{
912
+ branch: z.ZodString;
913
+ path: z.ZodOptional<z.ZodString>;
914
+ }, z.core.$strip>>;
879
915
  }, z.core.$strip>>;
880
916
  }, z.core.$strip>], "role">;
881
917
  type LegacyMessageContent = z.infer<typeof LegacyMessageContentSchema>;
@@ -1041,8 +1077,8 @@ declare const sessionNeedsContinueEventSchema: z.ZodObject<{
1041
1077
  declare const sessionStateChangedEventSchema: z.ZodObject<{
1042
1078
  t: z.ZodLiteral<"session-state-changed">;
1043
1079
  state: z.ZodEnum<{
1044
- idle: "idle";
1045
1080
  running: "running";
1081
+ idle: "idle";
1046
1082
  requires_action: "requires_action";
1047
1083
  }>;
1048
1084
  }, z.core.$strip>;
@@ -1203,8 +1239,8 @@ declare const sessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1203
1239
  }, z.core.$strip>, z.ZodObject<{
1204
1240
  t: z.ZodLiteral<"session-state-changed">;
1205
1241
  state: z.ZodEnum<{
1206
- idle: "idle";
1207
1242
  running: "running";
1243
+ idle: "idle";
1208
1244
  requires_action: "requires_action";
1209
1245
  }>;
1210
1246
  }, z.core.$strip>, z.ZodObject<{
@@ -1367,8 +1403,8 @@ declare const sessionEnvelopeSchema: z.ZodObject<{
1367
1403
  }, z.core.$strip>, z.ZodObject<{
1368
1404
  t: z.ZodLiteral<"session-state-changed">;
1369
1405
  state: z.ZodEnum<{
1370
- idle: "idle";
1371
1406
  running: "running";
1407
+ idle: "idle";
1372
1408
  requires_action: "requires_action";
1373
1409
  }>;
1374
1410
  }, z.core.$strip>, z.ZodObject<{
@@ -1528,8 +1564,8 @@ declare const TunnelStateSchema: z.ZodObject<{
1528
1564
  }, z.core.$strip>;
1529
1565
  type TunnelState = z.infer<typeof TunnelStateSchema>;
1530
1566
  declare const AutomationPrioritySchema: z.ZodEnum<{
1531
- user: "user";
1532
1567
  urgent: "urgent";
1568
+ user: "user";
1533
1569
  background: "background";
1534
1570
  }>;
1535
1571
  type AutomationPriority = z.infer<typeof AutomationPrioritySchema>;
@@ -1541,12 +1577,12 @@ declare const AutomationJobKindSchema: z.ZodEnum<{
1541
1577
  }>;
1542
1578
  type AutomationJobKind = z.infer<typeof AutomationJobKindSchema>;
1543
1579
  declare const AutomationJobStatusSchema: z.ZodEnum<{
1580
+ queued: "queued";
1581
+ dispatching: "dispatching";
1582
+ running: "running";
1544
1583
  completed: "completed";
1545
1584
  failed: "failed";
1546
1585
  cancelled: "cancelled";
1547
- running: "running";
1548
- queued: "queued";
1549
- dispatching: "dispatching";
1550
1586
  }>;
1551
1587
  type AutomationJobStatus = z.infer<typeof AutomationJobStatusSchema>;
1552
1588
  declare const AutomationJobSummarySchema: z.ZodObject<{
@@ -1558,16 +1594,16 @@ declare const AutomationJobSummarySchema: z.ZodObject<{
1558
1594
  task: "task";
1559
1595
  }>;
1560
1596
  status: z.ZodEnum<{
1597
+ queued: "queued";
1598
+ dispatching: "dispatching";
1599
+ running: "running";
1561
1600
  completed: "completed";
1562
1601
  failed: "failed";
1563
1602
  cancelled: "cancelled";
1564
- running: "running";
1565
- queued: "queued";
1566
- dispatching: "dispatching";
1567
1603
  }>;
1568
1604
  priority: z.ZodEnum<{
1569
- user: "user";
1570
1605
  urgent: "urgent";
1606
+ user: "user";
1571
1607
  background: "background";
1572
1608
  }>;
1573
1609
  dedupeKey: z.ZodString;
@@ -1721,16 +1757,16 @@ declare const AutomationStateSchema: z.ZodObject<{
1721
1757
  task: "task";
1722
1758
  }>;
1723
1759
  status: z.ZodEnum<{
1760
+ queued: "queued";
1761
+ dispatching: "dispatching";
1762
+ running: "running";
1724
1763
  completed: "completed";
1725
1764
  failed: "failed";
1726
1765
  cancelled: "cancelled";
1727
- running: "running";
1728
- queued: "queued";
1729
- dispatching: "dispatching";
1730
1766
  }>;
1731
1767
  priority: z.ZodEnum<{
1732
- user: "user";
1733
1768
  urgent: "urgent";
1769
+ user: "user";
1734
1770
  background: "background";
1735
1771
  }>;
1736
1772
  dedupeKey: z.ZodString;
@@ -1963,16 +1999,16 @@ declare const DaemonStateSchema: z.ZodObject<{
1963
1999
  task: "task";
1964
2000
  }>;
1965
2001
  status: z.ZodEnum<{
2002
+ queued: "queued";
2003
+ dispatching: "dispatching";
2004
+ running: "running";
1966
2005
  completed: "completed";
1967
2006
  failed: "failed";
1968
2007
  cancelled: "cancelled";
1969
- running: "running";
1970
- queued: "queued";
1971
- dispatching: "dispatching";
1972
2008
  }>;
1973
2009
  priority: z.ZodEnum<{
1974
- user: "user";
1975
2010
  urgent: "urgent";
2011
+ user: "user";
1976
2012
  background: "background";
1977
2013
  }>;
1978
2014
  dedupeKey: z.ZodString;
@@ -2125,9 +2161,9 @@ declare const KnowledgeEntryTypeSchema: z.ZodEnum<{
2125
2161
  }>;
2126
2162
  type KnowledgeEntryType = z.infer<typeof KnowledgeEntryTypeSchema>;
2127
2163
  declare const KnowledgeContributorTypeSchema: z.ZodEnum<{
2128
- session: "session";
2129
2164
  user: "user";
2130
2165
  supervisor: "supervisor";
2166
+ session: "session";
2131
2167
  }>;
2132
2168
  type KnowledgeContributorType = z.infer<typeof KnowledgeContributorTypeSchema>;
2133
2169
  declare const KnowledgeActionSchema: z.ZodEnum<{
@@ -2158,9 +2194,9 @@ declare const CreateKnowledgeEntryBodySchema: z.ZodObject<{
2158
2194
  warning: "warning";
2159
2195
  }>;
2160
2196
  contributorType: z.ZodEnum<{
2161
- session: "session";
2162
2197
  user: "user";
2163
2198
  supervisor: "supervisor";
2199
+ session: "session";
2164
2200
  }>;
2165
2201
  action: z.ZodEnum<{
2166
2202
  create: "create";
@@ -2469,18 +2505,18 @@ declare const VoiceTokenResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2469
2505
  type VoiceTokenResponse = z.infer<typeof VoiceTokenResponseSchema>;
2470
2506
 
2471
2507
  declare const TaskPrioritySchema: z.ZodEnum<{
2472
- user: "user";
2473
2508
  urgent: "urgent";
2509
+ user: "user";
2474
2510
  background: "background";
2475
2511
  }>;
2476
2512
  type TaskPriority = z.infer<typeof TaskPrioritySchema>;
2477
2513
  declare const TaskStatusSchema: z.ZodEnum<{
2514
+ queued: "queued";
2515
+ dispatching: "dispatching";
2516
+ running: "running";
2478
2517
  completed: "completed";
2479
2518
  failed: "failed";
2480
2519
  cancelled: "cancelled";
2481
- running: "running";
2482
- queued: "queued";
2483
- dispatching: "dispatching";
2484
2520
  }>;
2485
2521
  type TaskStatus = z.infer<typeof TaskStatusSchema>;
2486
2522
  declare const TaskTriggerTypeSchema: z.ZodEnum<{
@@ -2494,17 +2530,17 @@ declare const TaskSummarySchema: z.ZodObject<{
2494
2530
  projectId: z.ZodNullable<z.ZodString>;
2495
2531
  machineId: z.ZodString;
2496
2532
  priority: z.ZodEnum<{
2497
- user: "user";
2498
2533
  urgent: "urgent";
2534
+ user: "user";
2499
2535
  background: "background";
2500
2536
  }>;
2501
2537
  status: z.ZodEnum<{
2538
+ queued: "queued";
2539
+ dispatching: "dispatching";
2540
+ running: "running";
2502
2541
  completed: "completed";
2503
2542
  failed: "failed";
2504
2543
  cancelled: "cancelled";
2505
- running: "running";
2506
- queued: "queued";
2507
- dispatching: "dispatching";
2508
2544
  }>;
2509
2545
  triggerType: z.ZodEnum<{
2510
2546
  webhook: "webhook";
@@ -2529,8 +2565,8 @@ declare const CreateTaskBodySchema: z.ZodObject<{
2529
2565
  machineId: z.ZodString;
2530
2566
  prompt: z.ZodString;
2531
2567
  priority: z.ZodDefault<z.ZodEnum<{
2532
- user: "user";
2533
2568
  urgent: "urgent";
2569
+ user: "user";
2534
2570
  background: "background";
2535
2571
  }>>;
2536
2572
  maxAttempts: z.ZodDefault<z.ZodNumber>;
@@ -2544,8 +2580,8 @@ declare const TaskTriggerDataSchema: z.ZodObject<{
2544
2580
  prompt: z.ZodString;
2545
2581
  directory: z.ZodString;
2546
2582
  priority: z.ZodEnum<{
2547
- user: "user";
2548
2583
  urgent: "urgent";
2584
+ user: "user";
2549
2585
  background: "background";
2550
2586
  }>;
2551
2587
  projectId: z.ZodOptional<z.ZodString>;
@@ -2586,8 +2622,8 @@ declare const TaskTriggerDataSchema: z.ZodObject<{
2586
2622
  }, z.core.$strip>>>;
2587
2623
  modelMappings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2588
2624
  defaultSessionType: z.ZodOptional<z.ZodEnum<{
2589
- simple: "simple";
2590
2625
  worktree: "worktree";
2626
+ simple: "simple";
2591
2627
  }>>;
2592
2628
  defaultPermissionMode: z.ZodOptional<z.ZodEnum<{
2593
2629
  default: "default";
@@ -2612,12 +2648,12 @@ type TaskOutcome = z.infer<typeof TaskOutcomeSchema>;
2612
2648
  declare const TaskStatusReportSchema: z.ZodObject<{
2613
2649
  taskId: z.ZodString;
2614
2650
  status: z.ZodEnum<{
2651
+ queued: "queued";
2652
+ dispatching: "dispatching";
2653
+ running: "running";
2615
2654
  completed: "completed";
2616
2655
  failed: "failed";
2617
2656
  cancelled: "cancelled";
2618
- running: "running";
2619
- queued: "queued";
2620
- dispatching: "dispatching";
2621
2657
  }>;
2622
2658
  outcome: z.ZodOptional<z.ZodEnum<{
2623
2659
  completed: "completed";
@@ -2633,12 +2669,12 @@ declare const TaskStatusChangedSchema: z.ZodObject<{
2633
2669
  taskId: z.ZodString;
2634
2670
  machineId: z.ZodOptional<z.ZodString>;
2635
2671
  status: z.ZodEnum<{
2672
+ queued: "queued";
2673
+ dispatching: "dispatching";
2674
+ running: "running";
2636
2675
  completed: "completed";
2637
2676
  failed: "failed";
2638
2677
  cancelled: "cancelled";
2639
- running: "running";
2640
- queued: "queued";
2641
- dispatching: "dispatching";
2642
2678
  }>;
2643
2679
  sessionId: z.ZodOptional<z.ZodString>;
2644
2680
  errorMessage: z.ZodOptional<z.ZodString>;
@@ -2683,10 +2719,10 @@ declare const SkillContentSchema: z.ZodObject<{
2683
2719
  type SkillContent = z.infer<typeof SkillContentSchema>;
2684
2720
 
2685
2721
  declare const InboxCategorySchema: z.ZodEnum<{
2686
- session: "session";
2687
2722
  supervisor: "supervisor";
2688
2723
  task: "task";
2689
2724
  trigger: "trigger";
2725
+ session: "session";
2690
2726
  knowledge: "knowledge";
2691
2727
  system: "system";
2692
2728
  }>;
@@ -2700,10 +2736,10 @@ type InboxSeverity = z.infer<typeof InboxSeveritySchema>;
2700
2736
  declare const InboxItemSummarySchema: z.ZodObject<{
2701
2737
  id: z.ZodString;
2702
2738
  category: z.ZodEnum<{
2703
- session: "session";
2704
2739
  supervisor: "supervisor";
2705
2740
  task: "task";
2706
2741
  trigger: "trigger";
2742
+ session: "session";
2707
2743
  knowledge: "knowledge";
2708
2744
  system: "system";
2709
2745
  }>;
@@ -2728,10 +2764,10 @@ declare const InboxNewItemSchema: z.ZodObject<{
2728
2764
  item: z.ZodObject<{
2729
2765
  id: z.ZodString;
2730
2766
  category: z.ZodEnum<{
2731
- session: "session";
2732
2767
  supervisor: "supervisor";
2733
2768
  task: "task";
2734
2769
  trigger: "trigger";
2770
+ session: "session";
2735
2771
  knowledge: "knowledge";
2736
2772
  system: "system";
2737
2773
  }>;
@@ -3019,8 +3055,8 @@ declare const AIBackendProfileSchema: z$1.ZodObject<{
3019
3055
  }, z$1.core.$strip>>>;
3020
3056
  modelMappings: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
3021
3057
  defaultSessionType: z$1.ZodOptional<z$1.ZodEnum<{
3022
- simple: "simple";
3023
3058
  worktree: "worktree";
3059
+ simple: "simple";
3024
3060
  }>>;
3025
3061
  defaultPermissionMode: z$1.ZodOptional<z$1.ZodEnum<{
3026
3062
  default: "default";
@@ -3086,8 +3122,8 @@ declare const ResolvedRuntimeProfileSchema: z$1.ZodObject<{
3086
3122
  }, z$1.core.$strip>>>;
3087
3123
  modelMappings: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
3088
3124
  defaultSessionType: z$1.ZodOptional<z$1.ZodEnum<{
3089
- simple: "simple";
3090
3125
  worktree: "worktree";
3126
+ simple: "simple";
3091
3127
  }>>;
3092
3128
  defaultPermissionMode: z$1.ZodOptional<z$1.ZodEnum<{
3093
3129
  default: "default";
package/dist/index.d.mts CHANGED
@@ -22,6 +22,10 @@ declare const MessageMetaSchema: z.ZodObject<{
22
22
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
23
23
  displayText: z.ZodOptional<z.ZodString>;
24
24
  shouldQuery: z.ZodOptional<z.ZodBoolean>;
25
+ worktree: z.ZodOptional<z.ZodObject<{
26
+ branch: z.ZodString;
27
+ path: z.ZodOptional<z.ZodString>;
28
+ }, z.core.$strip>>;
25
29
  }, z.core.$strip>;
26
30
  type MessageMeta = z.infer<typeof MessageMetaSchema>;
27
31
 
@@ -177,8 +181,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
177
181
  }, z.core.$strip>, z.ZodObject<{
178
182
  t: z.ZodLiteral<"session-state-changed">;
179
183
  state: z.ZodEnum<{
180
- idle: "idle";
181
184
  running: "running";
185
+ idle: "idle";
182
186
  requires_action: "requires_action";
183
187
  }>;
184
188
  }, z.core.$strip>, z.ZodObject<{
@@ -230,6 +234,10 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
230
234
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
231
235
  displayText: z.ZodOptional<z.ZodString>;
232
236
  shouldQuery: z.ZodOptional<z.ZodBoolean>;
237
+ worktree: z.ZodOptional<z.ZodObject<{
238
+ branch: z.ZodString;
239
+ path: z.ZodOptional<z.ZodString>;
240
+ }, z.core.$strip>>;
233
241
  }, z.core.$strip>>;
234
242
  }, z.core.$strip>;
235
243
  type SessionProtocolMessage = z.infer<typeof SessionProtocolMessageSchema>;
@@ -261,6 +269,10 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
261
269
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
262
270
  displayText: z.ZodOptional<z.ZodString>;
263
271
  shouldQuery: z.ZodOptional<z.ZodBoolean>;
272
+ worktree: z.ZodOptional<z.ZodObject<{
273
+ branch: z.ZodString;
274
+ path: z.ZodOptional<z.ZodString>;
275
+ }, z.core.$strip>>;
264
276
  }, z.core.$strip>>;
265
277
  }, z.core.$strip>, z.ZodObject<{
266
278
  role: z.ZodLiteral<"agent">;
@@ -288,6 +300,10 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
288
300
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
289
301
  displayText: z.ZodOptional<z.ZodString>;
290
302
  shouldQuery: z.ZodOptional<z.ZodBoolean>;
303
+ worktree: z.ZodOptional<z.ZodObject<{
304
+ branch: z.ZodString;
305
+ path: z.ZodOptional<z.ZodString>;
306
+ }, z.core.$strip>>;
291
307
  }, z.core.$strip>>;
292
308
  }, z.core.$strip>, z.ZodObject<{
293
309
  role: z.ZodLiteral<"session">;
@@ -423,8 +439,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
423
439
  }, z.core.$strip>, z.ZodObject<{
424
440
  t: z.ZodLiteral<"session-state-changed">;
425
441
  state: z.ZodEnum<{
426
- idle: "idle";
427
442
  running: "running";
443
+ idle: "idle";
428
444
  requires_action: "requires_action";
429
445
  }>;
430
446
  }, z.core.$strip>, z.ZodObject<{
@@ -476,6 +492,10 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
476
492
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
477
493
  displayText: z.ZodOptional<z.ZodString>;
478
494
  shouldQuery: z.ZodOptional<z.ZodBoolean>;
495
+ worktree: z.ZodOptional<z.ZodObject<{
496
+ branch: z.ZodString;
497
+ path: z.ZodOptional<z.ZodString>;
498
+ }, z.core.$strip>>;
479
499
  }, z.core.$strip>>;
480
500
  }, z.core.$strip>], "role">;
481
501
  type MessageContent = z.infer<typeof MessageContentSchema>;
@@ -789,6 +809,10 @@ declare const UserMessageSchema: z.ZodObject<{
789
809
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
790
810
  displayText: z.ZodOptional<z.ZodString>;
791
811
  shouldQuery: z.ZodOptional<z.ZodBoolean>;
812
+ worktree: z.ZodOptional<z.ZodObject<{
813
+ branch: z.ZodString;
814
+ path: z.ZodOptional<z.ZodString>;
815
+ }, z.core.$strip>>;
792
816
  }, z.core.$strip>>;
793
817
  }, z.core.$strip>;
794
818
  type UserMessage = z.infer<typeof UserMessageSchema>;
@@ -818,6 +842,10 @@ declare const AgentMessageSchema: z.ZodObject<{
818
842
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
819
843
  displayText: z.ZodOptional<z.ZodString>;
820
844
  shouldQuery: z.ZodOptional<z.ZodBoolean>;
845
+ worktree: z.ZodOptional<z.ZodObject<{
846
+ branch: z.ZodString;
847
+ path: z.ZodOptional<z.ZodString>;
848
+ }, z.core.$strip>>;
821
849
  }, z.core.$strip>>;
822
850
  }, z.core.$strip>;
823
851
  type AgentMessage = z.infer<typeof AgentMessageSchema>;
@@ -849,6 +877,10 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
849
877
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
850
878
  displayText: z.ZodOptional<z.ZodString>;
851
879
  shouldQuery: z.ZodOptional<z.ZodBoolean>;
880
+ worktree: z.ZodOptional<z.ZodObject<{
881
+ branch: z.ZodString;
882
+ path: z.ZodOptional<z.ZodString>;
883
+ }, z.core.$strip>>;
852
884
  }, z.core.$strip>>;
853
885
  }, z.core.$strip>, z.ZodObject<{
854
886
  role: z.ZodLiteral<"agent">;
@@ -876,6 +908,10 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
876
908
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
877
909
  displayText: z.ZodOptional<z.ZodString>;
878
910
  shouldQuery: z.ZodOptional<z.ZodBoolean>;
911
+ worktree: z.ZodOptional<z.ZodObject<{
912
+ branch: z.ZodString;
913
+ path: z.ZodOptional<z.ZodString>;
914
+ }, z.core.$strip>>;
879
915
  }, z.core.$strip>>;
880
916
  }, z.core.$strip>], "role">;
881
917
  type LegacyMessageContent = z.infer<typeof LegacyMessageContentSchema>;
@@ -1041,8 +1077,8 @@ declare const sessionNeedsContinueEventSchema: z.ZodObject<{
1041
1077
  declare const sessionStateChangedEventSchema: z.ZodObject<{
1042
1078
  t: z.ZodLiteral<"session-state-changed">;
1043
1079
  state: z.ZodEnum<{
1044
- idle: "idle";
1045
1080
  running: "running";
1081
+ idle: "idle";
1046
1082
  requires_action: "requires_action";
1047
1083
  }>;
1048
1084
  }, z.core.$strip>;
@@ -1203,8 +1239,8 @@ declare const sessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1203
1239
  }, z.core.$strip>, z.ZodObject<{
1204
1240
  t: z.ZodLiteral<"session-state-changed">;
1205
1241
  state: z.ZodEnum<{
1206
- idle: "idle";
1207
1242
  running: "running";
1243
+ idle: "idle";
1208
1244
  requires_action: "requires_action";
1209
1245
  }>;
1210
1246
  }, z.core.$strip>, z.ZodObject<{
@@ -1367,8 +1403,8 @@ declare const sessionEnvelopeSchema: z.ZodObject<{
1367
1403
  }, z.core.$strip>, z.ZodObject<{
1368
1404
  t: z.ZodLiteral<"session-state-changed">;
1369
1405
  state: z.ZodEnum<{
1370
- idle: "idle";
1371
1406
  running: "running";
1407
+ idle: "idle";
1372
1408
  requires_action: "requires_action";
1373
1409
  }>;
1374
1410
  }, z.core.$strip>, z.ZodObject<{
@@ -1528,8 +1564,8 @@ declare const TunnelStateSchema: z.ZodObject<{
1528
1564
  }, z.core.$strip>;
1529
1565
  type TunnelState = z.infer<typeof TunnelStateSchema>;
1530
1566
  declare const AutomationPrioritySchema: z.ZodEnum<{
1531
- user: "user";
1532
1567
  urgent: "urgent";
1568
+ user: "user";
1533
1569
  background: "background";
1534
1570
  }>;
1535
1571
  type AutomationPriority = z.infer<typeof AutomationPrioritySchema>;
@@ -1541,12 +1577,12 @@ declare const AutomationJobKindSchema: z.ZodEnum<{
1541
1577
  }>;
1542
1578
  type AutomationJobKind = z.infer<typeof AutomationJobKindSchema>;
1543
1579
  declare const AutomationJobStatusSchema: z.ZodEnum<{
1580
+ queued: "queued";
1581
+ dispatching: "dispatching";
1582
+ running: "running";
1544
1583
  completed: "completed";
1545
1584
  failed: "failed";
1546
1585
  cancelled: "cancelled";
1547
- running: "running";
1548
- queued: "queued";
1549
- dispatching: "dispatching";
1550
1586
  }>;
1551
1587
  type AutomationJobStatus = z.infer<typeof AutomationJobStatusSchema>;
1552
1588
  declare const AutomationJobSummarySchema: z.ZodObject<{
@@ -1558,16 +1594,16 @@ declare const AutomationJobSummarySchema: z.ZodObject<{
1558
1594
  task: "task";
1559
1595
  }>;
1560
1596
  status: z.ZodEnum<{
1597
+ queued: "queued";
1598
+ dispatching: "dispatching";
1599
+ running: "running";
1561
1600
  completed: "completed";
1562
1601
  failed: "failed";
1563
1602
  cancelled: "cancelled";
1564
- running: "running";
1565
- queued: "queued";
1566
- dispatching: "dispatching";
1567
1603
  }>;
1568
1604
  priority: z.ZodEnum<{
1569
- user: "user";
1570
1605
  urgent: "urgent";
1606
+ user: "user";
1571
1607
  background: "background";
1572
1608
  }>;
1573
1609
  dedupeKey: z.ZodString;
@@ -1721,16 +1757,16 @@ declare const AutomationStateSchema: z.ZodObject<{
1721
1757
  task: "task";
1722
1758
  }>;
1723
1759
  status: z.ZodEnum<{
1760
+ queued: "queued";
1761
+ dispatching: "dispatching";
1762
+ running: "running";
1724
1763
  completed: "completed";
1725
1764
  failed: "failed";
1726
1765
  cancelled: "cancelled";
1727
- running: "running";
1728
- queued: "queued";
1729
- dispatching: "dispatching";
1730
1766
  }>;
1731
1767
  priority: z.ZodEnum<{
1732
- user: "user";
1733
1768
  urgent: "urgent";
1769
+ user: "user";
1734
1770
  background: "background";
1735
1771
  }>;
1736
1772
  dedupeKey: z.ZodString;
@@ -1963,16 +1999,16 @@ declare const DaemonStateSchema: z.ZodObject<{
1963
1999
  task: "task";
1964
2000
  }>;
1965
2001
  status: z.ZodEnum<{
2002
+ queued: "queued";
2003
+ dispatching: "dispatching";
2004
+ running: "running";
1966
2005
  completed: "completed";
1967
2006
  failed: "failed";
1968
2007
  cancelled: "cancelled";
1969
- running: "running";
1970
- queued: "queued";
1971
- dispatching: "dispatching";
1972
2008
  }>;
1973
2009
  priority: z.ZodEnum<{
1974
- user: "user";
1975
2010
  urgent: "urgent";
2011
+ user: "user";
1976
2012
  background: "background";
1977
2013
  }>;
1978
2014
  dedupeKey: z.ZodString;
@@ -2125,9 +2161,9 @@ declare const KnowledgeEntryTypeSchema: z.ZodEnum<{
2125
2161
  }>;
2126
2162
  type KnowledgeEntryType = z.infer<typeof KnowledgeEntryTypeSchema>;
2127
2163
  declare const KnowledgeContributorTypeSchema: z.ZodEnum<{
2128
- session: "session";
2129
2164
  user: "user";
2130
2165
  supervisor: "supervisor";
2166
+ session: "session";
2131
2167
  }>;
2132
2168
  type KnowledgeContributorType = z.infer<typeof KnowledgeContributorTypeSchema>;
2133
2169
  declare const KnowledgeActionSchema: z.ZodEnum<{
@@ -2158,9 +2194,9 @@ declare const CreateKnowledgeEntryBodySchema: z.ZodObject<{
2158
2194
  warning: "warning";
2159
2195
  }>;
2160
2196
  contributorType: z.ZodEnum<{
2161
- session: "session";
2162
2197
  user: "user";
2163
2198
  supervisor: "supervisor";
2199
+ session: "session";
2164
2200
  }>;
2165
2201
  action: z.ZodEnum<{
2166
2202
  create: "create";
@@ -2469,18 +2505,18 @@ declare const VoiceTokenResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2469
2505
  type VoiceTokenResponse = z.infer<typeof VoiceTokenResponseSchema>;
2470
2506
 
2471
2507
  declare const TaskPrioritySchema: z.ZodEnum<{
2472
- user: "user";
2473
2508
  urgent: "urgent";
2509
+ user: "user";
2474
2510
  background: "background";
2475
2511
  }>;
2476
2512
  type TaskPriority = z.infer<typeof TaskPrioritySchema>;
2477
2513
  declare const TaskStatusSchema: z.ZodEnum<{
2514
+ queued: "queued";
2515
+ dispatching: "dispatching";
2516
+ running: "running";
2478
2517
  completed: "completed";
2479
2518
  failed: "failed";
2480
2519
  cancelled: "cancelled";
2481
- running: "running";
2482
- queued: "queued";
2483
- dispatching: "dispatching";
2484
2520
  }>;
2485
2521
  type TaskStatus = z.infer<typeof TaskStatusSchema>;
2486
2522
  declare const TaskTriggerTypeSchema: z.ZodEnum<{
@@ -2494,17 +2530,17 @@ declare const TaskSummarySchema: z.ZodObject<{
2494
2530
  projectId: z.ZodNullable<z.ZodString>;
2495
2531
  machineId: z.ZodString;
2496
2532
  priority: z.ZodEnum<{
2497
- user: "user";
2498
2533
  urgent: "urgent";
2534
+ user: "user";
2499
2535
  background: "background";
2500
2536
  }>;
2501
2537
  status: z.ZodEnum<{
2538
+ queued: "queued";
2539
+ dispatching: "dispatching";
2540
+ running: "running";
2502
2541
  completed: "completed";
2503
2542
  failed: "failed";
2504
2543
  cancelled: "cancelled";
2505
- running: "running";
2506
- queued: "queued";
2507
- dispatching: "dispatching";
2508
2544
  }>;
2509
2545
  triggerType: z.ZodEnum<{
2510
2546
  webhook: "webhook";
@@ -2529,8 +2565,8 @@ declare const CreateTaskBodySchema: z.ZodObject<{
2529
2565
  machineId: z.ZodString;
2530
2566
  prompt: z.ZodString;
2531
2567
  priority: z.ZodDefault<z.ZodEnum<{
2532
- user: "user";
2533
2568
  urgent: "urgent";
2569
+ user: "user";
2534
2570
  background: "background";
2535
2571
  }>>;
2536
2572
  maxAttempts: z.ZodDefault<z.ZodNumber>;
@@ -2544,8 +2580,8 @@ declare const TaskTriggerDataSchema: z.ZodObject<{
2544
2580
  prompt: z.ZodString;
2545
2581
  directory: z.ZodString;
2546
2582
  priority: z.ZodEnum<{
2547
- user: "user";
2548
2583
  urgent: "urgent";
2584
+ user: "user";
2549
2585
  background: "background";
2550
2586
  }>;
2551
2587
  projectId: z.ZodOptional<z.ZodString>;
@@ -2586,8 +2622,8 @@ declare const TaskTriggerDataSchema: z.ZodObject<{
2586
2622
  }, z.core.$strip>>>;
2587
2623
  modelMappings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2588
2624
  defaultSessionType: z.ZodOptional<z.ZodEnum<{
2589
- simple: "simple";
2590
2625
  worktree: "worktree";
2626
+ simple: "simple";
2591
2627
  }>>;
2592
2628
  defaultPermissionMode: z.ZodOptional<z.ZodEnum<{
2593
2629
  default: "default";
@@ -2612,12 +2648,12 @@ type TaskOutcome = z.infer<typeof TaskOutcomeSchema>;
2612
2648
  declare const TaskStatusReportSchema: z.ZodObject<{
2613
2649
  taskId: z.ZodString;
2614
2650
  status: z.ZodEnum<{
2651
+ queued: "queued";
2652
+ dispatching: "dispatching";
2653
+ running: "running";
2615
2654
  completed: "completed";
2616
2655
  failed: "failed";
2617
2656
  cancelled: "cancelled";
2618
- running: "running";
2619
- queued: "queued";
2620
- dispatching: "dispatching";
2621
2657
  }>;
2622
2658
  outcome: z.ZodOptional<z.ZodEnum<{
2623
2659
  completed: "completed";
@@ -2633,12 +2669,12 @@ declare const TaskStatusChangedSchema: z.ZodObject<{
2633
2669
  taskId: z.ZodString;
2634
2670
  machineId: z.ZodOptional<z.ZodString>;
2635
2671
  status: z.ZodEnum<{
2672
+ queued: "queued";
2673
+ dispatching: "dispatching";
2674
+ running: "running";
2636
2675
  completed: "completed";
2637
2676
  failed: "failed";
2638
2677
  cancelled: "cancelled";
2639
- running: "running";
2640
- queued: "queued";
2641
- dispatching: "dispatching";
2642
2678
  }>;
2643
2679
  sessionId: z.ZodOptional<z.ZodString>;
2644
2680
  errorMessage: z.ZodOptional<z.ZodString>;
@@ -2683,10 +2719,10 @@ declare const SkillContentSchema: z.ZodObject<{
2683
2719
  type SkillContent = z.infer<typeof SkillContentSchema>;
2684
2720
 
2685
2721
  declare const InboxCategorySchema: z.ZodEnum<{
2686
- session: "session";
2687
2722
  supervisor: "supervisor";
2688
2723
  task: "task";
2689
2724
  trigger: "trigger";
2725
+ session: "session";
2690
2726
  knowledge: "knowledge";
2691
2727
  system: "system";
2692
2728
  }>;
@@ -2700,10 +2736,10 @@ type InboxSeverity = z.infer<typeof InboxSeveritySchema>;
2700
2736
  declare const InboxItemSummarySchema: z.ZodObject<{
2701
2737
  id: z.ZodString;
2702
2738
  category: z.ZodEnum<{
2703
- session: "session";
2704
2739
  supervisor: "supervisor";
2705
2740
  task: "task";
2706
2741
  trigger: "trigger";
2742
+ session: "session";
2707
2743
  knowledge: "knowledge";
2708
2744
  system: "system";
2709
2745
  }>;
@@ -2728,10 +2764,10 @@ declare const InboxNewItemSchema: z.ZodObject<{
2728
2764
  item: z.ZodObject<{
2729
2765
  id: z.ZodString;
2730
2766
  category: z.ZodEnum<{
2731
- session: "session";
2732
2767
  supervisor: "supervisor";
2733
2768
  task: "task";
2734
2769
  trigger: "trigger";
2770
+ session: "session";
2735
2771
  knowledge: "knowledge";
2736
2772
  system: "system";
2737
2773
  }>;
@@ -3019,8 +3055,8 @@ declare const AIBackendProfileSchema: z$1.ZodObject<{
3019
3055
  }, z$1.core.$strip>>>;
3020
3056
  modelMappings: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
3021
3057
  defaultSessionType: z$1.ZodOptional<z$1.ZodEnum<{
3022
- simple: "simple";
3023
3058
  worktree: "worktree";
3059
+ simple: "simple";
3024
3060
  }>>;
3025
3061
  defaultPermissionMode: z$1.ZodOptional<z$1.ZodEnum<{
3026
3062
  default: "default";
@@ -3086,8 +3122,8 @@ declare const ResolvedRuntimeProfileSchema: z$1.ZodObject<{
3086
3122
  }, z$1.core.$strip>>>;
3087
3123
  modelMappings: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
3088
3124
  defaultSessionType: z$1.ZodOptional<z$1.ZodEnum<{
3089
- simple: "simple";
3090
3125
  worktree: "worktree";
3126
+ simple: "simple";
3091
3127
  }>>;
3092
3128
  defaultPermissionMode: z$1.ZodOptional<z$1.ZodEnum<{
3093
3129
  default: "default";
package/dist/index.mjs CHANGED
@@ -253,7 +253,16 @@ const MessageMetaSchema = z.object({
253
253
  * an assistant turn. Requires @anthropic-ai/claude-agent-sdk 0.2.110+ on CLI.
254
254
  * Defaults to true when unset (normal turn-triggering message).
255
255
  */
256
- shouldQuery: z.boolean().optional()
256
+ shouldQuery: z.boolean().optional(),
257
+ /**
258
+ * Worktree context for sessions running in a git worktree branch.
259
+ * Injected by the CLI when the session directory is inside a git worktree.
260
+ * Used by the server to enrich push notification titles with branch info.
261
+ */
262
+ worktree: z.object({
263
+ branch: z.string(),
264
+ path: z.string().optional()
265
+ }).optional()
257
266
  });
258
267
 
259
268
  const UserMessageSchema = z.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmmao/happy-wire",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
4
4
  "description": "Shared message wire types and Zod schemas for Happy clients and services",
5
5
  "author": "kmmao",
6
6
  "license": "MIT",