@kmmao/happy-agent 0.5.5 → 0.7.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.d.cts CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import * as z from 'zod';
3
+ import { z as z$1 } from 'zod';
3
4
  import { EventEmitter } from 'node:events';
4
5
  import { Socket } from 'socket.io-client';
5
6
 
@@ -44,6 +45,27 @@ declare const MachineMetadataSchema: z.ZodObject<{
44
45
  happyLibDir: z.ZodString;
45
46
  }, z.core.$strip>;
46
47
  type MachineMetadata = z.infer<typeof MachineMetadataSchema>;
48
+ declare const TailscaleInfoSchema: z.ZodObject<{
49
+ status: z.ZodEnum<{
50
+ connected: "connected";
51
+ disconnected: "disconnected";
52
+ "not-installed": "not-installed";
53
+ }>;
54
+ ipv4: z.ZodOptional<z.ZodString>;
55
+ ipv6: z.ZodOptional<z.ZodString>;
56
+ hostname: z.ZodOptional<z.ZodString>;
57
+ tailnetName: z.ZodOptional<z.ZodString>;
58
+ version: z.ZodOptional<z.ZodString>;
59
+ serves: z.ZodOptional<z.ZodArray<z.ZodObject<{
60
+ port: z.ZodNumber;
61
+ path: z.ZodOptional<z.ZodString>;
62
+ protocol: z.ZodString;
63
+ target: z.ZodString;
64
+ funnel: z.ZodBoolean;
65
+ hostname: z.ZodString;
66
+ }, z.core.$strip>>>;
67
+ }, z.core.$strip>;
68
+ type TailscaleInfo = z.infer<typeof TailscaleInfoSchema>;
47
69
  declare const TunnelEntrySchema: z.ZodObject<{
48
70
  provider: z.ZodString;
49
71
  localPort: z.ZodNumber;
@@ -354,6 +376,52 @@ declare const DaemonStateSchema: z.ZodObject<{
354
376
  }, z.core.$strip>;
355
377
  type DaemonState = z.infer<typeof DaemonStateSchema>;
356
378
 
379
+ declare const ResolvedRuntimeProfileSchema: z$1.ZodObject<{
380
+ schemaVersion: z$1.ZodDefault<z$1.ZodLiteral<1>>;
381
+ profileId: z$1.ZodOptional<z$1.ZodString>;
382
+ profileName: z$1.ZodOptional<z$1.ZodString>;
383
+ source: z$1.ZodEnum<{
384
+ "built-in-profile": "built-in-profile";
385
+ "account-profile": "account-profile";
386
+ "local-profile": "local-profile";
387
+ "ad-hoc": "ad-hoc";
388
+ }>;
389
+ trust: z$1.ZodEnum<{
390
+ trusted: "trusted";
391
+ untrusted: "untrusted";
392
+ }>;
393
+ isBuiltIn: z$1.ZodOptional<z$1.ZodBoolean>;
394
+ compatibility: z$1.ZodOptional<z$1.ZodObject<{
395
+ claude: z$1.ZodDefault<z$1.ZodBoolean>;
396
+ codex: z$1.ZodDefault<z$1.ZodBoolean>;
397
+ gemini: z$1.ZodDefault<z$1.ZodBoolean>;
398
+ }, z$1.core.$strip>>;
399
+ environmentVariables: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
400
+ startupBashScript: z$1.ZodOptional<z$1.ZodString>;
401
+ customModels: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
402
+ id: z$1.ZodString;
403
+ name: z$1.ZodString;
404
+ description: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
405
+ }, z$1.core.$strip>>>;
406
+ modelMappings: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
407
+ defaultSessionType: z$1.ZodOptional<z$1.ZodEnum<{
408
+ worktree: "worktree";
409
+ simple: "simple";
410
+ }>>;
411
+ defaultPermissionMode: z$1.ZodOptional<z$1.ZodEnum<{
412
+ default: "default";
413
+ acceptEdits: "acceptEdits";
414
+ bypassPermissions: "bypassPermissions";
415
+ plan: "plan";
416
+ auto: "auto";
417
+ "read-only": "read-only";
418
+ "safe-yolo": "safe-yolo";
419
+ yolo: "yolo";
420
+ }>>;
421
+ defaultModelMode: z$1.ZodOptional<z$1.ZodString>;
422
+ }, z$1.core.$strip>;
423
+ type ResolvedRuntimeProfile = z$1.infer<typeof ResolvedRuntimeProfileSchema>;
424
+
357
425
  type EncryptionVariant = "legacy" | "dataKey";
