mainflow 0.44.0-alpha.2 → 0.44.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 +97 -9
- package/dist/facts.d.ts +3 -2
- package/dist/facts.js +4 -3
- package/dist/grant-check.d.ts +2 -2
- package/dist/grant-check.js +2 -2
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +18 -9
- package/dist/{host-C74j2Qox.js → host-CfBcUcg2.js} +376 -50
- package/dist/host.d.ts +1 -1
- package/dist/host.js +1 -1
- package/dist/{index-jq7lN8V8.d.ts → index-lsW80LDU.d.ts} +28 -5
- package/dist/launch.d.ts +1 -1
- package/dist/launch.js +2 -2
- package/dist/native/mainflow-swap-darwin-arm64 +0 -0
- package/dist/native/mainflow-swap-darwin-x64 +0 -0
- package/dist/{operation-BroV98VB.d.ts → operation-BTQm13OQ.d.ts} +1 -1
- package/dist/{operation-CUeOFEaf.js → operation-BmNzQC-L.js} +1 -1
- package/dist/{ui-qqVCewFz.js → ui-CnNAOM_Y.js} +2 -3
- package/dist/web/assets/{index-B4w2iRCQ.js → index-BX_V5mK5.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/progress-1BfPg2zN.js +0 -10
package/dist/host.d.ts
CHANGED
package/dist/host.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as openInApp, c as siteBlock, i as hostName, l as syncHost, n as DEFAULT_UI_PORT, o as removeDanglingLinks, r as caddySites, s as removeHostLink, t as APP_BUNDLE_ID } from "./host-
|
|
1
|
+
import { a as openInApp, c as siteBlock, i as hostName, l as syncHost, n as DEFAULT_UI_PORT, o as removeDanglingLinks, r as caddySites, s as removeHostLink, t as APP_BUNDLE_ID } from "./host-CfBcUcg2.js";
|
|
2
2
|
export { APP_BUNDLE_ID, DEFAULT_UI_PORT, caddySites, hostName, openInApp, removeDanglingLinks, removeHostLink, siteBlock, syncHost };
|
|
@@ -414,8 +414,8 @@ interface SessionInput {
|
|
|
414
414
|
*/
|
|
415
415
|
declare function startSession(hub: HubReader, input: SessionInput, ctx: OpContext): OpResult<Session>;
|
|
416
416
|
/**
|
|
417
|
-
* Start the session unless it already exists. An existing paused or ended session becomes active again,
|
|
418
|
-
* an archived one comes back into view, since resumed work should not stay hidden.
|
|
417
|
+
* Start the session unless it already exists. An existing paused or ended session becomes active again, back in
|
|
418
|
+
* local/sessions/, and an archived one comes back into view, since resumed work should not stay hidden.
|
|
419
419
|
*/
|
|
420
420
|
declare function ensureSession(hub: HubReader, input: SessionInput, ctx: OpContext): OpResult<{
|
|
421
421
|
session: Session;
|
|
@@ -457,10 +457,31 @@ type Settled = 'removed' | 'ended' | 'kept';
|
|
|
457
457
|
* no record, since nothing in it points at the hub's work. Then every active main session with no action left to
|
|
458
458
|
* do and no subagent still running ends, the others as well as this one: another session may have finished its
|
|
459
459
|
* last action, or it was closed before its own turn could settle it. The next prompt or action brings it back.
|
|
460
|
+
*
|
|
461
|
+
* Only the sessions in local/sessions/ are read, and the session itself wherever it is. An ended session moves to
|
|
462
|
+
* local/sessions/ended/, with the finished subagents under it and under this session that belong there now
|
|
463
|
+
* (belongsInEnded); a subagent already there cannot change what settling decides, so it is not read.
|
|
460
464
|
*/
|
|
461
465
|
declare function settleSession(hub: HubReader, input: {
|
|
462
466
|
id: string;
|
|
463
467
|
}): OpResult<Settled>;
|
|
468
|
+
/** What relocating the session files moved: the sessions moved to local/sessions/ended/, those moved back, and whether more are left. */
|
|
469
|
+
interface Relocated {
|
|
470
|
+
ended: string[];
|
|
471
|
+
resumed: string[];
|
|
472
|
+
more: boolean;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Move every session file to the directory it belongs in (belongsInEnded), as `mainflow migrate` does for a hub that
|
|
476
|
+
* kept every session in local/sessions/: at most `limit` files, and never more than RELOCATE_BATCH, so a large hub moves
|
|
477
|
+
* in several writes; `more` says another file is to move after them. `dryRun` moves none and lists them all. A file that
|
|
478
|
+
* does not read, or that both directories hold, stays where it is; check reports it. Running it again once nothing is
|
|
479
|
+
* left to move changes nothing.
|
|
480
|
+
*/
|
|
481
|
+
declare function relocateSessions(hub: HubReader, input?: {
|
|
482
|
+
dryRun?: boolean;
|
|
483
|
+
limit?: number;
|
|
484
|
+
}): OpResult<Relocated>;
|
|
464
485
|
/** Archive or unarchive a session; the status stays as it is, so an ended session is visible until archived. */
|
|
465
486
|
declare function setSessionArchived(hub: HubReader, input: {
|
|
466
487
|
id: string;
|
|
@@ -495,15 +516,16 @@ declare function updateAction(hub: HubReader, input: {
|
|
|
495
516
|
* (`item check` and `item uncheck` send `item.check`, with done true or false). The operations no command sends
|
|
496
517
|
* are listed in COMMANDLESS_OPERATIONS with who sends them.
|
|
497
518
|
*/
|
|
498
|
-
declare const OPERATION_NAMES: readonly ['repo.add', 'hub.add', 'mainline.new', 'mainline.set', 'mainline.title', 'mainline.archive', 'criterion.add', 'criterion.check', 'criterion.set', 'task.new', 'task.set', 'item.add', 'item.check', 'item.drop', 'item.undrop', 'decision.new', 'decision.accept', 'decision.supersede', 'issue.new', 'issue.set', 'issue.plan', 'issue.close', 'issue.reopen', 'issue.archive', 'finding.new', 'finding.set', 'finding.archive', 'group.new', 'group.set', 'ops.add', 'section.append', 'session.start', 'session.ensure', 'session.handoff', 'session.info', 'session.reminder', 'session.checked', 'session.set', 'session.settle', 'session.archive', 'action.add', 'action.set', 'file.remove'];
|
|
519
|
+
declare const OPERATION_NAMES: readonly ['repo.add', 'hub.add', 'mainline.new', 'mainline.set', 'mainline.title', 'mainline.archive', 'criterion.add', 'criterion.check', 'criterion.set', 'task.new', 'task.set', 'item.add', 'item.check', 'item.drop', 'item.undrop', 'decision.new', 'decision.accept', 'decision.supersede', 'issue.new', 'issue.set', 'issue.plan', 'issue.close', 'issue.reopen', 'issue.archive', 'finding.new', 'finding.set', 'finding.archive', 'group.new', 'group.set', 'ops.add', 'section.append', 'session.start', 'session.ensure', 'session.handoff', 'session.info', 'session.reminder', 'session.checked', 'session.set', 'session.settle', 'session.relocate', 'session.archive', 'action.add', 'action.set', 'file.remove'];
|
|
499
520
|
type OperationName = (typeof OPERATION_NAMES)[number];
|
|
500
521
|
//#endregion
|
|
501
522
|
//#region ../core/dist/ops/operations.d.ts
|
|
502
523
|
/**
|
|
503
524
|
* The operations by name, for a server that receives them from elsewhere. The names are the protocol's
|
|
504
525
|
* (OPERATION_NAMES in protocol.ts): the table must hold every one of them and nothing else. `migrate` and `init`
|
|
505
|
-
* are absent:
|
|
506
|
-
* is sent as an operation.
|
|
526
|
+
* are absent: migrating the data format rewrites the whole hub in one go and a new hub starts on the caller's machine,
|
|
527
|
+
* so neither is sent as an operation. Moving the session files to where they belong, which `migrate` also does, is
|
|
528
|
+
* one (`session.relocate`), sent again until nothing is left to move.
|
|
507
529
|
*/
|
|
508
530
|
declare const OPERATIONS: {
|
|
509
531
|
readonly 'repo.add': typeof addRepo;
|
|
@@ -545,6 +567,7 @@ declare const OPERATIONS: {
|
|
|
545
567
|
readonly 'session.checked': typeof setCheckReported;
|
|
546
568
|
readonly 'session.set': typeof setSessionStatus;
|
|
547
569
|
readonly 'session.settle': typeof settleSession;
|
|
570
|
+
readonly 'session.relocate': typeof relocateSessions;
|
|
548
571
|
readonly 'session.archive': typeof setSessionArchived;
|
|
549
572
|
readonly 'action.add': typeof addAction;
|
|
550
573
|
readonly 'action.set': typeof updateAction;
|
package/dist/launch.d.ts
CHANGED
package/dist/launch.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as hostName, l as syncHost, n as DEFAULT_UI_PORT,
|
|
1
|
+
import { i as hostName, l as syncHost, n as DEFAULT_UI_PORT, s as removeHostLink, un as WriteError } from "./host-CfBcUcg2.js";
|
|
2
2
|
import { t as CLI_VERSION } from "./version-Dvv4jwF1.js";
|
|
3
3
|
import { existsSync, mkdirSync, readFileSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { join, resolve } from "node:path";
|
|
@@ -273,7 +273,7 @@ async function launchUi(dirs, hub, configured, options) {
|
|
|
273
273
|
}
|
|
274
274
|
let server;
|
|
275
275
|
if (!reuse) {
|
|
276
|
-
const { serveUi } = await import("./ui-
|
|
276
|
+
const { serveUi } = await import("./ui-CnNAOM_Y.js");
|
|
277
277
|
server = await serveUi(dirs, choice.port);
|
|
278
278
|
writeUiRecord(dirs, {
|
|
279
279
|
port: choice.port,
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as Renumbering, i as Notice, n as OperationValue, r as OperationName, t as OperationInput } from "./index-
|
|
1
|
+
import { a as Renumbering, i as Notice, n as OperationValue, r as OperationName, t as OperationInput } from "./index-lsW80LDU.js";
|
|
2
2
|
//#region src/remote/operation.d.ts
|
|
3
3
|
/** What a write reports: the operation's value, and what its caller tells the user about it. */
|
|
4
4
|
interface Written<N extends OperationName = OperationName> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as syncedPath, At as requestTime, Ct as MAX_FILE_BYTES, Dt as comparePaths, Et as VERSION_HEADER, Ft as versionMismatch, G as renumberRequest, J as renumberText, K as renumberFiles, Ot as exceedsFileLimit, Pt as hubRequirements, Q as syncedDir, Tt as SOCKET_MAX_AGE_CLOSE, W as applyOffline, X as hubDigest, Xt as registeredName, Y as scopeOfPath, Z as mayHoldSynced, bt as BLOB_HASH, cn as ConflictError, dn as contentHash, et as applyOperation, fn as splitFrontMatter, gt as nowMinute, jt as textBytes, kt as readsAsText, q as renumberPath, tn as nodeStorage, un as WriteError, wt as ROUTES, xt as MAX_BLOB_BYTES, yt as ACCESS_HEADERS } from "./host-CfBcUcg2.js";
|
|
2
2
|
import { t as CLI_VERSION } from "./version-Dvv4jwF1.js";
|
|
3
3
|
import { createHash, randomBytes } from "node:crypto";
|
|
4
4
|
import { accessSync, appendFileSync, chmodSync, closeSync, constants, copyFileSync, createReadStream, createWriteStream, existsSync, linkSync, lstatSync, mkdirSync, openSync, readFileSync, readSync, readdirSync, renameSync, rmSync, rmdirSync, statSync, watch, writeFileSync } from "node:fs";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { I as configSchema, tt as repoPaths } from "./dist-CXrUfRQp.js";
|
|
2
|
-
import { A as
|
|
3
|
-
import {
|
|
4
|
-
import { C as readRemote, F as syncPaths, N as SYNC_DIR, P as isSynced, S as watchTree, _ as DaemonUnavailable, b as readDaemon, n as hubWriter, r as writtenLines, s as remoteMode, v as callDaemon } from "./operation-CUeOFEaf.js";
|
|
2
|
+
import { A as readNotices$1, D as HANDLED_FILE, H as traceTranscript, M as loadSessions, N as readSession, O as markNoticesHandled, P as transcriptPath, U as transcriptTitle, Ut as hubAtRoot, V as attributeTrace, a as openInApp, an as hubPath, at as loadHub, b as ARCHIVE_KINDS, cn as ConflictError, ct as dependencyGraph, d as groupPlan, f as listProgress, ft as refIndex, it as loadConfig, k as parseWarn, ln as DATA_DIR, lt as mainlineEdges, nt as HubError, pt as remoteMembers, rn as dataFile, st as sectionText, un as WriteError, ut as linksInto, vt as readYaml, x as setArchivedMany } from "./host-CfBcUcg2.js";
|
|
3
|
+
import { C as readRemote, F as syncPaths, N as SYNC_DIR, P as isSynced, S as watchTree, _ as DaemonUnavailable, b as readDaemon, n as hubWriter, r as writtenLines, s as remoteMode, v as callDaemon } from "./operation-BmNzQC-L.js";
|
|
5
4
|
import { t as CLI_VERSION } from "./version-Dvv4jwF1.js";
|
|
6
5
|
import { readUiRecord, realRoot } from "./launch.js";
|
|
7
6
|
import { createRequire } from "node:module";
|