@diafunc/cli 0.31.2 → 0.32.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.
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  package_default
3
- } from "./chunk-2BL23GQZ.js";
3
+ } from "./chunk-QALKS4CY.js";
4
4
 
5
5
  // src/index.ts
6
- import chalk41 from "chalk";
6
+ import chalk42 from "chalk";
7
7
 
8
8
  // src/commands/auth/login.ts
9
9
  import chalk4 from "chalk";
@@ -1628,8 +1628,8 @@ var ACRONYMS = /* @__PURE__ */ new Map([
1628
1628
  ["mcp", "MCP"]
1629
1629
  ]);
1630
1630
  function recordLabel(key) {
1631
- const words = humanizeKey(key).split(" ").filter((w) => w.length > 0).map((w) => ACRONYMS.get(w) ?? w);
1632
- const sentence = words.join(" ");
1631
+ const words2 = humanizeKey(key).split(" ").filter((w) => w.length > 0).map((w) => ACRONYMS.get(w) ?? w);
1632
+ const sentence = words2.join(" ");
1633
1633
  return sentence.charAt(0).toUpperCase() + sentence.slice(1);
1634
1634
  }
1635
1635
  function headerOf(spec) {
@@ -2095,12 +2095,12 @@ function createAnalysisService(client) {
2095
2095
  path: "/last"
2096
2096
  });
2097
2097
  },
2098
- async getRecent(count = 20) {
2098
+ async getRecent(count2 = 20) {
2099
2099
  return client.request({
2100
2100
  method: "GET",
2101
2101
  service: SERVICE2,
2102
2102
  path: "/recent",
2103
- query: { count }
2103
+ query: { count: count2 }
2104
2104
  });
2105
2105
  },
2106
2106
  async get(analysisId) {
@@ -2446,12 +2446,12 @@ function createAnalysisService(client) {
2446
2446
  path: `/${encodeURIComponent(analysisId)}/runs`
2447
2447
  });
2448
2448
  },
