clawmoney 0.17.10 → 0.17.12
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,4 +1,4 @@
|
|
|
1
|
-
import { intro, outro,
|
|
1
|
+
import { intro, outro, groupMultiselect, text, confirm, spinner, isCancel, cancel, log, note, } from "@clack/prompts";
|
|
2
2
|
import chalk from "chalk";
|
|
3
3
|
import { apiPost } from "../utils/api.js";
|
|
4
4
|
import { loadConfig } from "../utils/config.js";
|
|
@@ -108,25 +108,28 @@ export async function marketSetupCommand(opts = {}) {
|
|
|
108
108
|
intro(chalk.cyan(" ClawMoney Market Setup "));
|
|
109
109
|
}
|
|
110
110
|
log.message("Register one or more skills on the Market so other agents can call (and pay) you.");
|
|
111
|
-
// ── Step 1:
|
|
112
|
-
//
|
|
113
|
-
//
|
|
114
|
-
//
|
|
115
|
-
//
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
111
|
+
// ── Step 1: groupMultiselect renders three native sections —
|
|
112
|
+
// "Instant · poll for result", "Escrow · manual approve", "Auto · routed
|
|
113
|
+
// by price" — with checkbox rows under each. Section titles are part of
|
|
114
|
+
// clack's group rendering, NOT selectable items, so the earlier confusion
|
|
115
|
+
// (title rows being accidentally tickable) is gone.
|
|
116
|
+
const instantRows = CATEGORIES.filter((c) => c.routing === "instant");
|
|
117
|
+
const escrowRows = CATEGORIES.filter((c) => c.routing === "escrow");
|
|
118
|
+
const autoRows = CATEGORIES.filter((c) => c.routing === "auto");
|
|
119
|
+
// Pad category names to the same width across all groups so the
|
|
120
|
+
// dim-colored timeout column lines up no matter which section it sits in.
|
|
121
|
+
const nameColumnWidth = Math.max(...CATEGORIES.map((c) => c.value.length)) + 2;
|
|
122
|
+
const renderRow = (row) => ({
|
|
123
|
+
value: row.value,
|
|
124
|
+
label: `${row.value.padEnd(nameColumnWidth, " ")}${chalk.dim(formatHint(row))}`,
|
|
125
|
+
});
|
|
126
|
+
const picked = await groupMultiselect({
|
|
125
127
|
message: "Pick the skill categories to register (space to toggle, enter to confirm):",
|
|
126
|
-
options:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
options: {
|
|
129
|
+
"Instant · poll for result": instantRows.map(renderRow),
|
|
130
|
+
"Escrow · manual approve": escrowRows.map(renderRow),
|
|
131
|
+
"Auto · routed by price": autoRows.map(renderRow),
|
|
132
|
+
},
|
|
130
133
|
required: true,
|
|
131
134
|
});
|
|
132
135
|
if (isCancel(picked)) {
|
|
@@ -29,10 +29,13 @@ export async function providerSetupWizard() {
|
|
|
29
29
|
console.log(chalk.red("\n No agent config found. Run `clawmoney setup` first to register.\n"));
|
|
30
30
|
process.exit(1);
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
// Render the full role catalog as a note before the multiselect, so the
|
|
33
|
+
// user has a stable reference even after clack collapses the prompt to
|
|
34
|
+
// its selected-items summary. Without this, the user only sees what they
|
|
35
|
+
// ticked and can be left wondering "did I miss other roles?".
|
|
36
|
+
note(ROLES.map((r) => `${chalk.bold(r.label.padEnd(16, " "))}${chalk.dim(r.hint)}`).join("\n"), "Three provider roles — pick any combination");
|
|
34
37
|
const picked = await multiselect({
|
|
35
|
-
message: "
|
|
38
|
+
message: "Toggle roles with SPACE, confirm with ENTER (you can skip all to register no role):",
|
|
36
39
|
options: ROLES.map((r) => ({
|
|
37
40
|
value: r.value,
|
|
38
41
|
label: r.label,
|