openmill 0.1.0 → 0.2.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.
- package/README.md +5 -3
- package/dist/bin/openmill.mjs +94 -29
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ This works the same on macOS, Linux, and Windows. It:
|
|
|
31
31
|
4. installs the openmill Claude plugin, which has the workflow skill and review agents, from a
|
|
32
32
|
local marketplace in `~/.openmill/plugin`
|
|
33
33
|
5. stops a running server from an older version, so the next command starts the new one
|
|
34
|
-
6. asks for `concurrency` and `
|
|
34
|
+
6. asks for `concurrency`, `model`, and `effort`
|
|
35
35
|
|
|
36
36
|
Pass `--yes` to skip the prompts and keep the defaults. To upgrade, run
|
|
37
37
|
`npx openmill@latest install`.
|
|
@@ -53,6 +53,7 @@ openmill show login # worktree, session, and a resume command
|
|
|
53
53
|
openmill stop login # abort the headless run so you can take over
|
|
54
54
|
openmill requeue login # hand the job back to the queue
|
|
55
55
|
openmill config set concurrency 3
|
|
56
|
+
openmill config unset model # back to the default
|
|
56
57
|
openmill server status
|
|
57
58
|
```
|
|
58
59
|
|
|
@@ -115,8 +116,9 @@ publisher for a package that exists:
|
|
|
115
116
|
|
|
116
117
|
```sh
|
|
117
118
|
pnpm build
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
cd apps/cli
|
|
120
|
+
pnpm pack
|
|
121
|
+
npm publish openmill-0.1.0.tgz --access public
|
|
120
122
|
```
|
|
121
123
|
|
|
122
124
|
Then, on npmjs.com, open the package settings and add a trusted publisher. Use the GitHub
|
package/dist/bin/openmill.mjs
CHANGED
|
@@ -321,7 +321,7 @@ function jobsToStart(graph, jobs, slots) {
|
|
|
321
321
|
}
|
|
322
322
|
// package.json
|
|
323
323
|
var name = "openmill";
|
|
324
|
-
var version = "0.1
|
|
324
|
+
var version = "0.2.1";
|
|
325
325
|
var description = "A local software factory that turns design docs into pull requests.";
|
|
326
326
|
// ../server/src/config-store.ts
|
|
327
327
|
async function readConfig(path) {
|
|
@@ -540,6 +540,10 @@ function createApp(mill, { version, onShutdown }) {
|
|
|
540
540
|
const parsed = parseConfigValue(key, value);
|
|
541
541
|
if (!parsed.ok) throw new ApiError(400, parsed.error);
|
|
542
542
|
return c.json({ config: await mill.setConfig(key, parsed.value) });
|
|
543
|
+
}).delete("/config/:key", async (c) => {
|
|
544
|
+
const key = c.req.param("key");
|
|
545
|
+
if (!isConfigKey(key)) throw new ApiError(400, `unknown config key ${key}`);
|
|
546
|
+
return c.json({ config: await mill.setConfig(key, void 0) });
|
|
543
547
|
});
|
|
544
548
|
}
|
|
545
549
|
// ../server/src/exec.ts
|
|
@@ -607,17 +611,19 @@ function loadClaudeAgents() {
|
|
|
607
611
|
return agents;
|
|
608
612
|
}
|
|
609
613
|
// ../server/src/harness/prompt.ts
|
|
614
|
+
const CONCLUDE = "Before you report the result, write your conclusion as a normal message so a human who resumes this session can read why you stopped.";
|
|
610
615
|
function startPrompt(input) {
|
|
611
616
|
const facts = [
|
|
612
617
|
input.projectPath ? `The project overview is at ${input.projectPath}.` : void 0,
|
|
613
618
|
`You are already in your worktree on branch ${input.branch}, so don't create another branch or worktree.`,
|
|
614
619
|
`Open the draft PR against ${input.prBaseBranch}.`,
|
|
615
|
-
"No human is present. Wherever the skill says to ask or tell the user, stop and report needs_input with the question as reason."
|
|
620
|
+
"No human is present. Wherever the skill says to ask or tell the user, stop and report needs_input with the question as reason.",
|
|
621
|
+
CONCLUDE
|
|
616
622
|
].filter(Boolean);
|
|
617
623
|
return `/${PLUGIN_NAME}:${WORKFLOW_SKILL} ${input.docPath}\n\n${facts.map((fact) => `- ${fact}`).join("\n")}\n`;
|
|
618
624
|
}
|
|
619
|
-
const HANDBACK_MESSAGE =
|
|
620
|
-
const RESTART_MESSAGE =
|
|
625
|
+
const HANDBACK_MESSAGE = `openmill handed this job back to you after a human worked on it. Check the worktree and the conversation, continue the workflow until the draft PR is open, then report the result. ${CONCLUDE}`;
|
|
626
|
+
const RESTART_MESSAGE = `The openmill server restarted while you were working. Check the worktree, continue the workflow from where you stopped, then report the result. ${CONCLUDE}`;
|
|
621
627
|
// ../server/src/harness/types.ts
|
|
622
628
|
const RUN_STATUSES = [
|
|
623
629
|
"done",
|
|
@@ -1720,27 +1726,71 @@ async function stopRunningServer(options) {
|
|
|
1720
1726
|
await stopServer(client);
|
|
1721
1727
|
return "stopped";
|
|
1722
1728
|
}
|
|
1723
|
-
const
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1729
|
+
const MODELS = [
|
|
1730
|
+
{
|
|
1731
|
+
value: "claude-opus-5-5",
|
|
1732
|
+
label: "Opus 5.5"
|
|
1733
|
+
},
|
|
1734
|
+
{
|
|
1735
|
+
value: "claude-sonnet-5-5",
|
|
1736
|
+
label: "Sonnet 5.5"
|
|
1737
|
+
},
|
|
1738
|
+
{
|
|
1739
|
+
value: "claude-haiku-5-5",
|
|
1740
|
+
label: "Haiku 5.5"
|
|
1741
|
+
},
|
|
1742
|
+
{
|
|
1743
|
+
value: "claude-fable-5-2",
|
|
1744
|
+
label: "Fable 5.2"
|
|
1745
|
+
}
|
|
1746
|
+
];
|
|
1747
|
+
const DEFAULT_MODEL = "";
|
|
1748
|
+
const OTHER_MODEL = "other";
|
|
1730
1749
|
async function promptConfig(path) {
|
|
1731
1750
|
const current = await readConfig(path);
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1751
|
+
const concurrency = parseConfigValue("concurrency", answer(await p.text({
|
|
1752
|
+
message: "How many jobs can run at once?",
|
|
1753
|
+
initialValue: String(current.concurrency),
|
|
1754
|
+
validate: (input = "") => {
|
|
1755
|
+
const parsed = parseConfigValue("concurrency", input);
|
|
1756
|
+
return parsed.ok ? void 0 : parsed.error;
|
|
1757
|
+
}
|
|
1758
|
+
})));
|
|
1759
|
+
if (concurrency.ok) await writeConfigValue(path, "concurrency", concurrency.value);
|
|
1760
|
+
const custom = current.model && !MODELS.some((model) => model.value === current.model) ? [{
|
|
1761
|
+
value: current.model,
|
|
1762
|
+
label: current.model
|
|
1763
|
+
}] : [];
|
|
1764
|
+
let model = answer(await p.select({
|
|
1765
|
+
message: "Which model should agents use?",
|
|
1766
|
+
options: [
|
|
1767
|
+
{
|
|
1768
|
+
value: DEFAULT_MODEL,
|
|
1769
|
+
label: "Harness default"
|
|
1770
|
+
},
|
|
1771
|
+
...custom,
|
|
1772
|
+
...MODELS,
|
|
1773
|
+
{
|
|
1774
|
+
value: OTHER_MODEL,
|
|
1775
|
+
label: "Other",
|
|
1776
|
+
hint: "type a model id"
|
|
1739
1777
|
}
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1778
|
+
],
|
|
1779
|
+
initialValue: current.model ?? DEFAULT_MODEL
|
|
1780
|
+
}));
|
|
1781
|
+
if (model === OTHER_MODEL) model = answer(await p.text({
|
|
1782
|
+
message: "Model id",
|
|
1783
|
+
validate: (input = "") => {
|
|
1784
|
+
const parsed = parseConfigValue("model", input);
|
|
1785
|
+
return parsed.ok ? void 0 : parsed.error;
|
|
1786
|
+
}
|
|
1787
|
+
})).trim();
|
|
1788
|
+
await writeConfigValue(path, "model", model === DEFAULT_MODEL ? void 0 : model);
|
|
1789
|
+
await writeConfigValue(path, "effort", answer(await p.select({
|
|
1790
|
+
message: "How much effort should agents spend?",
|
|
1791
|
+
options: EFFORTS.map((value) => ({ value })),
|
|
1792
|
+
initialValue: current.effort
|
|
1793
|
+
})));
|
|
1744
1794
|
}
|
|
1745
1795
|
async function install(options) {
|
|
1746
1796
|
const paths = resolvePaths();
|
|
@@ -1828,6 +1878,17 @@ async function unwrap(response) {
|
|
|
1828
1878
|
}
|
|
1829
1879
|
return body;
|
|
1830
1880
|
}
|
|
1881
|
+
function fitLastColumn(header, rows) {
|
|
1882
|
+
const columns = process.stdout.isTTY ? process.stdout.columns : void 0;
|
|
1883
|
+
const last = header.length - 1;
|
|
1884
|
+
const used = header.slice(0, last).reduce((sum, title, column) => sum + Math.max(title.length, ...rows.map((row) => stripVTControlCharacters(row[column] ?? "").length)) + 2, 0);
|
|
1885
|
+
const room = columns ? Math.max(columns - used, header[last]?.length ?? 0) : 1e400;
|
|
1886
|
+
return rows.map((row) => {
|
|
1887
|
+
const text = (row[last] ?? "").replace(/\s+/g, " ").trim();
|
|
1888
|
+
const cell = text.length > room ? `${text.slice(0, room - 1)}…` : text;
|
|
1889
|
+
return [...row.slice(0, last), cell];
|
|
1890
|
+
});
|
|
1891
|
+
}
|
|
1831
1892
|
function table(header, rows) {
|
|
1832
1893
|
const widths = header.map((title, column) => Math.max(title.length, ...rows.map((row) => stripVTControlCharacters(row[column] ?? "").length)));
|
|
1833
1894
|
return [header.map((title) => pc.dim(title)), ...rows].map((row) => row.map((cell, column) => cell + " ".repeat((widths[column] ?? 0) - stripVTControlCharacters(cell).length)).join(" ").trimEnd()).join("\n");
|
|
@@ -1863,19 +1924,20 @@ program.command("add").description("queue design docs as jobs").argument("<paths
|
|
|
1863
1924
|
});
|
|
1864
1925
|
program.command("ls").description("list jobs").action(async () => {
|
|
1865
1926
|
const { jobs } = await unwrap((await connect()).jobs.$get());
|
|
1866
|
-
|
|
1927
|
+
const header = [
|
|
1867
1928
|
"ID",
|
|
1868
1929
|
"STATE",
|
|
1869
|
-
"REASON",
|
|
1870
1930
|
"SESSION",
|
|
1871
|
-
"PR"
|
|
1872
|
-
|
|
1931
|
+
"PR",
|
|
1932
|
+
"REASON"
|
|
1933
|
+
];
|
|
1934
|
+
console.log(table(header, fitLastColumn(header, jobs.map((job) => [
|
|
1873
1935
|
pc.bold(job.id),
|
|
1874
1936
|
state(job.state),
|
|
1875
|
-
job.reason ?? "",
|
|
1876
1937
|
pc.dim(job.sessionId ?? ""),
|
|
1877
|
-
job.prUrl ?? ""
|
|
1878
|
-
|
|
1938
|
+
job.prUrl ?? "",
|
|
1939
|
+
job.reason ?? ""
|
|
1940
|
+
]))));
|
|
1879
1941
|
});
|
|
1880
1942
|
program.command("show").description("show a job and how to resume its session").argument("<id>").action(async (id) => {
|
|
1881
1943
|
const job = await unwrap((await connect()).jobs[":id"].$get({
|
|
@@ -1922,6 +1984,9 @@ config.command("set").argument("<key>", CONFIG_KEYS.join(", ")).argument("<value
|
|
|
1922
1984
|
json: { value }
|
|
1923
1985
|
}));
|
|
1924
1986
|
});
|
|
1987
|
+
config.command("unset").description("remove a value so the default applies").argument("<key>", CONFIG_KEYS.join(", ")).action(async (key) => {
|
|
1988
|
+
await unwrap((await connect()).config[":key"].$delete({ param: { key } }));
|
|
1989
|
+
});
|
|
1925
1990
|
config.command("list").action(async () => {
|
|
1926
1991
|
const { config: values } = await unwrap((await connect()).config.$get());
|
|
1927
1992
|
console.log(table(["KEY", "VALUE"], CONFIG_KEYS.map((key) => [key, values[key] === void 0 ? pc.dim("(harness default)") : String(values[key])])));
|