barndog 0.2.1 → 0.2.3

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.
Files changed (92) hide show
  1. package/README.md +21 -0
  2. package/dist/cli.js +29 -3
  3. package/dist/commands/add.js +4 -2
  4. package/dist/commands/asset-install.js +7 -3
  5. package/dist/commands/asset-list.js +5 -1
  6. package/dist/commands/asset-share.js +15 -3
  7. package/dist/commands/capabilities.js +23 -5
  8. package/dist/commands/collaboration.js +9 -3
  9. package/dist/commands/harnesses.js +33 -3
  10. package/dist/commands/hooks.js +16 -1
  11. package/dist/commands/mcp-env.js +159 -43
  12. package/dist/commands/mcp.js +13 -3
  13. package/dist/commands/origin.js +7 -4
  14. package/dist/commands/sets.js +16 -5
  15. package/dist/commands/status.js +3 -1
  16. package/dist/commands/sync.js +1 -1
  17. package/dist/commands/uninstall.js +64 -0
  18. package/dist/commands/workspace.js +19 -0
  19. package/dist/config/paths.js +2 -0
  20. package/dist/config/state.js +19 -0
  21. package/dist/entry/update-check.js +15 -0
  22. package/dist/errors.js +4 -0
  23. package/dist/features/adoption/adopt.js +47 -29
  24. package/dist/features/adoption/scan.js +5 -0
  25. package/dist/features/asset-kinds/url-query.js +26 -0
  26. package/dist/features/auth/session.js +22 -0
  27. package/dist/features/collaboration/workspace-store.js +2 -1
  28. package/dist/features/doctor/check.js +1 -0
  29. package/dist/features/doctor/grouped.js +127 -0
  30. package/dist/features/doctor/index.js +29 -27
  31. package/dist/features/environment/events.js +18 -1
  32. package/dist/features/environment/kept-value-events.js +40 -0
  33. package/dist/features/environment/kept-values.js +68 -0
  34. package/dist/features/environment/mcp-records.js +57 -0
  35. package/dist/features/environment/moves.js +17 -1
  36. package/dist/features/environment/stage.js +32 -28
  37. package/dist/features/environment/sync.js +13 -3
  38. package/dist/features/environment/writes.js +25 -27
  39. package/dist/features/hooks/compatibility.js +37 -17
  40. package/dist/features/hooks/test.js +2 -2
  41. package/dist/features/inventory/hook-matrix.js +14 -0
  42. package/dist/features/inventory/hook-readiness.js +47 -0
  43. package/dist/features/inventory/index.js +54 -3
  44. package/dist/features/inventory/show.js +10 -2
  45. package/dist/features/mcps/import.js +74 -21
  46. package/dist/features/mcps/index.js +28 -5
  47. package/dist/features/mcps/values.js +161 -23
  48. package/dist/features/migration/migrate.js +15 -0
  49. package/dist/features/migration/move.js +38 -9
  50. package/dist/features/migration/promote.js +1 -0
  51. package/dist/features/native/adapters.js +5 -46
  52. package/dist/features/native/hook-shell.js +11 -0
  53. package/dist/features/native/requirements.js +98 -0
  54. package/dist/features/secrets/index.js +95 -29
  55. package/dist/features/uninstall/index.js +126 -0
  56. package/dist/features/uninstall/leave.js +152 -0
  57. package/dist/features/uninstall/survey.js +103 -0
  58. package/dist/features/update-check/index.js +108 -0
  59. package/dist/features/workspace/cloud-source.js +38 -4
  60. package/dist/features/workspace/format.js +6 -1
  61. package/dist/harnesses/claude.js +1 -1
  62. package/dist/harnesses/codex.js +46 -22
  63. package/dist/harnesses/cursor.js +1 -1
  64. package/dist/harnesses/opencode.js +1 -1
  65. package/dist/harnesses/read-renamed-variables.js +141 -0
  66. package/dist/harnesses/renamed-variables.js +99 -0
  67. package/dist/platform.js +12 -1
  68. package/dist/program.js +24 -9
  69. package/dist/ui/add-hook.js +2 -2
  70. package/dist/ui/add-mcp.js +54 -16
  71. package/dist/ui/add-skills.js +2 -2
  72. package/dist/ui/adopt.js +90 -19
  73. package/dist/ui/assets.js +15 -2
  74. package/dist/ui/collaboration.js +5 -3
  75. package/dist/ui/connection.js +2 -0
  76. package/dist/ui/format.js +81 -2
  77. package/dist/ui/harness-picker.js +7 -2
  78. package/dist/ui/hook-compatibility.js +176 -22
  79. package/dist/ui/mcp.js +169 -24
  80. package/dist/ui/move.js +3 -2
  81. package/dist/ui/onboarding.js +11 -2
  82. package/dist/ui/output.js +116 -37
  83. package/dist/ui/package-details.js +7 -2
  84. package/dist/ui/pick.js +20 -6
  85. package/dist/ui/secret-input.js +9 -0
  86. package/dist/ui/selection.js +1 -1
  87. package/dist/ui/uninstall.js +186 -0
  88. package/dist/ui/update.js +10 -0
  89. package/dist/ui/variable-problems.js +23 -0
  90. package/dist/version.js +2 -2
  91. package/package.json +2 -2
  92. package/dist/entry/mcp-launch.js +0 -71