2449
- async getRunsForAnalysis(analysisId, count = 20) {
2449
+ async getRunsForAnalysis(analysisId, count2 = 20) {
2450
2450
  return client.request({
2451
2451
  method: "GET",
2452
2452
  service: SERVICE2,
2453
2453
  path: `/${encodeURIComponent(analysisId)}/runs`,
2454
- query: { count }
2454
+ query: { count: count2 }
2455
2455
  });
2456
2456
  },
2457
2457
  async getRun(runId) {
@@ -2539,13 +2539,85 @@ function createAnalysisService(client) {
2539
2539
  };
2540
2540
  }
2541
2541
 
2542
- // src/client/services/storage.ts
2543
- var SERVICE3 = "storage";
2542
+ // src/client/services/deployments.ts
2543
+ var SERVICE3 = "deployments";
2544
2544
  function enc(s) {
2545
2545
  return encodeURIComponent(s);
2546
2546
  }
2547
+ function createDeploymentsService(client) {
2548
+ return {
2549
+ async list() {
2550
+ return client.request({ method: "GET", service: SERVICE3, path: "/" });
2551
+ },
2552
+ async get(deploymentId) {
2553
+ return client.request({ method: "GET", service: SERVICE3, path: `/${enc(deploymentId)}` });
2554
+ },
2555
+ async create(request) {
2556
+ return client.request({ method: "POST", service: SERVICE3, path: "/", body: request });
2557
+ },
2558
+ async delete(deploymentId) {
2559
+ return client.request({ method: "DELETE", service: SERVICE3, path: `/${enc(deploymentId)}` });
2560
+ },
2561
+ async update(deploymentId, request) {
2562
+ return client.request({
2563
+ method: "PATCH",
2564
+ service: SERVICE3,
2565
+ path: `/${enc(deploymentId)}`,
2566
+ body: request
2567
+ });
2568
+ },
2569
+ async predict(deploymentId, request) {
2570
+ return client.request({
2571
+ method: "POST",
2572
+ service: SERVICE3,
2573
+ path: `/${enc(deploymentId)}/predict`,
2574
+ body: request
2575
+ });
2576
+ },
2577
+ async predictBatch(deploymentId, request) {
2578
+ return client.request({
2579
+ method: "POST",
2580
+ service: SERVICE3,
2581
+ path: `/${enc(deploymentId)}/predict/batch`,
2582
+ body: request
2583
+ });
2584
+ },
2585
+ async recordOutcomes(deploymentId, request) {
2586
+ return client.request({
2587
+ method: "POST",
2588
+ service: SERVICE3,
2589
+ path: `/${enc(deploymentId)}/outcomes`,
2590
+ body: request
2591
+ });
2592
+ },
2593
+ async deletePrediction(deploymentId, predictionId) {
2594
+ return client.request({
2595
+ method: "DELETE",
2596
+ service: SERVICE3,
2597
+ path: `/${enc(deploymentId)}/predictions/${enc(predictionId)}`
2598
+ });
2599
+ },
2600
+ async monitoring(deploymentId, window) {
2601
+ return client.request({
2602
+ method: "GET",
2603
+ service: SERVICE3,
2604
+ path: `/${enc(deploymentId)}/monitoring`,
2605
+ query: { window }
2606
+ });
2607
+ },
2608
+ async serveNewestModel(deploymentId) {
2609
+ return client.request({ method: "POST", service: SERVICE3, path: `/${enc(deploymentId)}/model` });
2610
+ }
2611
+ };
2612
+ }
2613
+
2614
+ // src/client/services/storage.ts
2615
+ var SERVICE4 = "storage";
2616
+ function enc2(s) {
2617
+ return encodeURIComponent(s);
2618
+ }
2547
2619
  function entityPath(ref) {
2548
- return `/${enc(ref.projectId)}/${enc(ref.projectBranch)}/${enc(ref.entityId)}/${enc(ref.entityBranch)}`;
2620
+ return `/${enc2(ref.projectId)}/${enc2(ref.projectBranch)}/${enc2(ref.entityId)}/${enc2(ref.entityBranch)}`;
2549
2621
  }
2550
2622
  function exportTableQuery(options) {
2551
2623
  const query = {};
@@ -2567,14 +2639,14 @@ function createStorageService(client) {
2567
2639
  async entityExists(ref) {
2568
2640
  return client.request({
2569
2641
  method: "GET",
2570
- service: SERVICE3,
2642
+ service: SERVICE4,
2571
2643
  path: `/entities/exists${entityPath(ref)}`
2572
2644
  });
2573
2645
  },
2574
2646
  async getEntity(ref, content = false) {
2575
2647
  return client.request({
2576
2648
  method: "GET",
2577
- service: SERVICE3,
2649
+ service: SERVICE4,
2578
2650
  path: `/entities/actual${entityPath(ref)}`,
2579
2651
  query: content ? { content: true } : void 0
2580
2652
  });
@@ -2582,14 +2654,14 @@ function createStorageService(client) {
2582
2654
  async getEntityContent(ref) {
2583
2655
  return client.requestRaw({
2584
2656
  method: "GET",
2585
- service: SERVICE3,
2657
+ service: SERVICE4,
2586
2658
  path: `/entities/contents/actual${entityPath(ref)}`
2587
2659
  });
2588
2660
  },
2589
2661
  async saveEntities(entities) {
2590
2662
  return client.request({
2591
2663
  method: "PUT",
2592
- service: SERVICE3,
2664
+ service: SERVICE4,
2593
2665
  path: "/entities/actual",
2594
2666
  body: entities
2595
2667
  });
@@ -2597,14 +2669,14 @@ function createStorageService(client) {
2597
2669
  async deleteEntity(ref) {
2598
2670
  return client.request({
2599
2671
  method: "DELETE",
2600
- service: SERVICE3,
2672
+ service: SERVICE4,
2601
2673
  path: `/entities/actual${entityPath(ref)}`
2602
2674
  });
2603
2675
  },
2604
2676
  async saveEntityContentBase64(ref, base64Content) {
2605
2677
  return client.request({
2606
2678
  method: "PUT",
2607
- service: SERVICE3,
2679
+ service: SERVICE4,
2608
2680
  path: `/entities/contents/actual${entityPath(ref)}`,
2609
2681
  rawBody: base64Content,
2610
2682
  contentType: "text/plain"
@@ -2613,7 +2685,7 @@ function createStorageService(client) {
2613
2685
  async uploadEntityContent(ref, formData) {
2614
2686
  return client.request({
2615
2687
  method: "PUT",
2616
- service: SERVICE3,
2688
+ service: SERVICE4,
2617
2689
  path: `/entities/contents/actual${entityPath(ref)}`,
2618
2690
  rawBody: formData
2619
2691
  });
@@ -2621,35 +2693,35 @@ function createStorageService(client) {
2621
2693
  async deleteEntityContent(ref) {
2622
2694
  return client.request({
2623
2695
  method: "DELETE",
2624
- service: SERVICE3,
2696
+ service: SERVICE4,
2625
2697
  path: `/entities/contents/actual${entityPath(ref)}`
2626
2698
  });
2627
2699
  },
2628
2700
  async getEntityHistory(ref, version) {
2629
2701
  return client.request({
2630
2702
  method: "GET",
2631
- service: SERVICE3,
2703
+ service: SERVICE4,
2632
2704
  path: `/entities/history${entityPath(ref)}/${version}`
2633
2705
  });
2634
2706
  },
2635
2707
  async getEntityHistoryRange(ref, fromVersion, toVersion) {
2636
2708
  return client.request({
2637
2709
  method: "GET",
2638
- service: SERVICE3,
2710
+ service: SERVICE4,
2639
2711
  path: `/entities/history${entityPath(ref)}/${fromVersion}/${toVersion}`
2640
2712
  });
2641
2713
  },
2642
2714
  async renameEntity(ref, newEntityId) {
2643
2715
  return client.request({
2644
2716
  method: "PUT",
2645
- service: SERVICE3,
2646
- path: `/entities/ids${entityPath(ref)}/${enc(newEntityId)}`
2717
+ service: SERVICE4,
2718
+ path: `/entities/ids${entityPath(ref)}/${enc2(newEntityId)}`
2647
2719
  });
2648
2720
  },
2649
2721
  async revertEntity(ref, version) {
2650
2722
  return client.request({
2651
2723
  method: "PUT",
2652
- service: SERVICE3,
2724
+ service: SERVICE4,
2653
2725
  path: `/entities/revert${entityPath(ref)}/${version}`
2654
2726
  });
2655
2727
  },
@@ -2675,7 +2747,7 @@ function createStorageService(client) {
2675
2747
  };
2676
2748
  return client.request({
2677
2749
  method: "POST",
2678
- service: SERVICE3,
2750
+ service: SERVICE4,
2679
2751
  path: "/transactions/",
2680
2752
  body: transaction
2681
2753
  });
@@ -2684,25 +2756,25 @@ function createStorageService(client) {
2684
2756
  async searchEntityIds(projectId, projectBranch, body) {
2685
2757
  return client.request({
2686
2758
  method: "POST",
2687
- service: SERVICE3,
2759
+ service: SERVICE4,
2688
2760
  path: "/entity-ids/search",
2689
2761
  body
2690
2762
  });
2691
2763
  },
2692
2764
  // --- Linked Entities ---
2693
2765
  async getLinkedEntities(direction, ref, linkId) {
2694
- const byLink = linkId ? `/${enc(linkId)}` : "";
2766
+ const byLink = linkId ? `/${enc2(linkId)}` : "";
2695
2767
  return client.request({
2696
2768
  method: "GET",
2697
- service: SERVICE3,
2698
- path: `/linked-entities/${enc(direction)}${entityPath(ref)}${byLink}`
2769
+ service: SERVICE4,
2770
+ path: `/linked-entities/${enc2(direction)}${entityPath(ref)}${byLink}`
2699
2771
  });
2700
2772
  },
2701
2773
  async saveLinkedEntities(ref, linkId, entities) {
2702
2774
  return client.request({
2703
2775
  method: "PUT",
2704
- service: SERVICE3,
2705
- path: `/linked-entities/${enc(ref.projectId)}/${enc(ref.projectBranch)}/${enc(ref.entityId)}/${enc(ref.entityBranch)}/${enc(linkId)}`,
2776
+ service: SERVICE4,
2777
+ path: `/linked-entities/${enc2(ref.projectId)}/${enc2(ref.projectBranch)}/${enc2(ref.entityId)}/${enc2(ref.entityBranch)}/${enc2(linkId)}`,
2706
2778
  body: entities
2707
2779
  });
2708
2780
  },
@@ -2710,33 +2782,33 @@ function createStorageService(client) {
2710
2782
  async getLinks(direction, ref) {
2711
2783
  return client.request({
2712
2784
  method: "GET",
2713
- service: SERVICE3,
2714
- path: `/links/actual/${enc(direction)}${entityPath(ref)}`
2785
+ service: SERVICE4,
2786
+ path: `/links/actual/${enc2(direction)}${entityPath(ref)}`
2715
2787
  });
2716
2788
  },
2717
2789
  async getLinkIds(direction, ref) {
2718
2790
  return client.request({
2719
2791
  method: "GET",
2720
- service: SERVICE3,
2721
- path: `/links/ids/actual/${enc(direction)}${entityPath(ref)}`
2792
+ service: SERVICE4,
2793
+ path: `/links/ids/actual/${enc2(direction)}${entityPath(ref)}`
2722
2794
  });
2723
2795
  },
2724
2796
  async createLink(projectId, projectBranch, sourceEntityId, sourceEntityBranch, linkId, targetEntityId, targetEntityBranch, link) {
2725
2797
  return client.request({
2726
2798
  method: "POST",
2727
- service: SERVICE3,
2728
- path: `/links/actual/${enc(projectId)}/${enc(projectBranch)}/${enc(sourceEntityId)}/${enc(sourceEntityBranch)}/${enc(linkId)}/${enc(targetEntityId)}/${enc(targetEntityBranch)}`,
2799
+ service: SERVICE4,
2800
+ path: `/links/actual/${enc2(projectId)}/${enc2(projectBranch)}/${enc2(sourceEntityId)}/${enc2(sourceEntityBranch)}/${enc2(linkId)}/${enc2(targetEntityId)}/${enc2(targetEntityBranch)}`,
2729
2801
  body: link
2730
2802
  });
2731
2803
  },
2732
2804
  async deleteLink(projectId, projectBranch, sourceEntityId, sourceEntityBranch, linkId, targetEntityId, targetEntityBranch) {
2733
- let path13 = `/links/actual/${enc(projectId)}/${enc(projectBranch)}/${enc(sourceEntityId)}/${enc(sourceEntityBranch)}/${enc(linkId)}`;
2805
+ let path13 = `/links/actual/${enc2(projectId)}/${enc2(projectBranch)}/${enc2(sourceEntityId)}/${enc2(sourceEntityBranch)}/${enc2(linkId)}`;
2734
2806
  if (targetEntityId && targetEntityBranch) {
2735
- path13 += `/${enc(targetEntityId)}/${enc(targetEntityBranch)}`;
2807
+ path13 += `/${enc2(targetEntityId)}/${enc2(targetEntityBranch)}`;
2736
2808
  }
2737
2809
  return client.request({
2738
2810
  method: "DELETE",
2739
- service: SERVICE3,
2811
+ service: SERVICE4,
2740
2812
  path: path13
2741
2813
  });
2742
2814
  },
@@ -2744,21 +2816,21 @@ function createStorageService(client) {
2744
2816
  async getEvents(ref) {
2745
2817
  return client.request({
2746
2818
  method: "GET",
2747
- service: SERVICE3,
2819
+ service: SERVICE4,
2748
2820
  path: `/events/actual${entityPath(ref)}`
2749
2821
  });
2750
2822
  },
2751
2823
  async getEvent(ref, eventId, occurrenceId) {
2752
2824
  return client.request({
2753
2825
  method: "GET",
2754
- service: SERVICE3,
2755
- path: `/events/actual${entityPath(ref)}/${enc(eventId)}/${enc(occurrenceId)}`
2826
+ service: SERVICE4,
2827
+ path: `/events/actual${entityPath(ref)}/${enc2(eventId)}/${enc2(occurrenceId)}`
2756
2828
  });
2757
2829
  },
2758
2830
  async createEvents(events) {
2759
2831
  return client.request({
2760
2832
  method: "POST",
2761
- service: SERVICE3,
2833
+ service: SERVICE4,
2762
2834
  path: "/events/",
2763
2835
  body: events
2764
2836
  });
@@ -2766,7 +2838,7 @@ function createStorageService(client) {
2766
2838
  async consumeEvents(body) {
2767
2839
  return client.request({
2768
2840
  method: "POST",
2769
- service: SERVICE3,
2841
+ service: SERVICE4,
2770
2842
  path: "/events/consume",
2771
2843
  body
2772
2844
  });
@@ -2774,15 +2846,15 @@ function createStorageService(client) {
2774
2846
  async deleteEvent(ref, eventId, occurrenceId) {
2775
2847
  return client.request({
2776
2848
  method: "DELETE",
2777
- service: SERVICE3,
2778
- path: `/events/actual${entityPath(ref)}/${enc(eventId)}/${enc(occurrenceId)}`
2849
+ service: SERVICE4,
2850
+ path: `/events/actual${entityPath(ref)}/${enc2(eventId)}/${enc2(occurrenceId)}`
2779
2851
  });
2780
2852
  },
2781
2853
  // --- Tables ---
2782
2854
  async getTableSnapshot(ref, request) {
2783
2855
  return client.request({
2784
2856
  method: "POST",
2785
- service: SERVICE3,
2857
+ service: SERVICE4,
2786
2858
  path: `/tables${entityPath(ref)}/snapshots`,
2787
2859
  body: request ?? {}
2788
2860
  });
@@ -2790,78 +2862,78 @@ function createStorageService(client) {
2790
2862
  async appendRow(ref) {
2791
2863
  return client.request({
2792
2864
  method: "POST",
2793
- service: SERVICE3,
2865
+ service: SERVICE4,
2794
2866
  path: `/tables${entityPath(ref)}/rows`
2795
2867
  });
2796
2868
  },
2797
2869
  async insertRow(ref, rowIndex) {
2798
2870
  return client.request({
2799
2871
  method: "POST",
2800
- service: SERVICE3,
2872
+ service: SERVICE4,
2801
2873
  path: `/tables${entityPath(ref)}/rows/${rowIndex}/insert`
2802
2874
  });
2803
2875
  },
2804
2876
  async removeRow(ref, rowIndex) {
2805
2877
  return client.request({
2806
2878
  method: "DELETE",
2807
- service: SERVICE3,
2879
+ service: SERVICE4,
2808
2880
  path: `/tables${entityPath(ref)}/rows/${rowIndex}`
2809
2881
  });
2810
2882
  },
2811
2883
  async deleteRow(ref, rowIndex) {
2812
2884
  return client.request({
2813
2885
  method: "POST",
2814
- service: SERVICE3,
2886
+ service: SERVICE4,
2815
2887
  path: `/tables${entityPath(ref)}/rows/${rowIndex}/delete`
2816
2888
  });
2817
2889
  },
2818
2890
  async appendColumn(ref) {
2819
2891
  return client.request({
2820
2892
  method: "POST",
2821
- service: SERVICE3,
2893
+ service: SERVICE4,
2822
2894
  path: `/tables${entityPath(ref)}/columns`
2823
2895
  });
2824
2896
  },
2825
- async insertColumn(ref, columnIndex) {
2897
+ async insertColumn(ref, columnIndex2) {
2826
2898
  return client.request({
2827
2899
  method: "POST",
2828
- service: SERVICE3,
2829
- path: `/tables${entityPath(ref)}/columns/${columnIndex}/insert`
2900
+ service: SERVICE4,
2901
+ path: `/tables${entityPath(ref)}/columns/${columnIndex2}/insert`
2830
2902
  });
2831
2903
  },
2832
- async removeColumn(ref, columnIndex) {
2904
+ async removeColumn(ref, columnIndex2) {
2833
2905
  return client.request({
2834
2906
  method: "DELETE",
2835
- service: SERVICE3,
2836
- path: `/tables${entityPath(ref)}/columns/${columnIndex}`
2907
+ service: SERVICE4,
2908
+ path: `/tables${entityPath(ref)}/columns/${columnIndex2}`
2837
2909
  });
2838
2910
  },
2839
- async deleteColumn(ref, columnIndex) {
2911
+ async deleteColumn(ref, columnIndex2) {
2840
2912
  return client.request({
2841
2913
  method: "POST",
2842
- service: SERVICE3,
2843
- path: `/tables${entityPath(ref)}/columns/${columnIndex}/delete`
2914
+ service: SERVICE4,
2915
+ path: `/tables${entityPath(ref)}/columns/${columnIndex2}/delete`
2844
2916
  });
2845
2917
  },
2846
2918
  async mergeCells(ref, cells) {
2847
2919
  return client.request({
2848
2920
  method: "PUT",
2849
- service: SERVICE3,
2921
+ service: SERVICE4,
2850
2922
  path: `/tables${entityPath(ref)}/cells`,
2851
2923
  body: cells
2852
2924
  });
2853
2925
  },
2854
- async removeCell(ref, rowIndex, columnIndex) {
2926
+ async removeCell(ref, rowIndex, columnIndex2) {
2855
2927
  return client.request({
2856
2928
  method: "DELETE",
2857
- service: SERVICE3,
2858
- path: `/tables${entityPath(ref)}/cells/${rowIndex}/${columnIndex}`
2929
+ service: SERVICE4,
2930
+ path: `/tables${entityPath(ref)}/cells/${rowIndex}/${columnIndex2}`
2859
2931
  });
2860
2932
  },
2861
2933
  async clearTable(ref) {
2862
2934
  return client.request({
2863
2935
  method: "POST",
2864
- service: SERVICE3,
2936
+ service: SERVICE4,
2865
2937
  path: `/tables${entityPath(ref)}/clear`
2866
2938
  });
2867
2939
  },
@@ -2871,7 +2943,7 @@ function createStorageService(client) {
2871
2943
  if (selection) query.selection = selection;
2872
2944
  return client.request({
2873
2945
  method: "PUT",
2874
- service: SERVICE3,
2946
+ service: SERVICE4,
2875
2947
  path: `/table-imports${entityPath(ref)}`,
2876
2948
  query: Object.keys(query).length > 0 ? query : void 0,
2877
2949
  rawBody: formData
@@ -2880,15 +2952,15 @@ function createStorageService(client) {
2880
2952
  async getSupportedImportFormats() {
2881
2953
  return client.request({
2882
2954
  method: "GET",
2883
- service: SERVICE3,
2955
+ service: SERVICE4,
2884
2956
  path: `/table-imports/supported-formats`
2885
2957
  });
2886
2958
  },
2887
2959
  async getImport(ref, importId) {
2888
2960
  return client.request({
2889
2961
  method: "GET",
2890
- service: SERVICE3,
2891
- path: `/imports${entityPath(ref)}/${enc(importId)}`
2962
+ service: SERVICE4,
2963
+ path: `/imports${entityPath(ref)}/${enc2(importId)}`
2892
2964
  });
2893
2965
  },
2894
2966
  /**
@@ -2900,8 +2972,8 @@ function createStorageService(client) {
2900
2972
  const query = exportTableQuery(options);
2901
2973
  return client.request({
2902
2974
  method: "POST",
2903
- service: SERVICE3,
2904
- path: `/table-exports${entityPath(ref)}/${enc(format2)}`,
2975
+ service: SERVICE4,
2976
+ path: `/table-exports${entityPath(ref)}/${enc2(format2)}`,
2905
2977
  query: Object.keys(query).length > 0 ? query : void 0
2906
2978
  });
2907
2979
  },
@@ -2916,8 +2988,8 @@ function createStorageService(client) {
2916
2988
  const query = exportTableQuery(options);
2917
2989
  return client.requestRaw({
2918
2990
  method: "POST",
2919
- service: SERVICE3,
2920
- path: `/table-exports${entityPath(ref)}/${enc(format2)}/stream`,
2991
+ service: SERVICE4,
2992
+ path: `/table-exports${entityPath(ref)}/${enc2(format2)}/stream`,
2921
2993
  query: Object.keys(query).length > 0 ? query : void 0
2922
2994
  });
2923
2995
  },
@@ -2930,7 +3002,7 @@ function createStorageService(client) {
2930
3002
  async getSupportedExportFormats() {
2931
3003
  return client.request({
2932
3004
  method: "GET",
2933
- service: SERVICE3,
3005
+ service: SERVICE4,
2934
3006
  path: `/table-exports/supported-formats`
2935
3007
  });
2936
3008
  },
@@ -2938,7 +3010,7 @@ function createStorageService(client) {
2938
3010
  async listExports(ref) {
2939
3011
  return client.request({
2940
3012
  method: "GET",
2941
- service: SERVICE3,
3013
+ service: SERVICE4,
2942
3014
  path: `/exports${entityPath(ref)}`
2943
3015
  });
2944
3016
  },
@@ -2951,22 +3023,22 @@ function createStorageService(client) {
2951
3023
  async downloadExport(ref, exportId, filename) {
2952
3024
  return client.requestRaw({
2953
3025
  method: "GET",
2954
- service: SERVICE3,
2955
- path: `/exports${entityPath(ref)}/${enc(exportId)}/${enc(filename)}`
3026
+ service: SERVICE4,
3027
+ path: `/exports${entityPath(ref)}/${enc2(exportId)}/${enc2(filename)}`
2956
3028
  });
2957
3029
  },
2958
3030
  // --- Branches ---
2959
3031
  async getProjectBranches(projectId) {
2960
3032
  return client.request({
2961
3033
  method: "GET",
2962
- service: SERVICE3,
2963
- path: `/project-branches/${enc(projectId)}`
3034
+ service: SERVICE4,
3035
+ path: `/project-branches/${enc2(projectId)}`
2964
3036
  });
2965
3037
  },
2966
3038
  async createProjectBranch(request) {
2967
3039
  return client.request({
2968
3040
  method: "POST",
2969
- service: SERVICE3,
3041
+ service: SERVICE4,
2970
3042
  path: "/project-branches/",
2971
3043
  body: request
2972
3044
  });
@@ -2974,21 +3046,21 @@ function createStorageService(client) {
2974
3046
  async deleteProjectBranch(projectId, projectBranch) {
2975
3047
  return client.request({
2976
3048
  method: "DELETE",
2977
- service: SERVICE3,
2978
- path: `/project-branches/${enc(projectId)}/${enc(projectBranch)}`
3049
+ service: SERVICE4,
3050
+ path: `/project-branches/${enc2(projectId)}/${enc2(projectBranch)}`
2979
3051
  });
2980
3052
  },
2981
3053
  async getEntityBranches(projectId, projectBranch, entityId) {
2982
3054
  return client.request({
2983
3055
  method: "GET",
2984
- service: SERVICE3,
2985
- path: `/entity-branches/${enc(projectId)}/${enc(projectBranch)}/${enc(entityId)}`
3056
+ service: SERVICE4,
3057
+ path: `/entity-branches/${enc2(projectId)}/${enc2(projectBranch)}/${enc2(entityId)}`
2986
3058
  });
2987
3059
  },
2988
3060
  async createEntityBranch(request) {
2989
3061
  return client.request({
2990
3062
  method: "POST",
2991
- service: SERVICE3,
3063
+ service: SERVICE4,
2992
3064
  path: "/entity-branches/",
2993
3065
  body: request
2994
3066
  });
@@ -2997,7 +3069,7 @@ function createStorageService(client) {
2997
3069
  async merge(request) {
2998
3070
  return client.request({
2999
3071
  method: "POST",
3000
- service: SERVICE3,
3072
+ service: SERVICE4,
3001
3073
  path: "/merge/",
3002
3074
  body: request
3003
3075
  });
@@ -3005,7 +3077,7 @@ function createStorageService(client) {
3005
3077
  async fork(request) {
3006
3078
  return client.request({
3007
3079
  method: "POST",
3008
- service: SERVICE3,
3080
+ service: SERVICE4,
3009
3081
  path: "/fork/",
3010
3082
  body: request
3011
3083
  });
@@ -3014,8 +3086,8 @@ function createStorageService(client) {
3014
3086
  async searchProject(projectId, projectBranch, body) {
3015
3087
  return client.request({
3016
3088
  method: "POST",
3017
- service: SERVICE3,
3018
- path: `/project-searches/${enc(projectId)}/${enc(projectBranch)}`,
3089
+ service: SERVICE4,
3090
+ path: `/project-searches/${enc2(projectId)}/${enc2(projectBranch)}`,
3019
3091
  body
3020
3092
  });
3021
3093
  },
@@ -3023,21 +3095,21 @@ function createStorageService(client) {
3023
3095
  async createShortTermProjectBackup() {
3024
3096
  return client.request({
3025
3097
  method: "POST",
3026
- service: SERVICE3,
3098
+ service: SERVICE4,
3027
3099
  path: "/backups/project/short-term/create"
3028
3100
  });
3029
3101
  },
3030
3102
  async createLongTermProjectBackup() {
3031
3103
  return client.request({
3032
3104
  method: "POST",
3033
- service: SERVICE3,
3105
+ service: SERVICE4,
3034
3106
  path: "/backups/project/long-term/create"
3035
3107
  });
3036
3108
  },
3037
3109
  async restoreProjectBackup(request) {
3038
3110
  return client.request({
3039
3111
  method: "POST",
3040
- service: SERVICE3,
3112
+ service: SERVICE4,
3041
3113
  path: "/backups/project/restore",
3042
3114
  body: request
3043
3115
  });
@@ -3045,21 +3117,21 @@ function createStorageService(client) {
3045
3117
  async createShortTermFullBackup() {
3046
3118
  return client.request({
3047
3119
  method: "POST",
3048
- service: SERVICE3,
3120
+ service: SERVICE4,
3049
3121
  path: "/backups/full/short-term/create"
3050
3122
  });
3051
3123
  },
3052
3124
  async createLongTermFullBackup() {
3053
3125
  return client.request({
3054
3126
  method: "POST",
3055
- service: SERVICE3,
3127
+ service: SERVICE4,
3056
3128
  path: "/backups/full/long-term/create"
3057
3129
  });
3058
3130
  },
3059
3131
  async restoreFullBackup(request) {
3060
3132
  return client.request({
3061
3133
  method: "POST",
3062
- service: SERVICE3,
3134
+ service: SERVICE4,
3063
3135
  path: "/backups/full/restore",
3064
3136
  body: request
3065
3137
  });
@@ -3070,14 +3142,14 @@ function createStorageService(client) {
3070
3142
  async listUserDefinedExporters() {
3071
3143
  return client.request({
3072
3144
  method: "GET",
3073
- service: SERVICE3,
3145
+ service: SERVICE4,
3074
3146
  path: `/table-exporters`
3075
3147
  });
3076
3148
  },
3077
3149
  async registerUserDefinedExporter(request) {
3078
3150
  return client.request({
3079
3151
  method: "POST",
3080
- service: SERVICE3,
3152
+ service: SERVICE4,
3081
3153
  path: `/table-exporters`,
3082
3154
  body: request
3083
3155
  });
@@ -3085,15 +3157,15 @@ function createStorageService(client) {
3085
3157
  async deleteUserDefinedExporter(id) {
3086
3158
  await client.request({
3087
3159
  method: "DELETE",
3088
- service: SERVICE3,
3089
- path: `/table-exporters/${enc(id)}`
3160
+ service: SERVICE4,
3161
+ path: `/table-exporters/${enc2(id)}`
3090
3162
  });
3091
3163
  },
3092
3164
  // --- Data sources ---
3093
3165
  async createDataSource(request) {
3094
3166
  return client.request({
3095
3167
  method: "POST",
3096
- service: SERVICE3,
3168
+ service: SERVICE4,
3097
3169
  path: `/data-sources`,
3098
3170
  body: request
3099
3171
  });
@@ -3101,7 +3173,7 @@ function createStorageService(client) {
3101
3173
  async listDataSources(projectId) {
3102
3174
  return client.request({
3103
3175
  method: "GET",
3104
- service: SERVICE3,
3176
+ service: SERVICE4,
3105
3177
  path: `/data-sources`,
3106
3178
  query: projectId ? { projectId } : void 0
3107
3179
  });
@@ -3109,7 +3181,7 @@ function createStorageService(client) {
3109
3181
  async getDataSourceDashboard(projectId) {
3110
3182
  return client.request({
3111
3183
  method: "GET",
3112
- service: SERVICE3,
3184
+ service: SERVICE4,
3113
3185
  path: `/data-sources/dashboard`,
3114
3186
  query: { projectId }
3115
3187
  });
@@ -3117,51 +3189,51 @@ function createStorageService(client) {
3117
3189
  async getDataSource(id) {
3118
3190
  return client.request({
3119
3191
  method: "GET",
3120
- service: SERVICE3,
3121
- path: `/data-sources/${enc(id)}`
3192
+ service: SERVICE4,
3193
+ path: `/data-sources/${enc2(id)}`
3122
3194
  });
3123
3195
  },
3124
3196
  async updateDataSource(id, request) {
3125
3197
  return client.request({
3126
3198
  method: "PUT",
3127
- service: SERVICE3,
3128
- path: `/data-sources/${enc(id)}`,
3199
+ service: SERVICE4,
3200
+ path: `/data-sources/${enc2(id)}`,
3129
3201
  body: request
3130
3202
  });
3131
3203
  },
3132
3204
  async deleteDataSource(id) {
3133
3205
  await client.request({
3134
3206
  method: "DELETE",
3135
- service: SERVICE3,
3136
- path: `/data-sources/${enc(id)}`
3207
+ service: SERVICE4,
3208
+ path: `/data-sources/${enc2(id)}`
3137
3209
  });
3138
3210
  },
3139
3211
  async refreshDataSource(id) {
3140
3212
  return client.request({
3141
3213
  method: "POST",
3142
- service: SERVICE3,
3143
- path: `/data-sources/${enc(id)}/refresh`
3214
+ service: SERVICE4,
3215
+ path: `/data-sources/${enc2(id)}/refresh`
3144
3216
  });
3145
3217
  },
3146
3218
  async listDataSourceRuns(id, limit) {
3147
3219
  return client.request({
3148
3220
  method: "GET",
3149
- service: SERVICE3,
3150
- path: `/data-sources/${enc(id)}/runs`,
3221
+ service: SERVICE4,
3222
+ path: `/data-sources/${enc2(id)}/runs`,
3151
3223
  query: limit !== void 0 ? { limit } : void 0
3152
3224
  });
3153
3225
  },
3154
3226
  async getDataSourceRun(id, runId) {
3155
3227
  return client.request({
3156
3228
  method: "GET",
3157
- service: SERVICE3,
3158
- path: `/data-sources/${enc(id)}/runs/${enc(runId)}`
3229
+ service: SERVICE4,
3230
+ path: `/data-sources/${enc2(id)}/runs/${enc2(runId)}`
3159
3231
  });
3160
3232
  },
3161
3233
  async listDataSourceConnectorTypes() {
3162
3234
  return client.request({
3163
3235
  method: "GET",
3164
- service: SERVICE3,
3236
+ service: SERVICE4,
3165
3237
  path: `/data-sources/types`
3166
3238
  });
3167
3239
  },
@@ -3169,7 +3241,7 @@ function createStorageService(client) {
3169
3241
  async createSkeleton(request) {
3170
3242
  return client.request({
3171
3243
  method: "POST",
3172
- service: SERVICE3,
3244
+ service: SERVICE4,
3173
3245
  path: `/skeletons`,
3174
3246
  body: request
3175
3247
  });
@@ -3177,7 +3249,7 @@ function createStorageService(client) {
3177
3249
  async listSkeletons(projectId) {
3178
3250
  return client.request({
3179
3251
  method: "GET",
3180
- service: SERVICE3,
3252
+ service: SERVICE4,
3181
3253
  path: `/skeletons`,
3182
3254
  query: { projectId }
3183
3255
  });
@@ -3185,23 +3257,23 @@ function createStorageService(client) {
3185
3257
  async getSkeleton(id) {
3186
3258
  return client.request({
3187
3259
  method: "GET",
3188
- service: SERVICE3,
3189
- path: `/skeletons/${enc(id)}`
3260
+ service: SERVICE4,
3261
+ path: `/skeletons/${enc2(id)}`
3190
3262
  });
3191
3263
  },
3192
3264
  async updateSkeleton(id, request) {
3193
3265
  return client.request({
3194
3266
  method: "PUT",
3195
- service: SERVICE3,
3196
- path: `/skeletons/${enc(id)}`,
3267
+ service: SERVICE4,
3268
+ path: `/skeletons/${enc2(id)}`,
3197
3269
  body: request
3198
3270
  });
3199
3271
  },
3200
3272
  async deleteSkeleton(id) {
3201
3273
  await client.request({
3202
3274
  method: "DELETE",
3203
- service: SERVICE3,
3204
- path: `/skeletons/${enc(id)}`
3275
+ service: SERVICE4,
3276
+ path: `/skeletons/${enc2(id)}`
3205
3277
  });
3206
3278
  },
3207
3279
  // --- Notebook bundles ---
@@ -3209,8 +3281,8 @@ function createStorageService(client) {
3209
3281
  async exportBundle(projectId, projectBranch, request) {
3210
3282
  return client.request({
3211
3283
  method: "POST",
3212
- service: SERVICE3,
3213
- path: `/notebook-bundles/${enc(projectId)}/${enc(projectBranch)}/export`,
3284
+ service: SERVICE4,
3285
+ path: `/notebook-bundles/${enc2(projectId)}/${enc2(projectBranch)}/export`,
3214
3286
  body: request
3215
3287
  });
3216
3288
  },
@@ -3218,8 +3290,8 @@ function createStorageService(client) {
3218
3290
  async streamBundle(projectId, projectBranch, request) {
3219
3291
  return client.requestRaw({
3220
3292
  method: "POST",
3221
- service: SERVICE3,
3222
- path: `/notebook-bundles/${enc(projectId)}/${enc(projectBranch)}/export/stream`,
3293
+ service: SERVICE4,
3294
+ path: `/notebook-bundles/${enc2(projectId)}/${enc2(projectBranch)}/export/stream`,
3223
3295
  body: request
3224
3296
  });
3225
3297
  },
@@ -3227,16 +3299,16 @@ function createStorageService(client) {
3227
3299
  async exportProjectBundle(projectId, projectBranch) {
3228
3300
  return client.request({
3229
3301
  method: "POST",
3230
- service: SERVICE3,
3231
- path: `/project-bundles/${enc(projectId)}/${enc(projectBranch)}/export`
3302
+ service: SERVICE4,
3303
+ path: `/project-bundles/${enc2(projectId)}/${enc2(projectBranch)}/export`
3232
3304
  });
3233
3305
  },
3234
3306
  /** Queue an async entity-subset (.dfset) export; returns the bundleId for polling. */
3235
3307
  async exportEntitySubset(projectId, projectBranch, request) {
3236
3308
  return client.request({
3237
3309
  method: "POST",
3238
- service: SERVICE3,
3239
- path: `/entity-subset-bundles/${enc(projectId)}/${enc(projectBranch)}/export`,
3310
+ service: SERVICE4,
3311
+ path: `/entity-subset-bundles/${enc2(projectId)}/${enc2(projectBranch)}/export`,
3240
3312
  body: request
3241
3313
  });
3242
3314
  },
@@ -3244,39 +3316,39 @@ function createStorageService(client) {
3244
3316
  async streamEntitySubset(projectId, projectBranch, request) {
3245
3317
  return client.requestRaw({
3246
3318
  method: "POST",
3247
- service: SERVICE3,
3248
- path: `/entity-subset-bundles/${enc(projectId)}/${enc(projectBranch)}/export/stream`,
3319
+ service: SERVICE4,
3320
+ path: `/entity-subset-bundles/${enc2(projectId)}/${enc2(projectBranch)}/export/stream`,
3249
3321
  body: request
3250
3322
  });
3251
3323
  },
3252
3324
  async getBundles(projectId, projectBranch) {
3253
3325
  return client.request({
3254
3326
  method: "GET",
3255
- service: SERVICE3,
3256
- path: `/bundles/${enc(projectId)}/${enc(projectBranch)}`
3327
+ service: SERVICE4,
3328
+ path: `/bundles/${enc2(projectId)}/${enc2(projectBranch)}`
3257
3329
  });
3258
3330
  },
3259
3331
  /** Download a finished bundle's bytes. */
3260
3332
  async getBundleContent(projectId, projectBranch, bundleId, filename) {
3261
3333
  return client.requestRaw({
3262
3334
  method: "GET",
3263
- service: SERVICE3,
3264
- path: `/bundles/${enc(projectId)}/${enc(projectBranch)}/${enc(bundleId)}/${enc(filename)}`
3335
+ service: SERVICE4,
3336
+ path: `/bundles/${enc2(projectId)}/${enc2(projectBranch)}/${enc2(bundleId)}/${enc2(filename)}`
3265
3337
  });
3266
3338
  },
3267
3339
  async stopBundle(projectId, projectBranch, bundleId, filename) {
3268
3340
  await client.request({
3269
3341
  method: "DELETE",
3270
- service: SERVICE3,
3271
- path: `/bundles/${enc(projectId)}/${enc(projectBranch)}/${enc(bundleId)}/${enc(filename)}`
3342
+ service: SERVICE4,
3343
+ path: `/bundles/${enc2(projectId)}/${enc2(projectBranch)}/${enc2(bundleId)}/${enc2(filename)}`
3272
3344
  });
3273
3345
  },
3274
3346
  /** Non-committing inventory of an uploaded bundle. */
3275
3347
  async previewBundleImport(projectId, projectBranch, formData) {
3276
3348
  return client.request({
3277
3349
  method: "POST",
3278
- service: SERVICE3,
3279
- path: `/notebook-bundle-imports/${enc(projectId)}/${enc(projectBranch)}/preview`,
3350
+ service: SERVICE4,
3351
+ path: `/notebook-bundle-imports/${enc2(projectId)}/${enc2(projectBranch)}/preview`,
3280
3352
  rawBody: formData
3281
3353
  });
3282
3354
  },
@@ -3284,8 +3356,8 @@ function createStorageService(client) {
3284
3356
  async importBundle(projectId, projectBranch, formData, onConflict = "copy") {
3285
3357
  return client.request({
3286
3358
  method: "POST",
3287
- service: SERVICE3,
3288
- path: `/notebook-bundle-imports/${enc(projectId)}/${enc(projectBranch)}/import`,
3359
+ service: SERVICE4,
3360
+ path: `/notebook-bundle-imports/${enc2(projectId)}/${enc2(projectBranch)}/import`,
3289
3361
  query: { onConflict },
3290
3362
  rawBody: formData
3291
3363
  });
@@ -3294,8 +3366,8 @@ function createStorageService(client) {
3294
3366
  }
3295
3367
 
3296
3368
  // src/client/services/evaluation.ts
3297
- var SERVICE4 = "evaluation";
3298
- function enc2(s) {
3369
+ var SERVICE5 = "evaluation";
3370
+ function enc3(s) {
3299
3371
  return encodeURIComponent(s);
3300
3372
  }
3301
3373
  function createEvaluationService(client) {
@@ -3304,25 +3376,25 @@ function createEvaluationService(client) {
3304
3376
  async call(request, async = false) {
3305
3377
  return client.request({
3306
3378
  method: "POST",
3307
- service: SERVICE4,
3379
+ service: SERVICE5,
3308
3380
  path: "/calls/",
3309
3381
  body: request,
3310
3382
  query: async ? { async: true } : void 0
3311
3383
  });
3312
3384
  },
3313
3385
  // Evaluations
3314
- async getEvaluations(projectId, projectBranch, functionId, functionBranch, year, month, day, hour) {
3386
+ async getEvaluations(projectId, projectBranch, functionId, functionBranch, year, month, day2, hour) {
3315
3387
  return client.request({
3316
3388
  method: "GET",
3317
- service: SERVICE4,
3318
- path: `/evaluations/${enc2(projectId)}/${enc2(projectBranch)}/${enc2(functionId)}/${enc2(functionBranch)}/${year}/${month}/${day}/${hour}`
3389
+ service: SERVICE5,
3390
+ path: `/evaluations/${enc3(projectId)}/${enc3(projectBranch)}/${enc3(functionId)}/${enc3(functionBranch)}/${year}/${month}/${day2}/${hour}`
3319
3391
  });
3320
3392
  },
3321
- async getEvaluation(projectId, projectBranch, functionId, functionBranch, year, month, day, hour, evaluationId, result = false) {
3393
+ async getEvaluation(projectId, projectBranch, functionId, functionBranch, year, month, day2, hour, evaluationId, result = false) {
3322
3394
  return client.request({
3323
3395
  method: "GET",
3324
- service: SERVICE4,
3325
- path: `/evaluations/${enc2(projectId)}/${enc2(projectBranch)}/${enc2(functionId)}/${enc2(functionBranch)}/${year}/${month}/${day}/${hour}/${enc2(evaluationId)}`,
3396
+ service: SERVICE5,
3397
+ path: `/evaluations/${enc3(projectId)}/${enc3(projectBranch)}/${enc3(functionId)}/${enc3(functionBranch)}/${year}/${month}/${day2}/${hour}/${enc3(evaluationId)}`,
3326
3398
  query: result ? { result: true } : void 0
3327
3399
  });
3328
3400
  },
@@ -3330,61 +3402,61 @@ function createEvaluationService(client) {
3330
3402
  async getLastEvaluation(projectId, projectBranch, functionId, functionBranch) {
3331
3403
  return client.request({
3332
3404
  method: "GET",
3333
- service: SERVICE4,
3334
- path: `/last-evaluation/${enc2(projectId)}/${enc2(projectBranch)}/${enc2(functionId)}/${enc2(functionBranch)}`
3405
+ service: SERVICE5,
3406
+ path: `/last-evaluation/${enc3(projectId)}/${enc3(projectBranch)}/${enc3(functionId)}/${enc3(functionBranch)}`
3335
3407
  });
3336
3408
  },
3337
3409
  // Outputs
3338
3410
  async getOutputs(projectId, evaluationId) {
3339
3411
  return client.request({
3340
3412
  method: "GET",
3341
- service: SERVICE4,
3342
- path: `/output/${enc2(projectId)}/${enc2(evaluationId)}`
3413
+ service: SERVICE5,
3414
+ path: `/output/${enc3(projectId)}/${enc3(evaluationId)}`
3343
3415
  });
3344
3416
  },
3345
3417
  // Logs
3346
- async getLogs(projectId, projectBranch, functionId, functionBranch, year, month, day, hour) {
3418
+ async getLogs(projectId, projectBranch, functionId, functionBranch, year, month, day2, hour) {
3347
3419
  return client.request({
3348
3420
  method: "GET",
3349
- service: SERVICE4,
3350
- path: `/log/${enc2(projectId)}/${enc2(projectBranch)}/${enc2(functionId)}/${enc2(functionBranch)}/${year}/${month}/${day}/${hour}`
3421
+ service: SERVICE5,
3422
+ path: `/log/${enc3(projectId)}/${enc3(projectBranch)}/${enc3(functionId)}/${enc3(functionBranch)}/${year}/${month}/${day2}/${hour}`
3351
3423
  });
3352
3424
  },
3353
3425
  // Source Code
3354
3426
  async getSourceCode(projectId, projectBranch, functionId, functionBranch, sourceCodeHash, sourceCodeId) {
3355
3427
  return client.request({
3356
3428
  method: "GET",
3357
- service: SERVICE4,
3358
- path: `/sourcecodes/${enc2(projectId)}/${enc2(projectBranch)}/${enc2(functionId)}/${enc2(functionBranch)}/${enc2(sourceCodeHash)}/${enc2(sourceCodeId)}`
3429
+ service: SERVICE5,
3430
+ path: `/sourcecodes/${enc3(projectId)}/${enc3(projectBranch)}/${enc3(functionId)}/${enc3(functionBranch)}/${enc3(sourceCodeHash)}/${enc3(sourceCodeId)}`
3359
3431
  });
3360
3432
  },
3361
3433
  // Stop
3362
- async stopEvaluation(projectId, projectBranch, functionId, functionBranch, year, month, day, hour, evaluationId) {
3434
+ async stopEvaluation(projectId, projectBranch, functionId, functionBranch, year, month, day2, hour, evaluationId) {
3363
3435
  return client.request({
3364
3436
  method: "POST",
3365
- service: SERVICE4,
3366
- path: `/stop/${enc2(projectId)}/${enc2(projectBranch)}/${enc2(functionId)}/${enc2(functionBranch)}/${year}/${month}/${day}/${hour}/${enc2(evaluationId)}`
3437
+ service: SERVICE5,
3438
+ path: `/stop/${enc3(projectId)}/${enc3(projectBranch)}/${enc3(functionId)}/${enc3(functionBranch)}/${year}/${month}/${day2}/${hour}/${enc3(evaluationId)}`
3367
3439
  });
3368
3440
  },
3369
3441
  // Triggers
3370
3442
  async getTriggers(projectId, projectBranch, functionId, functionBranch) {
3371
3443
  return client.request({
3372
3444
  method: "GET",
3373
- service: SERVICE4,
3374
- path: `/triggers/actual/${enc2(projectId)}/${enc2(projectBranch)}/${enc2(functionId)}/${enc2(functionBranch)}`
3445
+ service: SERVICE5,
3446
+ path: `/triggers/actual/${enc3(projectId)}/${enc3(projectBranch)}/${enc3(functionId)}/${enc3(functionBranch)}`
3375
3447
  });
3376
3448
  },
3377
3449
  async getTrigger(projectId, projectBranch, functionId, functionBranch, triggerId) {
3378
3450
  return client.request({
3379
3451
  method: "GET",
3380
- service: SERVICE4,
3381
- path: `/triggers/actual/${enc2(projectId)}/${enc2(projectBranch)}/${enc2(functionId)}/${enc2(functionBranch)}/${enc2(triggerId)}`
3452
+ service: SERVICE5,
3453
+ path: `/triggers/actual/${enc3(projectId)}/${enc3(projectBranch)}/${enc3(functionId)}/${enc3(functionBranch)}/${enc3(triggerId)}`
3382
3454
  });
3383
3455
  },
3384
3456
  async saveTrigger(trigger) {
3385
3457
  return client.request({
3386
3458
  method: "PUT",
3387
- service: SERVICE4,
3459
+ service: SERVICE5,
3388
3460
  path: "/triggers/",
3389
3461
  body: trigger
3390
3462
  });
@@ -3392,16 +3464,16 @@ function createEvaluationService(client) {
3392
3464
  async deleteTrigger(projectId, projectBranch, functionId, functionBranch, triggerId) {
3393
3465
  return client.request({
3394
3466
  method: "DELETE",
3395
- service: SERVICE4,
3396
- path: `/triggers/${enc2(projectId)}/${enc2(projectBranch)}/${enc2(functionId)}/${enc2(functionBranch)}/${enc2(triggerId)}`
3467
+ service: SERVICE5,
3468
+ path: `/triggers/${enc3(projectId)}/${enc3(projectBranch)}/${enc3(functionId)}/${enc3(functionBranch)}/${enc3(triggerId)}`
3397
3469
  });
3398
3470
  }
3399
3471
  };
3400
3472
  }
3401
3473
 
3402
3474
  // src/client/services/scheduler.ts
3403
- var SERVICE5 = "scheduler";
3404
- function enc3(s) {
3475
+ var SERVICE6 = "scheduler";
3476
+ function enc4(s) {
3405
3477
  return encodeURIComponent(s);
3406
3478
  }
3407
3479
  function createSchedulerService(client) {
@@ -3409,24 +3481,24 @@ function createSchedulerService(client) {
3409
3481
  async scheduleCall(request) {
3410
3482
  return client.request({
3411
3483
  method: "POST",
3412
- service: SERVICE5,
3484
+ service: SERVICE6,
3413
3485
  path: "/calls/",
3414
3486
  body: request
3415
3487
  });
3416
3488
  },
3417
- async stopScheduled(projectId, projectBranch, functionId, functionBranch, year, month, day, hour, evaluationId) {
3489
+ async stopScheduled(projectId, projectBranch, functionId, functionBranch, year, month, day2, hour, evaluationId) {
3418
3490
  return client.request({
3419
3491
  method: "POST",
3420
- service: SERVICE5,
3421
- path: `/stop/${enc3(projectId)}/${enc3(projectBranch)}/${enc3(functionId)}/${enc3(functionBranch)}/${year}/${month}/${day}/${hour}/${enc3(evaluationId)}`
3492
+ service: SERVICE6,
3493
+ path: `/stop/${enc4(projectId)}/${enc4(projectBranch)}/${enc4(functionId)}/${enc4(functionBranch)}/${year}/${month}/${day2}/${hour}/${enc4(evaluationId)}`
3422
3494
  });
3423
3495
  }
3424
3496
  };
3425
3497
  }
3426
3498
 
3427
3499
  // src/client/services/language.ts
3428
- var SERVICE6 = "language";
3429
- function enc4(s) {
3500
+ var SERVICE7 = "language";
3501
+ function enc5(s) {
3430
3502
  return encodeURIComponent(s);
3431
3503
  }
3432
3504
  function createLanguageService(client) {
@@ -3435,7 +3507,7 @@ function createLanguageService(client) {
3435
3507
  async chat(request) {
3436
3508
  return client.request({
3437
3509
  method: "POST",
3438
- service: SERVICE6,
3510
+ service: SERVICE7,
3439
3511
  path: "/chat/",
3440
3512
  body: request
3441
3513
  });
@@ -3444,7 +3516,7 @@ function createLanguageService(client) {
3444
3516
  async chatStream(request) {
3445
3517
  return client.requestRaw({
3446
3518
  method: "POST",
3447
- service: SERVICE6,
3519
+ service: SERVICE7,
3448
3520
  path: "/chat/stream",
3449
3521
  body: request
3450
3522
  });
@@ -3453,7 +3525,7 @@ function createLanguageService(client) {
3453
3525
  async upload(formData) {
3454
3526
  return client.request({
3455
3527
  method: "POST",
3456
- service: SERVICE6,
3528
+ service: SERVICE7,
3457
3529
  path: "/upload/",
3458
3530
  rawBody: formData
3459
3531
  });
@@ -3462,7 +3534,7 @@ function createLanguageService(client) {
3462
3534
  async getUsage() {
3463
3535
  return client.request({
3464
3536
  method: "GET",
3465
- service: SERVICE6,
3537
+ service: SERVICE7,
3466
3538
  path: "/usage/"
3467
3539
  });
3468
3540
  },
@@ -3470,36 +3542,36 @@ function createLanguageService(client) {
3470
3542
  async getSessions() {
3471
3543
  return client.request({
3472
3544
  method: "GET",
3473
- service: SERVICE6,
3545
+ service: SERVICE7,
3474
3546
  path: "/sessions/"
3475
3547
  });
3476
3548
  },
3477
3549
  async getSession(sessionId) {
3478
3550
  return client.request({
3479
3551
  method: "GET",
3480
- service: SERVICE6,
3481
- path: `/sessions/${enc4(sessionId)}`
3552
+ service: SERVICE7,
3553
+ path: `/sessions/${enc5(sessionId)}`
3482
3554
  });
3483
3555
  },
3484
3556
  async deleteSession(sessionId) {
3485
3557
  return client.request({
3486
3558
  method: "DELETE",
3487
- service: SERVICE6,
3488
- path: `/sessions/${enc4(sessionId)}`
3559
+ service: SERVICE7,
3560
+ path: `/sessions/${enc5(sessionId)}`
3489
3561
  });
3490
3562
  },
3491
3563
  async getSessionMessages(sessionId) {
3492
3564
  return client.request({
3493
3565
  method: "GET",
3494
- service: SERVICE6,
3495
- path: `/sessions/${enc4(sessionId)}/messages`
3566
+ service: SERVICE7,
3567
+ path: `/sessions/${enc5(sessionId)}/messages`
3496
3568
  });
3497
3569
  },
3498
3570
  async renameSession(sessionId, title) {
3499
3571
  return client.request({
3500
3572
  method: "PUT",
3501
- service: SERVICE6,
3502
- path: `/sessions/${enc4(sessionId)}/title`,
3573
+ service: SERVICE7,
3574
+ path: `/sessions/${enc5(sessionId)}/title`,
3503
3575
  rawBody: title,
3504
3576
  contentType: "text/plain"
3505
3577
  });
@@ -3508,8 +3580,8 @@ function createLanguageService(client) {
3508
3580
  }
3509
3581
 
3510
3582
  // src/client/services/index-search.ts
3511
- var SERVICE7 = "index";
3512
- function enc5(s) {
3583
+ var SERVICE8 = "index";
3584
+ function enc6(s) {
3513
3585
  return encodeURIComponent(s);
3514
3586
  }
3515
3587
  function createIndexService(client) {
@@ -3521,7 +3593,7 @@ function createIndexService(client) {
3521
3593
  async searchPage(query) {
3522
3594
  return client.request({
3523
3595
  method: "GET",
3524
- service: SERVICE7,
3596
+ service: SERVICE8,
3525
3597
  path: "/search/page",
3526
3598
  query: {
3527
3599
  query: query.query,
@@ -3541,7 +3613,7 @@ function createIndexService(client) {
3541
3613
  async getCuratedTags(counts = false) {
3542
3614
  return client.request({
3543
3615
  method: "GET",
3544
- service: SERVICE7,
3616
+ service: SERVICE8,
3545
3617
  path: "/tags/curated",
3546
3618
  query: counts ? { counts: true } : void 0
3547
3619
  });
@@ -3550,7 +3622,7 @@ function createIndexService(client) {
3550
3622
  async createCuratedTag(request) {
3551
3623
  return client.request({
3552
3624
  method: "POST",
3553
- service: SERVICE7,
3625
+ service: SERVICE8,
3554
3626
  path: "/admin/curated-tags",
3555
3627
  body: request
3556
3628
  });
@@ -3559,8 +3631,8 @@ function createIndexService(client) {
3559
3631
  async updateCuratedTag(tag, request) {
3560
3632
  return client.request({
3561
3633
  method: "PUT",
3562
- service: SERVICE7,
3563
- path: `/admin/curated-tags/${enc5(tag)}`,
3634
+ service: SERVICE8,
3635
+ path: `/admin/curated-tags/${enc6(tag)}`,
3564
3636
  body: request
3565
3637
  });
3566
3638
  },
@@ -3568,22 +3640,22 @@ function createIndexService(client) {
3568
3640
  async deleteCuratedTag(tag) {
3569
3641
  return client.request({
3570
3642
  method: "DELETE",
3571
- service: SERVICE7,
3572
- path: `/admin/curated-tags/${enc5(tag)}`
3643
+ service: SERVICE8,
3644
+ path: `/admin/curated-tags/${enc6(tag)}`
3573
3645
  });
3574
3646
  },
3575
3647
  async rebuildAll() {
3576
3648
  return client.request({
3577
3649
  method: "POST",
3578
- service: SERVICE7,
3650
+ service: SERVICE8,
3579
3651
  path: "/indexes/rebuild"
3580
3652
  });
3581
3653
  },
3582
3654
  async rebuildProject(projectId) {
3583
3655
  return client.request({
3584
3656
  method: "POST",
3585
- service: SERVICE7,
3586
- path: `/indexes/rebuild/${enc5(projectId)}`
3657
+ service: SERVICE8,
3658
+ path: `/indexes/rebuild/${enc6(projectId)}`
3587
3659
  });
3588
3660
  }
3589
3661
  };
@@ -3596,6 +3668,7 @@ function createApiClient(options = {}) {
3596
3668
  http,
3597
3669
  admin: createAdminService(http),
3598
3670
  analysis: createAnalysisService(http),
3671
+ deployments: createDeploymentsService(http),
3599
3672
  storage: createStorageService(http),
3600
3673
  evaluation: createEvaluationService(http),
3601
3674
  scheduler: createSchedulerService(http),
@@ -4144,8 +4217,8 @@ function printImportPreview(preview) {
4144
4217
  for (const e of preview.entities ?? []) {
4145
4218
  counts.set(e.type, (counts.get(e.type) ?? 0) + 1);
4146
4219
  }
4147
- for (const [type, count] of [...counts.entries()].sort((a, b) => a[0].localeCompare(b[0]))) {
4148
- console.log(` ${type}: ${count}`);
4220
+ for (const [type, count2] of [...counts.entries()].sort((a, b) => a[0].localeCompare(b[0]))) {
4221
+ console.log(` ${type}: ${count2}`);
4149
4222
  }
4150
4223
  if (preview.hasAnalysis) {
4151
4224
  console.log(" analysis recipe: included");
@@ -5071,11 +5144,11 @@ function parseInterval(value) {
5071
5144
  return interval;
5072
5145
  }
5073
5146
  function parseCount(value, label) {
5074
- const count = Number(value);
5075
- if (!Number.isInteger(count) || count < 0) {
5147
+ const count2 = Number(value);
5148
+ if (!Number.isInteger(count2) || count2 < 0) {
5076
5149
  throw new Error(`Invalid ${label} "${value}". Expected a non-negative whole number.`);
5077
5150
  }
5078
- return count;
5151
+ return count2;
5079
5152
  }
5080
5153
  function formatMoney(cents, currency) {
5081
5154
  const sign = cents < 0 ? "-" : "";
@@ -5330,20 +5403,20 @@ function registerInvitationCommands(team) {
5330
5403
  }
5331
5404
  function registerSeatCommands(team) {
5332
5405
  const seats = team.command("seats").description("Change a team's seat count");
5333
- seats.command("preview").description("Preview the invoice for a seat-count change without applying it").argument("<teamId>", "Team ID").argument("<count>", "New seat count").action(async (teamId, count, _options, cmd) => {
5406
+ seats.command("preview").description("Preview the invoice for a seat-count change without applying it").argument("<teamId>", "Team ID").argument("<count>", "New seat count").action(async (teamId, count2, _options, cmd) => {
5334
5407
  try {
5335
5408
  const api = createApiClient();
5336
5409
  printInvoicePreview(
5337
- await api.admin.previewTeamSeatCount(teamId, parseCount(count, "seat count")),
5410
+ await api.admin.previewTeamSeatCount(teamId, parseCount(count2, "seat count")),
5338
5411
  getOutputFormat4(cmd)
5339
5412
  );
5340
5413
  } catch (error) {
5341
5414
  handleError(error);
5342
5415
  }
5343
5416
  });
5344
- seats.command("set").description("Change the seat count and bill the difference").argument("<teamId>", "Team ID").argument("<count>", "New seat count").option("-y, --yes", "Skip the confirmation prompt").action(async (teamId, count, options, cmd) => {
5417
+ seats.command("set").description("Change the seat count and bill the difference").argument("<teamId>", "Team ID").argument("<count>", "New seat count").option("-y, --yes", "Skip the confirmation prompt").action(async (teamId, count2, options, cmd) => {
5345
5418
  try {
5346
- const seatCount = parseCount(count, "seat count");
5419
+ const seatCount = parseCount(count2, "seat count");
5347
5420
  await confirmDestructive(
5348
5421
  `This will change the seat count of team "${teamId}" to ${seatCount} and adjust billing.`,
5349
5422
  { yes: options.yes, resourceId: teamId }
@@ -5360,20 +5433,20 @@ function registerSeatCommands(team) {
5360
5433
  }
5361
5434
  function registerPackCommands(team) {
5362
5435
  const packs = team.command("packs").description("Change a team's credit extension packs");
5363
- packs.command("preview").description("Preview the invoice for a pack-count change without applying it").argument("<teamId>", "Team ID").argument("<count>", "New pack count").action(async (teamId, count, _options, cmd) => {
5436
+ packs.command("preview").description("Preview the invoice for a pack-count change without applying it").argument("<teamId>", "Team ID").argument("<count>", "New pack count").action(async (teamId, count2, _options, cmd) => {
5364
5437
  try {
5365
5438
  const api = createApiClient();
5366
5439
  printInvoicePreview(
5367
- await api.admin.previewTeamPackCount(teamId, parseCount(count, "pack count")),
5440
+ await api.admin.previewTeamPackCount(teamId, parseCount(count2, "pack count")),
5368
5441
  getOutputFormat4(cmd)
5369
5442
  );
5370
5443
  } catch (error) {
5371
5444
  handleError(error);
5372
5445
  }
5373
5446
  });
5374
- packs.command("set").description("Change the pack count and bill the difference").argument("<teamId>", "Team ID").argument("<count>", "New pack count").option("-y, --yes", "Skip the confirmation prompt").action(async (teamId, count, options, cmd) => {
5447
+ packs.command("set").description("Change the pack count and bill the difference").argument("<teamId>", "Team ID").argument("<count>", "New pack count").option("-y, --yes", "Skip the confirmation prompt").action(async (teamId, count2, options, cmd) => {
5375
5448
  try {
5376
- const packCount = parseCount(count, "pack count");
5449
+ const packCount = parseCount(count2, "pack count");
5377
5450
  await confirmDestructive(
5378
5451
  `This will change the extension packs of team "${teamId}" to ${packCount} and adjust billing.`,
5379
5452
  { yes: options.yes, resourceId: teamId }
@@ -5812,8 +5885,8 @@ function registerEventCommands(program) {
5812
5885
  });
5813
5886
  event.command("create").description("Create one or more events (body from JSON file or stdin)").argument("[file]", "JSON file containing a BareEvent array; defaults to stdin").action(async (file) => {
5814
5887
  try {
5815
- const fs19 = await import("fs");
5816
- const body = file ? fs19.readFileSync(file, "utf-8") : await new Promise((resolve2, reject) => {
5888
+ const fs20 = await import("fs");
5889
+ const body = file ? fs20.readFileSync(file, "utf-8") : await new Promise((resolve2, reject) => {
5817
5890
  let data = "";
5818
5891
  process.stdin.setEncoding("utf-8");
5819
5892
  process.stdin.on("data", (chunk) => {
@@ -6692,8 +6765,8 @@ Examples:
6692
6765
  for (const e of preview.entities ?? []) {
6693
6766
  counts.set(e.type, (counts.get(e.type) ?? 0) + 1);
6694
6767
  }
6695
- for (const [type, count] of [...counts.entries()].sort((a, b) => a[0].localeCompare(b[0]))) {
6696
- console.log(` ${type}: ${count}`);
6768
+ for (const [type, count2] of [...counts.entries()].sort((a, b) => a[0].localeCompare(b[0]))) {
6769
+ console.log(` ${type}: ${count2}`);
6697
6770
  }
6698
6771
  if (preview.lossinessNotes && preview.lossinessNotes.length > 0) {
6699
6772
  console.log(chalk17.yellow("Lossiness:"));
@@ -6975,7 +7048,7 @@ Examples:
6975
7048
  const resolved = parseEntityReference(ref, overrides);
6976
7049
  const api = createApiClient();
6977
7050
  const parts = options.date.split("-").map(Number);
6978
- const [year, month, day, hour] = parts;
7051
+ const [year, month, day2, hour] = parts;
6979
7052
  const evaluations = await api.evaluation.getEvaluations(
6980
7053
  resolved.projectId,
6981
7054
  resolved.projectBranch,
@@ -6983,7 +7056,7 @@ Examples:
6983
7056
  resolved.entityBranch,
6984
7057
  year,
6985
7058
  month,
6986
- day,
7059
+ day2,
6987
7060
  hour
6988
7061
  );
6989
7062
  const summary = evaluations.map((e) => ({
@@ -7036,7 +7109,7 @@ Examples:
7036
7109
  const resolved = parseEntityReference(ref, overrides);
7037
7110
  const api = createApiClient();
7038
7111
  const parts = options.date.split("-").map(Number);
7039
- const [year, month, day, hour] = parts;
7112
+ const [year, month, day2, hour] = parts;
7040
7113
  const logs = await api.evaluation.getLogs(
7041
7114
  resolved.projectId,
7042
7115
  resolved.projectBranch,
@@ -7044,7 +7117,7 @@ Examples:
7044
7117
  resolved.entityBranch,
7045
7118
  year,
7046
7119
  month,
7047
- day,
7120
+ day2,
7048
7121
  hour
7049
7122
  );
7050
7123
  format(logs, { format: outputFormat });
@@ -7058,7 +7131,7 @@ Examples:
7058
7131
  const resolved = parseEntityReference(ref, overrides);
7059
7132
  const api = createApiClient();
7060
7133
  const parts = options.date.split("-").map(Number);
7061
- const [year, month, day, hour] = parts;
7134
+ const [year, month, day2, hour] = parts;
7062
7135
  await api.evaluation.stopEvaluation(
7063
7136
  resolved.projectId,
7064
7137
  resolved.projectBranch,
@@ -7066,7 +7139,7 @@ Examples:
7066
7139
  resolved.entityBranch,
7067
7140
  year,
7068
7141
  month,
7069
- day,
7142
+ day2,
7070
7143
  hour,
7071
7144
  evaluationId
7072
7145
  );
@@ -7904,6 +7977,8 @@ var BY_COMMAND = {
7904
7977
  "project members invite": { "<userId>": TEXT, "<role>": { kind: "choice", choices: PROJECT_ROLES } },
7905
7978
  "project members join": { "<userId>": TEXT },
7906
7979
  "license create": { "<licenseId>": TEXT, "--name": TEXT, "--flags": TEXT },
7980
+ "deployment create": { "--analysis": { kind: "analysis" }, "--target": TEXT },
7981
+ "deployment delete-prediction": { "<predictionId>": TEXT },
7907
7982
  "trigger create": { "--type": { kind: "choice", choices: TRIGGER_TYPES } },
7908
7983
  "analyze triggers create": { "--kind": { kind: "choice", choices: ANALYSIS_TRIGGER_KINDS } },
7909
7984
  "function outputs": { "<evaluationId>": TEXT },
@@ -7920,6 +7995,7 @@ var BY_NAME = {
7920
7995
  invitationId: { kind: "teamInvitation" },
7921
7996
  analysisId: { kind: "analysis" },
7922
7997
  licenseId: { kind: "license" },
7998
+ deploymentId: { kind: "deployment" },
7923
7999
  sessionId: { kind: "chatSession" },
7924
8000
  tokenId: { kind: "apiToken" },
7925
8001
  resource: { kind: "tokenResource" },
@@ -8133,8 +8209,8 @@ Examples:
8133
8209
  if (!TRIGGER_TYPES.includes(type)) {
8134
8210
  throw new Error(`Unknown trigger type "${options.type}": use one of ${TRIGGER_TYPES.join(", ")}.`);
8135
8211
  }
8136
- const count = Number(options.count);
8137
- if (!Number.isInteger(count) || count < 1) {
8212
+ const count2 = Number(options.count);
8213
+ if (!Number.isInteger(count2) || count2 < 1) {
8138
8214
  throw new Error(`--count must be a whole number of at least 1, not "${options.count}".`);
8139
8215
  }
8140
8216
  const api = createApiClient();
@@ -8163,7 +8239,7 @@ Examples:
8163
8239
  originEntityId,
8164
8240
  originEntityBranch,
8165
8241
  active: !options.inactive,
8166
- quantity: count,
8242
+ quantity: count2,
8167
8243
  fired: 0,
8168
8244
  maximum: options.max ? parseInt(options.max, 10) || null : null,
8169
8245
  evaluationIds: null,
@@ -8247,7 +8323,7 @@ function registerScheduleCommands(program) {
8247
8323
  const overrides = getOverrides10(cmd);
8248
8324
  const resolved = parseEntityReference(ref, overrides);
8249
8325
  const api = createApiClient();
8250
- const [year, month, day, hour] = options.date.split("-").map(Number);
8326
+ const [year, month, day2, hour] = options.date.split("-").map(Number);
8251
8327
  await api.scheduler.stopScheduled(
8252
8328
  resolved.projectId,
8253
8329
  resolved.projectBranch,
@@ -8255,7 +8331,7 @@ function registerScheduleCommands(program) {
8255
8331
  resolved.entityBranch,
8256
8332
  year,
8257
8333
  month,
8258
- day,
8334
+ day2,
8259
8335
  hour,
8260
8336
  evaluationId
8261
8337
  );
@@ -8479,7 +8555,7 @@ var HELP = [
8479
8555
  ];
8480
8556
  async function runChatRepl(options) {
8481
8557
  const { input: promptInput } = await import("@inquirer/prompts");
8482
- const { getUpdateNotice } = await import("./update-check-WNT76O6I.js");
8558
+ const { getUpdateNotice } = await import("./update-check-R7B2D7VX.js");
8483
8559
  let sessionId = options.session;
8484
8560
  let lastReportedSession;
8485
8561
  console.log(chalk21.bold("Diafunc chat") + chalk21.dim(" \xB7 /help for commands, /quit to exit"));
@@ -10306,8 +10382,8 @@ function licenseText(analysis) {
10306
10382
  return analysis.visibility === "PUBLIC" ? "none chosen" : null;
10307
10383
  }
10308
10384
  function sentenceCase(token) {
10309
- const words = token.toLowerCase().replace(/_/g, " ");
10310
- return words.charAt(0).toUpperCase() + words.slice(1);
10385
+ const words2 = token.toLowerCase().replace(/_/g, " ");
10386
+ return words2.charAt(0).toUpperCase() + words2.slice(1);
10311
10387
  }
10312
10388
  function hoursText(hours) {
10313
10389
  if (hours == null || hours === "") return null;
@@ -11823,10 +11899,10 @@ async function listColumns(analysisId, cmd) {
11823
11899
  }
11824
11900
  format(columns, { format: outputFormat, columns: ["name", "valueType"] });
11825
11901
  }
11826
- async function listRuns(analysisId, count, cmd) {
11902
+ async function listRuns(analysisId, count2, cmd) {
11827
11903
  const outputFormat = getOutputFormat19(cmd);
11828
11904
  const api = createApiClient();
11829
- const runs = await api.analysis.getRunsForAnalysis(analysisId, count);
11905
+ const runs = await api.analysis.getRunsForAnalysis(analysisId, count2);
11830
11906
  format(runs.map((r) => ({
11831
11907
  runId: r.runId,
11832
11908
  state: r.state,
@@ -12391,10 +12467,896 @@ Examples:
12391
12467
  });
12392
12468
  }
12393
12469
 
12470
+ // src/commands/deployment/index.ts
12471
+ import * as fs13 from "fs";
12472
+ import chalk30 from "chalk";
12473
+
12474
+ // src/util/csv.ts
12475
+ function detectDelimiter(firstLine) {
12476
+ if (firstLine.includes(",")) return ",";
12477
+ if (firstLine.includes(" ")) return " ";
12478
+ if (firstLine.includes(";")) return ";";
12479
+ return ",";
12480
+ }
12481
+ function records(text2, delimiter) {
12482
+ const out = [];
12483
+ let fields = [];
12484
+ let field = "";
12485
+ let quoted = false;
12486
+ let line = 1;
12487
+ let startLine = 1;
12488
+ let i = 0;
12489
+ const finishRecord = () => {
12490
+ fields.push(field);
12491
+ if (!(fields.length === 1 && fields[0].trim() === "")) out.push({ fields, line: startLine });
12492
+ fields = [];
12493
+ field = "";
12494
+ };
12495
+ while (i < text2.length) {
12496
+ const c = text2[i];
12497
+ if (quoted) {
12498
+ if (c === '"') {
12499
+ if (text2[i + 1] === '"') {
12500
+ field += '"';
12501
+ i += 2;
12502
+ continue;
12503
+ }
12504
+ quoted = false;
12505
+ } else {
12506
+ if (c === "\n") line++;
12507
+ field += c;
12508
+ }
12509
+ i++;
12510
+ continue;
12511
+ }
12512
+ if (c === '"' && field === "") {
12513
+ quoted = true;
12514
+ } else if (c === delimiter) {
12515
+ fields.push(field);
12516
+ field = "";
12517
+ } else if (c === "\r" && text2[i + 1] === "\n") {
12518
+ } else if (c === "\n") {
12519
+ finishRecord();
12520
+ line++;
12521
+ startLine = line;
12522
+ } else {
12523
+ field += c;
12524
+ }
12525
+ i++;
12526
+ }
12527
+ if (field !== "" || fields.length > 0) finishRecord();
12528
+ return out;
12529
+ }
12530
+ function parseCsv(text2) {
12531
+ const body = text2.charCodeAt(0) === 65279 ? text2.slice(1) : text2;
12532
+ const firstLine = body.split(/\r?\n/, 1)[0] ?? "";
12533
+ const all = records(body, detectDelimiter(firstLine));
12534
+ if (all.length === 0) return { header: [], rows: [], lines: [] };
12535
+ const header = all[0].fields.map((h) => h.trim());
12536
+ const rows = all.slice(1).map((r) => header.map((_, index) => r.fields[index] ?? ""));
12537
+ return { header, rows, lines: all.slice(1).map((r) => r.line) };
12538
+ }
12539
+ function csvLine(fields) {
12540
+ return fields.map((value) => {
12541
+ const text2 = value === null || value === void 0 ? "" : String(value);
12542
+ return /[",\r\n]/.test(text2) ? `"${text2.replace(/"/g, '""')}"` : text2;
12543
+ }).join(",");
12544
+ }
12545
+ function chunks(items, size) {
12546
+ if (size < 1) throw new Error("chunk size must be at least 1");
12547
+ const out = [];
12548
+ for (let i = 0; i < items.length; i += size) out.push(items.slice(i, i + size));
12549
+ return out;
12550
+ }
12551
+
12552
+ // src/prompting/command.ts
12553
+ import { Command as Command2 } from "commander";
12554
+ var commanderOriginal = Command2.prototype;
12555
+ var DiafuncCommand = class _DiafuncCommand extends Command2 {
12556
+ /** Gaps recorded during the current parse, in the order commander found them. */
12557
+ pendingInputs = [];
12558
+ /** Set on the program only; every command reads it from there. */
12559
+ promptEnvironment = {};
12560
+ createCommand(name) {
12561
+ return new _DiafuncCommand(name);
12562
+ }
12563
+ missingArgument(name) {
12564
+ if (!this.mayPrompt()) {
12565
+ commanderOriginal.missingArgument.call(this, name);
12566
+ return;
12567
+ }
12568
+ const index = this.registeredArguments.findIndex((a) => a.name() === name);
12569
+ const argument = this.registeredArguments[index];
12570
+ this.pendingInputs.push({
12571
+ kind: "argument",
12572
+ name,
12573
+ index,
12574
+ description: argument?.description ?? "",
12575
+ variadic: Boolean(argument?.variadic)
12576
+ });
12577
+ }
12578
+ missingMandatoryOptionValue(option) {
12579
+ if (!this.mayPrompt()) {
12580
+ commanderOriginal.missingMandatoryOptionValue.call(this, option);
12581
+ return;
12582
+ }
12583
+ this.pendingInputs.push({
12584
+ kind: "option",
12585
+ name: option.attributeName(),
12586
+ flag: option.long ?? option.flags,
12587
+ description: option.description ?? "",
12588
+ variadic: Boolean(option.variadic)
12589
+ });
12590
+ }
12591
+ /** The environment set on the program. */
12592
+ environment() {
12593
+ let root = this;
12594
+ while (root.parent) root = root.parent;
12595
+ return root instanceof _DiafuncCommand ? root.promptEnvironment : {};
12596
+ }
12597
+ mayPrompt() {
12598
+ const forced = this.environment().interactive;
12599
+ if (forced !== void 0) return forced;
12600
+ const globals = this.optsWithGlobals();
12601
+ const output = globals.output ?? loadConfig().defaults.output ?? "human";
12602
+ return canPrompt(output, globals.interactive === false);
12603
+ }
12604
+ };
12605
+
12606
+ // src/commands/deployment/index.ts
12607
+ var MAX_ROWS_PER_CALL = 1e3;
12608
+ var RETENTION_DAYS = [30, 90, 180];
12609
+ var WINDOWS = ["7d", "30d"];
12610
+ var NOT_ENOUGH_CREDITS = "Not enough credits. Each prediction costs credits.";
12611
+ var CREDITS_HINT = `See your credits with 'diafunc utilization'.`;
12612
+ function getOutputFormat20(cmd) {
12613
+ const config = loadConfig();
12614
+ const globalOpts = cmd.optsWithGlobals();
12615
+ return globalOpts.output ?? config.defaults.output ?? "human";
12616
+ }
12617
+ function prompterFor(cmd) {
12618
+ const env = cmd instanceof DiafuncCommand ? cmd.environment() : {};
12619
+ const globals = cmd.optsWithGlobals();
12620
+ const interactive = env.interactive ?? canPrompt(getOutputFormat20(cmd), globals.interactive === false);
12621
+ return interactive ? env.prompter ?? createInquirerPrompter() : null;
12622
+ }
12623
+ async function confirmStep(cmd, question2, yes, refusal) {
12624
+ if (yes || isDryRun()) return true;
12625
+ const prompter = prompterFor(cmd);
12626
+ if (!prompter) throw new CliError(refusal, { exitCode: EXIT_USAGE, hint: "Add --yes to go ahead without being asked." });
12627
+ return prompter.confirm({ message: question2, default: false });
12628
+ }
12629
+ function words(code) {
12630
+ return code ? code.replace(/_/g, " ") : null;
12631
+ }
12632
+ function num(value) {
12633
+ if (value === null || value === void 0 || !Number.isFinite(value)) return ABSENT;
12634
+ if (Number.isInteger(value)) return value.toLocaleString("en-US");
12635
+ const abs = Math.abs(value);
12636
+ if (abs >= 1e3) return Math.round(value).toLocaleString("en-US");
12637
+ if (abs >= 1e-3) return String(Number(value.toPrecision(4)));
12638
+ return value.toPrecision(3);
12639
+ }
12640
+ function percent2(share) {
12641
+ if (share === null || share === void 0 || !Number.isFinite(share)) return ABSENT;
12642
+ const p = share * 100;
12643
+ return `${p >= 10 || Number.isInteger(p) ? Math.round(p) : p.toFixed(1)}%`;
12644
+ }
12645
+ function day(value) {
12646
+ if (value === null || value === void 0 || value === "") return null;
12647
+ const date = new Date(typeof value === "number" && value < 1e11 ? value * 1e3 : value);
12648
+ return Number.isNaN(date.getTime()) ? null : date.toISOString().slice(0, 10);
12649
+ }
12650
+ function shortRun(id) {
12651
+ return id.length > 8 ? `${id.slice(0, 8)}\u2026` : id;
12652
+ }
12653
+ function modelWords(version, at) {
12654
+ const when2 = day(at);
12655
+ if (when2 && version) return `the model of the run of ${when2} (run ${shortRun(version)})`;
12656
+ if (when2) return `the model of the run of ${when2}`;
12657
+ if (version) return `the model of run ${shortRun(version)}`;
12658
+ return null;
12659
+ }
12660
+ function count(n) {
12661
+ return n.toLocaleString("en-US");
12662
+ }
12663
+ function onOff(value) {
12664
+ return value ? "on" : "off";
12665
+ }
12666
+ function parseOnOff(flag, value) {
12667
+ if (value === void 0) return void 0;
12668
+ const v = value.trim().toLowerCase();
12669
+ if (v === "on" || v === "true") return true;
12670
+ if (v === "off" || v === "false") return false;
12671
+ throw new CliError(`${flag} takes on or off, not "${value}".`, { exitCode: EXIT_USAGE });
12672
+ }
12673
+ function parseRetention(value) {
12674
+ if (value === void 0) return void 0;
12675
+ const days = Number(value.trim());
12676
+ if (!RETENTION_DAYS.includes(days)) {
12677
+ throw new CliError(`--retention takes ${RETENTION_DAYS.join(", ")} (days), not "${value}".`, { exitCode: EXIT_USAGE });
12678
+ }
12679
+ return days;
12680
+ }
12681
+ function parseWindow(value) {
12682
+ const w = (value ?? "7d").trim().toLowerCase();
12683
+ if (!WINDOWS.includes(w)) {
12684
+ throw new CliError(`--window takes 7d or 30d, not "${value}".`, { exitCode: EXIT_USAGE });
12685
+ }
12686
+ return w;
12687
+ }
12688
+ function settingsFrom(options) {
12689
+ const request = {};
12690
+ if (options.name !== void 0) {
12691
+ if (options.name.trim() === "") throw new CliError("--name cannot be empty.", { exitCode: EXIT_USAGE });
12692
+ request.name = options.name;
12693
+ }
12694
+ const logInputs = parseOnOff("--log-inputs", options.logInputs);
12695
+ if (logInputs !== void 0) request.logInputs = logInputs;
12696
+ const retention = parseRetention(options.retention);
12697
+ if (retention !== void 0) request.retentionDays = retention;
12698
+ const mailAlerts = parseOnOff("--mail-alerts", options.mailAlerts);
12699
+ if (mailAlerts !== void 0) request.mailAlerts = mailAlerts;
12700
+ if (Object.keys(request).length === 0) {
12701
+ throw new CliError("Nothing to change.", {
12702
+ exitCode: EXIT_USAGE,
12703
+ hint: "Give at least one of --name, --log-inputs on|off, --retention 30|90|180, --mail-alerts on|off."
12704
+ });
12705
+ }
12706
+ return request;
12707
+ }
12708
+ function parseInputs(pairs) {
12709
+ const inputs = {};
12710
+ for (const pair of pairs) {
12711
+ const at = pair.indexOf("=");
12712
+ const key = at < 0 ? "" : pair.slice(0, at).trim();
12713
+ if (at < 0 || key === "") {
12714
+ throw new CliError(`--input takes name=value, not "${pair}".`, { exitCode: EXIT_USAGE });
12715
+ }
12716
+ if (Object.prototype.hasOwnProperty.call(inputs, key)) {
12717
+ throw new CliError(`Input ${key} is given twice.`, { exitCode: EXIT_USAGE });
12718
+ }
12719
+ inputs[key] = pair.slice(at + 1).trim();
12720
+ }
12721
+ return inputs;
12722
+ }
12723
+ function predictRequestsFrom(table, inputKeys, options = {}) {
12724
+ if (table.rows.length === 0) throw new CliError("The file has no rows to predict.");
12725
+ const referenceIndex = options.referenceColumn === void 0 ? -1 : table.header.indexOf(options.referenceColumn);
12726
+ if (options.referenceColumn !== void 0 && referenceIndex < 0) {
12727
+ throw new CliError(`The file has no column ${options.referenceColumn} for --reference.`, {
12728
+ hint: `Its columns are: ${table.header.join(", ")}.`
12729
+ });
12730
+ }
12731
+ const keys = inputKeys && inputKeys.length > 0 ? inputKeys : table.header.filter((_, i) => i !== referenceIndex);
12732
+ const missing = keys.filter((k) => !table.header.includes(k));
12733
+ if (missing.length > 0) {
12734
+ throw new CliError(`The file has no column for the input${missing.length > 1 ? "s" : ""} ${missing.join(", ")}.`, {
12735
+ hint: `The deployment reads ${keys.join(", ")}.`
12736
+ });
12737
+ }
12738
+ const indexOf = new Map(keys.map((k) => [k, table.header.indexOf(k)]));
12739
+ return table.rows.map((row) => {
12740
+ const inputs = {};
12741
+ for (const [key, index] of indexOf) {
12742
+ const value = row[index].trim();
12743
+ if (value !== "") inputs[key] = value;
12744
+ }
12745
+ const request = { inputs };
12746
+ if (referenceIndex >= 0 && row[referenceIndex].trim() !== "") request.reference = row[referenceIndex].trim();
12747
+ if (options.store === false) request.store = false;
12748
+ return request;
12749
+ });
12750
+ }
12751
+ var RESULT_HEADER = ["row", "reference", "prediction", "lower", "upper", "outOfRange", "predictionId", "error"];
12752
+ function resultFields(row, answer) {
12753
+ const outOfRange = (answer?.checks?.inputs ?? []).map((c) => c.input).join(";");
12754
+ return [
12755
+ row,
12756
+ answer?.reference ?? null,
12757
+ answer?.prediction ?? answer?.classLabel ?? null,
12758
+ answer?.confidence?.lower ?? null,
12759
+ answer?.confidence?.upper ?? null,
12760
+ outOfRange,
12761
+ answer?.predictionId ?? null,
12762
+ answer === void 0 ? "no answer for this row" : answer.error ?? null
12763
+ ];
12764
+ }
12765
+ function columnIndex(header, name) {
12766
+ const norm = (s) => s.toLowerCase().replace(/[_\s-]/g, "");
12767
+ return header.findIndex((h) => norm(h) === norm(name));
12768
+ }
12769
+ function parseOutcomeValue(value, where) {
12770
+ const text2 = value.trim();
12771
+ if (text2 === "") throw new CliError(`${where}: the outcome is empty.`, { exitCode: EXIT_USAGE });
12772
+ const number = Number(text2);
12773
+ return Number.isFinite(number) ? number : text2;
12774
+ }
12775
+ function outcomesFrom(table) {
12776
+ const actualIndex = columnIndex(table.header, "actual");
12777
+ const idIndex = columnIndex(table.header, "predictionId");
12778
+ const referenceIndex = columnIndex(table.header, "reference");
12779
+ if (actualIndex < 0 || idIndex < 0 && referenceIndex < 0) {
12780
+ throw new CliError("The file needs an actual column and a predictionId or reference column.", {
12781
+ hint: `Its columns are: ${table.header.join(", ") || "none"}.`
12782
+ });
12783
+ }
12784
+ const outcomes = [];
12785
+ let skipped = 0;
12786
+ table.rows.forEach((row, i) => {
12787
+ const line = `Line ${table.lines[i] ?? i + 2}`;
12788
+ if (row[actualIndex].trim() === "") {
12789
+ skipped++;
12790
+ return;
12791
+ }
12792
+ const actual = parseOutcomeValue(row[actualIndex], line);
12793
+ const predictionId = idIndex >= 0 ? row[idIndex].trim() : "";
12794
+ const reference = referenceIndex >= 0 ? row[referenceIndex].trim() : "";
12795
+ if (predictionId !== "") outcomes.push({ predictionId, actual });
12796
+ else if (reference !== "") outcomes.push({ reference, actual });
12797
+ else throw new CliError(`${line}: no prediction id and no reference.`, { exitCode: EXIT_USAGE });
12798
+ });
12799
+ if (outcomes.length === 0) throw new CliError("The file has no rows with an outcome in its actual column.");
12800
+ return { outcomes, skipped };
12801
+ }
12802
+ function readTable(file) {
12803
+ let text2;
12804
+ try {
12805
+ text2 = fs13.readFileSync(file, "utf8");
12806
+ } catch (error) {
12807
+ throw new CliError(`Could not read ${file}: ${error.message}`);
12808
+ }
12809
+ return parseCsv(text2);
12810
+ }
12811
+ function deploymentNotFound(error, deploymentId, predictionId) {
12812
+ if (!(error instanceof ApiError) || error.status !== 404) return error;
12813
+ if (predictionId !== void 0) {
12814
+ return new CliError(`No prediction ${predictionId} in deployment ${deploymentId}, or no such deployment.`, {
12815
+ hint: `List your deployments with 'diafunc deployment list'.`
12816
+ });
12817
+ }
12818
+ return new CliError(`No deployment ${deploymentId} in your account.`, {
12819
+ hint: `List your deployments with 'diafunc deployment list'.`
12820
+ });
12821
+ }
12822
+ function isNotEnoughCredits(error) {
12823
+ return error instanceof ApiError && error.status === 402;
12824
+ }
12825
+ function checkWords(check) {
12826
+ const range = check.observedMin !== null && check.observedMin !== void 0 && check.observedMax !== null && check.observedMax !== void 0 ? ` (observed ${num(check.observedMin)} to ${num(check.observedMax)})` : "";
12827
+ const value = check.value === null || check.value === void 0 ? "" : ` = ${String(check.value)}`;
12828
+ switch (check.kind) {
12829
+ case "below_range":
12830
+ return `${check.input}${value}, below the observed range${range}`;
12831
+ case "above_range":
12832
+ return `${check.input}${value}, above the observed range${range}`;
12833
+ case "unseen_level":
12834
+ return `${check.input}${value}, a level the model was not found on`;
12835
+ case "missing":
12836
+ return `${check.input}, not sent or not readable`;
12837
+ default:
12838
+ return `${check.input}${value}, ${words(check.kind)}`;
12839
+ }
12840
+ }
12841
+ function predictionLines(deploymentId, answer) {
12842
+ const lines = [];
12843
+ const value = answer.prediction ?? answer.classLabel;
12844
+ const target = answer.target ? `${answer.target}: ` : "";
12845
+ lines.push(`${target}${value === null || value === void 0 ? ABSENT : typeof value === "number" ? num(value) : value}`);
12846
+ const c = answer.confidence;
12847
+ if (c && c.lower !== null && c.lower !== void 0 && c.upper !== null && c.upper !== void 0) {
12848
+ const level = c.level ? `${percent2(c.level)} ` : "";
12849
+ const expected = c.expectedCoverage ? `, expected to hold ${percent2(c.expectedCoverage)} of new rows` : "";
12850
+ lines.push(`${level}interval ${num(c.lower)} to ${num(c.upper)}${expected}`);
12851
+ }
12852
+ const checks = answer.checks;
12853
+ if (checks && !checks.withinRange) {
12854
+ for (const check of checks.inputs ?? []) lines.push(`Outside what the model was found on: ${checkWords(check)}`);
12855
+ }
12856
+ if (checks?.distance !== null && checks?.distance !== void 0 && checks.distanceLine !== null && checks.distanceLine !== void 0 && checks.distance > checks.distanceLine) {
12857
+ lines.push("The row lies farther from the training rows than 99 of 100 training rows do.");
12858
+ }
12859
+ if (answer.predictionId) {
12860
+ lines.push(`Prediction id ${answer.predictionId}`);
12861
+ lines.push(`Record its outcome with 'diafunc deployment outcomes ${deploymentId} --prediction ${answer.predictionId} --actual <value>'.`);
12862
+ }
12863
+ return lines;
12864
+ }
12865
+ function inputRow(i) {
12866
+ return {
12867
+ input: i.input === "@prediction" ? "(predictions)" : i.input,
12868
+ state: words(i.state),
12869
+ psi: i.psi === null || i.psi === void 0 ? null : num(i.psi),
12870
+ outOfRange: i.outOfRange > 0 ? `${count(i.outOfRange)} (${percent2(i.outOfRangeShare)})` : "0",
12871
+ missing: i.missing,
12872
+ counted: i.counted
12873
+ };
12874
+ }
12875
+ function monitoringSummary(deploymentId, report) {
12876
+ const verdict = report.health ? [report.health.title, ...report.health.reasons ?? []] : ["No verdict yet: the first daily check has not run."];
12877
+ const outside = report.outOfRangeShare === null || report.outOfRangeShare === void 0 ? "" : `, ${percent2(report.outOfRangeShare)} with an input outside the observed range`;
12878
+ const traffic = `${count(report.predictions)} predictions, ${count(report.failed)} failed${outside}.`;
12879
+ const quality = [];
12880
+ const q = report.quality;
12881
+ if (!q || q.scored === 0) {
12882
+ quality.push(`No outcomes recorded in this window. Record them with 'diafunc deployment outcomes ${deploymentId}'.`);
12883
+ } else {
12884
+ const reportRange = q.reportQualityLow !== null && q.reportQualityLow !== void 0 && q.reportQualityHigh !== null && q.reportQualityHigh !== void 0 ? `, from ${num(q.reportQualityLow)} to ${num(q.reportQualityHigh)}` : "";
12885
+ if (q.classification && q.accuracy !== null && q.accuracy !== void 0) {
12886
+ quality.push(`Accuracy ${percent2(q.accuracy)} on ${count(q.scored)} predictions with an outcome: the share whose recorded label matches the predicted one.`);
12887
+ }
12888
+ if (!q.classification || q.quality !== null && q.quality !== void 0) {
12889
+ quality.push(`Quality ${num(q.quality)} on ${count(q.scored)} predictions with an outcome; the report has ${num(q.reportQuality)}${reportRange}.`);
12890
+ }
12891
+ if (q.error !== null && q.error !== void 0) {
12892
+ quality.push(`Error ${num(q.error)} (report ${num(q.reportError)}), mean absolute error ${num(q.mae)}.`);
12893
+ }
12894
+ if (!q.graded) quality.push("Not graded yet: grading starts at 30 predictions with an outcome.");
12895
+ if (q.withInterval > 0) {
12896
+ quality.push(`${count(q.inInterval)} of ${count(q.withInterval)} outcomes lay inside their prediction's interval (${percent2(q.coverage)}); the report expects ${percent2(q.expectedCoverage)}.`);
12897
+ }
12898
+ }
12899
+ const model = [];
12900
+ const m = report.model;
12901
+ if (m) {
12902
+ const served = modelWords(m.servedVersion, m.servedAt) ?? "the model it was made with";
12903
+ model.push(`Serves ${served}${m.servedQuality !== null && m.servedQuality !== void 0 ? `, quality ${num(m.servedQuality)} in its report` : ""}.`);
12904
+ if (m.newerAvailable) {
12905
+ const newer = modelWords(m.newerVersion, m.newerAt) ?? "the model of a newer run";
12906
+ model.push(`The analysis has a newer model: ${newer}${m.newerQuality !== null && m.newerQuality !== void 0 ? `, quality ${num(m.newerQuality)} in its report` : ""}.`);
12907
+ model.push(`Serve it with 'diafunc deployment serve-newest ${deploymentId}'.`);
12908
+ }
12909
+ }
12910
+ const u = report.usage;
12911
+ const usage = u ? `${count(u.predictions)} predictions this month, ${num(u.credits)} credits (${num(u.creditsPerPrediction)} per prediction).` : null;
12912
+ const s = report.settings;
12913
+ const settings = s ? `Input storage ${onOff(s.logInputs)}${s.logInputs && s.retentionDays ? ` (kept ${s.retentionDays} days)` : ""}, mail alerts ${onOff(s.mailAlerts)}.` : null;
12914
+ return { verdict, traffic, quality, model, usage, settings };
12915
+ }
12916
+ async function listDeployments(cmd) {
12917
+ const outputFormat = getOutputFormat20(cmd);
12918
+ const deployments = await createApiClient().deployments.list();
12919
+ if (outputFormat === "json") {
12920
+ format(deployments, { format: outputFormat });
12921
+ return;
12922
+ }
12923
+ if (deployments.length === 0 && outputFormat === "human") {
12924
+ empty("deployments");
12925
+ hint(`Deploy a finished analysis with 'diafunc deployment create --analysis <id> --target <column>'.`);
12926
+ return;
12927
+ }
12928
+ format(deployments.map((d) => ({
12929
+ deploymentId: d.deploymentId,
12930
+ name: d.name,
12931
+ target: d.target,
12932
+ health: words(d.health),
12933
+ status: d.status ? d.status.toLowerCase() : null,
12934
+ createdAt: d.createdAt
12935
+ })), {
12936
+ format: outputFormat,
12937
+ columns: [
12938
+ { key: "deploymentId", header: "id", kind: "id" },
12939
+ { key: "name" },
12940
+ { key: "target" },
12941
+ { key: "health" },
12942
+ { key: "status", kind: "state" },
12943
+ { key: "createdAt", header: "created", kind: "date" }
12944
+ ]
12945
+ });
12946
+ }
12947
+ function printDeployment(deployment, outputFormat) {
12948
+ if (outputFormat === "json") {
12949
+ format(deployment, { format: outputFormat });
12950
+ return;
12951
+ }
12952
+ format({
12953
+ deploymentId: deployment.deploymentId,
12954
+ name: deployment.name,
12955
+ target: deployment.target,
12956
+ analysisId: deployment.analysisId,
12957
+ formula: deployment.formula,
12958
+ inputs: (deployment.inputKeys ?? []).join(", "),
12959
+ status: deployment.status ? deployment.status.toLowerCase() : null,
12960
+ health: words(deployment.health),
12961
+ model: modelWords(deployment.modelVersion, deployment.modelVersionAt),
12962
+ logInputs: onOff(deployment.logInputs) + (deployment.logInputs && deployment.retentionDays ? `, kept ${deployment.retentionDays} days` : ""),
12963
+ mailAlerts: onOff(deployment.mailAlerts),
12964
+ createdAt: deployment.createdAt
12965
+ }, {
12966
+ format: outputFormat,
12967
+ columns: [
12968
+ { key: "deploymentId", header: "ID", kind: "id" },
12969
+ { key: "name", header: "Name" },
12970
+ { key: "target", header: "Target" },
12971
+ { key: "analysisId", header: "Analysis", kind: "id" },
12972
+ { key: "formula", header: "Formula" },
12973
+ { key: "inputs", header: "Inputs" },
12974
+ { key: "status", header: "Status", kind: "state" },
12975
+ { key: "health", header: "Health" },
12976
+ { key: "model", header: "Model" },
12977
+ { key: "logInputs", header: "Input storage" },
12978
+ { key: "mailAlerts", header: "Mail alerts" },
12979
+ { key: "createdAt", header: "Created", kind: "date" }
12980
+ ]
12981
+ });
12982
+ if (outputFormat === "human" && (deployment.inputRanges ?? []).length > 0) {
12983
+ heading("Inputs on the rows the model was found on");
12984
+ for (const r of deployment.inputRanges ?? []) {
12985
+ detail(r.kind === "categorical" ? `${r.input}: ${(r.levels ?? []).join(", ") || ABSENT}` : `${r.input}: ${num(r.min)} to ${num(r.max)}, median ${num(r.median)}`);
12986
+ }
12987
+ }
12988
+ }
12989
+ async function predictOne(deploymentId, options, cmd) {
12990
+ const outputFormat = getOutputFormat20(cmd);
12991
+ const request = { inputs: parseInputs(options.input ?? []) };
12992
+ if (options.reference !== void 0) request.reference = options.reference;
12993
+ if (options.store === false) request.store = false;
12994
+ let answer;
12995
+ try {
12996
+ answer = await createApiClient().deployments.predict(deploymentId, request);
12997
+ } catch (error) {
12998
+ if (isNotEnoughCredits(error)) throw new CliError(NOT_ENOUGH_CREDITS, { hint: CREDITS_HINT });
12999
+ throw error;
13000
+ }
13001
+ if (isDryRun()) return;
13002
+ if (outputFormat !== "human") {
13003
+ format(answer, { format: outputFormat });
13004
+ return;
13005
+ }
13006
+ const [first, ...rest] = predictionLines(deploymentId, answer);
13007
+ console.log(first);
13008
+ for (const line of rest) {
13009
+ if (line.startsWith("Outside") || line.startsWith("The row lies")) warn(line);
13010
+ else detail(line);
13011
+ }
13012
+ }
13013
+ function resultSink(out) {
13014
+ if (out) {
13015
+ fs13.writeFileSync(out, "");
13016
+ return (line) => fs13.appendFileSync(out, `${line}
13017
+ `);
13018
+ }
13019
+ return (line) => {
13020
+ process.stdout.write(`${line}
13021
+ `);
13022
+ };
13023
+ }
13024
+ async function predictFile(deploymentId, options, cmd) {
13025
+ const outputFormat = getOutputFormat20(cmd);
13026
+ const api = createApiClient();
13027
+ const deployment = await api.deployments.get(deploymentId);
13028
+ const table = readTable(options.file);
13029
+ const requests = predictRequestsFrom(table, deployment.inputKeys, {
13030
+ referenceColumn: options.reference,
13031
+ store: options.store
13032
+ });
13033
+ const rows = requests.length;
13034
+ const note = (line) => console.error(chalk30.dim(line));
13035
+ note(`${options.file}: ${count(rows)} row${rows === 1 ? "" : "s"} for ${deployment.name}. Each prediction costs credits; rows that cannot be predicted are not charged.`);
13036
+ if (!options.yes && !isDryRun() && prompterFor(cmd)) {
13037
+ try {
13038
+ const usage = (await api.deployments.monitoring(deploymentId, "7d")).usage;
13039
+ if (usage) note(`One prediction costs ${num(usage.creditsPerPrediction)} credits; ${count(rows)} cost ${num(usage.creditsPerPrediction * rows)}.`);
13040
+ } catch (error) {
13041
+ if (!(error instanceof ApiError)) throw error;
13042
+ }
13043
+ }
13044
+ const go = await confirmStep(
13045
+ cmd,
13046
+ `Predict ${count(rows)} rows?`,
13047
+ options.yes,
13048
+ `${count(rows)} predictions cost credits, so this run needs a confirmation.`
13049
+ );
13050
+ if (!go) {
13051
+ warn("Nothing was sent.");
13052
+ return;
13053
+ }
13054
+ const json = outputFormat === "json";
13055
+ const collected = [];
13056
+ const write2 = json ? null : resultSink(options.out);
13057
+ write2?.(csvLine([...RESULT_HEADER]));
13058
+ let sent = 0;
13059
+ let predicted = 0;
13060
+ let failed = 0;
13061
+ const pieces = chunks(requests, MAX_ROWS_PER_CALL);
13062
+ for (const piece of pieces) {
13063
+ let response;
13064
+ try {
13065
+ response = await api.deployments.predictBatch(deploymentId, { rows: piece });
13066
+ } catch (error) {
13067
+ if (json) formatJson(collected);
13068
+ if (sent > 0) {
13069
+ warn(`${count(sent)} of ${count(rows)} rows were sent before this; their results are written. The other ${count(rows - sent)} were not sent.`);
13070
+ }
13071
+ if (isNotEnoughCredits(error)) throw new CliError(NOT_ENOUGH_CREDITS, { hint: CREDITS_HINT });
13072
+ throw error;
13073
+ }
13074
+ if (isDryRun()) {
13075
+ sent += piece.length;
13076
+ continue;
13077
+ }
13078
+ const answers = response.predictions ?? [];
13079
+ piece.forEach((_, i) => {
13080
+ const row = sent + i + 1;
13081
+ const answer = answers[i];
13082
+ if (json) collected.push({ row, ...answer ?? { error: "no answer for this row" } });
13083
+ else write2(csvLine(resultFields(row, answer)));
13084
+ });
13085
+ predicted += response.predicted ?? answers.filter((a) => !a.error).length;
13086
+ failed += response.failed ?? answers.filter((a) => a.error).length;
13087
+ sent += piece.length;
13088
+ if (pieces.length > 1) note(`Sent ${count(sent)} of ${count(rows)} rows.`);
13089
+ }
13090
+ if (isDryRun()) return;
13091
+ if (json) formatJson(collected);
13092
+ const where = options.out ? ` Results are in ${options.out}.` : "";
13093
+ const failures = failed > 0 ? ` ${count(failed)} ${failed === 1 ? "row" : "rows"} could not be predicted and ${failed === 1 ? "was" : "were"} not charged; the error column says why.` : "";
13094
+ console.error(`${chalk30.green("\u2713")} Predicted ${count(predicted)} of ${count(rows)} rows.${failures}${where}`);
13095
+ }
13096
+ async function recordOutcomes(deploymentId, options, cmd) {
13097
+ const outputFormat = getOutputFormat20(cmd);
13098
+ let outcomes;
13099
+ let skipped = 0;
13100
+ if (options.file !== void 0) {
13101
+ if (options.prediction !== void 0 || options.reference !== void 0 || options.actual !== void 0) {
13102
+ throw new CliError("--file goes alone; --prediction, --reference and --actual are for one outcome.", { exitCode: EXIT_USAGE });
13103
+ }
13104
+ ({ outcomes, skipped } = outcomesFrom(readTable(options.file)));
13105
+ } else {
13106
+ if (options.actual === void 0 || options.prediction === void 0 === (options.reference === void 0)) {
13107
+ throw new CliError("Name one prediction and its outcome.", {
13108
+ exitCode: EXIT_USAGE,
13109
+ hint: "Use --prediction <predictionId> (or --reference <reference>) with --actual <value>, or --file outcomes.csv."
13110
+ });
13111
+ }
13112
+ const actual = parseOutcomeValue(options.actual, "--actual");
13113
+ outcomes = [options.prediction !== void 0 ? { predictionId: options.prediction, actual } : { reference: options.reference, actual }];
13114
+ }
13115
+ const api = createApiClient();
13116
+ let recorded = 0;
13117
+ const notFound = [];
13118
+ for (const piece of chunks(outcomes, MAX_ROWS_PER_CALL)) {
13119
+ const response = await api.deployments.recordOutcomes(deploymentId, { outcomes: piece });
13120
+ if (isDryRun()) continue;
13121
+ recorded += response.recorded ?? 0;
13122
+ notFound.push(...response.notFound ?? []);
13123
+ }
13124
+ if (isDryRun()) return;
13125
+ if (outputFormat !== "human") {
13126
+ format({ recorded, notFound, skipped }, { format: outputFormat });
13127
+ return;
13128
+ }
13129
+ success(`Recorded ${count(recorded)} outcome${recorded === 1 ? "" : "s"}.`);
13130
+ if (skipped > 0) detail(`${count(skipped)} row${skipped === 1 ? " with an empty actual column was" : "s with an empty actual column were"} skipped.`);
13131
+ if (notFound.length > 0) {
13132
+ warn(`${count(notFound.length)} named no prediction of this deployment:`);
13133
+ for (const name of notFound.slice(0, 20)) detail(name);
13134
+ if (notFound.length > 20) detail(`and ${count(notFound.length - 20)} more (see them all with --output json).`);
13135
+ }
13136
+ }
13137
+ async function monitor(deploymentId, options, cmd) {
13138
+ const outputFormat = getOutputFormat20(cmd);
13139
+ const window = parseWindow(options.window);
13140
+ const report = await createApiClient().deployments.monitoring(deploymentId, window);
13141
+ if (outputFormat === "json") {
13142
+ format(report, { format: outputFormat });
13143
+ return;
13144
+ }
13145
+ const inputs = [...report.inputs ?? [], ...report.prediction ? [report.prediction] : []];
13146
+ const columns = [
13147
+ { key: "input" },
13148
+ { key: "state" },
13149
+ { key: "psi", header: "PSI" },
13150
+ { key: "outOfRange", header: "outside range" },
13151
+ { key: "missing", kind: "number" },
13152
+ { key: "counted", kind: "number" }
13153
+ ];
13154
+ if (outputFormat === "table") {
13155
+ format(inputs.map(inputRow), { format: outputFormat, columns });
13156
+ return;
13157
+ }
13158
+ const summary = monitoringSummary(deploymentId, report);
13159
+ console.log(chalk30.bold(`${report.name}`) + chalk30.dim(` (target ${report.target}), last ${report.windowDays} days`));
13160
+ heading("Verdict");
13161
+ const [title, ...reasons] = summary.verdict;
13162
+ console.log(` ${title}`);
13163
+ for (const reason2 of reasons) detail(reason2);
13164
+ heading("Traffic");
13165
+ console.log(` ${summary.traffic}`);
13166
+ if (inputs.length > 0) {
13167
+ heading("Inputs against the training rows");
13168
+ format(inputs.map(inputRow), { format: "human", columns });
13169
+ }
13170
+ heading("Quality on outcomes");
13171
+ for (const line of summary.quality) console.log(` ${line}`);
13172
+ if (summary.model.length > 0) {
13173
+ heading("Model");
13174
+ for (const line of summary.model) console.log(` ${line}`);
13175
+ }
13176
+ if (summary.usage) {
13177
+ heading("Usage");
13178
+ console.log(` ${summary.usage}`);
13179
+ }
13180
+ if (summary.settings) {
13181
+ heading("Settings");
13182
+ console.log(` ${summary.settings}`);
13183
+ }
13184
+ }
13185
+ async function serveNewest(deploymentId, options, cmd) {
13186
+ const outputFormat = getOutputFormat20(cmd);
13187
+ const api = createApiClient();
13188
+ const model = (await api.deployments.monitoring(deploymentId, "7d")).model;
13189
+ if (model && !model.newerAvailable) {
13190
+ const served = modelWords(model.servedVersion, model.servedAt);
13191
+ success(
13192
+ `The deployment already serves the newest model${served ? `, ${served}` : ""}.`,
13193
+ { format: outputFormat === "json" ? "json" : void 0 }
13194
+ );
13195
+ return;
13196
+ }
13197
+ if (model && outputFormat === "human") {
13198
+ detail(`Serves ${modelWords(model.servedVersion, model.servedAt) ?? "the model it was made with"}, quality ${num(model.servedQuality)} in its report.`);
13199
+ detail(`Newest: ${modelWords(model.newerVersion, model.newerAt) ?? "the model of a newer run"}, quality ${num(model.newerQuality)} in its report.`);
13200
+ }
13201
+ const go = await confirmStep(
13202
+ cmd,
13203
+ "Serve the newest model? Every prediction from now on uses it.",
13204
+ options.yes,
13205
+ "Serving the newest model changes what every prediction uses, so it needs a confirmation."
13206
+ );
13207
+ if (!go) {
13208
+ warn("Nothing changed; the deployment serves the same model.");
13209
+ return;
13210
+ }
13211
+ const updated = await api.deployments.serveNewestModel(deploymentId);
13212
+ if (isDryRun()) return;
13213
+ if (outputFormat !== "human") {
13214
+ format(updated, { format: outputFormat });
13215
+ return;
13216
+ }
13217
+ success(`Now serving ${modelWords(updated.modelVersion, updated.modelVersionAt) ?? "the newest model"}.`);
13218
+ }
13219
+ function registerDeploymentCommands(program) {
13220
+ const deployment = program.command("deployment").description("Serve a finished analysis's model as a predict endpoint, predict with it, record outcomes and follow its monitoring").addHelpText("after", `
13221
+ Every prediction costs 0.001 credits, monitoring included. Recording outcomes costs nothing.
13222
+
13223
+ Examples:
13224
+ $ diafunc deployment create --analysis <analysisId> --target price
13225
+ $ diafunc deployment predict <deploymentId> --input size=120 --input rooms=4
13226
+ $ diafunc deployment predict <deploymentId> --file rows.csv --reference id --out results.csv
13227
+ $ diafunc deployment outcomes <deploymentId> --file results-with-outcomes.csv
13228
+ $ diafunc deployment monitor <deploymentId> --window 30d
13229
+ $ diafunc deployment set <deploymentId> --log-inputs on --retention 90
13230
+ `);
13231
+ deployment.command("list").description("List your deployments, newest first, with the verdict of each one's latest daily check").action(async (_options, cmd) => {
13232
+ try {
13233
+ await listDeployments(cmd);
13234
+ } catch (error) {
13235
+ handleError(error);
13236
+ }
13237
+ });
13238
+ deployment.command("get").description("Show a deployment: its formula, the inputs it reads and their ranges on the training rows, and its settings").argument("<deploymentId>", "Deployment ID").action(async (deploymentId, _options, cmd) => {
13239
+ try {
13240
+ printDeployment(await createApiClient().deployments.get(deploymentId), getOutputFormat20(cmd));
13241
+ } catch (error) {
13242
+ handleError(deploymentNotFound(error, deploymentId));
13243
+ }
13244
+ });
13245
+ deployment.command("create").description("Deploy the model a finished analysis found for one target").requiredOption("--analysis <analysisId>", "The analysis").requiredOption("--target <column>", "The target column whose model is served").option("--name <name>", "Name of the deployment (default: the analysis name and the target)").action(async (options, cmd) => {
13246
+ try {
13247
+ const created = await createApiClient().deployments.create({
13248
+ analysisId: options.analysis,
13249
+ target: options.target,
13250
+ ...options.name !== void 0 ? { name: options.name } : {}
13251
+ });
13252
+ if (isDryRun()) return;
13253
+ const outputFormat = getOutputFormat20(cmd);
13254
+ if (outputFormat !== "human") {
13255
+ format(created, { format: outputFormat });
13256
+ return;
13257
+ }
13258
+ success(`Deployment ${created.name} created (${created.deploymentId}).`);
13259
+ if ((created.inputKeys ?? []).length > 0) detail(`It reads ${created.inputKeys.join(", ")}.`);
13260
+ hint(`Predict with 'diafunc deployment predict ${created.deploymentId} --input <name>=<value> ...'; each prediction costs credits.`);
13261
+ } catch (error) {
13262
+ handleError(error);
13263
+ }
13264
+ });
13265
+ deployment.command("delete").description("Delete a deployment; its endpoint stops answering").argument("<deploymentId>", "Deployment ID").option("-y, --yes", "Skip confirmation prompt (for CI / scripted use)").action(async (deploymentId, options, cmd) => {
13266
+ try {
13267
+ await confirmDestructive(
13268
+ `This will permanently delete deployment "${deploymentId}"; its endpoint stops answering.`,
13269
+ { yes: options.yes, resourceId: deploymentId }
13270
+ );
13271
+ await createApiClient().deployments.delete(deploymentId);
13272
+ success(`Deployment ${deploymentId} deleted.`, { format: getOutputFormat20(cmd) === "json" ? "json" : void 0 });
13273
+ } catch (error) {
13274
+ handleError(deploymentNotFound(error, deploymentId));
13275
+ }
13276
+ });
13277
+ deployment.command("predict").description("Predict with a deployment, one row from --input or every row of a CSV file. Each prediction costs 0.001 credits").argument("<deploymentId>", "Deployment ID").option(
13278
+ "--input <name=value>",
13279
+ "An input value; repeat for every input (see them with 'deployment get')",
13280
+ (value, previous = []) => previous.concat([value])
13281
+ ).option("--file <path>", "A CSV file with a header row and one row per prediction, sent in calls of 1,000 rows").option("--reference <text>", "Your own reference, to record the outcome by it later. With --file: the column that holds each row's reference").option("--no-store", "Keep the input values of these predictions out of storage, even when the deployment stores inputs").option("--out <file>", "With --file: write the results here instead of to standard output").option("-y, --yes", "With --file: predict without asking first (for CI / scripted use)").addHelpText("after", `
13282
+ Each prediction costs 0.001 credits, monitoring included. A --file run prints the number of rows and asks before
13283
+ sending them; rows the platform cannot predict are not charged. The result is CSV, one line
13284
+ per input row: ${RESULT_HEADER.join(", ")}.
13285
+ Add an actual column with the values that came true and send it back with
13286
+ 'diafunc deployment outcomes <id> --file'.
13287
+ `).action(async (deploymentId, options, cmd) => {
13288
+ try {
13289
+ const hasInputs = (options.input ?? []).length > 0;
13290
+ if (hasInputs === (options.file !== void 0)) {
13291
+ throw new CliError("Give the inputs with --input name=value, or a CSV file with --file, not both.", {
13292
+ exitCode: EXIT_USAGE,
13293
+ hint: `See the inputs the deployment reads with 'diafunc deployment get ${deploymentId}'.`
13294
+ });
13295
+ }
13296
+ if (options.out !== void 0 && options.file === void 0) {
13297
+ throw new CliError("--out goes with --file.", { exitCode: EXIT_USAGE });
13298
+ }
13299
+ if (options.file !== void 0) await predictFile(deploymentId, options, cmd);
13300
+ else await predictOne(deploymentId, options, cmd);
13301
+ } catch (error) {
13302
+ handleError(deploymentNotFound(error, deploymentId));
13303
+ }
13304
+ });
13305
+ deployment.command("outcomes").description("Record outcomes, the values that came true, for earlier predictions, by prediction id or by your reference. Recording costs nothing").argument("<deploymentId>", "Deployment ID").option("--prediction <predictionId>", "The prediction the outcome belongs to").option("--reference <reference>", "Instead of --prediction: the reference you sent with the prediction").option("--actual <value>", "The value that came true: a number, or a class label for a classification deployment").option("--file <path>", "A CSV file with an actual column and a predictionId or reference column, sent in calls of 1,000 rows").action(async (deploymentId, options, cmd) => {
13306
+ try {
13307
+ await recordOutcomes(deploymentId, options, cmd);
13308
+ } catch (error) {
13309
+ handleError(deploymentNotFound(error, deploymentId));
13310
+ }
13311
+ });
13312
+ deployment.command("monitor").description("How a deployment is doing: verdict and reasons, traffic, drift and range per input, quality on outcomes, interval coverage, newer model, usage").argument("<deploymentId>", "Deployment ID").option("--window <window>", "The period the figures cover: 7d or 30d", "7d").action(async (deploymentId, options, cmd) => {
13313
+ try {
13314
+ await monitor(deploymentId, options, cmd);
13315
+ } catch (error) {
13316
+ handleError(deploymentNotFound(error, deploymentId));
13317
+ }
13318
+ });
13319
+ deployment.command("set").description("Change a deployment's name, input storage or mail alerts; what is not given stays as it is").argument("<deploymentId>", "Deployment ID").option("--name <name>", "New name").option("--log-inputs <on|off>", "Store the input values of each prediction").option("--retention <days>", "How long stored input values are kept: 30, 90 or 180 days").option("--mail-alerts <on|off>", "Also send a change of health by mail (the notice in the app is always sent)").action(async (deploymentId, options, cmd) => {
13320
+ try {
13321
+ const request = settingsFrom(options);
13322
+ const updated = await createApiClient().deployments.update(deploymentId, request);
13323
+ if (isDryRun()) return;
13324
+ const outputFormat = getOutputFormat20(cmd);
13325
+ if (outputFormat !== "human") {
13326
+ format(updated, { format: outputFormat });
13327
+ return;
13328
+ }
13329
+ success(`Deployment ${updated.name} updated.`);
13330
+ detail(`Input storage ${onOff(updated.logInputs)}${updated.logInputs && updated.retentionDays ? ` (kept ${updated.retentionDays} days)` : ""}, mail alerts ${onOff(updated.mailAlerts)}.`);
13331
+ } catch (error) {
13332
+ handleError(deploymentNotFound(error, deploymentId));
13333
+ }
13334
+ });
13335
+ deployment.command("serve-newest").description("Serve the newest model the analysis has for the target. Until then a deployment keeps the model it was made with").argument("<deploymentId>", "Deployment ID").option("-y, --yes", "Switch without asking first (for CI / scripted use)").action(async (deploymentId, options, cmd) => {
13336
+ try {
13337
+ await serveNewest(deploymentId, options, cmd);
13338
+ } catch (error) {
13339
+ handleError(deploymentNotFound(error, deploymentId));
13340
+ }
13341
+ });
13342
+ deployment.command("delete-prediction").description("Delete one prediction with its stored input values and its outcome").argument("<deploymentId>", "Deployment ID").argument("<predictionId>", "Prediction ID").option("-y, --yes", "Skip confirmation prompt (for CI / scripted use)").action(async (deploymentId, predictionId, options, cmd) => {
13343
+ try {
13344
+ await confirmDestructive(
13345
+ `This will permanently delete prediction "${predictionId}" with its stored inputs and outcome.`,
13346
+ { yes: options.yes, resourceId: predictionId }
13347
+ );
13348
+ await createApiClient().deployments.deletePrediction(deploymentId, predictionId);
13349
+ success(`Prediction ${predictionId} deleted.`, { format: getOutputFormat20(cmd) === "json" ? "json" : void 0 });
13350
+ } catch (error) {
13351
+ handleError(deploymentNotFound(error, deploymentId, predictionId));
13352
+ }
13353
+ });
13354
+ }
13355
+
12394
13356
  // src/commands/public/index.ts
12395
13357
  var MIN_LIMIT = 1;
12396
13358
  var MAX_LIMIT = 500;
12397
- function getOutputFormat20(cmd) {
13359
+ function getOutputFormat21(cmd) {
12398
13360
  const config = loadConfig();
12399
13361
  const globalOpts = cmd.optsWithGlobals();
12400
13362
  return globalOpts.output ?? config.defaults.output ?? "human";
@@ -12446,7 +13408,7 @@ async function readPublicAnalyses(analysis, options) {
12446
13408
  }
12447
13409
  }
12448
13410
  async function listPublicAnalyses(options, cmd) {
12449
- const outputFormat = getOutputFormat20(cmd);
13411
+ const outputFormat = getOutputFormat21(cmd);
12450
13412
  const limit = parseLimit(options.limit);
12451
13413
  const changedSince = options.changedSince === void 0 ? void 0 : parseChangedSince(options.changedSince);
12452
13414
  const api = createApiClient();
@@ -12489,7 +13451,7 @@ function newestRunRecord(run) {
12489
13451
  };
12490
13452
  }
12491
13453
  async function showPublicAnalysis(analysisId, cmd) {
12492
- const outputFormat = getOutputFormat20(cmd);
13454
+ const outputFormat = getOutputFormat21(cmd);
12493
13455
  const api = createApiClient();
12494
13456
  const result = await api.analysis.get(analysisId);
12495
13457
  if (!result?.analysis) {
@@ -12558,8 +13520,8 @@ Examples:
12558
13520
  }
12559
13521
 
12560
13522
  // src/commands/license/index.ts
12561
- import chalk30 from "chalk";
12562
- function getOutputFormat21(cmd) {
13523
+ import chalk31 from "chalk";
13524
+ function getOutputFormat22(cmd) {
12563
13525
  const config = loadConfig();
12564
13526
  const globalOpts = cmd.optsWithGlobals();
12565
13527
  return globalOpts.output ?? config.defaults.output ?? "human";
@@ -12620,7 +13582,7 @@ async function catalogEntry(licenseId) {
12620
13582
  return entry;
12621
13583
  }
12622
13584
  function printLicense(license, cmd, verb) {
12623
- const outputFormat = getOutputFormat21(cmd);
13585
+ const outputFormat = getOutputFormat22(cmd);
12624
13586
  if (outputFormat !== "human") {
12625
13587
  format(license, { format: outputFormat });
12626
13588
  return;
@@ -12628,7 +13590,7 @@ function printLicense(license, cmd, verb) {
12628
13590
  success(`License "${license.licenceId}" ${verb} (${stateWord(license.state)}, flags ${licenseMarks(license) ?? "none"}).`);
12629
13591
  }
12630
13592
  async function listCatalog(cmd) {
12631
- const outputFormat = getOutputFormat21(cmd);
13593
+ const outputFormat = getOutputFormat22(cmd);
12632
13594
  const entries = await createApiClient().admin.listLicenseCatalog();
12633
13595
  if (outputFormat === "json") {
12634
13596
  format(entries, { format: outputFormat });
@@ -12660,7 +13622,7 @@ async function listCatalog(cmd) {
12660
13622
  });
12661
13623
  }
12662
13624
  async function listLicenses(cmd) {
12663
- const outputFormat = getOutputFormat21(cmd);
13625
+ const outputFormat = getOutputFormat22(cmd);
12664
13626
  const api = createApiClient();
12665
13627
  const licenses = await api.admin.listLicenses();
12666
13628
  if (outputFormat === "json") {
@@ -12688,14 +13650,14 @@ async function listLicenses(cmd) {
12688
13650
  ]
12689
13651
  });
12690
13652
  if (outputFormat === "human") {
12691
- console.error(chalk30.dim(
13653
+ console.error(chalk31.dim(
12692
13654
  `
12693
13655
  Flags: ${LICENSE_MARKS.map(({ mark, meaning }) => `${mark} ${meaning}`).join(", ")}. A deprecated license stays on the projects that carry it and cannot be chosen.`
12694
13656
  ));
12695
13657
  }
12696
13658
  }
12697
13659
  async function showLicense(licenseId, cmd) {
12698
- const outputFormat = getOutputFormat21(cmd);
13660
+ const outputFormat = getOutputFormat22(cmd);
12699
13661
  const api = createApiClient();
12700
13662
  let license;
12701
13663
  try {
@@ -12855,8 +13817,8 @@ Examples:
12855
13817
  }
12856
13818
 
12857
13819
  // src/commands/data-sources/index.ts
12858
- import chalk31 from "chalk";
12859
- function getOutputFormat22(cmd) {
13820
+ import chalk32 from "chalk";
13821
+ function getOutputFormat23(cmd) {
12860
13822
  const config = loadConfig();
12861
13823
  const globalOpts = cmd.optsWithGlobals();
12862
13824
  return globalOpts.output ?? config.defaults.output ?? "human";
@@ -12956,7 +13918,7 @@ function resolveProjectId(cmd) {
12956
13918
  return resolved;
12957
13919
  }
12958
13920
  async function listDataSources(projectId, cmd) {
12959
- const outputFormat = getOutputFormat22(cmd);
13921
+ const outputFormat = getOutputFormat23(cmd);
12960
13922
  const api = createApiClient();
12961
13923
  const sources = await api.storage.listDataSources(projectId);
12962
13924
  if (outputFormat === "human" && sources.length === 0) {
@@ -12977,13 +13939,13 @@ async function listDataSources(projectId, cmd) {
12977
13939
  });
12978
13940
  }
12979
13941
  async function getDataSource(id, cmd) {
12980
- const outputFormat = getOutputFormat22(cmd);
13942
+ const outputFormat = getOutputFormat23(cmd);
12981
13943
  const api = createApiClient();
12982
13944
  const ds = await api.storage.getDataSource(id);
12983
13945
  format(ds, { format: outputFormat });
12984
13946
  }
12985
13947
  async function showDashboard(projectId, cmd) {
12986
- const outputFormat = getOutputFormat22(cmd);
13948
+ const outputFormat = getOutputFormat23(cmd);
12987
13949
  const api = createApiClient();
12988
13950
  const dashboard = await api.storage.getDataSourceDashboard(projectId);
12989
13951
  if (outputFormat !== "human") {
@@ -12991,7 +13953,7 @@ async function showDashboard(projectId, cmd) {
12991
13953
  return;
12992
13954
  }
12993
13955
  const r = dashboard.rollup;
12994
- let line = chalk31.bold(`DataSources in ${projectId}: `) + `${r.totalSources} total, ${r.scheduledSources} scheduled, ${r.sourcesWithRecentFailure} failing recently`;
13956
+ let line = chalk32.bold(`DataSources in ${projectId}: `) + `${r.totalSources} total, ${r.scheduledSources} scheduled, ${r.sourcesWithRecentFailure} failing recently`;
12995
13957
  if (r.lastActivityAt) line += `, last activity ${r.lastActivityAt}`;
12996
13958
  console.log(line);
12997
13959
  if (dashboard.sources.length === 0) {
@@ -13052,14 +14014,14 @@ async function createForAnalysis(api, options, human) {
13052
14014
  if (human) {
13053
14015
  success(`Added ${source.fileName} to analysis ${analysisId} from data source ${source.dataSourceId ?? ""}`.trimEnd());
13054
14016
  for (const line of planLines(build.plan)) {
13055
- console.log(line.caution ? chalk31.yellow(` ${line.text}`) : chalk31.dim(` ${line.text}`));
14017
+ console.log(line.caution ? chalk32.yellow(` ${line.text}`) : chalk32.dim(` ${line.text}`));
13056
14018
  }
13057
- console.log(chalk31.dim(options.scheduleCron ? ` Refreshes ${humanizeCron(options.scheduleCron)}; each refresh replaces the file and builds the data again.` : " No schedule of its own: refresh it with `data-sources refresh`, or let a trigger fetch it before a run (`analyze triggers create --refresh-first`)."));
14019
+ console.log(chalk32.dim(options.scheduleCron ? ` Refreshes ${humanizeCron(options.scheduleCron)}; each refresh replaces the file and builds the data again.` : " No schedule of its own: refresh it with `data-sources refresh`, or let a trigger fetch it before a run (`analyze triggers create --refresh-first`)."));
13058
14020
  }
13059
14021
  return { source, build };
13060
14022
  }
13061
14023
  async function createDataSource(options, cmd) {
13062
- const outputFormat = getOutputFormat22(cmd);
14024
+ const outputFormat = getOutputFormat23(cmd);
13063
14025
  const target = createTarget(options);
13064
14026
  const api = createApiClient();
13065
14027
  if (target === "analysis") {
@@ -13082,14 +14044,14 @@ async function createDataSource(options, cmd) {
13082
14044
  const ds = await api.storage.createDataSource(request);
13083
14045
  if (outputFormat === "human") {
13084
14046
  success(`Created data source ${ds.id}`);
13085
- console.log(chalk31.dim(` Last run: ${ds.lastRunStatus ?? "\u2014"}`));
13086
- if (ds.lastRunError) console.log(chalk31.dim(` Error: ${ds.lastRunError}`));
14047
+ console.log(chalk32.dim(` Last run: ${ds.lastRunStatus ?? "\u2014"}`));
14048
+ if (ds.lastRunError) console.log(chalk32.dim(` Error: ${ds.lastRunError}`));
13087
14049
  } else {
13088
14050
  format(ds, { format: outputFormat });
13089
14051
  }
13090
14052
  }
13091
14053
  async function updateDataSource(id, options, cmd) {
13092
- const outputFormat = getOutputFormat22(cmd);
14054
+ const outputFormat = getOutputFormat23(cmd);
13093
14055
  if (options.name === void 0 && options.type === void 0 && (!options.config || options.config.length === 0) && options.scheduleCron === void 0 && !options.clearSchedule) {
13094
14056
  throw new Error("Provide at least one of --name, --type, --config, --schedule-cron, or --clear-schedule.");
13095
14057
  }
@@ -13124,18 +14086,18 @@ async function deleteDataSource(id) {
13124
14086
  success(`Deleted data source ${id}`);
13125
14087
  }
13126
14088
  async function refreshDataSource(id, cmd) {
13127
- const outputFormat = getOutputFormat22(cmd);
14089
+ const outputFormat = getOutputFormat23(cmd);
13128
14090
  const api = createApiClient();
13129
14091
  const run = await api.storage.refreshDataSource(id);
13130
14092
  if (outputFormat === "human") {
13131
14093
  success(`Refresh queued: run ${run.runId}, status ${run.status}.`);
13132
- if (run.errorMessage) console.log(chalk31.red(` Error: ${run.errorMessage}`));
14094
+ if (run.errorMessage) console.log(chalk32.red(` Error: ${run.errorMessage}`));
13133
14095
  } else {
13134
14096
  format(run, { format: outputFormat });
13135
14097
  }
13136
14098
  }
13137
14099
  async function listRuns2(id, limit, cmd) {
13138
- const outputFormat = getOutputFormat22(cmd);
14100
+ const outputFormat = getOutputFormat23(cmd);
13139
14101
  const api = createApiClient();
13140
14102
  const runs = await api.storage.listDataSourceRuns(id, limit);
13141
14103
  if (outputFormat === "human" && runs.length === 0) {
@@ -13157,13 +14119,13 @@ async function listRuns2(id, limit, cmd) {
13157
14119
  });
13158
14120
  }
13159
14121
  async function getRun(id, runId, cmd) {
13160
- const outputFormat = getOutputFormat22(cmd);
14122
+ const outputFormat = getOutputFormat23(cmd);
13161
14123
  const api = createApiClient();
13162
14124
  const run = await api.storage.getDataSourceRun(id, runId);
13163
14125
  format(run, { format: outputFormat });
13164
14126
  }
13165
14127
  async function listConnectorTypes(cmd) {
13166
- const outputFormat = getOutputFormat22(cmd);
14128
+ const outputFormat = getOutputFormat23(cmd);
13167
14129
  const api = createApiClient();
13168
14130
  const types = await api.storage.listDataSourceConnectorTypes();
13169
14131
  if (outputFormat === "human") {
@@ -13256,8 +14218,8 @@ Examples:
13256
14218
  }
13257
14219
 
13258
14220
  // src/commands/table-exporters/index.ts
13259
- import chalk32 from "chalk";
13260
- function getOutputFormat23(cmd) {
14221
+ import chalk33 from "chalk";
14222
+ function getOutputFormat24(cmd) {
13261
14223
  const config = loadConfig();
13262
14224
  const globalOpts = cmd.optsWithGlobals();
13263
14225
  return globalOpts.output ?? config.defaults.output ?? "human";
@@ -13266,7 +14228,7 @@ function registerTableExportersCommands(program) {
13266
14228
  const exporters = program.command("table-exporters").description("Manage user-defined exporters (UDE); admin only");
13267
14229
  exporters.command("list").description("List all registered user-defined exporters").action(async (_options, cmd) => {
13268
14230
  try {
13269
- const outputFormat = getOutputFormat23(cmd);
14231
+ const outputFormat = getOutputFormat24(cmd);
13270
14232
  const api = createApiClient();
13271
14233
  const list = await api.storage.listUserDefinedExporters();
13272
14234
  if (outputFormat === "json") {
@@ -13287,14 +14249,14 @@ function registerTableExportersCommands(program) {
13287
14249
  format: outputFormat,
13288
14250
  columns: ["id", "name", "format", "extension", "mimeType", "priority", "function", "createdBy"]
13289
14251
  });
13290
- console.log(chalk32.dim(`${list.length} exporter(s)`));
14252
+ console.log(chalk33.dim(`${list.length} exporter(s)`));
13291
14253
  } catch (error) {
13292
14254
  handleError(error);
13293
14255
  }
13294
14256
  });
13295
14257
  exporters.command("get").description("Show a single user-defined exporter by id").argument("<id>", "Exporter id").action(async (id, _options, cmd) => {
13296
14258
  try {
13297
- const outputFormat = getOutputFormat23(cmd);
14259
+ const outputFormat = getOutputFormat24(cmd);
13298
14260
  const api = createApiClient();
13299
14261
  const list = await api.storage.listUserDefinedExporters();
13300
14262
  const exporter = list.find((e) => e.id === id);
@@ -13309,7 +14271,7 @@ function registerTableExportersCommands(program) {
13309
14271
  });
13310
14272
  exporters.command("create").description("Register a new user-defined exporter").requiredOption("--name <name>", 'Display name (e.g. "Acme machine instrument export")').requiredOption("--format <token>", 'Format token used in the dispatch URL (e.g. "acme")').requiredOption("--function-project <id>", "Function entity's project id").requiredOption("--function-entity <id>", "Function entity id").option("--description <text>", "Free-form description").option("--extension <ext>", 'Filename extension (must start with ".")').option("--mime-type <mime>", "MIME type the function produces").option("--function-project-branch <branch>", "Function project branch", "main").option("--function-entity-branch <branch>", "Function entity branch", "main").option("--priority <n>", "Dispatch priority (default 50; > 200 overrides built-ins)", "50").action(async (options, cmd) => {
13311
14273
  try {
13312
- const outputFormat = getOutputFormat23(cmd);
14274
+ const outputFormat = getOutputFormat24(cmd);
13313
14275
  const api = createApiClient();
13314
14276
  const payload = {
13315
14277
  name: options.name,
@@ -13345,9 +14307,9 @@ function registerTableExportersCommands(program) {
13345
14307
  }
13346
14308
 
13347
14309
  // src/commands/skeleton/index.ts
13348
- import chalk33 from "chalk";
13349
- import * as fs13 from "fs";
13350
- function getOutputFormat24(cmd) {
14310
+ import chalk34 from "chalk";
14311
+ import * as fs14 from "fs";
14312
+ function getOutputFormat25(cmd) {
13351
14313
  const config = loadConfig();
13352
14314
  const globalOpts = cmd.optsWithGlobals();
13353
14315
  return globalOpts.output ?? config.defaults.output ?? "human";
@@ -13370,10 +14332,10 @@ function resolveTemplate(raw) {
13370
14332
  if (!file) {
13371
14333
  throw new Error("--template @ requires a filename after the @, e.g. --template @template.txt");
13372
14334
  }
13373
- if (!fs13.existsSync(file)) {
14335
+ if (!fs14.existsSync(file)) {
13374
14336
  throw new Error(`Template file not found: ${file}`);
13375
14337
  }
13376
- return fs13.readFileSync(file, "utf-8").trim();
14338
+ return fs14.readFileSync(file, "utf-8").trim();
13377
14339
  }
13378
14340
  return raw;
13379
14341
  }
@@ -13396,7 +14358,7 @@ function skeletonTableRow(s) {
13396
14358
  };
13397
14359
  }
13398
14360
  async function createSkeleton(options, cmd) {
13399
- const outputFormat = getOutputFormat24(cmd);
14361
+ const outputFormat = getOutputFormat25(cmd);
13400
14362
  const projectId = resolveProjectId2(cmd);
13401
14363
  const template = resolveTemplate(options.template);
13402
14364
  const weight = parseWeight(options.weight);
@@ -13412,16 +14374,16 @@ async function createSkeleton(options, cmd) {
13412
14374
  const skeleton = await api.storage.createSkeleton(request);
13413
14375
  if (outputFormat === "human") {
13414
14376
  success(`Created skeleton ${skeleton.id}`);
13415
- console.log(chalk33.dim(` name: ${skeleton.name}`));
13416
- console.log(chalk33.dim(` template: ${skeleton.template}`));
13417
- console.log(chalk33.dim(` paramCount: ${skeleton.paramCount}`));
13418
- console.log(chalk33.dim(` weight: ${skeleton.weight}`));
14377
+ console.log(chalk34.dim(` name: ${skeleton.name}`));
14378
+ console.log(chalk34.dim(` template: ${skeleton.template}`));
14379
+ console.log(chalk34.dim(` paramCount: ${skeleton.paramCount}`));
14380
+ console.log(chalk34.dim(` weight: ${skeleton.weight}`));
13419
14381
  } else {
13420
14382
  format(skeleton, { format: outputFormat });
13421
14383
  }
13422
14384
  }
13423
14385
  async function listSkeletons(cmd) {
13424
- const outputFormat = getOutputFormat24(cmd);
14386
+ const outputFormat = getOutputFormat25(cmd);
13425
14387
  const projectId = resolveProjectId2(cmd);
13426
14388
  const api = createApiClient();
13427
14389
  const skeletons = await api.storage.listSkeletons(projectId);
@@ -13435,13 +14397,13 @@ async function listSkeletons(cmd) {
13435
14397
  });
13436
14398
  }
13437
14399
  async function getSkeleton(id, cmd) {
13438
- const outputFormat = getOutputFormat24(cmd);
14400
+ const outputFormat = getOutputFormat25(cmd);
13439
14401
  const api = createApiClient();
13440
14402
  const skeleton = await api.storage.getSkeleton(id);
13441
14403
  format(skeleton, { format: outputFormat });
13442
14404
  }
13443
14405
  async function updateSkeleton(id, options, cmd) {
13444
- const outputFormat = getOutputFormat24(cmd);
14406
+ const outputFormat = getOutputFormat25(cmd);
13445
14407
  if (options.name === void 0 && options.template === void 0 && options.weight === void 0) {
13446
14408
  throw new Error("Provide at least one of --name, --template, --weight.");
13447
14409
  }
@@ -13454,10 +14416,10 @@ async function updateSkeleton(id, options, cmd) {
13454
14416
  const skeleton = await api.storage.updateSkeleton(id, request);
13455
14417
  if (outputFormat === "human") {
13456
14418
  success(`Updated skeleton ${skeleton.id}`);
13457
- console.log(chalk33.dim(` name: ${skeleton.name}`));
13458
- console.log(chalk33.dim(` template: ${skeleton.template}`));
13459
- console.log(chalk33.dim(` paramCount: ${skeleton.paramCount}`));
13460
- console.log(chalk33.dim(` weight: ${skeleton.weight}`));
14419
+ console.log(chalk34.dim(` name: ${skeleton.name}`));
14420
+ console.log(chalk34.dim(` template: ${skeleton.template}`));
14421
+ console.log(chalk34.dim(` paramCount: ${skeleton.paramCount}`));
14422
+ console.log(chalk34.dim(` weight: ${skeleton.weight}`));
13461
14423
  } else {
13462
14424
  format(skeleton, { format: outputFormat });
13463
14425
  }
@@ -13782,7 +14744,7 @@ function registerCompletionCommand(program) {
13782
14744
  }
13783
14745
 
13784
14746
  // src/commands/whoami/index.ts
13785
- import chalk34 from "chalk";
14747
+ import chalk35 from "chalk";
13786
14748
  function registerWhoamiCommand(program) {
13787
14749
  program.command("whoami").description("Show the currently authenticated user").action(async (_options, cmd) => {
13788
14750
  try {
@@ -13792,8 +14754,8 @@ function registerWhoamiCommand(program) {
13792
14754
  const api = createApiClient();
13793
14755
  const user = await api.admin.getMyUser();
13794
14756
  if (outputFormat === "human") {
13795
- console.log(chalk34.bold(user.name) + chalk34.dim(` <${user.email}>`));
13796
- console.log(chalk34.dim(` Role: ${user.role} \xB7 Remaining credits: ${user.remainingCredits} \xB7 Profile: ${getActiveProfileName(config)}`));
14757
+ console.log(chalk35.bold(user.name) + chalk35.dim(` <${user.email}>`));
14758
+ console.log(chalk35.dim(` Role: ${user.role} \xB7 Remaining credits: ${user.remainingCredits} \xB7 Profile: ${getActiveProfileName(config)}`));
13797
14759
  } else {
13798
14760
  format(user, { format: outputFormat });
13799
14761
  }
@@ -13804,8 +14766,8 @@ function registerWhoamiCommand(program) {
13804
14766
  }
13805
14767
 
13806
14768
  // src/commands/utilization/index.ts
13807
- import chalk35 from "chalk";
13808
- function getOutputFormat25(cmd) {
14769
+ import chalk36 from "chalk";
14770
+ function getOutputFormat26(cmd) {
13809
14771
  const config = loadConfig();
13810
14772
  const globalOpts = cmd.optsWithGlobals();
13811
14773
  return globalOpts.output ?? config.defaults.output ?? "human";
@@ -13821,19 +14783,19 @@ function windowLabel(u) {
13821
14783
  }
13822
14784
  function printUtilizationHuman(u, label) {
13823
14785
  const when2 = windowLabel(u);
13824
- console.log(label ? chalk35.bold(label) + " " + chalk35.dim(when2) : chalk35.bold(when2));
14786
+ console.log(label ? chalk36.bold(label) + " " + chalk36.dim(when2) : chalk36.bold(when2));
13825
14787
  if (u.types.length === 0) {
13826
- console.log(chalk35.dim(" (no usage)"));
14788
+ console.log(chalk36.dim(" (no usage)"));
13827
14789
  return;
13828
14790
  }
13829
14791
  const types = [...u.types].sort((a, b) => b.credits - a.credits);
13830
14792
  const width = Math.max(...types.map((t) => t.type.length));
13831
14793
  for (const t of types) {
13832
- const line = ` ${t.type.padEnd(width)} ${formatNumber(t.quantity).padStart(12)} ${chalk35.dim("credits")} ${t.credits.toFixed(2).padStart(10)}`;
13833
- console.log(t.credits === 0 ? chalk35.dim(line) : line);
14794
+ const line = ` ${t.type.padEnd(width)} ${formatNumber(t.quantity).padStart(12)} ${chalk36.dim("credits")} ${t.credits.toFixed(2).padStart(10)}`;
14795
+ console.log(t.credits === 0 ? chalk36.dim(line) : line);
13834
14796
  }
13835
14797
  const total = u.totalCredits ?? u.types.reduce((s, t) => s + t.credits, 0);
13836
- console.log(chalk35.bold(` ${"Total".padEnd(width)} ${" ".repeat(12)} ${chalk35.dim("credits")} ${total.toFixed(2).padStart(10)}`));
14798
+ console.log(chalk36.bold(` ${"Total".padEnd(width)} ${" ".repeat(12)} ${chalk36.dim("credits")} ${total.toFixed(2).padStart(10)}`));
13837
14799
  }
13838
14800
  function formatDailyHistory(history) {
13839
14801
  const spentOn = (u) => u.dailyCredits ?? u.types.reduce((sum, t) => sum + (t.dailyCredits ?? 0), 0);
@@ -13850,14 +14812,14 @@ function formatDailyHistory(history) {
13850
14812
  for (const u of history) {
13851
14813
  const spent = spentOn(u);
13852
14814
  total += spent;
13853
- const line = `${windowLabel(u).padEnd(width)} ${amount(spent)} ${chalk35.dim("credits")}`;
13854
- lines.push(spent > 0 ? chalk35.bold(line) : chalk35.dim(line));
14815
+ const line = `${windowLabel(u).padEnd(width)} ${amount(spent)} ${chalk36.dim("credits")}`;
14816
+ lines.push(spent > 0 ? chalk36.bold(line) : chalk36.dim(line));
13855
14817
  for (const t of costly(u)) {
13856
14818
  lines.push(` ${t.type.padEnd(width - 2)} ${amount(t.dailyCredits ?? 0)}`);
13857
14819
  }
13858
14820
  }
13859
14821
  lines.push("");
13860
- lines.push(chalk35.bold(`${totalLabel.padEnd(width)} ${amount(total)} ${chalk35.dim("credits")}`));
14822
+ lines.push(chalk36.bold(`${totalLabel.padEnd(width)} ${amount(total)} ${chalk36.dim("credits")}`));
13861
14823
  return lines;
13862
14824
  }
13863
14825
  function registerUtilizationCommand(program) {
@@ -13870,7 +14832,7 @@ Examples:
13870
14832
  `);
13871
14833
  util.command("actual", { isDefault: true }).description("Show current utilization (default subcommand)").action(async (_options, cmd) => {
13872
14834
  try {
13873
- const outputFormat = getOutputFormat25(cmd);
14835
+ const outputFormat = getOutputFormat26(cmd);
13874
14836
  const api = createApiClient();
13875
14837
  const utilization = await api.admin.getActualUtilization();
13876
14838
  if (outputFormat === "human") {
@@ -13884,7 +14846,7 @@ Examples:
13884
14846
  });
13885
14847
  util.command("history").description("Show what each day of the billing cycle cost").action(async (_options, cmd) => {
13886
14848
  try {
13887
- const outputFormat = getOutputFormat25(cmd);
14849
+ const outputFormat = getOutputFormat26(cmd);
13888
14850
  const api = createApiClient();
13889
14851
  const history = await api.admin.getUtilizationHistory();
13890
14852
  if (outputFormat === "human") {
@@ -13905,7 +14867,7 @@ Examples:
13905
14867
  }
13906
14868
 
13907
14869
  // src/commands/entity-branch/index.ts
13908
- function getOutputFormat26(cmd) {
14870
+ function getOutputFormat27(cmd) {
13909
14871
  const config = loadConfig();
13910
14872
  const globalOpts = cmd.optsWithGlobals();
13911
14873
  return globalOpts.output ?? config.defaults.output ?? "human";
@@ -13918,7 +14880,7 @@ function registerEntityBranchCommands(program) {
13918
14880
  const eb = program.command("entity-branch").description("Manage entity branches (parallel versions of a single entity)");
13919
14881
  eb.command("list").description("List branches of an entity").argument("<ref>", "Entity reference (projectId/branch/entityId)").action(async (ref, _options, cmd) => {
13920
14882
  try {
13921
- const outputFormat = getOutputFormat26(cmd);
14883
+ const outputFormat = getOutputFormat27(cmd);
13922
14884
  const overrides = getOverrides11(cmd);
13923
14885
  const resolved = parseEntityReference(ref, overrides);
13924
14886
  const api = createApiClient();
@@ -13970,7 +14932,7 @@ function forReader(subscription) {
13970
14932
  Object.entries(subscription).filter(([key]) => !BILLING_INTERNALS.has(key))
13971
14933
  );
13972
14934
  }
13973
- function getOutputFormat27(cmd) {
14935
+ function getOutputFormat28(cmd) {
13974
14936
  const config = loadConfig();
13975
14937
  const globalOpts = cmd.optsWithGlobals();
13976
14938
  return globalOpts.output ?? config.defaults.output ?? "human";
@@ -13984,7 +14946,7 @@ Examples:
13984
14946
  sub.command("current", { isDefault: true }).description("Show the current subscription").action(async (_options, cmd) => {
13985
14947
  try {
13986
14948
  const api = createApiClient();
13987
- const outputFormat = getOutputFormat27(cmd);
14949
+ const outputFormat = getOutputFormat28(cmd);
13988
14950
  const s = await api.admin.getCurrentSubscription();
13989
14951
  format(outputFormat === "human" ? forReader(s) : s, { format: outputFormat });
13990
14952
  } catch (error) {
@@ -13994,7 +14956,7 @@ Examples:
13994
14956
  sub.command("next").description("Show the next (upcoming) subscription").action(async (_options, cmd) => {
13995
14957
  try {
13996
14958
  const api = createApiClient();
13997
- const outputFormat = getOutputFormat27(cmd);
14959
+ const outputFormat = getOutputFormat28(cmd);
13998
14960
  const s = await api.admin.getNextSubscription();
13999
14961
  format(outputFormat === "human" ? forReader(s) : s, { format: outputFormat });
14000
14962
  } catch (error) {
@@ -14005,7 +14967,7 @@ Examples:
14005
14967
  try {
14006
14968
  const api = createApiClient();
14007
14969
  const plans = await api.admin.getSubscriptionPlans(subscriptionToken);
14008
- format(plans, { format: getOutputFormat27(cmd) });
14970
+ format(plans, { format: getOutputFormat28(cmd) });
14009
14971
  } catch (error) {
14010
14972
  handleError(error);
14011
14973
  }
@@ -14013,8 +14975,8 @@ Examples:
14013
14975
  }
14014
14976
 
14015
14977
  // src/commands/invoice/index.ts
14016
- import * as fs14 from "fs";
14017
- function getOutputFormat28(cmd) {
14978
+ import * as fs15 from "fs";
14979
+ function getOutputFormat29(cmd) {
14018
14980
  const config = loadConfig();
14019
14981
  const globalOpts = cmd.optsWithGlobals();
14020
14982
  return globalOpts.output ?? config.defaults.output ?? "human";
@@ -14031,7 +14993,7 @@ Examples:
14031
14993
  const api = createApiClient();
14032
14994
  const invoices = await api.admin.getInvoices();
14033
14995
  format(invoices, {
14034
- format: getOutputFormat28(cmd),
14996
+ format: getOutputFormat29(cmd),
14035
14997
  columns: [
14036
14998
  { key: "invoiceNumber", header: "number" },
14037
14999
  { key: "issued", kind: "date" },
@@ -14051,7 +15013,7 @@ Examples:
14051
15013
  const response = await api.admin.downloadInvoice(invoiceNumber, fileName);
14052
15014
  const buffer = Buffer.from(await response.arrayBuffer());
14053
15015
  const outPath = options.out ?? fileName;
14054
- fs14.writeFileSync(outPath, buffer);
15016
+ fs15.writeFileSync(outPath, buffer);
14055
15017
  success(`Invoice saved to ${outPath}`);
14056
15018
  } catch (error) {
14057
15019
  handleError(error);
@@ -14060,8 +15022,8 @@ Examples:
14060
15022
  }
14061
15023
 
14062
15024
  // src/commands/shell/index.ts
14063
- import chalk36 from "chalk";
14064
- import * as fs15 from "fs";
15025
+ import chalk37 from "chalk";
15026
+ import * as fs16 from "fs";
14065
15027
  import * as os4 from "os";
14066
15028
  import * as path10 from "path";
14067
15029
  import { spawn as spawn3 } from "child_process";
@@ -14077,15 +15039,15 @@ function extensionFor2(language) {
14077
15039
  }
14078
15040
  async function openInEditor(initial, ext) {
14079
15041
  const tmpFile = path10.join(os4.tmpdir(), `diafunc-shell-${randomUUID4()}.${ext}`);
14080
- fs15.writeFileSync(tmpFile, initial);
15042
+ fs16.writeFileSync(tmpFile, initial);
14081
15043
  const editor = process.env.VISUAL ?? process.env.EDITOR ?? "vi";
14082
15044
  await new Promise((resolve2, reject) => {
14083
15045
  const child = spawn3(editor, [tmpFile], { stdio: "inherit" });
14084
15046
  child.on("exit", (code) => code === 0 ? resolve2() : reject(new Error(`Editor exited with ${code}`)));
14085
15047
  child.on("error", reject);
14086
15048
  });
14087
- const content = fs15.readFileSync(tmpFile, "utf-8");
14088
- fs15.unlinkSync(tmpFile);
15049
+ const content = fs16.readFileSync(tmpFile, "utf-8");
15050
+ fs16.unlinkSync(tmpFile);
14089
15051
  return content;
14090
15052
  }
14091
15053
  function utcNowParts() {
@@ -14126,21 +15088,21 @@ async function evaluate(api, fnRef, language, sourceCode) {
14126
15088
  }, false);
14127
15089
  if (result.outputs?.length) {
14128
15090
  for (const out of result.outputs) {
14129
- console.log(chalk36.dim(` [${out.type}]`) + " " + out.output);
15091
+ console.log(chalk37.dim(` [${out.type}]`) + " " + out.output);
14130
15092
  }
14131
15093
  }
14132
15094
  if (result.successful) {
14133
15095
  if (result.result) {
14134
- console.log(chalk36.green("=>") + " " + resultText(result.result, result.resultEncoding));
15096
+ console.log(chalk37.green("=>") + " " + resultText(result.result, result.resultEncoding));
14135
15097
  } else {
14136
- console.log(chalk36.dim("=> (no value)"));
15098
+ console.log(chalk37.dim("=> (no value)"));
14137
15099
  }
14138
15100
  const duration = result.completed - result.started;
14139
- console.log(chalk36.dim(` [${duration}ms \xB7 ${evaluationId}]`));
15101
+ console.log(chalk37.dim(` [${duration}ms \xB7 ${evaluationId}]`));
14140
15102
  } else {
14141
- console.log(chalk36.red("error: ") + result.error);
15103
+ console.log(chalk37.red("error: ") + result.error);
14142
15104
  if (result.lineNumber > 0) {
14143
- console.log(chalk36.dim(` at line ${result.lineNumber}, col ${result.columnNumber}`));
15105
+ console.log(chalk37.dim(` at line ${result.lineNumber}, col ${result.columnNumber}`));
14144
15106
  }
14145
15107
  }
14146
15108
  }
@@ -14161,19 +15123,19 @@ function registerShellCommand(program) {
14161
15123
  });
14162
15124
  const api = createApiClient();
14163
15125
  const { input: promptInput } = await import("@inquirer/prompts");
14164
- const { getUpdateNotice } = await import("./update-check-WNT76O6I.js");
15126
+ const { getUpdateNotice } = await import("./update-check-R7B2D7VX.js");
14165
15127
  const resolvedLanguage = await resolveLanguage(api, fnRef.projectId, options.language);
14166
- console.log(chalk36.bold("Diafunc shell") + chalk36.dim(` \xB7 function ${fnRef.entityId} \xB7 ${resolvedLanguage}`));
14167
- console.log(chalk36.dim(`Endpoint: ${config.profiles[getActiveProfileName(config)]?.endpoint}`));
14168
- console.log(chalk36.dim("Commands: /edit (multi-line in $EDITOR), /lang <name>, /file <path>, /help, /quit"));
15128
+ console.log(chalk37.bold("Diafunc shell") + chalk37.dim(` \xB7 function ${fnRef.entityId} \xB7 ${resolvedLanguage}`));
15129
+ console.log(chalk37.dim(`Endpoint: ${config.profiles[getActiveProfileName(config)]?.endpoint}`));
15130
+ console.log(chalk37.dim("Commands: /edit (multi-line in $EDITOR), /lang <name>, /file <path>, /help, /quit"));
14169
15131
  const notice = await getUpdateNotice();
14170
- if (notice) console.log(chalk36.dim(notice));
15132
+ if (notice) console.log(chalk37.dim(notice));
14171
15133
  console.log();
14172
15134
  let language = resolvedLanguage;
14173
15135
  for (; ; ) {
14174
15136
  let line;
14175
15137
  try {
14176
- line = await promptInput({ message: chalk36.cyan.bold(`${language} >`) });
15138
+ line = await promptInput({ message: chalk37.cyan.bold(`${language} >`) });
14177
15139
  } catch {
14178
15140
  console.log();
14179
15141
  return;
@@ -14191,54 +15153,54 @@ function registerShellCommand(program) {
14191
15153
  case "help":
14192
15154
  case "h":
14193
15155
  case "?":
14194
- console.log(chalk36.dim(" /edit open $EDITOR for multi-line code"));
14195
- console.log(chalk36.dim(" /file <path> evaluate the contents of a file"));
14196
- console.log(chalk36.dim(" /lang <name> switch language (Java, JavaScript, Kotlin, Python, Scala)"));
14197
- console.log(chalk36.dim(" /quit exit the shell"));
15156
+ console.log(chalk37.dim(" /edit open $EDITOR for multi-line code"));
15157
+ console.log(chalk37.dim(" /file <path> evaluate the contents of a file"));
15158
+ console.log(chalk37.dim(" /lang <name> switch language (Java, JavaScript, Kotlin, Python, Scala)"));
15159
+ console.log(chalk37.dim(" /quit exit the shell"));
14198
15160
  continue;
14199
15161
  case "lang":
14200
15162
  if (arg) language = arg;
14201
- console.log(chalk36.dim(`Language: ${language}`));
15163
+ console.log(chalk37.dim(`Language: ${language}`));
14202
15164
  continue;
14203
15165
  case "edit": {
14204
15166
  const sourceCode = await openInEditor("", extensionFor2(language));
14205
15167
  if (!sourceCode.trim()) {
14206
- console.log(chalk36.dim("(empty; not evaluated)"));
15168
+ console.log(chalk37.dim("(empty; not evaluated)"));
14207
15169
  continue;
14208
15170
  }
14209
15171
  try {
14210
15172
  await evaluate(api, fnRef, language, sourceCode);
14211
15173
  } catch (e) {
14212
- console.error(chalk36.red(e.message));
15174
+ console.error(chalk37.red(e.message));
14213
15175
  }
14214
15176
  continue;
14215
15177
  }
14216
15178
  case "file": {
14217
15179
  if (!arg) {
14218
- console.log(chalk36.dim("usage: /file <path>"));
15180
+ console.log(chalk37.dim("usage: /file <path>"));
14219
15181
  continue;
14220
15182
  }
14221
- if (!fs15.existsSync(arg)) {
14222
- console.log(chalk36.red(`file not found: ${arg}`));
15183
+ if (!fs16.existsSync(arg)) {
15184
+ console.log(chalk37.red(`file not found: ${arg}`));
14223
15185
  continue;
14224
15186
  }
14225
- const sourceCode = fs15.readFileSync(arg, "utf-8");
15187
+ const sourceCode = fs16.readFileSync(arg, "utf-8");
14226
15188
  try {
14227
15189
  await evaluate(api, fnRef, language, sourceCode);
14228
15190
  } catch (e) {
14229
- console.error(chalk36.red(e.message));
15191
+ console.error(chalk37.red(e.message));
14230
15192
  }
14231
15193
  continue;
14232
15194
  }
14233
15195
  default:
14234
- console.log(chalk36.dim(`Unknown command: /${cmd2}. Try /help.`));
15196
+ console.log(chalk37.dim(`Unknown command: /${cmd2}. Try /help.`));
14235
15197
  continue;
14236
15198
  }
14237
15199
  }
14238
15200
  try {
14239
15201
  await evaluate(api, fnRef, language, trimmed);
14240
15202
  } catch (e) {
14241
- console.error(chalk36.red(e.message));
15203
+ console.error(chalk37.red(e.message));
14242
15204
  }
14243
15205
  }
14244
15206
  } catch (error) {
@@ -14248,19 +15210,19 @@ function registerShellCommand(program) {
14248
15210
  }
14249
15211
 
14250
15212
  // src/commands/update/index.ts
14251
- import chalk37 from "chalk";
15213
+ import chalk38 from "chalk";
14252
15214
  import * as path11 from "path";
14253
15215
  import { spawn as spawn4 } from "child_process";
14254
15216
 
14255
15217
  // src/util/install-method.ts
14256
- import * as fs16 from "fs";
15218
+ import * as fs17 from "fs";
14257
15219
  function detectInstall() {
14258
15220
  const exec = process.execPath;
14259
15221
  const exe = exec.replace(/\\/g, "/").toLowerCase();
14260
15222
  const isNode = exe.endsWith("/node") || exe.endsWith("/node.exe");
14261
15223
  return {
14262
15224
  method: isNode ? "npm" : "binary",
14263
- binaryPath: isNode ? exec : fs16.realpathSync(exec)
15225
+ binaryPath: isNode ? exec : fs17.realpathSync(exec)
14264
15226
  };
14265
15227
  }
14266
15228
 
@@ -14294,14 +15256,14 @@ function registerUpdateCommand(program) {
14294
15256
  const install = detectInstall();
14295
15257
  const latest = await fetchLatestVersion();
14296
15258
  if (latest === package_default.version) {
14297
- console.log(chalk37.dim(`diafunc is already at the latest version (${package_default.version}).`));
15259
+ console.log(chalk38.dim(`diafunc is already at the latest version (${package_default.version}).`));
14298
15260
  return;
14299
15261
  }
14300
- console.log(chalk37.dim(`Current: ${package_default.version} \u2192 Available: ${latest}`));
15262
+ console.log(chalk38.dim(`Current: ${package_default.version} \u2192 Available: ${latest}`));
14301
15263
  if (install.method === "npm") {
14302
15264
  console.log();
14303
15265
  console.log("Installed via npm. Upgrade with:");
14304
- console.log(chalk37.bold(` npm install -g @diafunc/cli@${latest}`));
15266
+ console.log(chalk38.bold(` npm install -g @diafunc/cli@${latest}`));
14305
15267
  return;
14306
15268
  }
14307
15269
  const installDir = path11.dirname(install.binaryPath);
@@ -14315,9 +15277,9 @@ function registerUpdateCommand(program) {
14315
15277
  }
14316
15278
 
14317
15279
  // src/commands/uninstall/index.ts
14318
- import chalk38 from "chalk";
15280
+ import chalk39 from "chalk";
14319
15281
  import { spawn as spawn5 } from "child_process";
14320
- import * as fs17 from "fs";
15282
+ import * as fs18 from "fs";
14321
15283
  import * as os5 from "os";
14322
15284
  import * as path12 from "path";
14323
15285
  function registerUninstallCommand(program) {
@@ -14327,11 +15289,11 @@ function registerUninstallCommand(program) {
14327
15289
  const configDir = path12.join(os5.homedir(), ".diafunc");
14328
15290
  if (install.method === "npm") {
14329
15291
  console.log("Installed via npm. Remove with:");
14330
- console.log(chalk38.bold(" npm uninstall -g @diafunc/cli"));
14331
- if (fs17.existsSync(configDir)) {
15292
+ console.log(chalk39.bold(" npm uninstall -g @diafunc/cli"));
15293
+ if (fs18.existsSync(configDir)) {
14332
15294
  console.log();
14333
15295
  console.log(`Config and credentials live at ${configDir}. Remove them manually with:`);
14334
- console.log(chalk38.bold(` rm -rf ${configDir}`));
15296
+ console.log(chalk39.bold(` rm -rf ${configDir}`));
14335
15297
  }
14336
15298
  return;
14337
15299
  }
@@ -14341,19 +15303,19 @@ function registerUninstallCommand(program) {
14341
15303
  default: false
14342
15304
  });
14343
15305
  if (!removeBinary) {
14344
- console.log(chalk38.dim("Aborted."));
15306
+ console.log(chalk39.dim("Aborted."));
14345
15307
  return;
14346
15308
  }
14347
15309
  let removeConfig = options.purge ?? false;
14348
- if (!options.purge && !options.yes && fs17.existsSync(configDir)) {
15310
+ if (!options.purge && !options.yes && fs18.existsSync(configDir)) {
14349
15311
  removeConfig = await confirm({
14350
15312
  message: `Also remove ${configDir} (config + credentials)?`,
14351
15313
  default: false
14352
15314
  });
14353
15315
  }
14354
- if (removeConfig && fs17.existsSync(configDir)) {
14355
- fs17.rmSync(configDir, { recursive: true, force: true });
14356
- console.log(chalk38.dim(`Removed ${configDir}`));
15316
+ if (removeConfig && fs18.existsSync(configDir)) {
15317
+ fs18.rmSync(configDir, { recursive: true, force: true });
15318
+ console.log(chalk39.dim(`Removed ${configDir}`));
14357
15319
  }
14358
15320
  if (process.platform === "win32") {
14359
15321
  const cmd = `timeout /t 2 /nobreak >nul & del /f /q "${install.binaryPath}"`;
@@ -14363,13 +15325,13 @@ function registerUninstallCommand(program) {
14363
15325
  windowsHide: true
14364
15326
  });
14365
15327
  child.unref();
14366
- console.log(chalk38.dim(`Removing ${install.binaryPath} on exit...`));
15328
+ console.log(chalk39.dim(`Removing ${install.binaryPath} on exit...`));
14367
15329
  console.log();
14368
15330
  console.log("diafunc uninstalled.");
14369
15331
  return;
14370
15332
  }
14371
- fs17.rmSync(install.binaryPath, { force: true });
14372
- console.log(chalk38.dim(`Removed ${install.binaryPath}`));
15333
+ fs18.rmSync(install.binaryPath, { force: true });
15334
+ console.log(chalk39.dim(`Removed ${install.binaryPath}`));
14373
15335
  console.log();
14374
15336
  console.log("diafunc uninstalled.");
14375
15337
  } catch (error) {
@@ -14378,66 +15340,12 @@ function registerUninstallCommand(program) {
14378
15340
  });
14379
15341
  }
14380
15342
 
14381
- // src/prompting/command.ts
14382
- import { Command as Command2 } from "commander";
14383
- var commanderOriginal = Command2.prototype;
14384
- var DiafuncCommand = class _DiafuncCommand extends Command2 {
14385
- /** Gaps recorded during the current parse, in the order commander found them. */
14386
- pendingInputs = [];
14387
- /** Set on the program only; every command reads it from there. */
14388
- promptEnvironment = {};
14389
- createCommand(name) {
14390
- return new _DiafuncCommand(name);
14391
- }
14392
- missingArgument(name) {
14393
- if (!this.mayPrompt()) {
14394
- commanderOriginal.missingArgument.call(this, name);
14395
- return;
14396
- }
14397
- const index = this.registeredArguments.findIndex((a) => a.name() === name);
14398
- const argument = this.registeredArguments[index];
14399
- this.pendingInputs.push({
14400
- kind: "argument",
14401
- name,
14402
- index,
14403
- description: argument?.description ?? "",
14404
- variadic: Boolean(argument?.variadic)
14405
- });
14406
- }
14407
- missingMandatoryOptionValue(option) {
14408
- if (!this.mayPrompt()) {
14409
- commanderOriginal.missingMandatoryOptionValue.call(this, option);
14410
- return;
14411
- }
14412
- this.pendingInputs.push({
14413
- kind: "option",
14414
- name: option.attributeName(),
14415
- flag: option.long ?? option.flags,
14416
- description: option.description ?? "",
14417
- variadic: Boolean(option.variadic)
14418
- });
14419
- }
14420
- /** The environment set on the program. */
14421
- environment() {
14422
- let root = this;
14423
- while (root.parent) root = root.parent;
14424
- return root instanceof _DiafuncCommand ? root.promptEnvironment : {};
14425
- }
14426
- mayPrompt() {
14427
- const forced = this.environment().interactive;
14428
- if (forced !== void 0) return forced;
14429
- const globals = this.optsWithGlobals();
14430
- const output = globals.output ?? loadConfig().defaults.output ?? "human";
14431
- return canPrompt(output, globals.interactive === false);
14432
- }
14433
- };
14434
-
14435
15343
  // src/prompting/fill.ts
14436
- import chalk40 from "chalk";
15344
+ import chalk41 from "chalk";
14437
15345
 
14438
15346
  // src/prompting/pickers.ts
14439
- import * as fs18 from "fs";
14440
- import chalk39 from "chalk";
15347
+ import * as fs19 from "fs";
15348
+ import chalk40 from "chalk";
14441
15349
  var SEARCH_THRESHOLD = 10;
14442
15350
  var TYPE_IT = "\0type-it";
14443
15351
  async function askFor(spec, input, ctx) {
@@ -14559,6 +15467,8 @@ async function askFor(spec, input, ctx) {
14559
15467
  return listed(ctx, "profiles", messageFor(input, "Profile"), async () => Object.keys(loadConfig().profiles).map((p) => ({ label: p, value: p })));
14560
15468
  case "statusComponent":
14561
15469
  return listed(ctx, "components", messageFor(input, "Component"), async () => (await createStatusService().getComponents()).map((c) => ({ label: c.id, value: c.id, hint: `${c.state} \xB7 ${c.domainId}` })));
15470
+ case "deployment":
15471
+ return listed(ctx, "deployments", messageFor(input, "Deployment"), async () => (await ctx.api().deployments.list()).map((d) => ({ label: d.name, value: d.deploymentId, hint: `${d.target} \xB7 ${d.deploymentId}` })));
14562
15472
  case "license":
14563
15473
  return listed(ctx, "licenses", messageFor(input, "License"), async () => (await ctx.api().admin.listLicenses()).map((l) => ({ label: l.name, value: l.licenceId, hint: `${l.state.toLowerCase()} \xB7 ${l.licenceId}` })));
14564
15474
  case "choice":
@@ -14573,7 +15483,7 @@ async function askFor(spec, input, ctx) {
14573
15483
  }
14574
15484
  case "file":
14575
15485
  return typed(ctx, question(input), {
14576
- validate: (value) => fs18.existsSync(value.trim()) || `No file at ${value.trim()}.`
15486
+ validate: (value) => fs19.existsSync(value.trim()) || `No file at ${value.trim()}.`
14577
15487
  });
14578
15488
  case "number":
14579
15489
  return typed(ctx, question(input), { validate: numberRule(spec) });
@@ -14787,7 +15697,7 @@ function typedValue(ctx, message) {
14787
15697
  return typed(ctx, message);
14788
15698
  }
14789
15699
  function typeItChoice() {
14790
- return { name: chalk39.dim("Type it instead"), value: TYPE_IT };
15700
+ return { name: chalk40.dim("Type it instead"), value: TYPE_IT };
14791
15701
  }
14792
15702
  function text(ctx, name) {
14793
15703
  const value = ctx.known.get(name);
@@ -14817,7 +15727,7 @@ function capitalize(value) {
14817
15727
  return value.charAt(0).toUpperCase() + value.slice(1);
14818
15728
  }
14819
15729
  function labelled(label, hint2) {
14820
- return hint2 && hint2 !== label ? `${label} ${chalk39.dim(hint2)}` : label;
15730
+ return hint2 && hint2 !== label ? `${label} ${chalk40.dim(hint2)}` : label;
14821
15731
  }
14822
15732
  function numberRule(spec) {
14823
15733
  return (raw) => {
@@ -14863,7 +15773,7 @@ async function fillPendingInputs(actionCommand) {
14863
15773
  known: knownValues(actionCommand),
14864
15774
  globals: actionCommand.optsWithGlobals(),
14865
15775
  prefill: /* @__PURE__ */ new Map(),
14866
- note: (line) => process.stderr.write(chalk40.dim(` ${line}
15776
+ note: (line) => process.stderr.write(chalk41.dim(` ${line}
14867
15777
  `))
14868
15778
  };
14869
15779
  for (const item of orderByDependencies(pending)) {
@@ -14872,7 +15782,7 @@ async function fillPendingInputs(actionCommand) {
14872
15782
  ctx.known.set(item.input.name, value);
14873
15783
  }
14874
15784
  const log = env.log ?? ((line) => console.log(line));
14875
- log(chalk40.dim(` Equivalent: ${equivalentCommand(actionCommand)}`));
15785
+ log(chalk41.dim(` Equivalent: ${equivalentCommand(actionCommand)}`));
14876
15786
  }
14877
15787
  function commandChain(cmd) {
14878
15788
  const chain = [];
@@ -14978,7 +15888,7 @@ function createProgram(environment = {}) {
14978
15888
  selectProfile(opts.profile);
14979
15889
  if (opts.dryRun) setDryRun(true);
14980
15890
  if (opts.verbose) setVerbose(true);
14981
- if (opts.color === false) chalk41.level = 0;
15891
+ if (opts.color === false) chalk42.level = 0;
14982
15892
  }).hook("preAction", (_thisCommand, actionCommand) => fillPendingInputs(actionCommand));
14983
15893
  program.addHelpText("after", HELP_EPILOGUE);
14984
15894
  registerAuthCommands(program);
@@ -14999,6 +15909,7 @@ function createProgram(environment = {}) {
14999
15909
  registerAdminCommands(program);
15000
15910
  registerStatusCommands(program);
15001
15911
  registerAnalyzeCommand(program);
15912
+ registerDeploymentCommands(program);
15002
15913
  registerPublicCommands(program);
15003
15914
  registerLicenseCommands(program);
15004
15915
  registerDataSourcesCommands(program);
@@ -15023,4 +15934,4 @@ export {
15023
15934
  PromptCanceled,
15024
15935
  createProgram
15025
15936
  };
15026
- //# sourceMappingURL=chunk-FP3ZMLXZ.js.map
15937
+ //# sourceMappingURL=chunk-MRKZZ4XD.js.map