@lifesi/genesis 0.1.0 → 0.1.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/genesis.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { GenesisClient, type GenesisOptions } from './client.js';
2
2
  import type { OperationInput as In } from './types.js';
3
3
  import type { components } from './generated/schema.js';
4
+ import { type HivesUploadOptions } from './hives-upload.js';
4
5
  type S = components['schemas'];
5
6
  export type ChatMessage = {
6
7
  role: 'system' | 'user' | 'assistant' | 'tool';
@@ -20,16 +21,91 @@ export declare class Genesis extends GenesisClient {
20
21
  headers?: Record<string, string>;
21
22
  }) => Promise<import("./types.js").OperationOutput<K>>;
22
23
  readonly dials: {
24
+ overview: {
25
+ summary: (scope: import("./dials.js").DialsScope) => Promise<{
26
+ ok: boolean;
27
+ scope: components["schemas"]["Dials.Scope"];
28
+ calls: {
29
+ total: number;
30
+ queued: number;
31
+ active: number;
32
+ completed: number;
33
+ failed: number;
34
+ };
35
+ dispatch: {
36
+ total: number;
37
+ pending: number;
38
+ claimed: number;
39
+ dispatched: number;
40
+ failed: number;
41
+ };
42
+ people: {
43
+ deployed: number;
44
+ };
45
+ agents: {
46
+ deployed: number;
47
+ };
48
+ routes: {
49
+ deployed: number;
50
+ };
51
+ numbers: {
52
+ deployed: number;
53
+ };
54
+ voice: {
55
+ deployed: number;
56
+ };
57
+ messages: {
58
+ total: number;
59
+ queued: number;
60
+ delivered: number;
61
+ failed: number;
62
+ };
63
+ usage: {
64
+ total: number;
65
+ quantity: number;
66
+ lastMetric: string | null;
67
+ lastResourceId: string | null;
68
+ };
69
+ }>;
70
+ operatingSurface: (scope: import("./dials.js").DialsScope) => Promise<{
71
+ ok: boolean;
72
+ scope: components["schemas"]["Dials.Scope"];
73
+ summary: components["schemas"]["Dials.ConsoleSummary"];
74
+ surfaces: components["schemas"]["Dials.OperatingSurfaceCard"][];
75
+ } & {
76
+ [key: string]: unknown;
77
+ }>;
78
+ };
23
79
  numbers: {
80
+ reconciliations: (scope: import("./dials.js").DialsScope) => Promise<{
81
+ ok: boolean;
82
+ reconciliations: components["schemas"]["Dials.InventoryReconciliation"][];
83
+ }>;
84
+ drift: (scope: import("./dials.js").DialsScope) => Promise<{
85
+ ok: boolean;
86
+ drift: components["schemas"]["Dials.InventoryDrift"][];
87
+ }>;
88
+ updateCallerName: (body: In<"dials_updateNumberCallerName">["body"]) => Promise<{
89
+ ok: boolean;
90
+ number: components["schemas"]["Dials.Number"];
91
+ auditId: string;
92
+ next: string;
93
+ }>;
94
+ reconcile: (body: In<"dials_reconcileNumberInventory">["body"]) => Promise<{
95
+ ok: boolean;
96
+ reconciliations: components["schemas"]["Dials.InventoryReconciliation"][];
97
+ drift: components["schemas"]["Dials.InventoryDrift"][];
98
+ orphanCount: number;
99
+ auditId: string;
100
+ next: string;
101
+ }>;
24
102
  list: (scope: import("./dials.js").DialsScope) => Promise<{
25
103
  ok: boolean;
26
104
  numbers: components["schemas"]["Dials.Number"][];
27
105
  }>;
28
- search: (scope: import("./dials.js").DialsScope, query?: {
29
- areaCode?: string;
30
- limit?: number;
31
- }) => Promise<{
32
- [key: string]: unknown;
106
+ search: (scope: import("./dials.js").DialsScope, query?: Omit<In<"dials_searchNumbers">, keyof import("./dials.js").DialsScope>) => Promise<{
107
+ ok: boolean;
108
+ numbers: components["schemas"]["Dials.AvailableNumber"][];
33
109
  }>;
34
110
  provision: (body: In<"dials_provisionNumber">["body"]) => Promise<{
35
111
  [key: string]: unknown;
@@ -406,42 +482,251 @@ export declare class Genesis extends GenesisClient {
406
482
  requests_24h: number;
407
483
  total_deployments: number;
408
484
  }>;
485
+ update: (project_id: string, body: In<"hives_update_project">["body"]) => Promise<Record<string, never> & {
486
+ active_instances: number;
487
+ current_version?: number | null;
488
+ requests_24h: number;
489
+ total_deployments: number;
490
+ }>;
491
+ activity: (project_id: string, q?: Omit<In<"hives_get_project_activity">, "project_id">) => Promise<{
492
+ data: components["schemas"]["Hives.ActivityEntry"][];
493
+ pagination: components["schemas"]["Hives.PaginationMeta"];
494
+ }>;
409
495
  delete: (project_id: string) => Promise<{
410
496
  id: string;
411
497
  message: string;
412
498
  success: boolean;
413
499
  }>;
414
500
  };
501
+ secrets: {
502
+ list: (project_id: string, q?: Omit<In<"hives_list_secrets">, "project_id">) => Promise<{
503
+ data: {
504
+ created_at: string;
505
+ description?: string | null;
506
+ name: string;
507
+ updated_at: string;
508
+ version: number;
509
+ }[];
510
+ pagination: components["schemas"]["Hives.PaginationMeta"];
511
+ }>;
512
+ get: (project_id: string, secret_id: string) => Promise<{
513
+ id: string;
514
+ created_at: string;
515
+ description?: string | null;
516
+ name: string;
517
+ updated_at: string;
518
+ version: number;
519
+ }>;
520
+ create: (project_id: string, body: In<"hives_create_secret">["body"]) => Promise<{
521
+ id: string;
522
+ created_at: string;
523
+ description?: string | null;
524
+ name: string;
525
+ updated_at: string;
526
+ version: number;
527
+ }>;
528
+ update: (project_id: string, secret_id: string, body: In<"hives_update_secret">["body"]) => Promise<{
529
+ id: string;
530
+ created_at: string;
531
+ description?: string | null;
532
+ name: string;
533
+ updated_at: string;
534
+ version: number;
535
+ }>;
536
+ delete: (project_id: string, secret_id: string) => Promise<{
537
+ id: string;
538
+ message: string;
539
+ success: boolean;
540
+ }>;
541
+ /** Explicit sensitive operation. Do not log or retain the returned plaintext. */
542
+ reveal: (project_id: string, secret_id: string) => Promise<{
543
+ value: string;
544
+ }>;
545
+ bulkUpsert: (project_id: string, body: In<"hives_bulk_upsert_secrets">["body"]) => Promise<{
546
+ success: boolean;
547
+ secrets: components["schemas"]["Hives.SecretResponse"][];
548
+ }>;
549
+ };
415
550
  deployments: {
416
- list: (project_id: string) => Promise<{
551
+ list: (project_id: string, q?: Omit<In<"hives_list_deployments">, "project_id">) => Promise<{
417
552
  data: (Record<string, never> & {
418
553
  logs_url?: string | null;
419
554
  url?: string | null;
420
555
  })[];
421
556
  pagination: components["schemas"]["Hives.PaginationMeta"];
422
557
  }>;
423
- create: (project_id: string, body: In<"hives_create_deployment">["body"]) => Promise<Record<string, never> & {
558
+ get: (project_id: string, deployment_id: string) => Promise<{
559
+ id: string;
560
+ project_id: string;
561
+ tenant_id: string;
562
+ module_id: string;
563
+ module_hash?: string | null;
564
+ version: number;
565
+ status: string;
566
+ git_sha?: string | null;
567
+ git_branch?: string | null;
568
+ created_by: string;
569
+ created_at: string;
570
+ promoted_at?: string | null;
571
+ logs_url?: string | null;
572
+ url?: string | null;
573
+ }>;
574
+ upload: (project_id: string, file: Blob, options?: HivesUploadOptions) => Promise<{
575
+ id: string;
576
+ project_id: string;
577
+ tenant_id: string;
578
+ module_id: string;
579
+ module_hash?: string | null;
580
+ version: number;
581
+ status: string;
582
+ git_sha?: string | null;
583
+ git_branch?: string | null;
584
+ created_by: string;
585
+ created_at: string;
586
+ promoted_at?: string | null;
424
587
  logs_url?: string | null;
425
588
  url?: string | null;
426
589
  }>;
427
- rollback: (project_id: string, body?: unknown) => Promise<Record<string, never> & {
590
+ create: (project_id: string, body: In<"hives_create_deployment">["body"]) => Promise<{
591
+ id: string;
592
+ project_id: string;
593
+ tenant_id: string;
594
+ module_id: string;
595
+ module_hash?: string | null;
596
+ version: number;
597
+ status: string;
598
+ git_sha?: string | null;
599
+ git_branch?: string | null;
600
+ created_by: string;
601
+ created_at: string;
602
+ promoted_at?: string | null;
603
+ logs_url?: string | null;
604
+ url?: string | null;
605
+ }>;
606
+ promote: (project_id: string, deployment_id: string) => Promise<{
607
+ id: string;
608
+ project_id: string;
609
+ tenant_id: string;
610
+ module_id: string;
611
+ module_hash?: string | null;
612
+ version: number;
613
+ status: string;
614
+ git_sha?: string | null;
615
+ git_branch?: string | null;
616
+ created_by: string;
617
+ created_at: string;
618
+ promoted_at?: string | null;
619
+ logs_url?: string | null;
620
+ url?: string | null;
621
+ }>;
622
+ rollback: (project_id: string, deployment_id: string, body?: In<"hives_rollback_deployment">["body"]) => Promise<{
623
+ id: string;
624
+ project_id: string;
625
+ tenant_id: string;
626
+ module_id: string;
627
+ module_hash?: string | null;
628
+ version: number;
629
+ status: string;
630
+ git_sha?: string | null;
631
+ git_branch?: string | null;
632
+ created_by: string;
633
+ created_at: string;
634
+ promoted_at?: string | null;
635
+ logs_url?: string | null;
636
+ url?: string | null;
637
+ }>;
638
+ cancel: (project_id: string, deployment_id: string) => Promise<{
639
+ id: string;
640
+ project_id: string;
641
+ tenant_id: string;
642
+ module_id: string;
643
+ module_hash?: string | null;
644
+ version: number;
645
+ status: string;
646
+ git_sha?: string | null;
647
+ git_branch?: string | null;
648
+ created_by: string;
649
+ created_at: string;
650
+ promoted_at?: string | null;
428
651
  logs_url?: string | null;
429
652
  url?: string | null;
430
653
  }>;
654
+ delete: (project_id: string, deployment_id: string) => Promise<{
655
+ id: string;
656
+ message: string;
657
+ success: boolean;
658
+ }>;
659
+ logs: (project_id: string, deployment_id: string, q?: Omit<In<"hives_query_deployment_logs">, "project_id" | "deployment_id">) => Promise<{
660
+ logs: components["schemas"]["Hives.LogEntry"][];
661
+ pagination: components["schemas"]["Hives.PaginationMeta"];
662
+ time_range: components["schemas"]["Hives.TimeRange"];
663
+ }>;
664
+ invoke: (project_id: string, deployment_id: string, body?: In<"hives_invoke_deployment">["body"], init?: {
665
+ signal?: AbortSignal;
666
+ }) => Promise<Response>;
431
667
  };
432
668
  functions: {
433
- list: (project_id: string) => Promise<Record<string, never>>;
434
- invoke: (project_id: string, function_id: string, body?: unknown) => Promise<{
435
- billed_duration_ms: number;
436
- body: unknown;
437
- duration_ms: number;
438
- headers: {
439
- [key: string]: string;
440
- };
441
- memory_used_mb: number;
442
- request_id: string;
443
- status: number;
669
+ list: (project_id: string, q?: Omit<In<"hives_list_functions">, "project_id">) => Promise<{
670
+ data: components["schemas"]["Hives.FunctionResponse"][];
671
+ pagination: components["schemas"]["Hives.PaginationMeta"];
672
+ }>;
673
+ get: (project_id: string, function_id: string) => Promise<{
674
+ id: string;
675
+ tenant_id: string;
676
+ project_id: string;
677
+ name: string;
678
+ description?: string | null;
679
+ handler: string;
680
+ route?: string | null;
681
+ memory_mb: number;
682
+ timeout_ms: number;
683
+ status: string;
684
+ invocations: number;
685
+ avg_duration_ms: number;
686
+ created_at: string;
687
+ updated_at: string;
688
+ }>;
689
+ create: (project_id: string, body: In<"hives_create_function">["body"]) => Promise<{
690
+ id: string;
691
+ tenant_id: string;
692
+ project_id: string;
693
+ name: string;
694
+ description?: string | null;
695
+ handler: string;
696
+ route?: string | null;
697
+ memory_mb: number;
698
+ timeout_ms: number;
699
+ status: string;
700
+ invocations: number;
701
+ avg_duration_ms: number;
702
+ created_at: string;
703
+ updated_at: string;
704
+ }>;
705
+ update: (project_id: string, function_id: string, body: In<"hives_update_function">["body"]) => Promise<{
706
+ id: string;
707
+ tenant_id: string;
708
+ project_id: string;
709
+ name: string;
710
+ description?: string | null;
711
+ handler: string;
712
+ route?: string | null;
713
+ memory_mb: number;
714
+ timeout_ms: number;
715
+ status: string;
716
+ invocations: number;
717
+ avg_duration_ms: number;
718
+ created_at: string;
719
+ updated_at: string;
720
+ }>;
721
+ delete: (project_id: string, function_id: string) => Promise<{
722
+ id: string;
723
+ message: string;
724
+ success: boolean;
444
725
  }>;
726
+ /** Completed raw guest response; parse text/JSON/bytes explicitly. Never follows redirects. */
727
+ invoke: (project_id: string, function_id: string, body?: In<"hives_invoke_function">["body"], init?: {
728
+ signal?: AbortSignal;
729
+ }) => Promise<Response>;
445
730
  };
446
731
  regions: {
447
732
  list: () => Promise<{
package/dist/genesis.js CHANGED
@@ -3,6 +3,7 @@ import { dialsModule } from './dials.js';
3
3
  import { GenesisClient } from './client.js';
4
4
  import { henryModule } from './henry.js';
5
5
  import { fleetsModule } from './fleets.js';
6
+ import { hivesUploadBody } from './hives-upload.js';
6
7
  import { runnerModule } from './runner.js';
7
8
  /**
8
9
  * The Genesis SDK: one client, every service.
@@ -38,16 +39,40 @@ export class Genesis extends GenesisClient {
38
39
  list: (q = {}) => this.request('hives_list_projects', q),
39
40
  get: (project_id) => this.request('hives_get_project', { project_id }),
40
41
  create: (body) => this.request('hives_create_project', { body }),
42
+ update: (project_id, body) => this.request('hives_update_project', { project_id, body }),
43
+ activity: (project_id, q = {}) => this.request('hives_get_project_activity', { ...q, project_id }),
41
44
  delete: (project_id) => this.request('hives_delete_project', { project_id }),
42
45
  },
46
+ secrets: {
47
+ list: (project_id, q = {}) => this.request('hives_list_secrets', { ...q, project_id }),
48
+ get: (project_id, secret_id) => this.request('hives_get_secret', { project_id, secret_id }),
49
+ create: (project_id, body) => this.request('hives_create_secret', { project_id, body }),
50
+ update: (project_id, secret_id, body) => this.request('hives_update_secret', { project_id, secret_id, body }),
51
+ delete: (project_id, secret_id) => this.request('hives_delete_secret', { project_id, secret_id }),
52
+ /** Explicit sensitive operation. Do not log or retain the returned plaintext. */
53
+ reveal: (project_id, secret_id) => this.request('hives_reveal_secret', { project_id, secret_id }),
54
+ bulkUpsert: (project_id, body) => this.request('hives_bulk_upsert_secrets', { project_id, body }),
55
+ },
43
56
  deployments: {
44
- list: (project_id) => this.request('hives_list_deployments', { project_id }),
57
+ list: (project_id, q = {}) => this.request('hives_list_deployments', { ...q, project_id }),
58
+ get: (project_id, deployment_id) => this.request('hives_get_deployment', { project_id, deployment_id }),
59
+ upload: async (project_id, file, options = {}) => this.request('hives_upload_deployment', { project_id, body: await hivesUploadBody(file, options) }),
45
60
  create: (project_id, body) => this.request('hives_create_deployment', { project_id, body }),
46
- rollback: (project_id, body) => this.request('hives_rollback_deployment', { project_id, body }),
61
+ promote: (project_id, deployment_id) => this.request('hives_promote_deployment', { project_id, deployment_id }),
62
+ rollback: (project_id, deployment_id, body = {}) => this.request('hives_rollback_deployment', { project_id, deployment_id, body }),
63
+ cancel: (project_id, deployment_id) => this.request('hives_cancel_deployment', { project_id, deployment_id }),
64
+ delete: (project_id, deployment_id) => this.request('hives_delete_deployment', { project_id, deployment_id }),
65
+ logs: (project_id, deployment_id, q = {}) => this.request('hives_query_deployment_logs', { ...q, project_id, deployment_id }),
66
+ invoke: (project_id, deployment_id, body = {}, init = {}) => this.raw('hives_invoke_deployment', { project_id, deployment_id, body }, init),
47
67
  },
48
68
  functions: {
49
- list: (project_id) => this.request('hives_list_functions', { project_id }),
50
- invoke: (project_id, function_id, body) => this.request('hives_invoke_function', { project_id, function_id, body }),
69
+ list: (project_id, q = {}) => this.request('hives_list_functions', { ...q, project_id }),
70
+ get: (project_id, function_id) => this.request('hives_get_function', { project_id, function_id }),
71
+ create: (project_id, body) => this.request('hives_create_function', { project_id, body }),
72
+ update: (project_id, function_id, body) => this.request('hives_update_function', { project_id, function_id, body }),
73
+ delete: (project_id, function_id) => this.request('hives_delete_function', { project_id, function_id }),
74
+ /** Completed raw guest response; parse text/JSON/bytes explicitly. Never follows redirects. */
75
+ invoke: (project_id, function_id, body = {}, init = {}) => this.raw('hives_invoke_function', { project_id, function_id, body }, init),
51
76
  },
52
77
  regions: { list: () => this.request('hives_list_regions') },
53
78
  };