vibes-diy 14.3.187 → 14.3.189

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/cli/cli-ctx.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { VibesDiyApi } from "@vibes.diy/api-impl";
1
+ import { VibesDiyApi, type WsProxyEnv } from "@vibes.diy/api-impl";
2
2
  import { SuperThis } from "@vibes.diy/identity";
3
3
  import type { HarnessCliCtx } from "./cli-kit.js";
4
4
  export declare const DEFAULT_API_URL = "https://vibes.diy/api?.stable-entry.=cli";
@@ -27,5 +27,7 @@ export interface CliCtx extends HarnessCliCtx {
27
27
  }) => VibesDiyApi;
28
28
  readonly fetch?: typeof fetch;
29
29
  readonly cwd?: () => string;
30
+ readonly proxyEnv?: WsProxyEnv;
31
+ readonly cliVersion?: string;
30
32
  exitCode: number;
31
33
  }
@@ -12,75 +12,50 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
12
12
  port: string;
13
13
  timeout: string;
14
14
  forceRenew: boolean;
15
+ cert?: string | undefined;
16
+ noBrowser?: boolean | undefined;
15
17
  }, {
16
18
  type: "core-cli.res-device-id-register";
17
19
  output: string;
18
20
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
19
- type: "vibes-diy.cli.system";
20
- }, {
21
- type: "vibes-diy.cli.res-system";
22
- systemPrompt: string;
23
- }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
24
- type: "vibes-diy.cli.remix";
25
- srcUserSlug: string;
26
- srcAppSlug: string;
27
- dstOwnerHandle?: string | undefined;
28
- dstAppSlug?: string | undefined;
29
- published: boolean;
30
- settingsOnly: boolean;
31
- apiUrl: string;
32
- }, {
33
- type: "vibes-diy.cli.res-remix";
34
- ownerHandle: string;
35
- appSlug: string;
36
- url: string;
37
- carried?: string[] | undefined;
38
- skippedPresent?: string[] | undefined;
39
- chatId?: string | undefined;
40
- }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
41
- type: "vibes-diy.cli.put-asset";
42
- file: string;
43
- appSlug: string;
44
- ownerHandle: string;
45
- apiUrl: string;
46
- mimeType: string;
47
- verifyFetch: boolean;
21
+ type: "use-vibes.cli.themes";
48
22
  }, {
49
- type: "vibes-diy.cli.res-put-asset";
50
- cid: string;
51
- getURL: string;
52
- size: number;
53
- uploadId: string;
54
- verified?: boolean | undefined;
23
+ type: "use-vibes.cli.res-themes-list";
24
+ themes: {
25
+ slug: string;
26
+ name: string;
27
+ }[];
28
+ } | {
29
+ type: "use-vibes.cli.res-theme-content";
30
+ slug: string;
31
+ content: string;
55
32
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
56
- type: "vibes-diy.cli.db.list";
33
+ type: "vibes-diy.cli.db.get";
57
34
  apiUrl: string;
58
35
  appSlug: string;
59
36
  ownerHandle: string;
37
+ dbName: string;
38
+ docId: string;
60
39
  admin: boolean;
40
+ actingHandle: string;
61
41
  }, {
62
- type: "vibes-diy.cli.db.list-res";
63
- dbNames: string[];
42
+ type: "vibes-diy.cli.db.get-res";
43
+ doc: {
44
+ [x: string]: unknown;
45
+ };
64
46
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
65
- type: "vibes-diy.cli.db.put";
47
+ type: "vibes-diy.cli.db.del";
66
48
  apiUrl: string;
67
49
  appSlug: string;
68
50
  ownerHandle: string;
69
51
  dbName: string;
70
- docJson: string;
71
52
  docId: string;
72
53
  admin: boolean;
73
54
  actingHandle: string;
74
- files?: string[] | undefined;
75
55
  }, {
76
- type: "vibes-diy.cli.db.put-res";
56
+ type: "vibes-diy.cli.db.del-res";
77
57
  id: string;
78
58
  ok: true;
79
- files?: {
80
- key: string;
81
- status: "unchanged" | "uploaded";
82
- uploadId: string;
83
- }[] | undefined;
84
59
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
85
60
  type: "vibes-diy.cli.db.seed";
86
61
  action: "add" | "remove";
@@ -103,44 +78,30 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
103
78
  failed: number;
104
79
  }[];