358
426
  type SessionEncryption = {
359
427
  readonly key: Uint8Array;
@@ -593,30 +661,6 @@ declare class SessionClient extends EventEmitter {
593
661
  private setupSocketListeners;
594
662
  }
595
663
 
596
- /**
597
- * Tailscale detection utility for happy-agent.
598
- *
599
- * Adapted from happy-cli/src/utils/tailscale.ts — keep in sync.
600
- */
601
- type TailscaleStatus = "connected" | "disconnected" | "not-installed";
602
- type TailscaleServeEntry = {
603
- port: number;
604
- path: string;
605
- protocol: string;
606
- target: string;
607
- funnel: boolean;
608
- hostname: string;
609
- };
610
- type TailscaleInfo = {
611
- status: TailscaleStatus;
612
- ipv4?: string;
613
- ipv6?: string;
614
- hostname?: string;
615
- tailnetName?: string;
616
- version?: string;
617
- serves?: TailscaleServeEntry[];
618
- };
619
-
620
664
  /**
621
665
  * Tunnel Provider abstraction — unified interface for all tunnel backends.
622
666
  *
@@ -943,22 +987,6 @@ declare class AutomationAuditStore {
943
987
  get size(): number;
944
988
  }
945
989
 
946
- /**
947
- * Machine WebSocket client — trimmed from CLI's ApiMachineClient.
948
- *
949
- * Core capabilities retained:
950
- * - Machine-scoped Socket.IO connection
951
- * - RPC handler registration (via RpcHandlerManager)
952
- * - keepAlive heartbeat
953
- * - updateMetadata / updateDaemonState with OCC backoff
954
- * - Ephemeral event handling (webhook/supervisor triggers)
955
- *
956
- * Removed (CLI-only):
957
- * - Webhook/supervisor status emit + pending queues
958
- * - Fix kill handler
959
- * - CLI-specific logging (debugLargeJson)
960
- */
961
-
962
990
  /** Strongly-typed ephemeral event from server. */
963
991
  type EphemeralEvent = {
964
992
  type: "activity";
@@ -1001,6 +1029,10 @@ type EphemeralEvent = {
1001
1029
  name: string;
1002
1030
  content: string;
1003
1031
  }>;
1032
+ agentType?: string | null;
1033
+ modelOverride?: string | null;
1034
+ profileId?: string;
1035
+ runtimeProfile?: ResolvedRuntimeProfile;
1004
1036
  };
1005
1037
  type MachineClientOptions = {
1006
1038
  readonly token: string;
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import * as z from 'zod';
3
+ import { z as z$1 } from 'zod';
3
4
  import { EventEmitter } from 'node:events';
4
5
  import { Socket } from 'socket.io-client';
5
6
 
@@ -44,6 +45,27 @@ declare const MachineMetadataSchema: z.ZodObject<{
44
45
  happyLibDir: z.ZodString;
45
46
  }, z.core.$strip>;
46
47
  type MachineMetadata = z.infer<typeof MachineMetadataSchema>;
48
+ declare const TailscaleInfoSchema: z.ZodObject<{
49
+ status: z.ZodEnum<{
50
+ connected: "connected";
51
+ disconnected: "disconnected";
52
+ "not-installed": "not-installed";
53
+ }>;
54
+ ipv4: z.ZodOptional<z.ZodString>;
55
+ ipv6: z.ZodOptional<z.ZodString>;
56
+ hostname: z.ZodOptional<z.ZodString>;
57
+ tailnetName: z.ZodOptional<z.ZodString>;
58
+ version: z.ZodOptional<z.ZodString>;
59
+ serves: z.ZodOptional<z.ZodArray<z.ZodObject<{
60
+ port: z.ZodNumber;
61
+ path: z.ZodOptional<z.ZodString>;
62
+ protocol: z.ZodString;
63
+ target: z.ZodString;
64
+ funnel: z.ZodBoolean;
65
+ hostname: z.ZodString;
66
+ }, z.core.$strip>>>;
67
+ }, z.core.$strip>;
68
+ type TailscaleInfo = z.infer<typeof TailscaleInfoSchema>;
47
69
  declare const TunnelEntrySchema: z.ZodObject<{
48
70
  provider: z.ZodString;
49
71
  localPort: z.ZodNumber;
@@ -354,6 +376,52 @@ declare const DaemonStateSchema: z.ZodObject<{
354
376
  }, z.core.$strip>;
355
377
  type DaemonState = z.infer<typeof DaemonStateSchema>;
356
378
 
379
+ declare const ResolvedRuntimeProfileSchema: z$1.ZodObject<{
380
+ schemaVersion: z$1.ZodDefault<z$1.ZodLiteral<1>>;
381
+ profileId: z$1.ZodOptional<z$1.ZodString>;
382
+ profileName: z$1.ZodOptional<z$1.ZodString>;
383
+ source: z$1.ZodEnum<{
384
+ "built-in-profile": "built-in-profile";
385
+ "account-profile": "account-profile";
386
+ "local-profile": "local-profile";
387
+ "ad-hoc": "ad-hoc";
388
+ }>;
389
+ trust: z$1.ZodEnum<{
390
+ trusted: "trusted";
391
+ untrusted: "untrusted";
392
+ }>;
393
+ isBuiltIn: z$1.ZodOptional<z$1.ZodBoolean>;
394
+ compatibility: z$1.ZodOptional<z$1.ZodObject<{
395
+ claude: z$1.ZodDefault<z$1.ZodBoolean>;
396
+ codex: z$1.ZodDefault<z$1.ZodBoolean>;
397
+ gemini: z$1.ZodDefault<z$1.ZodBoolean>;
398
+ }, z$1.core.$strip>>;
399
+ environmentVariables: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
400
+ startupBashScript: z$1.ZodOptional<z$1.ZodString>;
401
+ customModels: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
402
+ id: z$1.ZodString;
403
+ name: z$1.ZodString;
404
+ description: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
405
+ }, z$1.core.$strip>>>;
406
+ modelMappings: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
407
+ defaultSessionType: z$1.ZodOptional<z$1.ZodEnum<{
408
+ worktree: "worktree";
409
+ simple: "simple";
410
+ }>>;
411
+ defaultPermissionMode: z$1.ZodOptional<z$1.ZodEnum<{
412
+ default: "default";
413
+ acceptEdits: "acceptEdits";
414
+ bypassPermissions: "bypassPermissions";
415
+ plan: "plan";
416
+ auto: "auto";
417
+ "read-only": "read-only";
418
+ "safe-yolo": "safe-yolo";
419
+ yolo: "yolo";
420
+ }>>;
421
+ defaultModelMode: z$1.ZodOptional<z$1.ZodString>;
422
+ }, z$1.core.$strip>;
423
+ type ResolvedRuntimeProfile = z$1.infer<typeof ResolvedRuntimeProfileSchema>;
424
+
357
425
  type EncryptionVariant = "legacy" | "dataKey";
358
426
  type SessionEncryption = {
359
427
  readonly key: Uint8Array;
@@ -593,30 +661,6 @@ declare class SessionClient extends EventEmitter {
593
661
  private setupSocketListeners;
594
662
  }
595
663
 
596
- /**
597
- * Tailscale detection utility for happy-agent.
598
- *
599
- * Adapted from happy-cli/src/utils/tailscale.ts — keep in sync.
600
- */
601
- type TailscaleStatus = "connected" | "disconnected" | "not-installed";
602
- type TailscaleServeEntry = {
603
- port: number;
604
- path: string;
605
- protocol: string;
606
- target: string;
607
- funnel: boolean;
608
- hostname: string;
609
- };
610
- type TailscaleInfo = {
611
- status: TailscaleStatus;
612
- ipv4?: string;
613
- ipv6?: string;
614
- hostname?: string;
615
- tailnetName?: string;
616
- version?: string;
617
- serves?: TailscaleServeEntry[];
618
- };
619
-
620
664
  /**
621
665
  * Tunnel Provider abstraction — unified interface for all tunnel backends.
622
666
  *
@@ -943,22 +987,6 @@ declare class AutomationAuditStore {
943
987
  get size(): number;
944
988
  }
945
989
 
946
- /**
947
- * Machine WebSocket client — trimmed from CLI's ApiMachineClient.
948
- *
949
- * Core capabilities retained:
950
- * - Machine-scoped Socket.IO connection
951
- * - RPC handler registration (via RpcHandlerManager)
952
- * - keepAlive heartbeat
953
- * - updateMetadata / updateDaemonState with OCC backoff
954
- * - Ephemeral event handling (webhook/supervisor triggers)
955
- *
956
- * Removed (CLI-only):
957
- * - Webhook/supervisor status emit + pending queues
958
- * - Fix kill handler
959
- * - CLI-specific logging (debugLargeJson)
960
- */
961
-
962
990
  /** Strongly-typed ephemeral event from server. */
963
991
  type EphemeralEvent = {
964
992
  type: "activity";
@@ -1001,6 +1029,10 @@ type EphemeralEvent = {
1001
1029
  name: string;
1002
1030
  content: string;
1003
1031
  }>;
1032
+ agentType?: string | null;
1033
+ modelOverride?: string | null;
1034
+ profileId?: string;
1035
+ runtimeProfile?: ResolvedRuntimeProfile;
1004
1036
  };
1005
1037
  type MachineClientOptions = {
1006
1038
  readonly token: string;