mainflow 0.28.0 → 0.29.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.
- package/dist/cli.d.ts +3 -1
- package/dist/cli.js +817 -213
- package/dist/facts.d.ts +64 -2
- package/dist/facts.js +64 -3
- package/dist/grant-commands.d.ts +1 -1
- package/dist/hooks.d.ts +514 -3
- package/dist/hooks.js +66 -35
- package/dist/host-BJnrv8xF.js +7300 -0
- package/dist/host.js +1 -1
- package/dist/index-DV6Gqu8K.d.ts +423 -0
- package/dist/{launch-BKKoCyTj.js → launch-DefacJEL.js} +2 -2
- package/dist/launch.js +1 -1
- package/dist/native/mainflow-swap-linux-x64 +0 -0
- package/dist/native/mainflow-swap.c +67 -0
- package/dist/operation-Bp4U2bx3.js +2862 -0
- package/dist/retro-formats-ECy0gGOL.js +30 -0
- package/dist/ui-CiapFoik.js +658 -0
- package/dist/web/assets/index-CyQML0b0.css +1 -0
- package/dist/web/assets/index-tAb99n75.js +82 -0
- package/dist/web/index.html +2 -2
- package/package.json +3 -1
- package/dist/host-CeN3dvXg.js +0 -3268
- package/dist/index-bIFT1ORw.d.ts +0 -46
- package/dist/ui-D_9x6XNs.js +0 -501
- package/dist/web/assets/index-BUxmYhLT.css +0 -1
- package/dist/web/assets/index-ypKt0hMg.js +0 -80
package/dist/host.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as openInApp, c as syncHost, i as hostName, n as DEFAULT_UI_PORT, o as removeHostLink, r as caddySites, s as siteBlock, t as APP_BUNDLE_ID } from "./host-
|
|
1
|
+
import { a as openInApp, c as syncHost, i as hostName, n as DEFAULT_UI_PORT, o as removeHostLink, r as caddySites, s as siteBlock, t as APP_BUNDLE_ID } from "./host-BJnrv8xF.js";
|
|
2
2
|
export { APP_BUNDLE_ID, DEFAULT_UI_PORT, caddySites, hostName, openInApp, removeHostLink, siteBlock, syncHost };
|
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region ../schema/dist/index.d.ts
|
|
3
|
+
declare const FORMAT_VERSION = 2;
|
|
4
|
+
declare const ID_PATTERNS: {
|
|
5
|
+
readonly mainline: RegExp;
|
|
6
|
+
readonly task: RegExp;
|
|
7
|
+
readonly checklistItem: RegExp;
|
|
8
|
+
readonly criterion: RegExp;
|
|
9
|
+
readonly decision: RegExp;
|
|
10
|
+
readonly action: RegExp;
|
|
11
|
+
readonly issue: RegExp;
|
|
12
|
+
readonly finding: RegExp;
|
|
13
|
+
readonly grant: RegExp;
|
|
14
|
+
};
|
|
15
|
+
declare const CHECKLIST_REF: RegExp;
|
|
16
|
+
/** What an action may serve: a checklist item, or a mainline's criterion while the mainline has no task for it yet. */
|
|
17
|
+
declare const SERVES_REF: RegExp;
|
|
18
|
+
declare const SLUG: RegExp;
|
|
19
|
+
/** One source the survey checks: the line's label, what it holds, and how it may be left unchecked. */
|
|
20
|
+
interface SurveyLine {
|
|
21
|
+
label: string;
|
|
22
|
+
holds: string;
|
|
23
|
+
/** The word that marks the source as not checked, followed by the reason, e.g. 不適用:{理由}. Absent when the source is always checked. */
|
|
24
|
+
skip?: string;
|
|
25
|
+
/** Text a checked line must contain, e.g. the environment a spike ran in. */
|
|
26
|
+
requires?: string;
|
|
27
|
+
}
|
|
28
|
+
declare const checklistItemSchema: z.ZodObject<{
|
|
29
|
+
text: z.ZodString;
|
|
30
|
+
doneWhen: z.ZodOptional<z.ZodString>;
|
|
31
|
+
done: z.ZodBoolean;
|
|
32
|
+
evidence: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
33
|
+
doneAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
34
|
+
dropped: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
supersededBy: z.ZodOptional<z.ZodString>;
|
|
36
|
+
note: z.ZodOptional<z.ZodString>;
|
|
37
|
+
id: z.ZodString;
|
|
38
|
+
serves: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
type ChecklistItem = z.infer<typeof checklistItemSchema>;
|
|
41
|
+
declare const mainlineSchema: z.ZodObject<{
|
|
42
|
+
category: z.ZodOptional<z.ZodString>;
|
|
43
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
44
|
+
created: z.ZodString;
|
|
45
|
+
closedAt: z.ZodOptional<z.ZodString>;
|
|
46
|
+
resolution: z.ZodOptional<z.ZodString>;
|
|
47
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
48
|
+
refs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
49
|
+
title: z.ZodString;
|
|
50
|
+
url: z.ZodOptional<z.ZodString>;
|
|
51
|
+
path: z.ZodOptional<z.ZodString>;
|
|
52
|
+
date: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, z.core.$strip>>>;
|
|
54
|
+
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
55
|
+
rel: z.ZodEnum<{
|
|
56
|
+
"depends-on": "depends-on";
|
|
57
|
+
relates: "relates";
|
|
58
|
+
"split-from": "split-from";
|
|
59
|
+
}>;
|
|
60
|
+
to: z.ZodString;
|
|
61
|
+
note: z.ZodOptional<z.ZodString>;
|
|
62
|
+
}, z.core.$strip>>>;
|
|
63
|
+
id: z.ZodString;
|
|
64
|
+
title: z.ZodString;
|
|
65
|
+
status: z.ZodEnum<{
|
|
66
|
+
active: "active";
|
|
67
|
+
done: "done";
|
|
68
|
+
dropped: "dropped";
|
|
69
|
+
paused: "paused";
|
|
70
|
+
planning: "planning";
|
|
71
|
+
}>;
|
|
72
|
+
priority: z.ZodOptional<z.ZodEnum<{
|
|
73
|
+
P0: "P0";
|
|
74
|
+
P1: "P1";
|
|
75
|
+
P2: "P2";
|
|
76
|
+
P3: "P3";
|
|
77
|
+
}>>;
|
|
78
|
+
due: z.ZodOptional<z.ZodString>;
|
|
79
|
+
archivedAt: z.ZodOptional<z.ZodString>;
|
|
80
|
+
criteria: z.ZodArray<z.ZodObject<{
|
|
81
|
+
text: z.ZodString;
|
|
82
|
+
doneWhen: z.ZodOptional<z.ZodString>;
|
|
83
|
+
done: z.ZodBoolean;
|
|
84
|
+
evidence: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
85
|
+
doneAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
86
|
+
dropped: z.ZodOptional<z.ZodBoolean>;
|
|
87
|
+
supersededBy: z.ZodOptional<z.ZodString>;
|
|
88
|
+
note: z.ZodOptional<z.ZodString>;
|
|
89
|
+
id: z.ZodString;
|
|
90
|
+
}, z.core.$strip>>;
|
|
91
|
+
budget: z.ZodOptional<z.ZodObject<{
|
|
92
|
+
amount: z.ZodNumber;
|
|
93
|
+
unit: z.ZodString;
|
|
94
|
+
}, z.core.$strip>>;
|
|
95
|
+
costs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
96
|
+
date: z.ZodString;
|
|
97
|
+
item: z.ZodString;
|
|
98
|
+
unit: z.ZodString;
|
|
99
|
+
estimate: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
actual: z.ZodOptional<z.ZodNumber>;
|
|
101
|
+
note: z.ZodOptional<z.ZodString>;
|
|
102
|
+
}, z.core.$strip>>>;
|
|
103
|
+
grants: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
104
|
+
id: z.ZodString;
|
|
105
|
+
action: z.ZodEnum<{
|
|
106
|
+
commit: "commit";
|
|
107
|
+
"install-prompts": "install-prompts";
|
|
108
|
+
"merge-pr": "merge-pr";
|
|
109
|
+
publish: "publish";
|
|
110
|
+
push: "push";
|
|
111
|
+
release: "release";
|
|
112
|
+
"sync-hubs": "sync-hubs";
|
|
113
|
+
}>;
|
|
114
|
+
target: z.ZodString;
|
|
115
|
+
note: z.ZodOptional<z.ZodString>;
|
|
116
|
+
}, z.core.$strip>>>;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
type Mainline = z.infer<typeof mainlineSchema>;
|
|
119
|
+
declare const decisionSchema: z.ZodObject<{
|
|
120
|
+
category: z.ZodOptional<z.ZodString>;
|
|
121
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
122
|
+
created: z.ZodString;
|
|
123
|
+
closedAt: z.ZodOptional<z.ZodString>;
|
|
124
|
+
resolution: z.ZodOptional<z.ZodString>;
|
|
125
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
126
|
+
refs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
127
|
+
title: z.ZodString;
|
|
128
|
+
url: z.ZodOptional<z.ZodString>;
|
|
129
|
+
path: z.ZodOptional<z.ZodString>;
|
|
130
|
+
date: z.ZodOptional<z.ZodString>;
|
|
131
|
+
}, z.core.$strip>>>;
|
|
132
|
+
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
133
|
+
rel: z.ZodEnum<{
|
|
134
|
+
"depends-on": "depends-on";
|
|
135
|
+
relates: "relates";
|
|
136
|
+
"split-from": "split-from";
|
|
137
|
+
}>;
|
|
138
|
+
to: z.ZodString;
|
|
139
|
+
note: z.ZodOptional<z.ZodString>;
|
|
140
|
+
}, z.core.$strip>>>;
|
|
141
|
+
id: z.ZodString;
|
|
142
|
+
title: z.ZodString;
|
|
143
|
+
status: z.ZodEnum<{
|
|
144
|
+
accepted: "accepted";
|
|
145
|
+
proposed: "proposed";
|
|
146
|
+
superseded: "superseded";
|
|
147
|
+
}>;
|
|
148
|
+
priority: z.ZodOptional<z.ZodEnum<{
|
|
149
|
+
P0: "P0";
|
|
150
|
+
P1: "P1";
|
|
151
|
+
P2: "P2";
|
|
152
|
+
P3: "P3";
|
|
153
|
+
}>>;
|
|
154
|
+
decidedAt: z.ZodOptional<z.ZodString>;
|
|
155
|
+
supersededBy: z.ZodOptional<z.ZodString>;
|
|
156
|
+
by: z.ZodOptional<z.ZodEnum<{
|
|
157
|
+
ai: "ai";
|
|
158
|
+
relay: "relay";
|
|
159
|
+
user: "user";
|
|
160
|
+
}>>;
|
|
161
|
+
basis: z.ZodOptional<z.ZodEnum<{
|
|
162
|
+
explicit: "explicit";
|
|
163
|
+
recommended: "recommended";
|
|
164
|
+
}>>;
|
|
165
|
+
affects: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
166
|
+
reversible: z.ZodOptional<z.ZodBoolean>;
|
|
167
|
+
}, z.core.$strip>;
|
|
168
|
+
type Decision = z.infer<typeof decisionSchema>;
|
|
169
|
+
declare const taskSchema: z.ZodObject<{
|
|
170
|
+
category: z.ZodOptional<z.ZodString>;
|
|
171
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
172
|
+
created: z.ZodString;
|
|
173
|
+
closedAt: z.ZodOptional<z.ZodString>;
|
|
174
|
+
resolution: z.ZodOptional<z.ZodString>;
|
|
175
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
176
|
+
refs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
177
|
+
title: z.ZodString;
|
|
178
|
+
url: z.ZodOptional<z.ZodString>;
|
|
179
|
+
path: z.ZodOptional<z.ZodString>;
|
|
180
|
+
date: z.ZodOptional<z.ZodString>;
|
|
181
|
+
}, z.core.$strip>>>;
|
|
182
|
+
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
183
|
+
rel: z.ZodEnum<{
|
|
184
|
+
"depends-on": "depends-on";
|
|
185
|
+
relates: "relates";
|
|
186
|
+
"split-from": "split-from";
|
|
187
|
+
}>;
|
|
188
|
+
to: z.ZodString;
|
|
189
|
+
note: z.ZodOptional<z.ZodString>;
|
|
190
|
+
}, z.core.$strip>>>;
|
|
191
|
+
id: z.ZodString;
|
|
192
|
+
title: z.ZodString;
|
|
193
|
+
status: z.ZodEnum<{
|
|
194
|
+
blocked: "blocked";
|
|
195
|
+
doing: "doing";
|
|
196
|
+
done: "done";
|
|
197
|
+
dropped: "dropped";
|
|
198
|
+
todo: "todo";
|
|
199
|
+
}>;
|
|
200
|
+
priority: z.ZodOptional<z.ZodEnum<{
|
|
201
|
+
P0: "P0";
|
|
202
|
+
P1: "P1";
|
|
203
|
+
P2: "P2";
|
|
204
|
+
P3: "P3";
|
|
205
|
+
}>>;
|
|
206
|
+
kind: z.ZodEnum<{
|
|
207
|
+
branch: "branch";
|
|
208
|
+
phase: "phase";
|
|
209
|
+
}>;
|
|
210
|
+
parent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
211
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
212
|
+
dependsOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
213
|
+
repo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
214
|
+
touches: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
215
|
+
startedAt: z.ZodOptional<z.ZodString>;
|
|
216
|
+
checklist: z.ZodArray<z.ZodObject<{
|
|
217
|
+
text: z.ZodString;
|
|
218
|
+
doneWhen: z.ZodOptional<z.ZodString>;
|
|
219
|
+
done: z.ZodBoolean;
|
|
220
|
+
evidence: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
221
|
+
doneAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
222
|
+
dropped: z.ZodOptional<z.ZodBoolean>;
|
|
223
|
+
supersededBy: z.ZodOptional<z.ZodString>;
|
|
224
|
+
note: z.ZodOptional<z.ZodString>;
|
|
225
|
+
id: z.ZodString;
|
|
226
|
+
serves: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
227
|
+
}, z.core.$strip>>;
|
|
228
|
+
blockedBy: z.ZodOptional<z.ZodObject<{
|
|
229
|
+
reason: z.ZodString;
|
|
230
|
+
waitingFor: z.ZodOptional<z.ZodString>;
|
|
231
|
+
signal: z.ZodOptional<z.ZodString>;
|
|
232
|
+
}, z.core.$strip>>;
|
|
233
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
234
|
+
worktree: z.ZodOptional<z.ZodString>;
|
|
235
|
+
base: z.ZodOptional<z.ZodString>;
|
|
236
|
+
merge: z.ZodOptional<z.ZodEnum<{
|
|
237
|
+
abandoned: "abandoned";
|
|
238
|
+
merged: "merged";
|
|
239
|
+
open: "open";
|
|
240
|
+
}>>;
|
|
241
|
+
}, z.core.$strip>;
|
|
242
|
+
type Task = z.infer<typeof taskSchema>;
|
|
243
|
+
/**
|
|
244
|
+
* A condition a program can check, written `{kind}:{argument}`. `commit` holds once a commit message on the
|
|
245
|
+
* branch contains the text, `action-done` once the action is done, `file` once the path exists under the hub
|
|
246
|
+
* root. Git branch names cannot contain a colon, so the text after the branch may.
|
|
247
|
+
*/
|
|
248
|
+
type Until = {
|
|
249
|
+
kind: 'commit';
|
|
250
|
+
branch: string;
|
|
251
|
+
text: string;
|
|
252
|
+
} | {
|
|
253
|
+
kind: 'action-done';
|
|
254
|
+
session: string;
|
|
255
|
+
action: string;
|
|
256
|
+
} | {
|
|
257
|
+
kind: 'file';
|
|
258
|
+
path: string;
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* Why a blocked action cannot move, what it waits for, and the condition a program checks to end the wait.
|
|
262
|
+
* `waitingFor` is free text, another session's action such as claude-code-1a2b3c4d#a003, or a hub reference
|
|
263
|
+
* such as m031/t002 when the whole text is one.
|
|
264
|
+
*/
|
|
265
|
+
declare const actionBlockSchema: z.ZodObject<{
|
|
266
|
+
reason: z.ZodString;
|
|
267
|
+
waitingFor: z.ZodOptional<z.ZodString>;
|
|
268
|
+
until: z.ZodOptional<z.ZodString>;
|
|
269
|
+
}, z.core.$strip>;
|
|
270
|
+
type ActionBlock = z.infer<typeof actionBlockSchema>;
|
|
271
|
+
declare const actionSchema: z.ZodObject<{
|
|
272
|
+
id: z.ZodString;
|
|
273
|
+
do: z.ZodString;
|
|
274
|
+
status: z.ZodEnum<{
|
|
275
|
+
blocked: "blocked";
|
|
276
|
+
doing: "doing";
|
|
277
|
+
done: "done";
|
|
278
|
+
dropped: "dropped";
|
|
279
|
+
todo: "todo";
|
|
280
|
+
}>;
|
|
281
|
+
serves: z.ZodArray<z.ZodString>;
|
|
282
|
+
note: z.ZodOptional<z.ZodString>;
|
|
283
|
+
blockedBy: z.ZodOptional<z.ZodObject<{
|
|
284
|
+
reason: z.ZodString;
|
|
285
|
+
waitingFor: z.ZodOptional<z.ZodString>;
|
|
286
|
+
until: z.ZodOptional<z.ZodString>;
|
|
287
|
+
}, z.core.$strip>>;
|
|
288
|
+
startedAt: z.ZodOptional<z.ZodString>;
|
|
289
|
+
doneAt: z.ZodOptional<z.ZodString>;
|
|
290
|
+
}, z.core.$strip>;
|
|
291
|
+
type Action = z.infer<typeof actionSchema>;
|
|
292
|
+
declare const sessionSchema: z.ZodObject<{
|
|
293
|
+
id: z.ZodString;
|
|
294
|
+
agent: z.ZodString;
|
|
295
|
+
status: z.ZodEnum<{
|
|
296
|
+
active: "active";
|
|
297
|
+
ended: "ended";
|
|
298
|
+
"handed-off": "handed-off";
|
|
299
|
+
paused: "paused";
|
|
300
|
+
}>;
|
|
301
|
+
started: z.ZodString;
|
|
302
|
+
delegatedFrom: z.ZodNullable<z.ZodString>;
|
|
303
|
+
handoffFrom: z.ZodNullable<z.ZodString>;
|
|
304
|
+
cwd: z.ZodString;
|
|
305
|
+
actions: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
306
|
+
id: z.ZodString;
|
|
307
|
+
do: z.ZodString;
|
|
308
|
+
status: z.ZodEnum<{
|
|
309
|
+
blocked: "blocked";
|
|
310
|
+
doing: "doing";
|
|
311
|
+
done: "done";
|
|
312
|
+
dropped: "dropped";
|
|
313
|
+
todo: "todo";
|
|
314
|
+
}>;
|
|
315
|
+
serves: z.ZodArray<z.ZodString>;
|
|
316
|
+
note: z.ZodOptional<z.ZodString>;
|
|
317
|
+
blockedBy: z.ZodOptional<z.ZodObject<{
|
|
318
|
+
reason: z.ZodString;
|
|
319
|
+
waitingFor: z.ZodOptional<z.ZodString>;
|
|
320
|
+
until: z.ZodOptional<z.ZodString>;
|
|
321
|
+
}, z.core.$strip>>;
|
|
322
|
+
startedAt: z.ZodOptional<z.ZodString>;
|
|
323
|
+
doneAt: z.ZodOptional<z.ZodString>;
|
|
324
|
+
}, z.core.$strip>, unknown>>;
|
|
325
|
+
transcript: z.ZodOptional<z.ZodString>;
|
|
326
|
+
worktree: z.ZodOptional<z.ZodString>;
|
|
327
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
328
|
+
model: z.ZodOptional<z.ZodString>;
|
|
329
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
330
|
+
description: z.ZodOptional<z.ZodString>;
|
|
331
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
332
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
333
|
+
reminderDigest: z.ZodOptional<z.ZodString>;
|
|
334
|
+
archivedAt: z.ZodOptional<z.ZodString>;
|
|
335
|
+
}, z.core.$strip>;
|
|
336
|
+
type Session = z.infer<typeof sessionSchema>;
|
|
337
|
+
/** Front matter of issues/i{NNN}-{slug}.md: follow-ups and waits that must survive the mainline that found them. */
|
|
338
|
+
declare const issueSchema: z.ZodObject<{
|
|
339
|
+
category: z.ZodOptional<z.ZodString>;
|
|
340
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
341
|
+
created: z.ZodString;
|
|
342
|
+
closedAt: z.ZodOptional<z.ZodString>;
|
|
343
|
+
resolution: z.ZodOptional<z.ZodString>;
|
|
344
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
345
|
+
refs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
346
|
+
title: z.ZodString;
|
|
347
|
+
url: z.ZodOptional<z.ZodString>;
|
|
348
|
+
path: z.ZodOptional<z.ZodString>;
|
|
349
|
+
date: z.ZodOptional<z.ZodString>;
|
|
350
|
+
}, z.core.$strip>>>;
|
|
351
|
+
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
352
|
+
rel: z.ZodEnum<{
|
|
353
|
+
"depends-on": "depends-on";
|
|
354
|
+
relates: "relates";
|
|
355
|
+
"split-from": "split-from";
|
|
356
|
+
}>;
|
|
357
|
+
to: z.ZodString;
|
|
358
|
+
note: z.ZodOptional<z.ZodString>;
|
|
359
|
+
}, z.core.$strip>>>;
|
|
360
|
+
id: z.ZodString;
|
|
361
|
+
title: z.ZodString;
|
|
362
|
+
status: z.ZodEnum<{
|
|
363
|
+
closed: "closed";
|
|
364
|
+
open: "open";
|
|
365
|
+
planned: "planned";
|
|
366
|
+
}>;
|
|
367
|
+
priority: z.ZodOptional<z.ZodEnum<{
|
|
368
|
+
P0: "P0";
|
|
369
|
+
P1: "P1";
|
|
370
|
+
P2: "P2";
|
|
371
|
+
P3: "P3";
|
|
372
|
+
}>>;
|
|
373
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
374
|
+
due: z.ZodOptional<z.ZodString>;
|
|
375
|
+
plannedIn: z.ZodOptional<z.ZodString>;
|
|
376
|
+
archivedAt: z.ZodOptional<z.ZodString>;
|
|
377
|
+
}, z.core.$strip>;
|
|
378
|
+
type Issue = z.infer<typeof issueSchema>;
|
|
379
|
+
/** Front matter of findings/f{NNN}-{slug}.md: lessons and pitfalls the next task should read before it starts. */
|
|
380
|
+
declare const findingSchema: z.ZodObject<{
|
|
381
|
+
category: z.ZodOptional<z.ZodString>;
|
|
382
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
383
|
+
created: z.ZodString;
|
|
384
|
+
closedAt: z.ZodOptional<z.ZodString>;
|
|
385
|
+
resolution: z.ZodOptional<z.ZodString>;
|
|
386
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
387
|
+
refs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
388
|
+
title: z.ZodString;
|
|
389
|
+
url: z.ZodOptional<z.ZodString>;
|
|
390
|
+
path: z.ZodOptional<z.ZodString>;
|
|
391
|
+
date: z.ZodOptional<z.ZodString>;
|
|
392
|
+
}, z.core.$strip>>>;
|
|
393
|
+
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
394
|
+
rel: z.ZodEnum<{
|
|
395
|
+
"depends-on": "depends-on";
|
|
396
|
+
relates: "relates";
|
|
397
|
+
"split-from": "split-from";
|
|
398
|
+
}>;
|
|
399
|
+
to: z.ZodString;
|
|
400
|
+
note: z.ZodOptional<z.ZodString>;
|
|
401
|
+
}, z.core.$strip>>>;
|
|
402
|
+
id: z.ZodString;
|
|
403
|
+
title: z.ZodString;
|
|
404
|
+
status: z.ZodEnum<{
|
|
405
|
+
obsolete: "obsolete";
|
|
406
|
+
valid: "valid";
|
|
407
|
+
}>;
|
|
408
|
+
appliesTo: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
409
|
+
reviewAfter: z.ZodOptional<z.ZodString>;
|
|
410
|
+
archivedAt: z.ZodOptional<z.ZodString>;
|
|
411
|
+
}, z.core.$strip>;
|
|
412
|
+
type Finding = z.infer<typeof findingSchema>;
|
|
413
|
+
/** One line of ops/{YYYY-MM}.log: an external operation, append-only. */
|
|
414
|
+
declare const opsEntrySchema: z.ZodObject<{
|
|
415
|
+
at: z.ZodString;
|
|
416
|
+
target: z.ZodString;
|
|
417
|
+
operation: z.ZodString;
|
|
418
|
+
result: z.ZodString;
|
|
419
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
420
|
+
}, z.core.$strip>;
|
|
421
|
+
type OpsEntry = z.infer<typeof opsEntrySchema>;
|
|
422
|
+
//#endregion
|
|
423
|
+
export { Until as _, Decision as a, ID_PATTERNS as c, OpsEntry as d, SERVES_REF as f, Task as g, SurveyLine as h, ChecklistItem as i, Issue as l, Session as m, ActionBlock as n, FORMAT_VERSION as o, SLUG as p, CHECKLIST_REF as r, Finding as s, Action as t, Mainline as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as syncHost, i as hostName, n as DEFAULT_UI_PORT, o as removeHostLink, ot as DATA_DIR, st as WriteError } from "./host-BJnrv8xF.js";
|
|
2
2
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { spawn, spawnSync } from "node:child_process";
|
|
@@ -176,7 +176,7 @@ async function launchUi(root, hub, configured, options) {
|
|
|
176
176
|
}
|
|
177
177
|
let server;
|
|
178
178
|
if (!reuse) {
|
|
179
|
-
const { serveUi } = await import("./ui-
|
|
179
|
+
const { serveUi } = await import("./ui-CiapFoik.js");
|
|
180
180
|
server = await serveUi(root, choice.port);
|
|
181
181
|
writeUiRecord(root, {
|
|
182
182
|
port: choice.port,
|
package/dist/launch.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as portCandidates, c as watchHubGone, i as networkProbe, n as choosePort, o as readUiRecord, r as launchUi, s as startUiInBackground, t as PORT_SPAN } from "./launch-
|
|
1
|
+
import { a as portCandidates, c as watchHubGone, i as networkProbe, n as choosePort, o as readUiRecord, r as launchUi, s as startUiInBackground, t as PORT_SPAN } from "./launch-DefacJEL.js";
|
|
2
2
|
export { PORT_SPAN, choosePort, launchUi, networkProbe, portCandidates, readUiRecord, startUiInBackground, watchHubGone };
|
|
Binary file
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// mainflow-swap: exchange two existing paths in one atomic step, for the sync client.
|
|
2
|
+
//
|
|
3
|
+
// The sync client writes a file from the sync server by preparing it beside the target and exchanging the two.
|
|
4
|
+
// After the exchange the old content sits at the prepared path, so a write by another program that landed just
|
|
5
|
+
// before the exchange is still there to read, where a rename would have dropped it. Node has no call for this,
|
|
6
|
+
// hence this helper: macOS renamex_np(RENAME_SWAP), Linux renameat2(RENAME_EXCHANGE).
|
|
7
|
+
//
|
|
8
|
+
// It answers every request on stdin until stdin ends; the client sends one per run (src/swap.ts). Each request is
|
|
9
|
+
// one line, the two paths separated by a tab; each answer is one line on stdout, in order:
|
|
10
|
+
// ok the paths were exchanged
|
|
11
|
+
// missing one of the paths does not exist
|
|
12
|
+
// unsupported the file system cannot exchange paths
|
|
13
|
+
// err <reason> any other failure
|
|
14
|
+
// `mainflow-swap --version` prints the version of this protocol, which the client checks before using it.
|
|
15
|
+
|
|
16
|
+
#define _GNU_SOURCE
|
|
17
|
+
#include <errno.h>
|
|
18
|
+
#include <stdio.h>
|
|
19
|
+
#include <stdlib.h>
|
|
20
|
+
#include <string.h>
|
|
21
|
+
|
|
22
|
+
#if defined(__APPLE__)
|
|
23
|
+
#ifndef RENAME_SWAP
|
|
24
|
+
#define RENAME_SWAP 0x00000002
|
|
25
|
+
#endif
|
|
26
|
+
int renamex_np(const char *from, const char *to, unsigned int flags);
|
|
27
|
+
static int exchange(const char *a, const char *b) { return renamex_np(a, b, RENAME_SWAP); }
|
|
28
|
+
#elif defined(__linux__)
|
|
29
|
+
#include <fcntl.h>
|
|
30
|
+
#include <sys/syscall.h>
|
|
31
|
+
#include <unistd.h>
|
|
32
|
+
#ifndef RENAME_EXCHANGE
|
|
33
|
+
#define RENAME_EXCHANGE (1 << 1)
|
|
34
|
+
#endif
|
|
35
|
+
// Through syscall() rather than the libc wrapper, which older glibc and musl do not have.
|
|
36
|
+
static int exchange(const char *a, const char *b) { return (int)syscall(SYS_renameat2, AT_FDCWD, a, AT_FDCWD, b, RENAME_EXCHANGE); }
|
|
37
|
+
#else
|
|
38
|
+
#error "mainflow-swap supports macOS and Linux"
|
|
39
|
+
#endif
|
|
40
|
+
|
|
41
|
+
#define PROTOCOL "mainflow-swap 1"
|
|
42
|
+
|
|
43
|
+
int main(int argc, char **argv) {
|
|
44
|
+
if (argc == 2 && strcmp(argv[1], "--version") == 0) {
|
|
45
|
+
puts(PROTOCOL);
|
|
46
|
+
return 0;
|
|
47
|
+
}
|
|
48
|
+
setvbuf(stdout, NULL, _IOLBF, 0);
|
|
49
|
+
char *line = NULL;
|
|
50
|
+
size_t size = 0;
|
|
51
|
+
ssize_t length;
|
|
52
|
+
while ((length = getline(&line, &size, stdin)) != -1) {
|
|
53
|
+
if (length > 0 && line[length - 1] == '\n') line[length - 1] = '\0';
|
|
54
|
+
char *tab = strchr(line, '\t');
|
|
55
|
+
if (!tab) {
|
|
56
|
+
puts("err bad-request");
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
*tab = '\0';
|
|
60
|
+
if (exchange(line, tab + 1) == 0) puts("ok");
|
|
61
|
+
else if (errno == ENOENT) puts("missing");
|
|
62
|
+
else if (errno == EINVAL || errno == ENOTSUP || errno == EOPNOTSUPP || errno == ENOSYS || errno == EXDEV) puts("unsupported");
|
|
63
|
+
else printf("err %s\n", strerror(errno));
|
|
64
|
+
}
|
|
65
|
+
free(line);
|
|
66
|
+
return 0;
|
|
67
|
+
}
|