105
80
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
106
- type: "vibes-diy.cli.app-chats";
107
- appSlug: string;
108
- ownerHandle: string;
109
- chatId?: string | undefined;
81
+ type: "vibes-diy.cli.doctor";
110
82
  apiUrl: string;
111
83
  }, {
112
- type: "vibes-diy.cli.res-app-chats-list";
113
- items: {
114
- chatId: string;
115
- appSlug: string;
116
- ownerHandle: string;
117
- created: string;
118
- userHandle?: string | undefined;
119
- }[];
120
- } | {
121
- type: "vibes-diy.cli.res-app-chats-detail";
122
- chatId: string;
123
- ownerHandle?: string | undefined;
124
- appSlug?: string | undefined;
125
- output: string;
126
- }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
127
- type: "vibes-diy.cli.list";
84
+ type: "vibes-diy.cli.res-doctor";
85
+ cliVersion: string;
86
+ node: string;
87
+ keybagPath: string;
88
+ device: string;
89
+ deviceOk: boolean;
90
+ fingerprint?: string | undefined;
91
+ certExpires?: string | undefined;
128
92
  apiUrl: string;
129
- }, {
130
- type: "vibes-diy.cli.res-list";
131
- items: {
132
- ownerHandle: string;
133
- appSlug: string;
134
- updated: string;
135
- title?: string | undefined;
136
- icon?: {
137
- cid: string;
138
- mime: string;
139
- } | undefined;
140
- pinnedAt?: string | undefined;
141
- neverPublished?: boolean | undefined;
142
- unpublishedAt?: string | undefined;
143
- }[];
93
+ wsUrl: string;
94
+ proxy: string;
95
+ handshake: {
96
+ ok: boolean;
97
+ detail: string;
98
+ ms?: number | undefined;
99
+ };
100
+ auth?: {
101
+ ok: boolean;
102
+ detail: string;
103
+ ms?: number | undefined;
104
+ } | undefined;
144
105
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
145
106
  type: "vibes-diy.cli.app-rearm";
146
107
  appSlug: string;
@@ -510,6 +471,9 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
510
471
  email: string;
511
472
  updatedAt: string;
512
473
  verified?: boolean | undefined;
474
+ } | {
475
+ type: "onboarding";
476
+ completedAt: string;
513
477
  } | {
514
478
  type: "geoCountry";
515
479
  country: string;
@@ -520,9 +484,6 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
520
484
  [x: string]: string;
521
485
  };
522
486
  updatedAt: string;
523
- } | {
524
- type: "onboarding";
525
- completedAt: string;
526
487
  } | {
527
488
  type: "kyc";
528
489
  cardAt?: string | undefined;
@@ -564,18 +525,6 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
564
525
  type: "vibes-diy.cli.res-skill-content";
565
526
  name: string;
566
527
  content: string;
567
- }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
568
- type: "use-vibes.cli.themes";
569
- }, {
570
- type: "use-vibes.cli.res-themes-list";
571
- themes: {
572
- slug: string;
573
- name: string;
574
- }[];
575
- } | {
576
- type: "use-vibes.cli.res-theme-content";
577
- slug: string;
578
- content: string;
579
528
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
580
529
  type: "vibes-diy.cli.variety";
581
530
  }, {
@@ -590,6 +539,11 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
590
539
  id: string;
591
540
  guidance: string;
592
541
  }[];
