mainflow 0.37.0 → 0.39.0

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.
@@ -15,7 +15,10 @@ declare const ID_PATTERNS: {
15
15
  readonly grant: RegExp;
16
16
  };
17
17
  declare const CHECKLIST_REF: RegExp;
18
- /** What an action may serve: a checklist item, or a mainline's criterion while the mainline has no task for it yet. */
18
+ /**
19
+ * What an action may serve: a checklist item, or a mainline's criterion while the mainline has no task for it yet,
20
+ * or a group's criterion (`w017#r001`).
21
+ */
19
22
  declare const SERVES_REF: RegExp;
20
23
  declare const SLUG: RegExp;
21
24
  /** One source the survey checks: the line's label, what it holds, and how it may be left unchecked. */
@@ -78,10 +81,6 @@ declare const mainlineSchema: z.ZodObject<{
78
81
  P3: "P3";
79
82
  }>>;
80
83
  group: z.ZodOptional<z.ZodString>;
81
- role: z.ZodOptional<z.ZodEnum<{
82
- impl: "impl";
83
- plan: "plan";
84
- }>>;
85
84
  due: z.ZodOptional<z.ZodString>;
86
85
  archivedAt: z.ZodOptional<z.ZodString>;
87
86
  criteria: z.ZodArray<z.ZodObject<{
@@ -423,8 +422,8 @@ declare const findingSchema: z.ZodObject<{
423
422
  }, z.core.$strip>;
424
423
  type Finding = z.infer<typeof findingSchema>;
425
424
  /**
426
- * Front matter of groups/w{NNN}-{slug}.md: mainlines and issues that belong together, such as a plan mainline with the
427
- * impl mainlines it split off, or the issues to take up together when a measurement is fixed. Membership is written
425
+ * Front matter of groups/w{NNN}-{slug}.md: mainlines and issues that belong together, such as the mainlines that split one
426
+ * piece of work, or the issues to take up together when a measurement is fixed. Membership is written
428
427
  * on each member (`group`), so a group file never lists its members and the two cannot disagree. A group is apart
429
428
  * from dependencies: depends-on between groups orders them, and priority and trigger say how urgent and when.
430
429
  */
@@ -463,6 +462,31 @@ declare const groupSchema: z.ZodObject<{
463
462
  P3: "P3";
464
463
  }>>;
465
464
  trigger: z.ZodOptional<z.ZodString>;
465
+ criteria: z.ZodOptional<z.ZodArray<z.ZodObject<{
466
+ text: z.ZodString;
467
+ doneWhen: z.ZodOptional<z.ZodString>;
468
+ done: z.ZodBoolean;
469
+ evidence: z.ZodOptional<z.ZodNullable<z.ZodString>>;
470
+ doneAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
471
+ dropped: z.ZodOptional<z.ZodBoolean>;
472
+ supersededBy: z.ZodOptional<z.ZodString>;
473
+ note: z.ZodOptional<z.ZodString>;
474
+ id: z.ZodString;
475
+ }, z.core.$strip>>>;
476
+ grants: z.ZodOptional<z.ZodArray<z.ZodObject<{
477
+ id: z.ZodString;
478
+ action: z.ZodEnum<{
479
+ commit: "commit";
480
+ "install-prompts": "install-prompts";
481
+ "merge-pr": "merge-pr";
482
+ publish: "publish";
483
+ push: "push";
484
+ release: "release";
485
+ "sync-hubs": "sync-hubs";
486
+ }>;
487
+ target: z.ZodString;
488
+ note: z.ZodOptional<z.ZodString>;
489
+ }, z.core.$strip>>>;
466
490
  }, z.core.$strip>;
467
491
  type Group = z.infer<typeof groupSchema>;
468
492
  /** One line of ops/{YYYY-MM}.log: an external operation, append-only. */
