workermill 0.4.1 → 0.4.2
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 +41 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -118,12 +118,14 @@ async function getApiKey(rl, provider, existingKeys) {
|
|
|
118
118
|
existingKeys.set(provider.name, key2);
|
|
119
119
|
return key2;
|
|
120
120
|
}
|
|
121
|
-
|
|
121
|
+
rl.pause();
|
|
122
|
+
const key = await readKeyMasked(chalk.dim(` ${provider.display} API key: `));
|
|
123
|
+
rl.resume();
|
|
122
124
|
const trimmed = key.trim();
|
|
123
125
|
existingKeys.set(provider.name, trimmed);
|
|
124
126
|
return trimmed;
|
|
125
127
|
}
|
|
126
|
-
function readKeyMasked(
|
|
128
|
+
function readKeyMasked(prompt) {
|
|
127
129
|
return new Promise((resolve) => {
|
|
128
130
|
let buffer = "";
|
|
129
131
|
let revealed = false;
|
|
@@ -1575,7 +1577,13 @@ function StatusBar(props) {
|
|
|
1575
1577
|
break;
|
|
1576
1578
|
}
|
|
1577
1579
|
const bgColor = theme.subtleDark;
|
|
1578
|
-
const
|
|
1580
|
+
const rm = props.roleModels;
|
|
1581
|
+
const workerStr = rm?.worker || `${props.provider}/${props.model}`;
|
|
1582
|
+
const extraRoles = [];
|
|
1583
|
+
if (rm && rm.planner !== rm.worker) extraRoles.push(`plan:${rm.planner}`);
|
|
1584
|
+
if (rm && rm.reviewer !== rm.worker) extraRoles.push(`review:${rm.reviewer}`);
|
|
1585
|
+
const rolesStr = extraRoles.length > 0 ? ` (${extraRoles.join(", ")})` : "";
|
|
1586
|
+
const modelStr = ` ${workerStr}${rolesStr} `;
|
|
1579
1587
|
const pct = props.maxContext > 0 ? Math.round(usage * 100) : 0;
|
|
1580
1588
|
const tokenStr = ` ${pct}% `;
|
|
1581
1589
|
const costStr = formatCost(props.cost);
|
|
@@ -1735,7 +1743,8 @@ function App(props) {
|
|
|
1735
1743
|
cost: props.cost,
|
|
1736
1744
|
mode,
|
|
1737
1745
|
gitBranch: props.gitBranch,
|
|
1738
|
-
cwd: props.workingDir.split("/").pop() || ""
|
|
1746
|
+
cwd: props.workingDir.split("/").pop() || "",
|
|
1747
|
+
roleModels: props.roleModels
|
|
1739
1748
|
}
|
|
1740
1749
|
),
|
|
1741
1750
|
/* @__PURE__ */ jsx6(
|
|
@@ -2155,27 +2164,44 @@ ${trimmedOutput}
|
|
|
2155
2164
|
tokens: agent.tokens,
|
|
2156
2165
|
cost: agent.cost,
|
|
2157
2166
|
gitBranch,
|
|
2158
|
-
inputHistory
|
|
2167
|
+
inputHistory,
|
|
2168
|
+
roleModels: props.roleModels
|
|
2159
2169
|
}
|
|
2160
2170
|
);
|
|
2161
2171
|
}
|
|
2162
2172
|
|
|
2163
2173
|
// src/index.ts
|
|
2164
|
-
function
|
|
2174
|
+
function getRoleModelsFromConfig(config) {
|
|
2175
|
+
const worker = getProviderForPersona(config);
|
|
2176
|
+
const planner = getProviderForPersona(config, "planner");
|
|
2177
|
+
const reviewer = getProviderForPersona(config, "tech_lead");
|
|
2178
|
+
return {
|
|
2179
|
+
worker: `${worker.provider}/${worker.model}`,
|
|
2180
|
+
planner: `${planner.provider}/${planner.model}`,
|
|
2181
|
+
reviewer: `${reviewer.provider}/${reviewer.model}`
|
|
2182
|
+
};
|
|
2183
|
+
}
|
|
2184
|
+
function printWelcome(roleModels, workingDir) {
|
|
2165
2185
|
const brand = chalk2.hex("#D77757");
|
|
2166
2186
|
const dim = chalk2.dim;
|
|
2167
2187
|
const white = chalk2.white;
|
|
2168
2188
|
console.log();
|
|
2169
2189
|
console.log(` ${brand("\u25C6")} ${white.bold("WorkerMill")} ${dim("v" + VERSION)}`);
|
|
2170
2190
|
console.log();
|
|
2171
|
-
|
|
2191
|
+
if (roleModels.planner === roleModels.worker && roleModels.reviewer === roleModels.worker) {
|
|
2192
|
+
console.log(dim(` ${roleModels.worker}`));
|
|
2193
|
+
} else {
|
|
2194
|
+
console.log(dim(` worker: ${roleModels.worker}`));
|
|
2195
|
+
console.log(dim(` planner: ${roleModels.planner}`));
|
|
2196
|
+
console.log(dim(` reviewer: ${roleModels.reviewer}`));
|
|
2197
|
+
}
|
|
2172
2198
|
console.log(dim(` cwd: ${workingDir}`));
|
|
2173
2199
|
console.log();
|
|
2174
2200
|
console.log(dim(" Ask me anything, or use ") + brand("/build") + dim(" to create software with multi-expert AI."));
|
|
2175
2201
|
console.log(dim(" Type ") + white("/help") + dim(" for all commands."));
|
|
2176
2202
|
console.log();
|
|
2177
2203
|
}
|
|
2178
|
-
var VERSION = "0.4.
|
|
2204
|
+
var VERSION = "0.4.2";
|
|
2179
2205
|
function addSharedOptions(cmd) {
|
|
2180
2206
|
return cmd.option("--provider <provider>", "Override default provider").option("--model <model>", "Override model").option("--trust", "Skip all tool permission prompts").option("--full-disk", "Allow tools to access files outside working directory");
|
|
2181
2207
|
}
|
|
@@ -2200,7 +2226,8 @@ var defaultCmd = program.command("chat", { isDefault: true }).description("Inter
|
|
|
2200
2226
|
const config = await resolveConfig(options);
|
|
2201
2227
|
const { provider, model, apiKey, host, contextLength } = getProviderForPersona(config);
|
|
2202
2228
|
const workingDir = process.cwd();
|
|
2203
|
-
|
|
2229
|
+
const roleModels = getRoleModelsFromConfig(config);
|
|
2230
|
+
printWelcome(roleModels, workingDir);
|
|
2204
2231
|
const { waitUntilExit } = render(
|
|
2205
2232
|
React5.createElement(Root, {
|
|
2206
2233
|
provider,
|
|
@@ -2212,7 +2239,8 @@ var defaultCmd = program.command("chat", { isDefault: true }).description("Inter
|
|
|
2212
2239
|
planMode: options.plan || false,
|
|
2213
2240
|
sandboxed: !options.fullDisk,
|
|
2214
2241
|
resume: options.resume || false,
|
|
2215
|
-
workingDir
|
|
2242
|
+
workingDir,
|
|
2243
|
+
roleModels
|
|
2216
2244
|
})
|
|
2217
2245
|
);
|
|
2218
2246
|
await waitUntilExit();
|
|
@@ -2232,6 +2260,7 @@ var buildCmd = program.command("build [task...]").description("Build software wi
|
|
|
2232
2260
|
config.review = { ...config.review, useCritic: true };
|
|
2233
2261
|
}
|
|
2234
2262
|
const { provider, model, apiKey, host, contextLength } = getProviderForPersona(config);
|
|
2263
|
+
const roleModels = getRoleModelsFromConfig(config);
|
|
2235
2264
|
const trustAll = options.trust || false;
|
|
2236
2265
|
const sandboxed = !options.fullDisk;
|
|
2237
2266
|
if (apiKey) {
|
|
@@ -2257,7 +2286,8 @@ var buildCmd = program.command("build [task...]").description("Build software wi
|
|
|
2257
2286
|
sandboxed,
|
|
2258
2287
|
resume: false,
|
|
2259
2288
|
workingDir: process.cwd(),
|
|
2260
|
-
initialBuildTask: task
|
|
2289
|
+
initialBuildTask: task,
|
|
2290
|
+
roleModels
|
|
2261
2291
|
})
|
|
2262
2292
|
);
|
|
2263
2293
|
await waitUntilExit();
|