542
+ }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
543
+ type: "vibes-diy.cli.system";
544
+ }, {
545
+ type: "vibes-diy.cli.res-system";
546
+ systemPrompt: string;
593
547
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
594
548
  type: "vibes-diy.cli.push";
595
549
  mode: string;
@@ -661,32 +615,49 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
661
615
  type: "vibes.diy.res-error";
662
616
  error: {
663
617
  message: string;
664
- code: "from-not-owned";
618
+ code: "max-app-slugs-reached";
665
619
  };
666
620
  } | {
667
621
  type: "vibes.diy.res-error";
668
622
  error: {
669
623
  message: string;
670
- code: "from-carry-failed";
624
+ code: "handle-required";
671
625
  };
672
626
  } | {
673
627
  type: "vibes.diy.res-error";
674
628
  error: {
675
629
  message: string;
676
- code: "auto-enhance-off";
630
+ code: "from-not-owned";
677
631
  };
678
632
  } | {
679
633
  type: "vibes.diy.res-error";
680
634
  error: {
681
635
  message: string;
682
- code: "handle-required";
636
+ code: "from-carry-failed";
683
637
  };
684
638
  } | {
685
639
  type: "vibes.diy.res-error";
686
640
  error: {
687
641
  message: string;
688
- code: "max-app-slugs-reached";
642
+ code: "auto-enhance-off";
689
643
  };
644
+ }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
645
+ type: "vibes-diy.cli.remix";
646
+ srcUserSlug: string;
647
+ srcAppSlug: string;
648
+ dstOwnerHandle?: string | undefined;
649
+ dstAppSlug?: string | undefined;
650
+ published: boolean;
651
+ settingsOnly: boolean;
652
+ apiUrl: string;
653
+ }, {
654
+ type: "vibes-diy.cli.res-remix";
655
+ ownerHandle: string;
656
+ appSlug: string;
657
+ url: string;
658
+ carried?: string[] | undefined;
659
+ skippedPresent?: string[] | undefined;
660
+ chatId?: string | undefined;
690
661
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
691
662
  type: "vibes-diy.cli.claim-handle";
692
663
  apiUrl: string;
@@ -699,6 +670,21 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
699
670
  defaultHandleSet?: boolean | undefined;
700
671
  defaultSkipped?: boolean | undefined;
701
672
  suggestions: string[];
673
+ }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
674
+ type: "vibes-diy.cli.put-asset";
675
+ file: string;
676
+ appSlug: string;
677
+ ownerHandle: string;
678
+ apiUrl: string;
679
+ mimeType: string;
680
+ verifyFetch: boolean;
681
+ }, {
682
+ type: "vibes-diy.cli.res-put-asset";
683
+ cid: string;
684
+ getURL: string;
685
+ size: number;
686
+ uploadId: string;
687
+ verified?: boolean | undefined;
702
688
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
703
689
  type: "vibes-diy.cli.generate";
704
690
  prompt: string;
@@ -718,6 +704,16 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
718
704
  style?: string | undefined;
719
705
  fastPass?: boolean | undefined;
720
706
  }, {
707
+ type: "vibes-diy.cli.res-generate";
708
+ appSlug: string;
709
+ ownerHandle: string;
710
+ url: string;
711
+ directory: string;
712
+ release?: "not-visible" | "published" | "version-locked" | undefined;
713
+ turns?: number | undefined;
714
+ publish?: "kept-private-no-access-fn" | "private" | "published" | undefined;
715
+ posture?: "gated" | "open" | "private" | undefined;
716
+ } | {
721
717
  appSlug: string;
722
718
  ownerHandle: string;
723
719
  mode: "dev" | "production";
@@ -772,42 +768,53 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
772
768
  type: "vibes.diy.res-error";
773
769
  error: {
774
770
  message: string;
775
- code: "from-not-owned";
771
+ code: "max-app-slugs-reached";
776
772
  };
777
773
  } | {
778
774
  type: "vibes.diy.res-error";
779
775
  error: {
780
776
  message: string;
781
- code: "from-carry-failed";
777
+ code: "handle-required";
782
778
  };
783
779
  } | {
784
780
  type: "vibes.diy.res-error";
785
781
  error: {
786
782
  message: string;
787
- code: "auto-enhance-off";
783
+ code: "from-not-owned";
788
784
  };
789
785
  } | {
790
786
  type: "vibes.diy.res-error";
791
787
  error: {
792
788
  message: string;
793
- code: "handle-required";
789
+ code: "from-carry-failed";
794
790
  };
795
791
  } | {
796
792
  type: "vibes.diy.res-error";
797
793
  error: {
798
794
  message: string;
799
- code: "max-app-slugs-reached";
795
+ code: "auto-enhance-off";
800
796
  };
801
- } | {
802
- type: "vibes-diy.cli.res-generate";
797
+ }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
798
+ type: "vibes-diy.cli.app-chats";
803
799
  appSlug: string;