@@ -1,4 +1,4 @@
1
- import { Ct as WriteError, St as DATA_DIR, i as hostName, l as syncHost, n as DEFAULT_UI_PORT, s as removeHostLink } from "./host-lY8ytTbw.js";
1
+ import { Ct as DATA_DIR, i as hostName, l as syncHost, n as DEFAULT_UI_PORT, s as removeHostLink, wt as WriteError } from "./host-CIOd2WSh.js";
2
2
  import { existsSync, mkdirSync, readFileSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
3
3
  import { join, resolve } from "node:path";
4
4
  import { spawn, spawnSync } from "node:child_process";
@@ -276,7 +276,7 @@ async function launchUi(root, hub, configured, options) {
276
276
  }
277
277
  let server;
278
278
  if (!reuse) {
279
- const { serveUi } = await import("./ui-AhBsqtZe.js");
279
+ const { serveUi } = await import("./ui-BhwCZPJR.js");
280
280
  server = await serveUi(root, choice.port);
281
281
  writeUiRecord(root, {
282
282
  port: choice.port,
package/dist/launch.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as networkProbe, c as realRoot, d as withUiLock, i as launchUi, l as startUiInBackground, n as choosePort, o as portCandidates, r as exitCodeFor, s as readUiRecord, t as PORT_SPAN, u as watchHubGone } from "./launch-3HLHjQF0.js";
1
+ import { a as networkProbe, c as realRoot, d as withUiLock, i as launchUi, l as startUiInBackground, n as choosePort, o as portCandidates, r as exitCodeFor, s as readUiRecord, t as PORT_SPAN, u as watchHubGone } from "./launch-DJ944-bI.js";
2
2
  export { PORT_SPAN, choosePort, exitCodeFor, launchUi, networkProbe, portCandidates, readUiRecord, realRoot, startUiInBackground, watchHubGone, withUiLock };
@@ -1,4 +1,4 @@
1
- import { $ as nowMinute, B as applyOperation, Ct as WriteError, F as renumberRequest, I as renumberFiles, L as renumberPath, P as applyOffline, R as renumberText, St as DATA_DIR, Tt as splitFrontMatter, at as MAX_FILE_BYTES, ct as comparePaths, dt as requestTime, ft as textBytes, it as MAX_BLOB_BYTES, lt as exceedsFileLimit, nt as ACCESS_HEADERS, ot as ROUTES, rt as BLOB_HASH, st as SOCKET_MAX_AGE_CLOSE, tt as nodeStorage, ut as readsAsText, wt as contentHash, xt as ConflictError, z as scopeOfPath } from "./host-lY8ytTbw.js";
1
+ import { B as scopeOfPath, Ct as DATA_DIR, Et as splitFrontMatter, F as applyOffline, I as renumberRequest, L as renumberFiles, R as renumberPath, St as ConflictError, Tt as contentHash, V as applyOperation, at as MAX_BLOB_BYTES, ct as SOCKET_MAX_AGE_CLOSE, dt as readsAsText, et as nowMinute, ft as requestTime, it as BLOB_HASH, lt as comparePaths, nt as nodeStorage, ot as MAX_FILE_BYTES, pt as textBytes, rt as ACCESS_HEADERS, st as ROUTES, ut as exceedsFileLimit, wt as WriteError, z as renumberText } from "./host-CIOd2WSh.js";
2
2
  import { createHash, randomBytes } from "node:crypto";
3
3
  import { accessSync, appendFileSync, chmodSync, closeSync, constants, copyFileSync, createReadStream, createWriteStream, existsSync, linkSync, lstatSync, mkdirSync, openSync, readFileSync, readSync, readdirSync, renameSync, rmSync, statSync, watch, writeFileSync } from "node:fs";
4
4
  import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
@@ -1,8 +1,8 @@
1
- import { F as configSchema, f as GROUP_SECTIONS } from "./dist-ud09dzZo.js";
2
- import { C as readSession, Ct as WriteError, G as sectionText, H as HubError, J as linksInto, K as dependencyGraph, M as traceTranscript, N as transcriptTitle, S as loadSessions, St as DATA_DIR, U as loadConfig, W as loadHub, X as refIndex, Z as remoteMembers, a as openInApp, et as readYaml, g as setArchivedMany, h as ARCHIVE_KINDS, j as attributeTrace, q as mainlineEdges, w as transcriptPath, xt as ConflictError } from "./host-lY8ytTbw.js";
1
+ import { P as configSchema } from "./dist-zSabglPq.js";
2
+ import { C as loadSessions, Ct as DATA_DIR, G as loadHub, J as mainlineEdges, K as sectionText, M as attributeTrace, N as traceTranscript, P as transcriptTitle, Q as remoteMembers, St as ConflictError, T as transcriptPath, U as HubError, W as loadConfig, Y as linksInto, Z as refIndex, _ as setArchivedMany, a as openInApp, g as ARCHIVE_KINDS, q as dependencyGraph, tt as readYaml, u as groupPlan, w as readSession, wt as WriteError } from "./host-CIOd2WSh.js";
3
3
  import { t as listProgress } from "./progress-1BfPg2zN.js";
4
- import { A as isSynced, _ as readDaemon, a as remoteMode, b as readRemote, h as callDaemon, j as syncPaths, k as SYNC_DIR, m as DaemonUnavailable, n as hubWriter, r as writtenLines, y as watchTree } from "./operation-BZ7CHB6J.js";
5
- import { c as realRoot, f as CLI_VERSION, s as readUiRecord } from "./launch-3HLHjQF0.js";
4
+ import { A as isSynced, _ as readDaemon, a as remoteMode, b as readRemote, h as callDaemon, j as syncPaths, k as SYNC_DIR, m as DaemonUnavailable, n as hubWriter, r as writtenLines, y as watchTree } from "./operation-DJARDCM0.js";
5
+ import { c as realRoot, f as CLI_VERSION, s as readUiRecord } from "./launch-DJ944-bI.js";
6
6
  import { createRequire } from "node:module";
7
7
  import { closeSync, existsSync, lstatSync, openSync, readFileSync, readSync, realpathSync, statSync } from "node:fs";
8
8
  import { basename, dirname, extname, join, normalize, relative, resolve, sep } from "node:path";
@@ -117,7 +117,6 @@ function summarize(m) {
117
117
  labels: m.labels ?? [],
118
118
  due: m.due ?? null,
119
119
  group: m.group ?? null,
120
- role: m.role ?? "impl",
121
120
  updated: [
122
121
  m,
123
122
  ...m.tasks,
@@ -134,11 +133,12 @@ function summarize(m) {
134
133
  }
135
134
  /** The first paragraph of a group's 說明 on one line, for the heading of its group in a list. */
136
135
  function groupSummary(body) {
137
- return ((sectionText(body, GROUP_SECTIONS[0]) ?? "").split(/\n\s*\n/)[0] ?? "").replace(/\s+/g, " ").trim();
136
+ return ((sectionText(body, "說明") ?? "").split(/\n\s*\n/)[0] ?? "").replace(/\s+/g, " ").trim();
138
137
  }
139
- const groupView = (g) => ({
138
+ const groupView = (hub, g) => ({
140
139
  ...g,
141
- summary: groupSummary(g.body)
140
+ summary: groupSummary(g.body),
141
+ order: groupPlan(hub, [], g.id).members.map((m) => m.ref)
142
142
  });
143
143
  /** The 503 body for a config.yaml that cannot be used, with the hub's root left out of paths. */
144
144
  function configErrorView(root, error) {
@@ -242,7 +242,7 @@ function createApp(root, options = {}) {
242
242
  version: CLI_VERSION,
243
243
  repos: hub.config.repos,
244
244
  mainlines: hub.mainlines.map(summarize),
245
- groups: hub.groups.map(groupView),
245
+ groups: hub.groups.map((g) => groupView(hub, g)),
246
246
  openIssues: hub.issues.filter((i) => i.status !== "closed").length,
247
247
  validFindings: hub.findings.filter((f) => f.status === "valid").length,
248
248
  problems: hub.problems