@zeroclickai/zam-cli 0.3.15 → 0.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +42 -52
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { Command as Command20 } from "commander";
|
|
|
7
7
|
// package.json
|
|
8
8
|
var package_default = {
|
|
9
9
|
name: "@zeroclickai/zam-cli",
|
|
10
|
-
version: "0.3.
|
|
10
|
+
version: "0.3.16",
|
|
11
11
|
type: "module",
|
|
12
12
|
bin: {
|
|
13
13
|
zam: "bin/zam.js",
|
|
@@ -2390,7 +2390,7 @@ var runCommand = (client2, apiKey) => new Command12("run").description("Search f
|
|
|
2390
2390
|
);
|
|
2391
2391
|
|
|
2392
2392
|
// src/commands/search.ts
|
|
2393
|
-
import {
|
|
2393
|
+
import { log as log15, spinner as spinner12 } from "@clack/prompts";
|
|
2394
2394
|
import { Command as Command13 } from "commander";
|
|
2395
2395
|
var zamToResult2 = (z3) => ({
|
|
2396
2396
|
id: z3.id,
|
|
@@ -2458,17 +2458,7 @@ ${formatRunContract(z3.runContract)}`;
|
|
|
2458
2458
|
};
|
|
2459
2459
|
var searchCommand = (client2) => new Command13("search").description("Search the ZeroClick Marketplace").argument("[query]", "Search query").option("--category <category>", "Filter by category").option("--show-schema", "Show input/output schemas for each result").option("--json", "Output results as JSON (machine-readable)").action(
|
|
2460
2460
|
async (queryArg, options) => {
|
|
2461
|
-
const query = queryArg
|
|
2462
|
-
const v = await text3({
|
|
2463
|
-
message: "Search query (leave empty to list all):",
|
|
2464
|
-
defaultValue: ""
|
|
2465
|
-
});
|
|
2466
|
-
if (isCancel5(v)) {
|
|
2467
|
-
cancel4("Cancelled.");
|
|
2468
|
-
process.exit(0);
|
|
2469
|
-
}
|
|
2470
|
-
return v || void 0;
|
|
2471
|
-
})();
|
|
2461
|
+
const query = queryArg;
|
|
2472
2462
|
const s = spinner12();
|
|
2473
2463
|
if (!options.json) s.start("Searching...");
|
|
2474
2464
|
try {
|
|
@@ -2696,10 +2686,10 @@ var formatBalance = (microdollars) => {
|
|
|
2696
2686
|
};
|
|
2697
2687
|
|
|
2698
2688
|
// src/commands/wallet-recover.ts
|
|
2699
|
-
import { log as log19, spinner as spinner15, text as
|
|
2689
|
+
import { log as log19, spinner as spinner15, text as text3 } from "@clack/prompts";
|
|
2700
2690
|
import { Command as Command17 } from "commander";
|
|
2701
2691
|
var walletRecoverCommand = (baseUrl, saveConfig2) => new Command17("recover").description("Recover wallet access with recovery phrase").action(async () => {
|
|
2702
|
-
const phrase = await
|
|
2692
|
+
const phrase = await text3({
|
|
2703
2693
|
message: "Enter your 12-word recovery phrase:"
|
|
2704
2694
|
});
|
|
2705
2695
|
if (typeof phrase !== "string") {
|
|
@@ -2759,13 +2749,13 @@ var walletUpdateCommand = (client2) => new Command18("update").description("Upda
|
|
|
2759
2749
|
|
|
2760
2750
|
// src/commands/zams.ts
|
|
2761
2751
|
import {
|
|
2762
|
-
cancel as
|
|
2752
|
+
cancel as cancel4,
|
|
2763
2753
|
confirm as confirm3,
|
|
2764
|
-
isCancel as
|
|
2754
|
+
isCancel as isCancel5,
|
|
2765
2755
|
log as log21,
|
|
2766
2756
|
select as select2,
|
|
2767
2757
|
spinner as spinner16,
|
|
2768
|
-
text as
|
|
2758
|
+
text as text4
|
|
2769
2759
|
} from "@clack/prompts";
|
|
2770
2760
|
import { Command as Command19 } from "commander";
|
|
2771
2761
|
|
|
@@ -2902,58 +2892,58 @@ Capabilities (${memberships.length}):`);
|
|
|
2902
2892
|
async (opts) => {
|
|
2903
2893
|
requireAuth(apiKey);
|
|
2904
2894
|
const title = opts.title ?? await (async () => {
|
|
2905
|
-
const v = await
|
|
2895
|
+
const v = await text4({
|
|
2906
2896
|
message: "Title:",
|
|
2907
2897
|
validate: (val) => val.length > 0 ? void 0 : "Title is required"
|
|
2908
2898
|
});
|
|
2909
|
-
if (
|
|
2910
|
-
|
|
2899
|
+
if (isCancel5(v)) {
|
|
2900
|
+
cancel4("Cancelled.");
|
|
2911
2901
|
process.exit(0);
|
|
2912
2902
|
}
|
|
2913
2903
|
return v;
|
|
2914
2904
|
})();
|
|
2915
2905
|
const description = opts.description ?? await (async () => {
|
|
2916
|
-
const v = await
|
|
2906
|
+
const v = await text4({
|
|
2917
2907
|
message: "Description (optional):",
|
|
2918
2908
|
defaultValue: ""
|
|
2919
2909
|
});
|
|
2920
|
-
if (
|
|
2921
|
-
|
|
2910
|
+
if (isCancel5(v)) {
|
|
2911
|
+
cancel4("Cancelled.");
|
|
2922
2912
|
process.exit(0);
|
|
2923
2913
|
}
|
|
2924
2914
|
return v;
|
|
2925
2915
|
})();
|
|
2926
2916
|
const category = opts.category ?? await (async () => {
|
|
2927
|
-
const v = await
|
|
2917
|
+
const v = await text4({
|
|
2928
2918
|
message: "Category (optional):",
|
|
2929
2919
|
defaultValue: ""
|
|
2930
2920
|
});
|
|
2931
|
-
if (
|
|
2932
|
-
|
|
2921
|
+
if (isCancel5(v)) {
|
|
2922
|
+
cancel4("Cancelled.");
|
|
2933
2923
|
process.exit(0);
|
|
2934
2924
|
}
|
|
2935
2925
|
return v;
|
|
2936
2926
|
})();
|
|
2937
2927
|
const tagsRaw = opts.tags ?? await (async () => {
|
|
2938
|
-
const v = await
|
|
2928
|
+
const v = await text4({
|
|
2939
2929
|
message: "Tags (comma-separated, optional):",
|
|
2940
2930
|
defaultValue: ""
|
|
2941
2931
|
});
|
|
2942
|
-
if (
|
|
2943
|
-
|
|
2932
|
+
if (isCancel5(v)) {
|
|
2933
|
+
cancel4("Cancelled.");
|
|
2944
2934
|
process.exit(0);
|
|
2945
2935
|
}
|
|
2946
2936
|
return v;
|
|
2947
2937
|
})();
|
|
2948
2938
|
const tags = tagsRaw ? tagsRaw.split(",").map((t) => t.trim()).filter(Boolean) : void 0;
|
|
2949
2939
|
const endpointUrl = opts.endpoint ?? await (async () => {
|
|
2950
|
-
const v = await
|
|
2940
|
+
const v = await text4({
|
|
2951
2941
|
message: "Endpoint URL (optional):",
|
|
2952
2942
|
defaultValue: "",
|
|
2953
2943
|
placeholder: "https://your-api.com/run"
|
|
2954
2944
|
});
|
|
2955
|
-
if (
|
|
2956
|
-
|
|
2945
|
+
if (isCancel5(v)) {
|
|
2946
|
+
cancel4("Cancelled.");
|
|
2957
2947
|
process.exit(0);
|
|
2958
2948
|
}
|
|
2959
2949
|
return v;
|
|
@@ -2972,8 +2962,8 @@ Capabilities (${memberships.length}):`);
|
|
|
2972
2962
|
{ value: "DELETE", label: "DELETE" }
|
|
2973
2963
|
]
|
|
2974
2964
|
});
|
|
2975
|
-
if (
|
|
2976
|
-
|
|
2965
|
+
if (isCancel5(v)) {
|
|
2966
|
+
cancel4("Cancelled.");
|
|
2977
2967
|
process.exit(0);
|
|
2978
2968
|
}
|
|
2979
2969
|
return v;
|
|
@@ -3061,8 +3051,8 @@ Capabilities (${memberships.length}):`);
|
|
|
3061
3051
|
const confirmed = await confirm3({
|
|
3062
3052
|
message: "Create ZAM from this contract?"
|
|
3063
3053
|
});
|
|
3064
|
-
if (
|
|
3065
|
-
|
|
3054
|
+
if (isCancel5(confirmed) || !confirmed) {
|
|
3055
|
+
cancel4("Cancelled.");
|
|
3066
3056
|
return;
|
|
3067
3057
|
}
|
|
3068
3058
|
}
|
|
@@ -3126,30 +3116,30 @@ Capabilities (${memberships.length}):`);
|
|
|
3126
3116
|
process.exitCode = 1;
|
|
3127
3117
|
return;
|
|
3128
3118
|
}
|
|
3129
|
-
const titleInput = await
|
|
3119
|
+
const titleInput = await text4({
|
|
3130
3120
|
message: "Title:",
|
|
3131
3121
|
defaultValue: current.title
|
|
3132
3122
|
});
|
|
3133
|
-
if (
|
|
3134
|
-
|
|
3123
|
+
if (isCancel5(titleInput)) {
|
|
3124
|
+
cancel4("Cancelled.");
|
|
3135
3125
|
process.exit(0);
|
|
3136
3126
|
}
|
|
3137
3127
|
titleVal = titleInput;
|
|
3138
|
-
const descInput = await
|
|
3128
|
+
const descInput = await text4({
|
|
3139
3129
|
message: "Description:",
|
|
3140
3130
|
defaultValue: current.description ?? ""
|
|
3141
3131
|
});
|
|
3142
|
-
if (
|
|
3143
|
-
|
|
3132
|
+
if (isCancel5(descInput)) {
|
|
3133
|
+
cancel4("Cancelled.");
|
|
3144
3134
|
process.exit(0);
|
|
3145
3135
|
}
|
|
3146
3136
|
descriptionVal = descInput || void 0;
|
|
3147
|
-
const catInput = await
|
|
3137
|
+
const catInput = await text4({
|
|
3148
3138
|
message: "Category:",
|
|
3149
3139
|
defaultValue: current.category ?? ""
|
|
3150
3140
|
});
|
|
3151
|
-
if (
|
|
3152
|
-
|
|
3141
|
+
if (isCancel5(catInput)) {
|
|
3142
|
+
cancel4("Cancelled.");
|
|
3153
3143
|
process.exit(0);
|
|
3154
3144
|
}
|
|
3155
3145
|
categoryVal = catInput || void 0;
|
|
@@ -3169,8 +3159,8 @@ Capabilities (${memberships.length}):`);
|
|
|
3169
3159
|
)?.value,
|
|
3170
3160
|
options: stateOptions
|
|
3171
3161
|
});
|
|
3172
|
-
if (
|
|
3173
|
-
|
|
3162
|
+
if (isCancel5(stateInput)) {
|
|
3163
|
+
cancel4("Cancelled.");
|
|
3174
3164
|
process.exit(0);
|
|
3175
3165
|
}
|
|
3176
3166
|
stateVal = stateInput;
|
|
@@ -3226,8 +3216,8 @@ Capabilities (${memberships.length}):`);
|
|
|
3226
3216
|
const confirmed = await confirm3({
|
|
3227
3217
|
message: "This will invalidate the old signing secret. Continue?"
|
|
3228
3218
|
});
|
|
3229
|
-
if (
|
|
3230
|
-
|
|
3219
|
+
if (isCancel5(confirmed) || !confirmed) {
|
|
3220
|
+
cancel4("Cancelled.");
|
|
3231
3221
|
return;
|
|
3232
3222
|
}
|
|
3233
3223
|
const s = spinner16();
|
|
@@ -3249,8 +3239,8 @@ Capabilities (${memberships.length}):`);
|
|
|
3249
3239
|
const confirmed = await confirm3({
|
|
3250
3240
|
message: `Delete ZAM ${id}?`
|
|
3251
3241
|
});
|
|
3252
|
-
if (
|
|
3253
|
-
|
|
3242
|
+
if (isCancel5(confirmed) || !confirmed) {
|
|
3243
|
+
cancel4("Cancelled.");
|
|
3254
3244
|
return;
|
|
3255
3245
|
}
|
|
3256
3246
|
}
|