804
800
  ownerHandle: string;
805
- url: string;
806
- directory: string;
807
- release?: "not-visible" | "published" | "version-locked" | undefined;
808
- turns?: number | undefined;
809
- publish?: "kept-private-no-access-fn" | "private" | "published" | undefined;
810
- posture?: "gated" | "open" | "private" | undefined;
801
+ chatId?: string | undefined;
802
+ apiUrl: string;
803
+ }, {
804
+ type: "vibes-diy.cli.res-app-chats-list";
805
+ items: {
806
+ chatId: string;
807
+ appSlug: string;
808
+ ownerHandle: string;
809
+ created: string;
810
+ userHandle?: string | undefined;
811
+ }[];
812
+ } | {
813
+ type: "vibes-diy.cli.res-app-chats-detail";
814
+ chatId: string;
815
+ ownerHandle?: string | undefined;
816
+ appSlug?: string | undefined;
817
+ output: string;
811
818
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
812
819
  type: "vibes-diy.cli.codegen-log";
813
820
  appSlug: string;
@@ -912,31 +919,31 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
912
919
  type: "vibes.diy.res-error";
913
920
  error: {
914
921
  message: string;
915
- code: "from-not-owned";
922
+ code: "max-app-slugs-reached";
916
923
  };
917
924
  } | {
918
925
  type: "vibes.diy.res-error";
919
926
  error: {
920
927
  message: string;
921
- code: "from-carry-failed";
928
+ code: "handle-required";
922
929
  };
923
930
  } | {
924
931
  type: "vibes.diy.res-error";
925
932
  error: {
926
933
  message: string;
927
- code: "auto-enhance-off";
934
+ code: "from-not-owned";
928
935
  };
929
936
  } | {
930
937
  type: "vibes.diy.res-error";
931
938
  error: {
932
939
  message: string;
933
- code: "handle-required";
940
+ code: "from-carry-failed";
934
941
  };
935
942
  } | {
936
943
  type: "vibes.diy.res-error";
937
944
  error: {
938
945
  message: string;
939
- code: "max-app-slugs-reached";
946
+ code: "auto-enhance-off";
940
947
  };
941
948
  } | {
942
949
  type: "vibes-diy.cli.res-edit";
@@ -945,6 +952,24 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
945
952
  url: string;
946
953
  directory: string;
947
954
  restyled?: boolean | undefined;
955
+ }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
956
+ type: "vibes-diy.cli.list";
957
+ apiUrl: string;
958
+ }, {
959
+ type: "vibes-diy.cli.res-list";
960
+ items: {
961
+ ownerHandle: string;
962
+ appSlug: string;
963
+ updated: string;
964
+ title?: string | undefined;
965
+ icon?: {
966
+ cid: string;
967
+ mime: string;
968
+ } | undefined;
969
+ pinnedAt?: string | undefined;
970
+ neverPublished?: boolean | undefined;
971
+ unpublishedAt?: string | undefined;
972
+ }[];
948
973
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
949
974
  type: "vibes-diy.cli.pull";
950
975
  appSlug: string;
@@ -1076,32 +1101,34 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
1076
1101
  userId: string;
1077
1102
  cleared: string[];
1078
1103
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
1079
- type: "vibes-diy.cli.db.get";
1104
+ type: "vibes-diy.cli.db.list";
1080
1105
  apiUrl: string;
1081
1106
  appSlug: string;
1082
1107
  ownerHandle: string;
1083
- dbName: string;
1084
- docId: string;
1085
1108
  admin: boolean;
1086
- actingHandle: string;
1087
1109
  }, {
1088
- type: "vibes-diy.cli.db.get-res";
1089
- doc: {
1090
- [x: string]: unknown;
1091
- };
1110
+ type: "vibes-diy.cli.db.list-res";
1111
+ dbNames: string[];
1092
1112
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
1093
- type: "vibes-diy.cli.db.del";
1113
+ type: "vibes-diy.cli.db.put";
1094
1114
  apiUrl: string;
1095
1115
  appSlug: string;
1096
1116
  ownerHandle: string;
1097
1117
  dbName: string;
1118
+ docJson: string;
1098
1119
  docId: string;
1099
1120
  admin: boolean;
1100
1121
  actingHandle: string;
1122
+ files?: string[] | undefined;
1101
1123
  }, {
1102
- type: "vibes-diy.cli.db.del-res";
1124
+ type: "vibes-diy.cli.db.put-res";
1103
1125
  id: string;
1104
1126
  ok: true;
1127
+ files?: {
1128
+ key: string;
1129
+ status: "unchanged" | "uploaded";
1130
+ uploadId: string;
1131
+ }[] | undefined;
1105
1132
  }> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
