@zinn-dev/cli 0.44.0 → 0.46.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 +7 -9
- package/src/actor.d.ts +1 -1
- package/src/actor.js +4 -1
- package/src/capabilities-schema.d.ts +9 -1
- package/src/column-hint.js +1 -3
- package/src/database.d.ts +1 -2
- package/src/database.js +1 -6
- package/src/duration-input.d.ts +7 -0
- package/src/duration-input.js +31 -0
- package/src/errors.d.ts +26 -0
- package/src/errors.js +46 -8
- package/src/expected-values.d.ts +48 -0
- package/src/expected-values.js +60 -0
- package/src/follow.d.ts +9 -0
- package/src/follow.js +58 -0
- package/src/input.d.ts +0 -8
- package/src/input.js +36 -16
- package/src/lib.d.ts +7 -3
- package/src/lib.js +70 -28
- package/src/list-continuation.js +1 -4
- package/src/presentation/activity-presentation.d.ts +2 -0
- package/src/presentation/activity-presentation.js +60 -3
- package/src/presentation/column-presentation.d.ts +9 -4
- package/src/presentation/column-presentation.js +29 -12
- package/src/presentation/doctor-presentation.d.ts +10 -0
- package/src/presentation/doctor-presentation.js +28 -0
- package/src/presentation/relation-presentation.js +2 -1
- 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 +2 -4
- package/src/presentation/task-blame-presentation.js +4 -2
- package/src/presentation/task-presentation.d.ts +18 -4
- package/src/presentation/task-presentation.js +94 -30
- package/src/result-schemas.d.ts +490 -58
- package/src/result-schemas.js +97 -2
- package/src/results.d.ts +6 -2
- package/src/results.js +9 -3
- package/src/routes/activity-router.d.ts +16 -5
- package/src/routes/activity-router.js +131 -70
- package/src/routes/aliases.js +1 -0
- package/src/routes/backup-router.d.ts +1 -0
- package/src/routes/backup-router.js +4 -3
- package/src/routes/capabilities-router.d.ts +1 -0
- package/src/routes/capabilities-router.js +1 -1
- package/src/routes/comment-router.d.ts +29 -6
- package/src/routes/comment-router.js +20 -10
- package/src/routes/doctor-router.d.ts +40 -0
- package/src/routes/doctor-router.js +83 -0
- package/src/routes/info-router.d.ts +1 -0
- package/src/routes/info-router.js +1 -1
- package/src/routes/label-router.d.ts +44 -6
- package/src/routes/label-router.js +27 -10
- package/src/routes/migrate-router.d.ts +1 -0
- package/src/routes/migrate-router.js +5 -7
- package/src/routes/project-router.d.ts +70 -11
- package/src/routes/project-router.js +130 -56
- package/src/routes/reindex-router.d.ts +1 -0
- package/src/routes/reindex-router.js +1 -1
- package/src/routes/relation-router.d.ts +3 -0
- package/src/routes/relation-router.js +9 -6
- package/src/routes/restore-router.d.ts +1 -0
- package/src/routes/restore-router.js +5 -6
- package/src/routes/router.js +5 -9
- package/src/routes/routes.d.ts +517 -35
- package/src/routes/routes.js +4 -0
- package/src/routes/skill-router.d.ts +76 -0
- package/src/routes/skill-router.js +179 -0
- package/src/routes/task-router.d.ts +264 -13
- package/src/routes/task-router.js +415 -93
- package/src/routes/whoami-router.d.ts +1 -0
- package/src/routes/whoami-router.js +1 -1
- 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 +8 -3
- package/src/text-edit.d.ts +2 -2
- package/src/text-input.d.ts +19 -1
- package/src/text-input.js +26 -5
- package/src/types.d.ts +4 -0
- package/src/types.js +6 -0
|
@@ -6,7 +6,7 @@ import { formatActor, presentActor } from "../presentation/activity-presentation
|
|
|
6
6
|
import { jsonResult } from "../results.js";
|
|
7
7
|
export const whoamiCommand = {
|
|
8
8
|
summary: "Show the actor a change would record in the current environment and folder.",
|
|
9
|
-
effects: { domain: "none", storage: "none" },
|
|
9
|
+
effects: { domain: "none", storage: "none", external: [] },
|
|
10
10
|
confirmation: { kind: "none" },
|
|
11
11
|
input: noInput,
|
|
12
12
|
results: [jsonResult("Actor")],
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** The name the skills CLI and agents know the workflow skill by */
|
|
2
|
+
export declare const SKILL_NAME = "zinn";
|
|
3
|
+
/** The workflow skill folder that ships with the CLI */
|
|
4
|
+
export declare const bundledSkillDirectory: string;
|
|
5
|
+
export type SkillCopyScope = "home" | "project";
|
|
6
|
+
/** A single Zinn skill file an agent can load, seen via every path that resolves to it */
|
|
7
|
+
export type SkillCopy = {
|
|
8
|
+
/** First checked path that resolves to this file */
|
|
9
|
+
path: string;
|
|
10
|
+
/** The other checked paths that resolve to this file, in checking order */
|
|
11
|
+
links: Array<string>;
|
|
12
|
+
realPath: string;
|
|
13
|
+
/** Where this copy lives (e.g. project, user, or bundled) */
|
|
14
|
+
scope: SkillCopyScope;
|
|
15
|
+
/** False when the file exists on disk but could not be read */
|
|
16
|
+
readable: boolean;
|
|
17
|
+
reviewedVersion: string | null;
|
|
18
|
+
/** Whether its reviewed version matches the bundled skill */
|
|
19
|
+
matches: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type SkillCopies = {
|
|
22
|
+
/** The reviewed version of the skill `zinn skill install` installs */
|
|
23
|
+
bundledVersion: string | null;
|
|
24
|
+
copies: Array<SkillCopy>;
|
|
25
|
+
};
|
|
26
|
+
/** The command that replaces a copy in the given scope with the bundled skill */
|
|
27
|
+
export declare function skillInstallCommand(scope: SkillCopyScope, workingFolder: string): string;
|
|
28
|
+
/** A skill file's reviewed CLI version, `null` when the file has none that can be read */
|
|
29
|
+
export declare function readReviewedVersion(skill: string): string | null;
|
|
30
|
+
/**
|
|
31
|
+
* Finds the Zinn skill copies in the home folder and the working folder and compares each with the bundled skill.
|
|
32
|
+
* Paths that lead to one file through links give one copy. A link that leads nowhere is no copy.
|
|
33
|
+
*/
|
|
34
|
+
export declare function findSkillCopies(home: string, workingFolder: string): SkillCopies;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { readFileSync, realpathSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { isMissingFileError } from "@zinn-dev/core";
|
|
5
|
+
/** The name the skills CLI and agents know the workflow skill by */
|
|
6
|
+
export const SKILL_NAME = "zinn";
|
|
7
|
+
/** The workflow skill folder that ships with the CLI */
|
|
8
|
+
export const bundledSkillDirectory = fileURLToPath(new URL("../skills/zinn", import.meta.url));
|
|
9
|
+
const SKILL_FILE_NAME = "SKILL.md";
|
|
10
|
+
/** The YAML frontmatter block that opens a skill file */
|
|
11
|
+
const FRONTMATTER_PATTERN = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/;
|
|
12
|
+
/**
|
|
13
|
+
* The reviewed version under the frontmatter's `metadata:`
|
|
14
|
+
* map, quoted or plain
|
|
15
|
+
*/
|
|
16
|
+
const REVIEWED_VERSION_PATTERN = /^metadata:[ \t]*\r?\n(?:[ \t]+.*\r?\n)*?[ \t]+zinn-cli-reviewed-version:[ \t]*(?:"([^"\r\n]*)"|'([^'\r\n]*)'|([^\s#'"]+))/m;
|
|
17
|
+
/**
|
|
18
|
+
* Agent skill folders in lookup order.
|
|
19
|
+
*
|
|
20
|
+
* OpenCode prefers project `.agents/skills` over home directory,
|
|
21
|
+
* whereas Claude Code prefers home `.claude/skills` over project.
|
|
22
|
+
*/
|
|
23
|
+
const SKILL_BASES = [
|
|
24
|
+
{ scope: "home", segments: [".agents", "skills"] },
|
|
25
|
+
{ scope: "home", segments: [".claude", "skills"] },
|
|
26
|
+
{ scope: "project", segments: [".agents", "skills"] },
|
|
27
|
+
{ scope: "project", segments: [".claude", "skills"] },
|
|
28
|
+
];
|
|
29
|
+
/** The command that replaces a copy in the given scope with the bundled skill */
|
|
30
|
+
export function skillInstallCommand(scope, workingFolder) {
|
|
31
|
+
return scope === "project"
|
|
32
|
+
? `\`zinn skill install --project\` run in ${workingFolder}`
|
|
33
|
+
: "`zinn skill install`";
|
|
34
|
+
}
|
|
35
|
+
/** A skill file's reviewed CLI version, `null` when the file has none that can be read */
|
|
36
|
+
export function readReviewedVersion(skill) {
|
|
37
|
+
const frontmatter = FRONTMATTER_PATTERN.exec(skill)?.[1];
|
|
38
|
+
if (frontmatter === undefined) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const match = REVIEWED_VERSION_PATTERN.exec(frontmatter);
|
|
42
|
+
if (match === null) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
return match[1] ?? match[2] ?? match[3] ?? null;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The file a path reaches after following links, `null` when it reaches nothing.
|
|
49
|
+
* Any other failure gives the path itself, so the read that follows reports the copy as unreadable.
|
|
50
|
+
*/
|
|
51
|
+
function resolveRealPath(path) {
|
|
52
|
+
try {
|
|
53
|
+
return realpathSync(path);
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
if (isMissingFileError(error)) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
return path;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Finds the Zinn skill copies in the home folder and the working folder and compares each with the bundled skill.
|
|
64
|
+
* Paths that lead to one file through links give one copy. A link that leads nowhere is no copy.
|
|
65
|
+
*/
|
|
66
|
+
export function findSkillCopies(home, workingFolder) {
|
|
67
|
+
// The skill ships with the CLI, and release checks guarantee its version.
|
|
68
|
+
const bundledVersion = readReviewedVersion(readFileSync(join(bundledSkillDirectory, SKILL_FILE_NAME), "utf8"));
|
|
69
|
+
const copies = [];
|
|
70
|
+
for (const { scope, segments } of SKILL_BASES) {
|
|
71
|
+
const path = join(scope === "home" ? home : workingFolder, ...segments, SKILL_NAME, SKILL_FILE_NAME);
|
|
72
|
+
const realPath = resolveRealPath(path);
|
|
73
|
+
if (realPath === null) {
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
const found = copies.find((copy) => copy.realPath === realPath);
|
|
77
|
+
if (found !== undefined) {
|
|
78
|
+
// A working folder equal to the home folder checks the same paths twice
|
|
79
|
+
const isNewPath = found.path !== path && !found.links.includes(path);
|
|
80
|
+
if (isNewPath) {
|
|
81
|
+
found.links.push(path);
|
|
82
|
+
}
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
let skill;
|
|
86
|
+
try {
|
|
87
|
+
skill = readFileSync(realPath, "utf8");
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
if (isMissingFileError(error)) {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
copies.push({
|
|
94
|
+
path,
|
|
95
|
+
links: [],
|
|
96
|
+
realPath,
|
|
97
|
+
scope,
|
|
98
|
+
readable: false,
|
|
99
|
+
reviewedVersion: null,
|
|
100
|
+
matches: false,
|
|
101
|
+
});
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
const reviewedVersion = readReviewedVersion(skill);
|
|
105
|
+
const matches = reviewedVersion !== null && reviewedVersion === bundledVersion;
|
|
106
|
+
copies.push({ path, links: [], realPath, scope, readable: true, reviewedVersion, matches });
|
|
107
|
+
}
|
|
108
|
+
return { bundledVersion, copies };
|
|
109
|
+
}
|
package/src/telemetry.d.ts
CHANGED
|
@@ -15,12 +15,12 @@ type MatchedRun = {
|
|
|
15
15
|
commandArgs: Array<string>;
|
|
16
16
|
help: boolean;
|
|
17
17
|
};
|
|
18
|
-
/** A successful run of a command that declares one of these only reads or reports, and leaves no record */
|
|
19
|
-
export declare const UNRECORDED_STORAGE_EFFECTS: ReadonlyArray<ParsedRoute["effects"]["storage"]>;
|
|
20
18
|
export declare function noteMatchedRun(run: MatchedRun): void;
|
|
21
19
|
/** An option-shaped word is left out of `unmatchedWord` because it can carry a value. `options` names it */
|
|
22
20
|
export declare function noteUnmatchedRun({ namespace, unmatchedWord, help }: UnmatchedRun): void;
|
|
23
21
|
export declare function noteParseArgsThrew(): void;
|
|
22
|
+
/** A successful run leaves no record when its command only reads or reports and writes no files outside the store */
|
|
23
|
+
export declare function isUnrecordedOnSuccess(effects: ParsedRoute["effects"]): boolean;
|
|
24
24
|
/**
|
|
25
25
|
* Appends this run's record to the current record file in the store's `telemetry` folder.
|
|
26
26
|
* A run that starts a new file first deletes old ones, so the newest records are the ones kept.
|
package/src/telemetry.js
CHANGED
|
@@ -21,8 +21,8 @@ const FILES_PER_CAP = 10;
|
|
|
21
21
|
const MILLISECONDS_PER_DAY = 86_400_000;
|
|
22
22
|
/** parseArgs reads any word starting with `--` as an option up to its first `=`, spaces included */
|
|
23
23
|
const OPTION_NAME_SHAPE = /^--?[A-Za-z0-9][\w-]*$/;
|
|
24
|
-
/** A
|
|
25
|
-
|
|
24
|
+
/** A command that declares one of these only reads or reports Zinn's data */
|
|
25
|
+
const UNRECORDED_STORAGE_EFFECTS = [
|
|
26
26
|
"none",
|
|
27
27
|
"inspect",
|
|
28
28
|
];
|
|
@@ -187,11 +187,16 @@ function createRecord(outcome, startedAt, elapsedMs) {
|
|
|
187
187
|
parentPid: process.ppid,
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
|
+
/** A successful run leaves no record when its command only reads or reports and writes no files outside the store */
|
|
191
|
+
export function isUnrecordedOnSuccess(effects) {
|
|
192
|
+
const writesExternalFiles = effects.external.includes("files");
|
|
193
|
+
return UNRECORDED_STORAGE_EFFECTS.includes(effects.storage) && !writesExternalFiles;
|
|
194
|
+
}
|
|
190
195
|
function isUnrecordedRun({ failure }) {
|
|
191
196
|
return (failure === undefined &&
|
|
192
197
|
matchedRun !== null &&
|
|
193
198
|
!matchedRun.help &&
|
|
194
|
-
|
|
199
|
+
isUnrecordedOnSuccess(matchedRun.match.effects));
|
|
195
200
|
}
|
|
196
201
|
/** One write on a descriptor opened for append, so parallel runs cannot split each other's lines */
|
|
197
202
|
function appendLine(path, line) {
|
package/src/text-edit.d.ts
CHANGED
|
@@ -22,11 +22,11 @@ export declare function textEditConstraints(textFlag: TextFlag): readonly [{
|
|
|
22
22
|
}, {
|
|
23
23
|
readonly kind: "requiresAny";
|
|
24
24
|
readonly input: "option:append";
|
|
25
|
-
readonly members: readonly ["option:description" | "option:text", "option:description-file" | "option:text-file"];
|
|
25
|
+
readonly members: readonly ["option:description" | "option:text" | "option:expect-description" | "option:expect-text", "option:description-file" | "option:text-file" | "option:expect-description-file" | "option:expect-text-file"];
|
|
26
26
|
}, {
|
|
27
27
|
readonly kind: "requiresAny";
|
|
28
28
|
readonly input: "option:replacing";
|
|
29
|
-
readonly members: readonly ["option:description" | "option:text", "option:description-file" | "option:text-file"];
|
|
29
|
+
readonly members: readonly ["option:description" | "option:text" | "option:expect-description" | "option:expect-text", "option:description-file" | "option:text-file" | "option:expect-description-file" | "option:expect-text-file"];
|
|
30
30
|
}, {
|
|
31
31
|
readonly kind: "requires";
|
|
32
32
|
readonly input: "option:all";
|
package/src/text-input.d.ts
CHANGED
|
@@ -9,6 +9,14 @@ declare const textOptions: {
|
|
|
9
9
|
readonly text: "text";
|
|
10
10
|
readonly file: "text-file";
|
|
11
11
|
};
|
|
12
|
+
readonly "--expect-description": {
|
|
13
|
+
readonly text: "expect-description";
|
|
14
|
+
readonly file: "expect-description-file";
|
|
15
|
+
};
|
|
16
|
+
readonly "--expect-text": {
|
|
17
|
+
readonly text: "expect-text";
|
|
18
|
+
readonly file: "expect-text-file";
|
|
19
|
+
};
|
|
12
20
|
};
|
|
13
21
|
export type TextFlag = keyof typeof textOptions;
|
|
14
22
|
export type TextValues = {
|
|
@@ -20,6 +28,12 @@ export declare function textOptionNames(textFlag: TextFlag): {
|
|
|
20
28
|
} | {
|
|
21
29
|
readonly text: "text";
|
|
22
30
|
readonly file: "text-file";
|
|
31
|
+
} | {
|
|
32
|
+
readonly text: "expect-description";
|
|
33
|
+
readonly file: "expect-description-file";
|
|
34
|
+
} | {
|
|
35
|
+
readonly text: "expect-text";
|
|
36
|
+
readonly file: "expect-text-file";
|
|
23
37
|
};
|
|
24
38
|
/** The flag that reads a text flag's value from a file, or from stdin as "-" */
|
|
25
39
|
export declare const textFileOption: {
|
|
@@ -33,7 +47,7 @@ export declare const textFileOption: {
|
|
|
33
47
|
/** Inline text and its file flag are alternatives for the same field */
|
|
34
48
|
export declare function textSourceConstraint(textFlag: TextFlag): {
|
|
35
49
|
readonly kind: "exclusive";
|
|
36
|
-
readonly members: readonly ["option:description" | "option:text", "option:description-file" | "option:text-file"];
|
|
50
|
+
readonly members: readonly ["option:description" | "option:text" | "option:expect-description" | "option:expect-text", "option:description-file" | "option:text-file" | "option:expect-description-file" | "option:expect-text-file"];
|
|
37
51
|
};
|
|
38
52
|
/**
|
|
39
53
|
* Validates `fields` against their rules in a core input schema, so a command can reject
|
|
@@ -42,6 +56,10 @@ export declare function textSourceConstraint(textFlag: TextFlag): {
|
|
|
42
56
|
*/
|
|
43
57
|
export declare function checkFieldsBeforeText(schema: z.ZodObject, fields: Record<string, unknown>): void;
|
|
44
58
|
export declare function textFileHelp(textFlag: TextFlag): string;
|
|
59
|
+
/** Refuses inline text together with its file flag before anything is read */
|
|
60
|
+
export declare function checkSingleTextSource(text: string | undefined, path: string | undefined, textFlag: TextFlag): void;
|
|
61
|
+
/** Refuses more than one file flag reading stdin, since stdin can be read only once.*/
|
|
62
|
+
export declare function checkSingleStdinReader(values: TextValues, textFlags: ReadonlyArray<TextFlag>): void;
|
|
45
63
|
/** Resolves one inline or file source before the command opens the database. */
|
|
46
64
|
export declare function resolveTextInput(text: string | undefined, path: string | undefined, textFlag: TextFlag): Promise<string | undefined>;
|
|
47
65
|
export {};
|
package/src/text-input.js
CHANGED
|
@@ -7,6 +7,13 @@ import { CliError, classifyFailure } from "./errors.js";
|
|
|
7
7
|
const textOptions = {
|
|
8
8
|
"--description": { text: "description", file: "description-file" },
|
|
9
9
|
"--text": { text: "text", file: "text-file" },
|
|
10
|
+
"--expect-description": { text: "expect-description", file: "expect-description-file" },
|
|
11
|
+
"--expect-text": { text: "expect-text", file: "expect-text-file" },
|
|
12
|
+
};
|
|
13
|
+
/** How to give an empty value for a text flag, shown when its file input is blank */
|
|
14
|
+
const blankInputHints = {
|
|
15
|
+
"--description": ' To clear a description, use --description "".',
|
|
16
|
+
"--expect-description": ' To expect no description, use --expect-description "".',
|
|
10
17
|
};
|
|
11
18
|
export function textOptionNames(textFlag) {
|
|
12
19
|
return textOptions[textFlag];
|
|
@@ -133,15 +140,30 @@ async function readStdin(fileFlag, refuse) {
|
|
|
133
140
|
readAvailable();
|
|
134
141
|
});
|
|
135
142
|
}
|
|
143
|
+
/** Refuses inline text together with its file flag before anything is read */
|
|
144
|
+
export function checkSingleTextSource(text, path, textFlag) {
|
|
145
|
+
const fileFlag = `--${textOptionNames(textFlag).file}`;
|
|
146
|
+
if (text !== undefined && path !== undefined) {
|
|
147
|
+
throw new CliError(`Options "${textFlag}" and "${fileFlag}" cannot be used together.`, "invalid_input", { argument: fileFlag, path });
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/** Refuses more than one file flag reading stdin, since stdin can be read only once.*/
|
|
151
|
+
export function checkSingleStdinReader(values, textFlags) {
|
|
152
|
+
const stdinFlags = textFlags
|
|
153
|
+
.map((textFlag) => textOptionNames(textFlag).file)
|
|
154
|
+
.filter((file) => values[file] === "-")
|
|
155
|
+
.map((file) => `--${file}`);
|
|
156
|
+
if (stdinFlags.length > 1) {
|
|
157
|
+
throw new CliError(`Only one option can read stdin, but ${stdinFlags.join(" and ")} are both "-".`, "invalid_input", { argument: stdinFlags[1], path: "-" });
|
|
158
|
+
}
|
|
159
|
+
}
|
|
136
160
|
/** Resolves one inline or file source before the command opens the database. */
|
|
137
161
|
export async function resolveTextInput(text, path, textFlag) {
|
|
138
162
|
const fileFlag = `--${textOptionNames(textFlag).file}`;
|
|
139
163
|
const refuse = (message) => {
|
|
140
164
|
throw new CliError(message, "invalid_input", { argument: fileFlag, path });
|
|
141
165
|
};
|
|
142
|
-
|
|
143
|
-
refuse(`Options "${textFlag}" and "${fileFlag}" cannot be used together.`);
|
|
144
|
-
}
|
|
166
|
+
checkSingleTextSource(text, path, textFlag);
|
|
145
167
|
if (path === undefined) {
|
|
146
168
|
return text;
|
|
147
169
|
}
|
|
@@ -176,8 +198,7 @@ export async function resolveTextInput(text, path, textFlag) {
|
|
|
176
198
|
}
|
|
177
199
|
const result = decoded.slice(0, end);
|
|
178
200
|
if (result.trim().length === 0) {
|
|
179
|
-
|
|
180
|
-
refuse(`Input is empty or blank.${clearHint}`);
|
|
201
|
+
refuse(`Input is empty or blank.${blankInputHints[textFlag] ?? ""}`);
|
|
181
202
|
}
|
|
182
203
|
return result;
|
|
183
204
|
}
|
package/src/types.d.ts
CHANGED
|
@@ -19,6 +19,10 @@ export declare const commandEffectsSchema: z.ZodObject<{
|
|
|
19
19
|
restore: "restore";
|
|
20
20
|
inspect: "inspect";
|
|
21
21
|
}>;
|
|
22
|
+
external: z.ZodArray<z.ZodEnum<{
|
|
23
|
+
files: "files";
|
|
24
|
+
network: "network";
|
|
25
|
+
}>>;
|
|
22
26
|
}, z.core.$strict>;
|
|
23
27
|
export declare const commandConfirmationSchema: z.ZodObject<{
|
|
24
28
|
kind: z.ZodEnum<{
|
package/src/types.js
CHANGED
|
@@ -2,6 +2,12 @@ import { z } from "zod";
|
|
|
2
2
|
export const commandEffectsSchema = z.strictObject({
|
|
3
3
|
domain: z.enum(["read", "create", "update", "delete", "replace", "none"]),
|
|
4
4
|
storage: z.enum(["normal-open", "backup", "restore", "migrate", "reindex", "inspect", "none"]),
|
|
5
|
+
/**
|
|
6
|
+
* Kinds of effect outside Zinn's own data,
|
|
7
|
+
* like files written or deleted outside the store
|
|
8
|
+
* or making HTTP requests
|
|
9
|
+
*/
|
|
10
|
+
external: z.array(z.enum(["files", "network"])),
|
|
5
11
|
});
|
|
6
12
|
export const commandConfirmationSchema = z.strictObject({
|
|
7
13
|
kind: z.enum(["none", "prompt", "project-delete"]),
|