@zinn-dev/cli 0.45.0 → 0.47.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/README.md +1 -1
- package/package.json +3 -3
- package/skills/zinn/SKILL.md +2 -2
- package/src/actor.d.ts +1 -1
- package/src/actor.js +4 -1
- package/src/capabilities-schema.d.ts +78 -0
- package/src/capabilities-schema.js +44 -0
- package/src/capabilities.d.ts +2 -0
- package/src/capabilities.js +2 -0
- package/src/column-hint.js +2 -9
- package/src/errors.d.ts +5 -0
- package/src/errors.js +19 -5
- package/src/input.d.ts +30 -0
- package/src/input.js +18 -0
- package/src/lib.d.ts +75 -6
- package/src/lib.js +121 -33
- package/src/presentation/activity-presentation.d.ts +2 -1
- package/src/presentation/activity-presentation.js +23 -6
- package/src/presentation/color.d.ts +12 -0
- package/src/presentation/color.js +12 -0
- package/src/presentation/doctor-presentation.d.ts +7 -1
- package/src/presentation/doctor-presentation.js +6 -2
- package/src/presentation/project-presentation.d.ts +4 -1
- package/src/presentation/project-presentation.js +18 -0
- package/src/presentation/relation-presentation.js +8 -20
- package/src/presentation/section.d.ts +7 -4
- package/src/presentation/section.js +21 -7
- package/src/presentation/skill-status-presentation.d.ts +9 -0
- package/src/presentation/skill-status-presentation.js +43 -0
- package/src/presentation/task-blame-presentation.d.ts +3 -1
- package/src/presentation/task-blame-presentation.js +7 -5
- package/src/presentation/task-presentation.d.ts +28 -5
- package/src/presentation/task-presentation.js +120 -42
- package/src/result-schemas.d.ts +230 -14
- package/src/result-schemas.js +52 -0
- package/src/routes/activity-router.d.ts +5 -3
- package/src/routes/activity-router.js +44 -33
- package/src/routes/backup-router.d.ts +1 -0
- package/src/routes/backup-router.js +6 -12
- package/src/routes/capabilities-router.d.ts +1 -0
- package/src/routes/capabilities-router.js +3 -10
- package/src/routes/comment-router.d.ts +7 -6
- package/src/routes/comment-router.js +18 -66
- package/src/routes/doctor-router.d.ts +1 -0
- package/src/routes/doctor-router.js +35 -62
- package/src/routes/info-router.d.ts +1 -0
- package/src/routes/info-router.js +3 -10
- package/src/routes/label-router.d.ts +5 -0
- package/src/routes/label-router.js +11 -48
- package/src/routes/migrate-router.d.ts +1 -0
- package/src/routes/migrate-router.js +7 -16
- package/src/routes/project-router.d.ts +10 -0
- package/src/routes/project-router.js +42 -121
- package/src/routes/reindex-router.d.ts +1 -0
- package/src/routes/reindex-router.js +3 -10
- package/src/routes/relation-router.d.ts +13 -4
- package/src/routes/relation-router.js +15 -23
- package/src/routes/restore-router.d.ts +1 -0
- package/src/routes/restore-router.js +5 -15
- package/src/routes/router.js +33 -12
- package/src/routes/routes.d.ts +142 -32
- package/src/routes/skill-router.d.ts +53 -2
- package/src/routes/skill-router.js +103 -35
- package/src/routes/task-router.d.ts +61 -28
- package/src/routes/task-router.js +224 -263
- package/src/routes/whoami-router.d.ts +1 -0
- package/src/routes/whoami-router.js +3 -10
- package/src/skill-copies.d.ts +34 -0
- package/src/skill-copies.js +109 -0
- package/src/telemetry.d.ts +2 -2
- package/src/telemetry.js +11 -7
- package/src/types.d.ts +9 -1
- package/src/types.js +6 -0
- package/src/views.d.ts +117 -0
- package/src/views.js +54 -0
|
@@ -1,62 +1,35 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
1
|
import { homedir } from "node:os";
|
|
3
|
-
import {
|
|
4
|
-
import { parseArgs } from "node:util";
|
|
5
|
-
import { doctor, isMissingFileError } from "@zinn-dev/core";
|
|
2
|
+
import { doctor } from "@zinn-dev/core";
|
|
6
3
|
import { generateCommandUsage, noInput } from "../input.js";
|
|
7
|
-
import { output,
|
|
4
|
+
import { output, parseCommandArgs } from "../lib.js";
|
|
8
5
|
import { jsonResult } from "../results.js";
|
|
9
6
|
import { formatDoctor, presentDoctor } from "../presentation/doctor-presentation.js";
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*/
|
|
21
|
-
const REVIEWED_VERSION_PATTERN = /^metadata:[ \t]*\r?\n(?:[ \t]+.*\r?\n)*?[ \t]+zinn-cli-reviewed-version:[ \t]*(?:"([^"\r\n]*)"|'([^'\r\n]*)'|([^\s#'"]+))/m;
|
|
22
|
-
/** A skill file's reviewed CLI version, `null` when the file has none that can be read */
|
|
23
|
-
function readReviewedVersion(skill) {
|
|
24
|
-
const frontmatter = FRONTMATTER_PATTERN.exec(skill)?.[1];
|
|
25
|
-
if (frontmatter === undefined) {
|
|
26
|
-
return null;
|
|
7
|
+
import { describeSkillCopy } from "../presentation/skill-status-presentation.js";
|
|
8
|
+
import { findSkillCopies, skillInstallCommand } from "../skill-copies.js";
|
|
9
|
+
/** How to replace the differing copies, by where they are */
|
|
10
|
+
function skillInstallRemedy(differing, workingFolder) {
|
|
11
|
+
const hasHomeCopy = differing.some(({ scope }) => scope === "home");
|
|
12
|
+
const hasProjectCopy = differing.some(({ scope }) => scope === "project");
|
|
13
|
+
const homeCommand = skillInstallCommand("home", workingFolder);
|
|
14
|
+
const projectCommand = skillInstallCommand("project", workingFolder);
|
|
15
|
+
if (hasHomeCopy && hasProjectCopy) {
|
|
16
|
+
return `Update the skill with ${homeCommand}, and with ${projectCommand}`;
|
|
27
17
|
}
|
|
28
|
-
|
|
29
|
-
if (match === null) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
return match[1] ?? match[2] ?? match[3] ?? null;
|
|
18
|
+
return `Update the skill with ${hasProjectCopy ? projectCommand : homeCommand}`;
|
|
33
19
|
}
|
|
34
20
|
function checkAgentSkill() {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
skill = readFileSync(path, "utf8");
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
if (isMissingFileError(error)) {
|
|
42
|
-
return {
|
|
43
|
-
id: "agent_skill",
|
|
44
|
-
status: "ok",
|
|
45
|
-
message: "No Zinn skill is installed for agents",
|
|
46
|
-
remedy: null,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
21
|
+
const workingFolder = process.cwd();
|
|
22
|
+
const { bundledVersion, copies } = findSkillCopies(homedir(), workingFolder);
|
|
23
|
+
if (copies.length === 0) {
|
|
49
24
|
return {
|
|
50
25
|
id: "agent_skill",
|
|
51
|
-
status: "
|
|
52
|
-
message:
|
|
53
|
-
remedy:
|
|
26
|
+
status: "ok",
|
|
27
|
+
message: "No Zinn skill is installed for agents",
|
|
28
|
+
remedy: null,
|
|
54
29
|
};
|
|
55
30
|
}
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
const bundledVersion = readReviewedVersion(readFileSync(join(bundledSkillDirectory, SKILL_FILE_NAME), "utf8"));
|
|
59
|
-
if (reviewedVersion !== null && reviewedVersion === bundledVersion) {
|
|
31
|
+
const differing = copies.filter(({ matches }) => !matches);
|
|
32
|
+
if (differing.length === 0) {
|
|
60
33
|
return {
|
|
61
34
|
id: "agent_skill",
|
|
62
35
|
status: "ok",
|
|
@@ -64,30 +37,30 @@ function checkAgentSkill() {
|
|
|
64
37
|
remedy: null,
|
|
65
38
|
};
|
|
66
39
|
}
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
40
|
+
const [first, ...others] = differing.map((copy) => `at ${copy.path} ${describeSkillCopy(copy)}`);
|
|
41
|
+
const differences = [
|
|
42
|
+
`The installed Zinn skill ${first}`,
|
|
43
|
+
...others.map((difference) => `the one ${difference}`),
|
|
44
|
+
];
|
|
45
|
+
const isOnlyUnreadable = differing.every(({ readable }) => !readable);
|
|
46
|
+
if (!isOnlyUnreadable) {
|
|
47
|
+
differences.push(`and the skill this CLI installs was reviewed for CLI ${bundledVersion}`);
|
|
48
|
+
}
|
|
70
49
|
return {
|
|
71
50
|
id: "agent_skill",
|
|
72
51
|
status: "warning",
|
|
73
|
-
message:
|
|
74
|
-
remedy:
|
|
52
|
+
message: differences.join(", "),
|
|
53
|
+
remedy: skillInstallRemedy(differing, workingFolder),
|
|
75
54
|
};
|
|
76
55
|
}
|
|
77
56
|
export const doctorCommand = {
|
|
78
57
|
summary: "Check the selected settings, database and installed agent skill for problems.",
|
|
79
|
-
effects: { domain: "none", storage: "inspect" },
|
|
58
|
+
effects: { domain: "none", storage: "inspect", external: [] },
|
|
80
59
|
confirmation: { kind: "none" },
|
|
81
60
|
input: noInput,
|
|
82
61
|
results: [{ ...jsonResult("Doctor"), findingsExitCode: 1 }],
|
|
83
62
|
run: (args) => {
|
|
84
|
-
|
|
85
|
-
options: noInput.options,
|
|
86
|
-
args,
|
|
87
|
-
strict: true,
|
|
88
|
-
allowPositionals: true,
|
|
89
|
-
});
|
|
90
|
-
validatePositionals(positionals, noInput.forms[0]);
|
|
63
|
+
parseCommandArgs(args, noInput);
|
|
91
64
|
const report = presentDoctor(doctor.check(), checkAgentSkill());
|
|
92
65
|
output(report, formatDoctor);
|
|
93
66
|
if (!report.ok) {
|
|
@@ -96,7 +69,7 @@ export const doctorCommand = {
|
|
|
96
69
|
},
|
|
97
70
|
help: `${generateCommandUsage("doctor", noInput)}
|
|
98
71
|
|
|
99
|
-
Check the selected settings, store folder, database, search index and
|
|
72
|
+
Check the selected settings, store folder, database, search index and the Zinn agent skill copies in the home and working folders for problems, and suggest a fix for each.
|
|
100
73
|
|
|
101
74
|
Exits 0 when every check is ok and 1 when any reports a warning or problem. The checks print on standard output either way.
|
|
102
75
|
Changes nothing: it creates no folder, database or settings file, and repairs nothing. SQLite may perform its normal file housekeeping.`,
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
import { jsonResult } from "../results.js";
|
|
2
|
-
import { parseArgs } from "node:util";
|
|
3
2
|
import { info } from "@zinn-dev/core";
|
|
4
3
|
import { generateCommandUsage, noInput } from "../input.js";
|
|
5
|
-
import { output,
|
|
4
|
+
import { output, parseCommandArgs } from "../lib.js";
|
|
6
5
|
import { formatInfo, presentInfo } from "../presentation/info-presentation.js";
|
|
7
6
|
export const infoCommand = {
|
|
8
7
|
summary: "Show the selected store, settings sources, telemetry state, database schema state and CLI, core and runtime versions.",
|
|
9
|
-
effects: { domain: "none", storage: "inspect" },
|
|
8
|
+
effects: { domain: "none", storage: "inspect", external: [] },
|
|
10
9
|
confirmation: { kind: "none" },
|
|
11
10
|
input: noInput,
|
|
12
11
|
results: [jsonResult("Info")],
|
|
13
12
|
run: (args) => {
|
|
14
|
-
|
|
15
|
-
options: noInput.options,
|
|
16
|
-
args,
|
|
17
|
-
strict: true,
|
|
18
|
-
allowPositionals: true,
|
|
19
|
-
});
|
|
20
|
-
validatePositionals(positionals, noInput.forms[0]);
|
|
13
|
+
parseCommandArgs(args, noInput);
|
|
21
14
|
output(presentInfo(info.get()), formatInfo);
|
|
22
15
|
},
|
|
23
16
|
help: `${generateCommandUsage("info", noInput)}
|
|
@@ -4,6 +4,7 @@ export declare const labelRouter: {
|
|
|
4
4
|
effects: {
|
|
5
5
|
domain: "create";
|
|
6
6
|
storage: "normal-open";
|
|
7
|
+
external: never[];
|
|
7
8
|
};
|
|
8
9
|
confirmation: {
|
|
9
10
|
kind: "none";
|
|
@@ -59,6 +60,7 @@ export declare const labelRouter: {
|
|
|
59
60
|
effects: {
|
|
60
61
|
domain: "read";
|
|
61
62
|
storage: "normal-open";
|
|
63
|
+
external: never[];
|
|
62
64
|
};
|
|
63
65
|
confirmation: {
|
|
64
66
|
kind: "none";
|
|
@@ -80,6 +82,7 @@ export declare const labelRouter: {
|
|
|
80
82
|
effects: {
|
|
81
83
|
domain: "read";
|
|
82
84
|
storage: "normal-open";
|
|
85
|
+
external: never[];
|
|
83
86
|
};
|
|
84
87
|
confirmation: {
|
|
85
88
|
kind: "none";
|
|
@@ -108,6 +111,7 @@ export declare const labelRouter: {
|
|
|
108
111
|
effects: {
|
|
109
112
|
domain: "update";
|
|
110
113
|
storage: "normal-open";
|
|
114
|
+
external: never[];
|
|
111
115
|
};
|
|
112
116
|
confirmation: {
|
|
113
117
|
kind: "none";
|
|
@@ -235,6 +239,7 @@ export declare const labelRouter: {
|
|
|
235
239
|
effects: {
|
|
236
240
|
domain: "delete";
|
|
237
241
|
storage: "normal-open";
|
|
242
|
+
external: never[];
|
|
238
243
|
};
|
|
239
244
|
confirmation: {
|
|
240
245
|
kind: "prompt";
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsonResult } from "../results.js";
|
|
2
|
-
import { parseArgs } from "node:util";
|
|
3
2
|
import { label, labelColorSchema, labelCreateSchema, labelDeleteSchema, labelEditSchema, } from "@zinn-dev/core";
|
|
4
3
|
import { CliError } from "../errors.js";
|
|
5
4
|
import { generateCommandUsage, noInput } from "../input.js";
|
|
6
|
-
import { confirmationDescription, confirmAction, dashValueHelp, output, outputChanges,
|
|
5
|
+
import { confirmationDescription, confirmAction, dashValueHelp, output, outputChanges, parseCommandArgs, } from "../lib.js";
|
|
7
6
|
import { resolveTextEdit, textEditHelp, textEditOptions, textEditConstraints, } from "../text-edit.js";
|
|
8
7
|
import { expectedValueFlags } from "../expected-values.js";
|
|
9
8
|
import { checkFieldsBeforeText, checkSingleStdinReader, resolveTextInput, textFileHelp, textFileOption, textSourceConstraint, } from "../text-input.js";
|
|
@@ -84,20 +83,12 @@ const labelInputs = {
|
|
|
84
83
|
export const labelRouter = {
|
|
85
84
|
create: {
|
|
86
85
|
summary: "Create a global label. Names preserve casing, but uniqueness is case-insensitive.",
|
|
87
|
-
effects: { domain: "create", storage: "normal-open" },
|
|
86
|
+
effects: { domain: "create", storage: "normal-open", external: [] },
|
|
88
87
|
confirmation: { kind: "none" },
|
|
89
88
|
input: labelInputs.create,
|
|
90
89
|
results: [jsonResult("Label")],
|
|
91
90
|
run: async (args) => {
|
|
92
|
-
const { values, positionals
|
|
93
|
-
args,
|
|
94
|
-
options: labelInputs.create.options,
|
|
95
|
-
allowPositionals: true,
|
|
96
|
-
strict: true,
|
|
97
|
-
tokens: true,
|
|
98
|
-
});
|
|
99
|
-
validateUniqueOptions(tokens, labelInputs.create.options);
|
|
100
|
-
validatePositionals(positionals, labelInputs.create.forms[0]);
|
|
91
|
+
const { values, positionals } = parseCommandArgs(args, labelInputs.create);
|
|
101
92
|
checkFieldsBeforeText(labelCreateSchema, { name: positionals[0], color: values.color });
|
|
102
93
|
const description = await resolveTextInput(values.description, values["description-file"], "--description");
|
|
103
94
|
const input = labelCreateSchema.parse({
|
|
@@ -125,18 +116,12 @@ Example: zinn label create bug --description 'Unexpected behavior' --color red`,
|
|
|
125
116
|
},
|
|
126
117
|
list: {
|
|
127
118
|
summary: "List all global label definitions.",
|
|
128
|
-
effects: { domain: "read", storage: "normal-open" },
|
|
119
|
+
effects: { domain: "read", storage: "normal-open", external: [] },
|
|
129
120
|
confirmation: { kind: "none" },
|
|
130
121
|
input: labelInputs.list,
|
|
131
122
|
results: [jsonResult("LabelList")],
|
|
132
123
|
run: (args) => {
|
|
133
|
-
|
|
134
|
-
options: labelInputs.list.options,
|
|
135
|
-
args,
|
|
136
|
-
strict: true,
|
|
137
|
-
allowPositionals: true,
|
|
138
|
-
});
|
|
139
|
-
validatePositionals(positionals, labelInputs.list.forms[0]);
|
|
124
|
+
parseCommandArgs(args, labelInputs.list);
|
|
140
125
|
output(label.getAll().map(presentLabel), (entries) => formatLabelList(entries, { showsDescriptionPreview: true }));
|
|
141
126
|
},
|
|
142
127
|
help: `${generateCommandUsage("label list", labelInputs.list)}
|
|
@@ -147,18 +132,12 @@ Use label view <name> for the full description. --json keeps the full text.`,
|
|
|
147
132
|
},
|
|
148
133
|
view: {
|
|
149
134
|
summary: "Show a global label with its full description.",
|
|
150
|
-
effects: { domain: "read", storage: "normal-open" },
|
|
135
|
+
effects: { domain: "read", storage: "normal-open", external: [] },
|
|
151
136
|
confirmation: { kind: "none" },
|
|
152
137
|
input: labelInputs.view,
|
|
153
138
|
results: [jsonResult("Label")],
|
|
154
139
|
run: (args) => {
|
|
155
|
-
const { positionals } =
|
|
156
|
-
args,
|
|
157
|
-
options: labelInputs.view.options,
|
|
158
|
-
strict: true,
|
|
159
|
-
allowPositionals: true,
|
|
160
|
-
});
|
|
161
|
-
validatePositionals(positionals, labelInputs.view.forms[0]);
|
|
140
|
+
const { positionals } = parseCommandArgs(args, labelInputs.view);
|
|
162
141
|
const props = labelDeleteSchema.parse({ name: positionals[0] });
|
|
163
142
|
const labelMatch = label.getByName(props.name);
|
|
164
143
|
if (labelMatch == null) {
|
|
@@ -179,20 +158,12 @@ Example: zinn label view bug`,
|
|
|
179
158
|
},
|
|
180
159
|
edit: {
|
|
181
160
|
summary: "Change specified fields.",
|
|
182
|
-
effects: { domain: "update", storage: "normal-open" },
|
|
161
|
+
effects: { domain: "update", storage: "normal-open", external: [] },
|
|
183
162
|
confirmation: { kind: "none" },
|
|
184
163
|
input: labelInputs.edit,
|
|
185
164
|
results: [jsonResult("LabelChange")],
|
|
186
165
|
run: async (args) => {
|
|
187
|
-
const { values, positionals
|
|
188
|
-
args,
|
|
189
|
-
options: labelInputs.edit.options,
|
|
190
|
-
allowPositionals: true,
|
|
191
|
-
strict: true,
|
|
192
|
-
tokens: true,
|
|
193
|
-
});
|
|
194
|
-
validateUniqueOptions(tokens, labelInputs.edit.options);
|
|
195
|
-
validatePositionals(positionals, labelInputs.edit.forms[0]);
|
|
166
|
+
const { values, positionals } = parseCommandArgs(args, labelInputs.edit);
|
|
196
167
|
const expected = labelExpectations.parseValues(values);
|
|
197
168
|
checkFieldsBeforeText(labelEditSchema, {
|
|
198
169
|
labelName: positionals[0],
|
|
@@ -238,20 +209,12 @@ Examples:
|
|
|
238
209
|
},
|
|
239
210
|
delete: {
|
|
240
211
|
summary: "Delete a label definition and remove it from all tasks after confirmation.",
|
|
241
|
-
effects: { domain: "delete", storage: "normal-open" },
|
|
212
|
+
effects: { domain: "delete", storage: "normal-open", external: [] },
|
|
242
213
|
confirmation: { kind: "prompt", description: confirmationDescription },
|
|
243
214
|
input: labelInputs.delete,
|
|
244
215
|
results: [jsonResult("Label")],
|
|
245
216
|
run: async (args) => {
|
|
246
|
-
const { values, positionals
|
|
247
|
-
args,
|
|
248
|
-
options: labelInputs.delete.options,
|
|
249
|
-
strict: true,
|
|
250
|
-
allowPositionals: true,
|
|
251
|
-
tokens: true,
|
|
252
|
-
});
|
|
253
|
-
validateUniqueOptions(tokens, labelInputs.delete.options);
|
|
254
|
-
validatePositionals(positionals, labelInputs.delete.forms[0]);
|
|
217
|
+
const { values, positionals } = parseCommandArgs(args, labelInputs.delete);
|
|
255
218
|
const props = labelDeleteSchema.parse({ name: positionals[0] });
|
|
256
219
|
const labelMatch = label.getByName(props.name);
|
|
257
220
|
if (labelMatch == null) {
|
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
import { jsonResult } from "../results.js";
|
|
2
|
-
import {
|
|
3
|
-
import { migrate, MigrationRefusedError, getBackupStorage } from "@zinn-dev/core";
|
|
2
|
+
import { migrate, DatabaseChangeAppliedError, MigrationRefusedError } from "@zinn-dev/core";
|
|
4
3
|
import { generateCommandUsage, noInput } from "../input.js";
|
|
5
4
|
import { reportLockWait } from "../database.js";
|
|
6
|
-
import { diagnostic, output,
|
|
5
|
+
import { diagnostic, output, parseCommandArgs } from "../lib.js";
|
|
7
6
|
import packageJson from "../../package.json" with { type: "json" };
|
|
8
7
|
export const migrateCommand = {
|
|
9
8
|
summary: "Upgrade an existing database to the latest schema version.",
|
|
10
|
-
effects: { domain: "none", storage: "migrate" },
|
|
9
|
+
effects: { domain: "none", storage: "migrate", external: [] },
|
|
11
10
|
confirmation: { kind: "none" },
|
|
12
11
|
input: noInput,
|
|
13
12
|
results: [jsonResult("Migrate")],
|
|
14
13
|
run: (args) => {
|
|
15
|
-
|
|
16
|
-
options: noInput.options,
|
|
17
|
-
args,
|
|
18
|
-
strict: true,
|
|
19
|
-
allowPositionals: true,
|
|
20
|
-
});
|
|
21
|
-
validatePositionals(positionals, noInput.forms[0]);
|
|
22
|
-
// Resolved before the try, so a store that cannot be resolved fails without the note about backups.
|
|
23
|
-
const { backupDirectory } = getBackupStorage();
|
|
14
|
+
parseCommandArgs(args, noInput);
|
|
24
15
|
try {
|
|
25
16
|
const result = migrate.run({
|
|
26
17
|
client: "cli",
|
|
@@ -32,9 +23,8 @@ export const migrateCommand = {
|
|
|
32
23
|
: `The database is already at schema version ${r.finalVersion}`);
|
|
33
24
|
}
|
|
34
25
|
catch (error) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
diagnostic(`The database is unchanged. Backups taken before each upgrade attempt are kept in ${backupDirectory}.`);
|
|
26
|
+
if (!(error instanceof MigrationRefusedError || error instanceof DatabaseChangeAppliedError)) {
|
|
27
|
+
diagnostic("The database is unchanged.");
|
|
38
28
|
}
|
|
39
29
|
throw error;
|
|
40
30
|
}
|
|
@@ -45,5 +35,6 @@ Upgrade an existing database to the latest schema version.
|
|
|
45
35
|
|
|
46
36
|
A backup is saved first, in the same place as \`zinn backup\`, and the upgrade is applied completely or not at all.
|
|
47
37
|
Does nothing when the database is already up to date.
|
|
38
|
+
Use this command to retry a paused automatic upgrade after fixing the cause of the failure.
|
|
48
39
|
Fails, leaving the database as it is, when there is no database with data yet, when it has no schema version, or when it is newer than this Zinn.`,
|
|
49
40
|
};
|
|
@@ -4,6 +4,7 @@ export declare const projectRouter: {
|
|
|
4
4
|
effects: {
|
|
5
5
|
domain: "create";
|
|
6
6
|
storage: "normal-open";
|
|
7
|
+
external: never[];
|
|
7
8
|
};
|
|
8
9
|
confirmation: {
|
|
9
10
|
kind: "none";
|
|
@@ -58,6 +59,7 @@ export declare const projectRouter: {
|
|
|
58
59
|
effects: {
|
|
59
60
|
domain: "read";
|
|
60
61
|
storage: "normal-open";
|
|
62
|
+
external: never[];
|
|
61
63
|
};
|
|
62
64
|
confirmation: {
|
|
63
65
|
kind: "none";
|
|
@@ -79,6 +81,7 @@ export declare const projectRouter: {
|
|
|
79
81
|
effects: {
|
|
80
82
|
domain: "read";
|
|
81
83
|
storage: "normal-open";
|
|
84
|
+
external: never[];
|
|
82
85
|
};
|
|
83
86
|
confirmation: {
|
|
84
87
|
kind: "none";
|
|
@@ -108,6 +111,7 @@ export declare const projectRouter: {
|
|
|
108
111
|
effects: {
|
|
109
112
|
domain: "update";
|
|
110
113
|
storage: "normal-open";
|
|
114
|
+
external: never[];
|
|
111
115
|
};
|
|
112
116
|
confirmation: {
|
|
113
117
|
kind: "none";
|
|
@@ -219,6 +223,7 @@ export declare const projectRouter: {
|
|
|
219
223
|
effects: {
|
|
220
224
|
domain: "delete";
|
|
221
225
|
storage: "normal-open";
|
|
226
|
+
external: never[];
|
|
222
227
|
};
|
|
223
228
|
confirmation: {
|
|
224
229
|
kind: "project-delete";
|
|
@@ -254,6 +259,7 @@ export declare const projectRouter: {
|
|
|
254
259
|
effects: {
|
|
255
260
|
domain: "create";
|
|
256
261
|
storage: "normal-open";
|
|
262
|
+
external: never[];
|
|
257
263
|
};
|
|
258
264
|
confirmation: {
|
|
259
265
|
kind: "none";
|
|
@@ -299,6 +305,7 @@ export declare const projectRouter: {
|
|
|
299
305
|
effects: {
|
|
300
306
|
domain: "read";
|
|
301
307
|
storage: "normal-open";
|
|
308
|
+
external: never[];
|
|
302
309
|
};
|
|
303
310
|
confirmation: {
|
|
304
311
|
kind: "none";
|
|
@@ -328,6 +335,7 @@ export declare const projectRouter: {
|
|
|
328
335
|
effects: {
|
|
329
336
|
domain: "update";
|
|
330
337
|
storage: "normal-open";
|
|
338
|
+
external: never[];
|
|
331
339
|
};
|
|
332
340
|
confirmation: {
|
|
333
341
|
kind: "prompt";
|
|
@@ -386,6 +394,7 @@ export declare const projectRouter: {
|
|
|
386
394
|
effects: {
|
|
387
395
|
domain: "update";
|
|
388
396
|
storage: "normal-open";
|
|
397
|
+
external: never[];
|
|
389
398
|
};
|
|
390
399
|
confirmation: {
|
|
391
400
|
kind: "none";
|
|
@@ -461,6 +470,7 @@ export declare const projectRouter: {
|
|
|
461
470
|
effects: {
|
|
462
471
|
domain: "delete";
|
|
463
472
|
storage: "normal-open";
|
|
473
|
+
external: never[];
|
|
464
474
|
};
|
|
465
475
|
confirmation: {
|
|
466
476
|
kind: "prompt";
|