1106
1133
  type: "vibes-diy.cli.db.query";
1107
1134
  apiUrl: string;
package/cli/cmd-evento.js CHANGED
@@ -13,6 +13,7 @@ import { codegenLogEvento } from "./cmds/codegen-log-cmd.js";
13
13
  import { appChatsEvento } from "./cmds/app-chats-cmd.js";
14
14
  import { editEvento } from "./cmds/edit-cmd.js";
15
15
  import { listEvento } from "./cmds/list-cmd.js";
16
+ import { doctorEvento } from "./cmds/doctor-cmd.js";
16
17
  import { pullEvento } from "./cmds/pull-cmd.js";
17
18
  import { versionsEvento } from "./cmds/versions-cmd.js";
18
19
  import { assetsLsEvento } from "./cmds/assets-cmd.js";
@@ -41,6 +42,7 @@ export function cliEventoHandlers() {
41
42
  codegenLogEvento,
42
43
  editEvento,
43
44
  listEvento,
45
+ doctorEvento,
44
46
  pullEvento,
45
47
  versionsEvento,
46
48
  assetsLsEvento,
@@ -1 +1 @@
1
- {"version":3,"file":"cmd-evento.js","sourceRoot":"","sources":["../../jsr/cli/cmd-evento.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,O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,aAAa;QACb,YAAY;QACZ,UAAU;QACV,WAAW;QACX,iBAAiB;QACjB,cAAc;QACd,cAAc;QACd,cAAc;QACd,gBAAgB;QAChB,UAAU;QACV,UAAU;QACV,UAAU;QACV,cAAc;QACd,cAAc;QACd,eAAe;QACf,cAAc;QACd,mBAAmB;QACnB,oBAAoB;QACpB,aAAa;QACb,cAAc;QACd,aAAa;QACb,kBAAkB;QAClB,oBAAoB;QACpB,kBAAkB;QAClB,aAAa;QACb,aAAa;QACb,eAAe;QACf,eAAe;QACf,sBAAsB;QACtB,oBAAoB;QACpB,sBAAsB;QACtB,YAAY;QACZ,WAAW;QACX,WAAW;QACX,WAAW;QACX,aAAa;QACb,iBAAiB;QACjB,YAAY;KACb,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,WAAW;IACzB,OAAO,eAAe,CAAC,iBAAiB,EAAE,CAAC,CAAC;AAC9C,CAAC"}
1
+ {"version":3,"file":"cmd-evento.js","sourceRoot":"","sources":["../../jsr/cli/cmd-evento.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,EACb,iBAA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d,cAAc;QACd,cAAc;QACd,gBAAgB;QAChB,UAAU;QACV,UAAU;QACV,YAAY;QACZ,UAAU;QACV,cAAc;QACd,cAAc;QACd,eAAe;QACf,cAAc;QACd,mBAAmB;QACnB,oBAAoB;QACpB,aAAa;QACb,cAAc;QACd,aAAa;QACb,kBAAkB;QAClB,oBAAoB;QACpB,kBAAkB;QAClB,aAAa;QACb,aAAa;QACb,eAAe;QACf,eAAe;QACf,sBAAsB;QACtB,oBAAoB;QACpB,sBAAsB;QACtB,YAAY;QACZ,WAAW;QACX,WAAW;QACX,WAAW;QACX,aAAa;QACb,iBAAiB;QACjB,YAAY;KACb,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,WAAW;IACzB,OAAO,eAAe,CAAC,iBAAiB,EAAE,CAAC,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { VibesDiyApi } from "@vibes.diy/api-impl";
2
+ export declare const WALL_BILLING_READ_MS = 2000;
3
+ export declare function billingSettingsUrl(apiUrl: string): string;
4
+ export interface WallBilling {
5
+ readonly plan?: "free" | "plus";
6
+ readonly grantResetsAt?: number;
7
+ }
8
+ export declare function creditsWallMessage(billing: WallBilling | undefined, settingsUrl: string): string;
9
+ export declare function mapCreditsWall(err: unknown, deps: {
10
+ readonly api: Pick<VibesDiyApi, "billingCustomer">;
11
+ readonly apiUrl: string;
12
+ readonly timeoutMs?: number;
13
+ }): Promise<unknown>;
@@ -0,0 +1,50 @@
1
+ import { exception2Result, URI } from "@adviser/cement";
2
+ import { CREDITS_EXHAUSTED_PREFIX, outOfCreditsLine } from "@vibes.diy/api-types";
3
+ export const WALL_BILLING_READ_MS = 2_000;
4
+ const FALLBACK_ORIGIN = "https://vibes.diy";
5
+ export function billingSettingsUrl(apiUrl) {
6
+ const rUri = exception2Result(() => URI.from(apiUrl));
7
+ const uri = rUri.isOk() ? rUri.Ok() : undefined;
8
+ const scheme = { "https:": "https:", "http:": "http:", "wss:": "https:", "ws:": "http:" };
9
+ const web = uri === undefined ? undefined : scheme[uri.protocol];
10
+ const origin = uri !== undefined && web !== undefined && uri.host !== "" ? `${web}//${uri.host}` : FALLBACK_ORIGIN;
11
+ return `${origin}/settings?tab=billing`;
12
+ }
13
+ export function creditsWallMessage(billing, settingsUrl) {
14
+ const line = outOfCreditsLine({
15
+ ...(billing?.plan === undefined ? {} : { plan: billing.plan }),
16
+ ...(billing?.grantResetsAt === undefined ? {} : { grantResetsAt: billing.grantResetsAt }),
17
+ });
18
+ return `${line}\nBilling in Settings: ${settingsUrl}`;
19
+ }
20
+ function errText(err) {
21
+ if (typeof err === "string")
22
+ return err;
23
+ if (err instanceof Error)
24
+ return err.message;
25
+ const message = err?.message;
26
+ return typeof message === "string" ? message : "";
27
+ }
28
+ async function readWallBilling(api, timeoutMs) {
29
+ let timer;
30
+ const expiry = new Promise((res) => {
31
+ timer = setTimeout(() => res(undefined), timeoutMs);
32
+ });
33
+ const read = exception2Result(() => api.billingCustomer({})).then((rr) => {
34
+ if (rr.isErr())
35
+ return undefined;
36
+ const b = rr.Ok();
37
+ return { plan: b.plan, grantResetsAt: b.grantResetsAt };
38
+ });
39
+ const billing = await Promise.race([read, expiry]);
40
+ if (timer !== undefined)
41
+ clearTimeout(timer);
42
+ return billing;
43
+ }
44
+ export async function mapCreditsWall(err, deps) {
45
+ if (!errText(err).includes(CREDITS_EXHAUSTED_PREFIX))
46
+ return err;
47
+ const billing = await readWallBilling(deps.api, deps.timeoutMs ?? WALL_BILLING_READ_MS);
48
+ return creditsWallMessage(billing, billingSettingsUrl(deps.apiUrl));
49
+ }
50
+ //# sourceMappingURL=credits-wall.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credits-wall.js","sourceRoot":"","sources":["../../../jsr/cli/cmds/credits-wall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB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