mainflow 0.43.0-alpha.2 → 0.43.0-alpha.4
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/cli.js +2 -2
- package/dist/facts.js +1 -1
- package/dist/hooks.js +5 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1822,8 +1822,8 @@ function fail(message) {
|
|
|
1822
1822
|
console.error(message);
|
|
1823
1823
|
return 1;
|
|
1824
1824
|
}
|
|
1825
|
-
/** How the executor runs this CLI inside a hub; used in the texts hooks inject. */
|
|
1826
|
-
const CLI = "
|
|
1825
|
+
/** How the executor runs this CLI inside a hub, the global install; used in the texts hooks inject. */
|
|
1826
|
+
const CLI = "mainflow";
|
|
1827
1827
|
/** The session a command acts on: an explicit argument, then --session, then MAINFLOW_SESSION set by the SessionStart hook. */
|
|
1828
1828
|
function sessionOf(opts, arg) {
|
|
1829
1829
|
const id = arg ?? opts.session ?? process.env.MAINFLOW_SESSION;
|
package/dist/facts.js
CHANGED
|
@@ -721,7 +721,7 @@ const FIELDS = {
|
|
|
721
721
|
field("order", false, "在主脈絡內的順序,小的在前"),
|
|
722
722
|
field("dependsOn", false, "開始前必須先完成的任務"),
|
|
723
723
|
field("repo", false, "主要動到的倉庫,名稱需在 config.yaml 登記"),
|
|
724
|
-
field("touches", false, "預計會改到的路徑或 glob 清單,相對於 repo
|
|
724
|
+
field("touches", false, "預計會改到的路徑或 glob 清單,相對於 repo 的根目錄。開場簡報只用它列出兩條進行中主脈絡的未結束任務在同一個 repo 重疊的路徑。check 不警告重疊,重疊由提交時兩邊的會話協調,不必記 depends-on。有 touches 卻沒填 repo 時路徑不會被比對,check 會列警告"),
|
|
725
725
|
field("startedAt", false, "第一次轉為 doing 時由 CLI 寫入"),
|
|
726
726
|
field("checklist", true, "checklist 項目清單,每項的欄位見 checklistItem"),
|
|
727
727
|
field("blockedBy", false, "卡住時的原因、等待對象與繼續的訊號,blocked 時必填;等待對象整串是參照時(例如 m031/t002)會檢查它存在"),
|
package/dist/hooks.js
CHANGED
|
@@ -137,8 +137,11 @@ const WRITE_TOOLS = /* @__PURE__ */ new Set([
|
|
|
137
137
|
"MultiEdit",
|
|
138
138
|
"NotebookEdit"
|
|
139
139
|
]);
|
|
140
|
-
/**
|
|
141
|
-
|
|
140
|
+
/**
|
|
141
|
+
* A Bash command that runs the mainflow CLI: the form the hook texts give, or a `mainflow` command word, starting a
|
|
142
|
+
* command after any variable assignments; one that is only an argument or part of a path does not count.
|
|
143
|
+
*/
|
|
144
|
+
const isMainflowCommand = (command, cli) => new RegExp(`(?:^|[;&|(])\\s*(?:\\w+=\\S*\\s+)*${cli.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\s+\\S`).test(command) || /(?:^|[;&|(])\s*(?:\w+=\S*\s+)*(?:pnpm\s+exec\s+|npx\s+)?mainflow\s+\S|(?:\.bin|mainflow\/dist)\/(?:cli\.js|mainflow)\b/.test(command);
|
|
142
145
|
/** Whether `path` is a file of a hub registered on this machine: it lies in that hub's data directory. */
|
|
143
146
|
const inHubData = (path, env) => hubHoldingFile(path, env) !== null;
|
|
144
147
|
/** A user record that holds what the user typed; tool results come back as user records too, but carry only tool_result blocks. */
|