@@ -1,21 +1,157 @@
1
1
  import { SHORT_COMMIT_LENGTH } from "../shared/constants.js";
2
- import { bad, dim, fields, hint, ok, table } from "./format.js";
3
- /** Whether each coding tool has a version of the Hook, and whether it can run here. */
4
- /** Whether a harness can run the Hook here: "—" when it isn't supported at all. */
5
- function runtimeLabel(status, runtimeIssue) {
6
- if (status === "unsupported") {
2
+ import { adapters, hookHarnesses } from "../harnesses/registry.js";
3
+ import { requirementFix, } from "../features/native/requirements.js";
4
+ import { bold, dim, fields, hint, ok, table, warn } from "./format.js";
5
+ /** What the author declares for a tool: `—` when the Hook isn't written for it. */
6
+ function authorSays(row) {
7
+ switch (row.status) {
8
+ case "supported":
9
+ return ok("supported");
10
+ case "partial":
11
+ return warn("partial");
12
+ case "unsupported":
13
+ return dim("—");
14
+ }
15
+ }
16
+ function onThisMachine(row) {
17
+ if (row.status === "unsupported") {
18
+ return dim("—");
19
+ }
20
+ return row.missingRequirements.length
21
+ ? warn("! missing requirement")
22
+ : ok("✔ ready");
23
+ }
24
+ /** One cell of `hooks compatibility --all`. */
25
+ function matrixCell(row) {
26
+ if (!row || row.status === "unsupported") {
7
27
  return dim("—");
8
28
  }
9
- return runtimeIssue ? `${bad("✖")} ${runtimeIssue}` : ok("✔");
29
+ if (row.missingRequirements.length) {
30
+ return warn("! can't run");
31
+ }
32
+ return row.status === "partial" ? warn("◐ partial") : ok("✔ supported");
33
+ }
34
+ /** How a missing requirement reads beside the requirement it belongs to. */
35
+ function shortStatus(harness, missing) {
36
+ const tool = adapters[harness].name;
37
+ switch (missing.type) {
38
+ case "command":
39
+ return "not installed or not on your PATH";
40
+ case "invalid-range":
41
+ return "not a valid version range";
42
+ case "tool-missing":
43
+ return `can't find ${tool}`;
44
+ case "version-unknown":
45
+ return `couldn't read ${tool}'s version`;
46
+ case "version":
47
+ return `this machine has ${missing.installed}`;
48
+ }
49
+ }
50
+ /** Each declared requirement with whether this machine meets it, and the fixes for those it doesn't. */
51
+ function requirementLines(rows) {
52
+ const lines = [];
53
+ const fixes = new Set();
54
+ for (const row of rows) {
55
+ const requirements = row.implementation?.requirements;
56
+ if (!requirements) {
57
+ continue;
58
+ }
59
+ const tool = adapters[row.harness].name;
60
+ const status = (missing) => {
61
+ if (!missing) {
62
+ return ok("✔");
63
+ }
64
+ fixes.add(requirementFix(row.harness, missing));
65
+ return warn(`! ${shortStatus(row.harness, missing)}`);
66
+ };
67
+ for (const command of requirements.commands) {
68
+ lines.push([
69
+ tool,
70
+ `${bold(command)} command`,
71
+ status(row.missingRequirements.find((missing) => missing.type === "command" && missing.command === command)),
72
+ ]);
73
+ }
74
+ if (requirements.harnessVersion) {
75
+ lines.push([
76
+ tool,
77
+ `${tool} ${requirements.harnessVersion}`,
78
+ status(row.missingRequirements.find((missing) => missing.type !== "command")),
79
+ ]);
80
+ }
81
+ }
82
+ if (!lines.length) {
83
+ return [];
84
+ }
85
+ return [
86
+ "",
87
+ dim("Requirements"),
88
+ ...table(lines),
89
+ ...[...fixes].map((fix) => ` ${dim("Fix:")} ${fix}, then run ${bold("barndog sync")}`),
90
+ ];
91
+ }
92
+ /** What the author wrote about partial support, or that they wrote nothing. */
93
+ function noteLines(rows) {
94
+ const notes = rows.flatMap((row) => {
95
+ const text = row.implementation?.notes?.trim();
96
+ if (text) {
97
+ return [[adapters[row.harness].name, text]];
98
+ }
99
+ return row.status === "partial"
100
+ ? [
101
+ [
102
+ adapters[row.harness].name,
103
+ dim("The author marked this partial but didn't say what's missing."),
104
+ ],
105
+ ]
106
+ : [];
107
+ });
108
+ if (!notes.length) {
109
+ return [];
110
+ }
111
+ return [
112
+ "",
113
+ dim("Author's notes"),
114
+ ...table(notes.map(([tool = "", text = ""]) => [bold(tool), text])),
115
+ ];
10
116
  }
11
117
  /**
12
- * Returns Hook support and runtime-readiness table lines, abbreviating content
13
- * hashes to seven characters.
118
+ * A Hook in each tool BarnDog manages: what the author declares, whether this
119
+ * machine can run it, its events, requirements and the author's notes.
120
+ */
121
+ export function renderHookTools(name, rows) {
122
+ const missing = rows.filter((row) => row.status === "unsupported");
123
+ const partial = rows.some((row) => row.status === "partial");
124
+ return [
125
+ dim("Tools"),
126
+ ...table(rows.map((row) => [
127
+ adapters[row.harness].name,
128
+ authorSays(row),
129
+ onThisMachine(row),
130
+ row.implementation
131
+ ? Object.keys(row.implementation.events).join(", ")
132
+ : dim("—"),
133
+ ]), { header: ["Tool", "Author says", "On this machine", "Events"] }),
134
+ ...requirementLines(rows),
135
+ ...noteLines(rows),
136
+ ...(partial
137
+ ? [
138
+ "",
139
+ dim("partial: the author says only part of this Hook works in that tool."),
140
+ ]
141
+ : []),
142
+ ...(missing.length
143
+ ? [
144
+ "",
145
+ `${dim(`No ${missing.map((row) => adapters[row.harness].name).join(" or ")} version yet.`)} ${hint(`barndog hooks adapt ${name} --for ${missing.map((row) => row.harness).join(" ")}`, "Tip")}`,
146
+ ]
147
+ : []),
148
+ ];
149
+ }
150
+ /**
151
+ * Returns a Hook's version, then its support and readiness per tool,
152
+ * abbreviating content hashes to seven characters.
14
153
  */
15
154
  export function renderHookCompatibility(name, result) {
16
- const missing = result.compatibility
17
- .filter((row) => row.status === "unsupported")
18
- .map((row) => row.harness);
19
155
  return [
20
156
  // A content hash is long; its first 7 characters identify it, as Git shows them.
21
157
  ...fields([
@@ -26,16 +162,34 @@ export function renderHookCompatibility(name, result) {
26
162
  : result.version.slice(0, SHORT_COMMIT_LENGTH),
27
163
  ],
28
164
  ]),
29
- ...table(result.compatibility.map((row) => [
30
- row.harness,
31
- row.status === "supported" ? row.status : dim(row.status),
32
- runtimeLabel(row.status, row.runtimeIssue),
33
- ]), { header: ["Tool", "Support", "Ready on this machine"], indent: 0 }),
34
- ...(missing.length
35
- ? [
36
- "",
37
- `${dim(`No ${missing.join(" or ")} version yet.`)} ${hint(`barndog hooks adapt ${name} --for ${missing.join(" ")}`, "Tip")}`,
38
- ]
39
- : []),
165
+ "",
166
+ ...renderHookTools(name, result.compatibility),
167
+ ];
168
+ }
169
+ /** Every selected Hook against every tool BarnDog manages, with what each mark means. */
170
+ export function renderHookMatrix(rows) {
171
+ if (!rows.length) {
172
+ return [dim("No Hooks are selected on this machine.")];
173
+ }
174
+ const tools = hookHarnesses.filter((harness) => rows.some((row) => row.compatibility.some((c) => c.harness === harness)));
175
+ return [
176
+ ...table(rows.map((row) => [
177
+ bold(row.name),
178
+ ...tools.map((harness) => matrixCell(row.compatibility.find((c) => c.harness === harness))),
179
+ ]), { header: ["Hook", ...tools.map((harness) => adapters[harness].name)] }),
180
+ "",
181
+ ...table([
182
+ [
183
+ dim("—"),
184
+ dim("not written for that tool, so BarnDog doesn't install it there"),
185
+ ],
186
+ [
187
+ dim("partial"),
188
+ dim("the author says only part of it works in that tool"),
189
+ ],
190
+ [dim("can't run"), dim("this machine is missing something it needs")],
191
+ ]),
192
+ "",
193
+ ` ${hint("barndog hooks show <name>", "Tip")}${dim(" for requirements and the author's notes")}`,
40
194
  ];
41
195
  }
package/dist/ui/mcp.js CHANGED
@@ -1,7 +1,12 @@
1
1
  import { SHORT_COMMIT_LENGTH } from "../shared/constants.js";
2
+ import { only } from "../shared/lookup.js";
3
+ import confirm from "@inquirer/confirm";
2
4
  import { mcpDefinitionSchema } from "@barndog-ai/api-contract";
3
5
  import { z } from "zod";
4
- import { clean, fields, originLabel, renderValue } from "./format.js";
6
+ import { CliError } from "../errors.js";
7
+ import { bold, clean, dim, fields, hint, originLabel, renderValue, table, warn, } from "./format.js";
8
+ import { promptTheme } from "./theme.js";
9
+ import { LOCAL_ORIGIN } from "../features/workspace/overlay.js";
5
10
  const shownMcpSchema = z.looseObject({
6
11
  name: z.string(),
7
12
  origin: z.union([
@@ -18,12 +23,100 @@ const shownMcpSchema = z.looseObject({
18
23
  z.looseObject({ number: z.number(), definition: mcpDefinitionSchema }),
19
24
  ]),
20
25
  definition: mcpDefinitionSchema.optional(),
26
+ /** Variables BarnDog keeps a value for, or reads from another variable. */
27
+ keptVariables: z
28
+ .array(z.object({ variable: z.string(), from: z.string().optional() }))
29
+ .optional(),
30
+ /** Variables it refers to that have no value on this machine. */
31
+ unsetVariables: z.array(z.string()).optional(),
21
32
  });
22
33
  const signIn = {
23
34
  none: "none",
24
35
  environment: "environment variables",
25
36
  "native-oauth": "OAuth, through each coding tool",
26
37
  };
38
+ /** How to sign in to each local server that signs in through its coding tools: one `mcp auth` per tool. */
39
+ export function renderSignIn(signIns) {
40
+ return signIns.flatMap(({ server, harnesses }) => {
41
+ const tools = harnesses.length ? harnesses : ["<tool>"];
42
+ return [
43
+ `${warn("!")} ${bold(clean(server))} signs in through each coding tool. Sign in once in each:`,
44
+ ...tools.map((tool) => ` ${bold(`barndog mcp auth ${clean(server)} --origin ${LOCAL_ORIGIN} --harness ${tool}`)}`),
45
+ ];
46
+ });
47
+ }
48
+ /**
49
+ * Where each literal MCP value went: one sentence for the values BarnDog keeps
50
+ * and one for those the developer has to set, each over a column of variables
51
+ * grouped by server.
52
+ */
53
+ export function renderMcpValues(values) {
54
+ const column = (kept) => {
55
+ const rows = [];
56
+ let previous;
57
+ for (const value of values.filter((v) => v.kept === kept)) {
58
+ rows.push([
59
+ value.server === previous ? "" : bold(clean(value.server)),
60
+ clean(value.variable),
61
+ ]);
62
+ previous = value.server;
63
+ }
64
+ return rows;
65
+ };
66
+ const kept = column(true);
67
+ const unset = column(false);
68
+ const output = [];
69
+ if (kept.length) {
70
+ output.push("", "BarnDog keeps these values in ~/.barndog/secrets.json, on this machine only and never uploaded, and writes them into your coding tools:", ...table(kept));
71
+ }
72
+ if (unset.length) {
73
+ output.push("", `${warn("!")} BarnDog doesn't keep these values. Set each in your environment, or keep it with ${bold("barndog mcp env set <server> <variable>")}:`, ...table(unset));
74
+ }
75
+ return output;
76
+ }
77
+ /** A variable whose value BarnDog keeps, as `mcp show` lists it. */
78
+ const KEPT_BY_BARNDOG = "kept by BarnDog";
79
+ /** What "kept by BarnDog" means, under the variables when any is. */
80
+ const KEPT_NOTE = "BarnDog keeps these values in ~/.barndog/secrets.json, on this machine only and never uploaded, and writes them into each coding tool's settings.";
81
+ /**
82
+ * One warning for all of a server's variables with no value here (the
83
+ * variables table above it marks which), and the
84
+ * `mcp env set` that fixes them: naming the variable when there's one, else
85
+ * letting the person pick each from a list.
86
+ */
87
+ function unsetProblem(server, variables) {
88
+ if (!variables.length) {
89
+ return [];
90
+ }
91
+ const single = only(variables);
92
+ const warning = single
93
+ ? `${bold(single)} has no value here, so ${server} can't use it.`
94
+ : `${variables.length} variables have no value here, so ${server} can't use them.`;
95
+ const fix = single
96
+ ? `barndog mcp env set ${server} ${single}`
97
+ : `barndog mcp env set ${server}`;
98
+ return ["", `${warn("!")} ${warning}`, ` ${hint(fix, "Fix")}`];
99
+ }
100
+ /**
101
+ * A note per listed MCP server with variables that have no value here, with
102
+ * the `mcp env set` that fixes them.
103
+ */
104
+ export function unsetVariableNotes(items) {
105
+ return items.flatMap(({ installedName: name, unsetVariables: variables }) => {
106
+ if (!variables?.length) {
107
+ return [];
108
+ }
109
+ const single = only(variables);
110
+ const fix = single
111
+ ? `barndog mcp env set ${clean(name)} ${clean(single)}`
112
+ : `barndog mcp env set ${clean(name)}`;
113
+ return [
114
+ "",
115
+ `${warn("!")} ${bold(clean(name))} can't use ${variables.map((variable) => bold(clean(variable))).join(", ")}: no value here.`,
116
+ ` ${hint(fix, "Fix")}`,
117
+ ];
118
+ });
119
+ }
27
120
  /** An MCP configuration as a person reads it; secret references print by name. */
28
121
  export function renderMcp(value) {
29
122
  const shown = shownMcpSchema.safeParse(value);
@@ -39,27 +132,79 @@ export function renderMcp(value) {
39
132
  const references = definition.transport === "stdio"
40
133
  ? definition.environment
41
134
  : definition.headers;
42
- const variables = Object.entries(references).map(([key, reference]) => `${clean(key)} from $${reference.secretRef}`);
43
- return fields([
44
- ["Name", clean(mcp.name)],
45
- [
46
- "Origin",
47
- typeof mcp.origin === "string" ? mcp.origin : originLabel(mcp.origin),
48
- ],
49
- [
50
- "Version",
51
- typeof mcp.version === "object"
52
- ? `v${mcp.version.number}`
53
- : mcp.version.slice(0, SHORT_COMMIT_LENGTH),
54
- ],
55
- ["Description", clean(definition.description)],
56
- [
57
- "Connects to",
58
- definition.transport === "http"
59
- ? clean(definition.url)
60
- : clean([definition.command, ...definition.args].join(" ")),
61
- ],
62
- ["Sign-in", signIn[definition.authentication]],
63
- ["Variables", variables.join(", ")],
64
- ]);
135
+ const unset = mcp.unsetVariables ?? [];
136
+ const kept = new Map((mcp.keptVariables ?? []).map((row) => [row.variable, row.from]));
137
+ // A kept `from` is a variable to read; only a kept value is BarnDog's own.
138
+ const keptValue = (secretRef) => kept.has(secretRef) && !kept.get(secretRef);
139
+ const valueSources = Object.entries(references).map(([key, { secretRef }]) => {
140
+ const source = keptValue(secretRef)
141
+ ? KEPT_BY_BARNDOG
142
+ : `from $${clean(kept.get(secretRef) ?? secretRef)}`;
143
+ return [
144
+ clean(key),
145
+ unset.includes(secretRef) ? `${source} ${warn("(not set)")}` : source,
146
+ ];
147
+ });
148
+ const keepsAny = Object.values(references).some(({ secretRef }) => keptValue(secretRef));
149
+ const variableTable = valueSources.length
150
+ ? [
151
+ "",
152
+ ...table(valueSources, { header: ["Variable", "Value"], indent: 0 }),
153
+ ...(keepsAny ? ["", dim(KEPT_NOTE)] : []),
154
+ ]
155
+ : [];
156
+ const problems = unsetProblem(clean(mcp.name), unset.map(clean));
157
+ return [
158
+ ...fields([
159
+ ["Name", clean(mcp.name)],
160
+ [
161
+ "Origin",
162
+ typeof mcp.origin === "string" ? mcp.origin : originLabel(mcp.origin),
163
+ ],
164
+ [
165
+ "Version",
166
+ typeof mcp.version === "object"
167
+ ? `v${mcp.version.number}`
168
+ : mcp.version.slice(0, SHORT_COMMIT_LENGTH),
169
+ ],
170
+ ["Description", clean(definition.description)],
171
+ [
172
+ "Connects to",
173
+ definition.transport === "http"
174
+ ? clean(definition.url)
175
+ : clean([definition.command, ...definition.args].join(" ")),
176
+ ],
177
+ ["Sign-in", signIn[definition.authentication]],
178
+ ]),
179
+ ...variableTable,
180
+ ...problems,
181
+ ];
182
+ }
183
+ /** One warning per MCP server whose URL has query parameters, naming them but never their values. */
184
+ export function renderUrlQueries(servers) {
185
+ return servers.map((server) => `${warn("!")} ${bold(server.name)}'s URL has query parameters: ${server.parameters.join(", ")}.`);
186
+ }
187
+ /** Said before adding servers with a query string to the local folder. */
188
+ export const LOCAL_URL_QUERY = "A query string can hold sensitive data, such as an API key. BarnDog keeps the URL as written: it stays on this machine and works as is.";
189
+ const askToShare = (message) => confirm({ message, default: false, theme: promptTheme });
190
+ /**
191
+ * How a command that shares assets beyond this machine asks about MCP servers
192
+ * whose URL has a query string: `--allow-url-query` shares them, a terminal
193
+ * asks (no by default), and anything else is refused with that flag as the fix.
194
+ */
195
+ export function confirmSharingUrlQuery(options) {
196
+ return async (servers) => {
197
+ if (options.allowed) {
198
+ return true;
199
+ }
200
+ const one = servers.length === 1;
201
+ if (!options.interactive) {
202
+ throw new CliError(`${servers.map((server) => server.name).join(", ")} ${one ? "has a URL" : "have URLs"} with query parameters, which can hold sensitive data such as an API key, and sharing shows ${one ? "it" : "them"} to everyone who can see the destination.`, options.fix);
203
+ }
204
+ for (const line of renderUrlQueries(servers)) {
205
+ options.write(line);
206
+ }
207
+ options.write(dim("A query string can hold sensitive data, such as an API key. Sharing keeps the URL as written, so everyone who can see the destination can read it."));
208
+ return (options.ask ?? askToShare)(`Share ${one ? "it" : "them"} anyway?`);
209
+ };
65
210
  }
package/dist/ui/move.js CHANGED
@@ -5,17 +5,18 @@ import { promptTheme } from "./theme.js";
5
5
  /** The local assets `local move` can take: valid, and not already moving. */
6
6
  export function pickLocalAssets(local) {
7
7
  return pickMany("Which local assets should move?", local.assets
8
- .filter((asset) => asset.state === "active")
8
+ .filter((asset) => asset.state === "available")
9
9
  .map((asset) => ({
10
10
  value: asset.name,
11
11
  name: asset.name,
12
- hint: asset.kind,
12
+ columns: [dim(asset.kind)],
13
13
  })), { empty: "No local assets can be moved." });
14
14
  }
15
15
  /** True keeps separate local copies; false makes the shared copies the only ones. */
16
16
  export function chooseKeepLocal(count) {
17
17
  const them = count === 1 ? "it" : "them";
18
18
  return select({
19
+ loop: false,
19
20
  message: `Move ${them}, or share a copy and keep ${them} here too?`,
20
21
  choices: [
21
22
  {
@@ -1,3 +1,4 @@
1
+ import { confirmSharingUrlQuery } from "./mcp.js";
1
2
  import { environmentChooser } from "./environment-onboarding.js";
2
3
  import { authStatus, configuredServer } from "../features/auth/session.js";
3
4
  import { chooseConnection, chooseLocalAssets, chooseMoveTarget, } from "./connection.js";
@@ -293,7 +294,7 @@ export async function runSetup(options) {
293
294
  },
294
295
  apply: connected
295
296
  ? async (settings) => {
296
- for (const line of renderSyncOutput(await synchronize(undefined, options.runtime, settings))) {
297
+ for (const line of renderSyncOutput(await synchronize(undefined, options.runtime, settings), options.runtime)) {
297
298
  write(line);
298
299
  }
299
300
  }
@@ -315,7 +316,15 @@ export async function runSetup(options) {
315
316
  ? await (options.chooseMoveTarget ?? chooseMoveTarget)(await cloudMoveTargets(options.runtime))
316
317
  : undefined;
317
318
  write("");
318
- for (const line of renderMove(await moveLocalAssets({ to, keepLocal: localChoice === "copy" }, options.runtime))) {
319
+ for (const line of renderMove(await moveLocalAssets({
320
+ to,
321
+ keepLocal: localChoice === "copy",
322
+ confirmUrlQuery: confirmSharingUrlQuery({
323
+ interactive: true,
324
+ write,
325
+ fix: "barndog local move --all --allow-url-query",
326
+ }),
327
+ }, options.runtime))) {
319
328
  write(line);
320
329
  }
321
330
  }