p-backlog 0.14.4 → 0.14.6
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/CHANGELOG.md +8 -0
- package/README.md +3 -2
- package/README.ru.md +3 -2
- package/dist/cli.js +288 -217
- package/dist/web/assets/{CodeTab-rgZ3oazM.js → CodeTab-_hswvGhR.js} +1 -1
- package/dist/web/assets/{CostTab-DR8zJt7h.js → CostTab-B45am3iT.js} +1 -1
- package/dist/web/assets/{EffectTab-DHdQSIlQ.js → EffectTab-BWrxZuDh.js} +1 -1
- package/dist/web/assets/{Figure-C2iLoqkF.js → Figure-C7mZic1d.js} +1 -1
- package/dist/web/assets/{OverviewTab-uNqeJSFu.js → OverviewTab-DPfu4cwL.js} +1 -1
- package/dist/web/assets/{Page-lpBrfWDj.js → Page-BY5pJG0W.js} +5 -5
- package/dist/web/assets/{QualityTab-hbgPdBwD.js → QualityTab-CeAPraBM.js} +1 -1
- package/dist/web/assets/{ShareBar-BXak6vBR.js → ShareBar-Do4ChaCM.js} +1 -1
- package/dist/web/assets/{StatsPage-CO1e1tAe.js → StatsPage-BVEaoI_Q.js} +1 -1
- package/dist/web/assets/{StatsTabState-ChT0Ee4K.js → StatsTabState-BnBfyJUZ.js} +1 -1
- package/dist/web/assets/{StatsTable-C0PeMtyw.js → StatsTable-DvgWwXbV.js} +1 -1
- package/dist/web/assets/{UnavailableRepos-CykRKvjj.js → UnavailableRepos-CSItGhrg.js} +1 -1
- package/dist/web/assets/{index-BuEw4eHx.js → index-C3BHVlUw.js} +2 -2
- package/dist/web/assets/start-D7vHv3Nm.js +257 -0
- package/dist/web/assets/{start-BvKCcZHI.css → start-Dt9zi6Yh.css} +1 -1
- package/dist/web/assets/{use-grain-panel-BrOKdaLI.js → use-grain-panel-BU4IiIEr.js} +7 -7
- package/dist/web/assets/web-paths-CUpod7kw.js +1 -0
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/web/assets/start-CmS4D9jZ.js +0 -257
- package/dist/web/assets/web-paths-B6f4e9Br.js +0 -1
package/dist/cli.js
CHANGED
|
@@ -914,7 +914,29 @@ ${content}
|
|
|
914
914
|
}
|
|
915
915
|
|
|
916
916
|
// src/core/model/types.ts
|
|
917
|
+
import { z as z5 } from "zod";
|
|
918
|
+
|
|
919
|
+
// src/core/model/probability.ts
|
|
917
920
|
import { z as z4 } from "zod";
|
|
921
|
+
var MAX_PROBABILITY = 100;
|
|
922
|
+
var probabilitySchema = z4.number().int().min(0).max(MAX_PROBABILITY);
|
|
923
|
+
function parseProbability(value) {
|
|
924
|
+
const text = value.trim();
|
|
925
|
+
return /^\d+$/u.test(text) ? probabilitySchema.safeParse(Number(text)).data : void 0;
|
|
926
|
+
}
|
|
927
|
+
function parseProbabilityFilter(value) {
|
|
928
|
+
if (value == null) return void 0;
|
|
929
|
+
if (value === "none") return value;
|
|
930
|
+
const [lower = "", upper, ...rest] = value.split("..").map((part) => part.trim());
|
|
931
|
+
if (upper === void 0 || rest.length > 0) return void 0;
|
|
932
|
+
const min = parseProbability(lower);
|
|
933
|
+
const max = parseProbability(upper);
|
|
934
|
+
if (lower !== "" && min === void 0 || upper !== "" && max === void 0) return void 0;
|
|
935
|
+
if (min === void 0 && max === void 0 || (min ?? 0) > (max ?? MAX_PROBABILITY)) return void 0;
|
|
936
|
+
return { min, max };
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
// src/core/model/types.ts
|
|
918
940
|
var TASK_TYPES = ["task", "epic"];
|
|
919
941
|
var TASK_STATUSES = ["backlog", "in-progress", "blocked", "done", "cancelled"];
|
|
920
942
|
var PRIORITIES = ["low", "medium", "high", "critical"];
|
|
@@ -931,33 +953,34 @@ function normalizeTags(tags) {
|
|
|
931
953
|
)
|
|
932
954
|
];
|
|
933
955
|
}
|
|
934
|
-
var taskIdSchema =
|
|
935
|
-
var taskIdList =
|
|
936
|
-
var taskFrontmatterSchema =
|
|
956
|
+
var taskIdSchema = z5.string().regex(ID_PATTERN, schemaCode("bad-id"));
|
|
957
|
+
var taskIdList = z5.array(taskIdSchema).default([]).transform((ids) => [...new Set(ids)]);
|
|
958
|
+
var taskFrontmatterSchema = z5.object({
|
|
937
959
|
id: taskIdSchema,
|
|
938
|
-
title:
|
|
939
|
-
type:
|
|
940
|
-
status:
|
|
941
|
-
priority:
|
|
942
|
-
|
|
943
|
-
|
|
960
|
+
title: z5.string().trim().min(1, schemaCode("empty-title")),
|
|
961
|
+
type: z5.enum(TASK_TYPES).default("task"),
|
|
962
|
+
status: z5.enum(TASK_STATUSES).default("backlog"),
|
|
963
|
+
priority: z5.enum(PRIORITIES).default("medium"),
|
|
964
|
+
probability: probabilitySchema.nullable().transform((value) => value ?? void 0).optional(),
|
|
965
|
+
category: z5.enum(TASK_CATEGORIES).optional(),
|
|
966
|
+
tags: z5.array(z5.string()).default([]).transform(normalizeTags),
|
|
944
967
|
epic: taskIdSchema.optional(),
|
|
945
968
|
blockedBy: taskIdList,
|
|
946
969
|
related: taskIdList,
|
|
947
|
-
created:
|
|
948
|
-
source:
|
|
949
|
-
anchor:
|
|
950
|
-
closed:
|
|
951
|
-
resolution:
|
|
952
|
-
reason:
|
|
953
|
-
verified:
|
|
970
|
+
created: z5.iso.datetime({ offset: true }),
|
|
971
|
+
source: z5.string().optional(),
|
|
972
|
+
anchor: z5.string().optional(),
|
|
973
|
+
closed: z5.iso.datetime({ offset: true }).optional(),
|
|
974
|
+
resolution: z5.enum(RESOLUTIONS).optional(),
|
|
975
|
+
reason: z5.string().optional(),
|
|
976
|
+
verified: z5.iso.datetime({ offset: true }).optional()
|
|
954
977
|
});
|
|
955
|
-
var projectFrontmatterSchema =
|
|
956
|
-
name:
|
|
957
|
-
prefix:
|
|
958
|
-
repos:
|
|
959
|
-
issuedUpTo:
|
|
960
|
-
active:
|
|
978
|
+
var projectFrontmatterSchema = z5.object({
|
|
979
|
+
name: z5.string().trim().min(1, schemaCode("empty-name")),
|
|
980
|
+
prefix: z5.string().regex(PREFIX_PATTERN, schemaCode("bad-prefix")),
|
|
981
|
+
repos: z5.array(z5.string()).default([]),
|
|
982
|
+
issuedUpTo: z5.number().int().nonnegative().optional(),
|
|
983
|
+
active: z5.boolean().default(true)
|
|
961
984
|
});
|
|
962
985
|
|
|
963
986
|
// src/core/model/project-file.ts
|
|
@@ -1187,7 +1210,7 @@ function hostCliEnv() {
|
|
|
1187
1210
|
}
|
|
1188
1211
|
|
|
1189
1212
|
// src/core/messages/en.ts
|
|
1190
|
-
import { z as
|
|
1213
|
+
import { z as z6 } from "zod";
|
|
1191
1214
|
|
|
1192
1215
|
// src/core/model/source.ts
|
|
1193
1216
|
var SOURCE_LINES = /:(\d+)(?:-(\d+))?$/;
|
|
@@ -1323,7 +1346,7 @@ function witnessOf(type) {
|
|
|
1323
1346
|
}
|
|
1324
1347
|
|
|
1325
1348
|
// src/core/messages/en.ts
|
|
1326
|
-
var zodEn =
|
|
1349
|
+
var zodEn = z6.locales.en().localeError;
|
|
1327
1350
|
var CATEGORY_LABELS = {
|
|
1328
1351
|
bloaters: "Bloaters",
|
|
1329
1352
|
"change-preventers": "Change preventers",
|
|
@@ -1586,8 +1609,8 @@ var coreEn = {
|
|
|
1586
1609
|
};
|
|
1587
1610
|
|
|
1588
1611
|
// src/core/messages/ru.ts
|
|
1589
|
-
import { z as
|
|
1590
|
-
var zodRu =
|
|
1612
|
+
import { z as z7 } from "zod";
|
|
1613
|
+
var zodRu = z7.locales.ru().localeError;
|
|
1591
1614
|
var CATEGORY_LABELS2 = {
|
|
1592
1615
|
bloaters: "\u0420\u0430\u0437\u0431\u0443\u0445\u0448\u0435\u0435",
|
|
1593
1616
|
"change-preventers": "\u041C\u0435\u0448\u0430\u0435\u0442 \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F\u043C",
|
|
@@ -1910,11 +1933,11 @@ function taskCreation(record, created) {
|
|
|
1910
1933
|
}
|
|
1911
1934
|
|
|
1912
1935
|
// src/core/journal/events.ts
|
|
1913
|
-
import { z as
|
|
1936
|
+
import { z as z8 } from "zod";
|
|
1914
1937
|
var CHANGE_SOURCES = ["cli", "web", "check", "sweep"];
|
|
1915
1938
|
var UNKNOWN = "unknown";
|
|
1916
1939
|
function recordedEnum(values) {
|
|
1917
|
-
return
|
|
1940
|
+
return z8.enum([...values, UNKNOWN]).catch(UNKNOWN);
|
|
1918
1941
|
}
|
|
1919
1942
|
var FOUND_HOW = ["review", "incidental", "manual"];
|
|
1920
1943
|
var CANDIDATE_EVIDENCE = ["source-changed", "source-missing", "duplicate", "no-source"];
|
|
@@ -1923,7 +1946,7 @@ var CHECK_METHODS = ["symbol", "anchor", "file"];
|
|
|
1923
1946
|
var RECORDED_METHODS = [...CHECK_METHODS, UNKNOWN];
|
|
1924
1947
|
var DUPLICATE_MATCHES = ["source", "title", "symbol"];
|
|
1925
1948
|
var RECORDED_MATCHES = [...DUPLICATE_MATCHES, UNKNOWN];
|
|
1926
|
-
var legacyMethodFlagsSchema =
|
|
1949
|
+
var legacyMethodFlagsSchema = z8.object({ bySymbol: z8.boolean().optional(), byAnchor: z8.boolean().optional() });
|
|
1927
1950
|
function recordedMethodOf(marks) {
|
|
1928
1951
|
return marks.method ?? methodOfLegacyFlags(marks);
|
|
1929
1952
|
}
|
|
@@ -1931,42 +1954,42 @@ function methodOfLegacyFlags({ bySymbol, byAnchor }) {
|
|
|
1931
1954
|
if (bySymbol === true) return "symbol";
|
|
1932
1955
|
return byAnchor === true ? "anchor" : UNKNOWN;
|
|
1933
1956
|
}
|
|
1934
|
-
var eventBase = { at:
|
|
1957
|
+
var eventBase = { at: z8.iso.datetime({ offset: true }), task: z8.string().min(1), via: recordedEnum(CHANGE_SOURCES), undo: z8.literal(true).optional().catch(void 0) };
|
|
1935
1958
|
var taskSnapshotSchema = taskFrontmatterSchema.extend({
|
|
1936
1959
|
priority: recordedEnum(PRIORITIES),
|
|
1937
1960
|
category: recordedEnum(TASK_CATEGORIES).optional(),
|
|
1938
1961
|
resolution: recordedEnum(RESOLUTIONS).optional()
|
|
1939
1962
|
});
|
|
1940
|
-
var journalEventSchema =
|
|
1941
|
-
|
|
1963
|
+
var journalEventSchema = z8.discriminatedUnion("kind", [
|
|
1964
|
+
z8.object({
|
|
1942
1965
|
...eventBase,
|
|
1943
|
-
kind:
|
|
1944
|
-
type:
|
|
1966
|
+
kind: z8.literal("created"),
|
|
1967
|
+
type: z8.enum(TASK_TYPES),
|
|
1945
1968
|
priority: recordedEnum(PRIORITIES),
|
|
1946
|
-
tags:
|
|
1947
|
-
source:
|
|
1948
|
-
epic:
|
|
1969
|
+
tags: z8.array(z8.string()),
|
|
1970
|
+
source: z8.string().optional(),
|
|
1971
|
+
epic: z8.string().optional(),
|
|
1949
1972
|
category: recordedEnum(TASK_CATEGORIES).optional(),
|
|
1950
1973
|
found: recordedEnum(FOUND_HOW).optional(),
|
|
1951
|
-
origin:
|
|
1974
|
+
origin: z8.object({ branch: z8.string().optional(), commit: z8.string().min(1) }).optional()
|
|
1952
1975
|
}),
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1976
|
+
z8.object({ ...eventBase, kind: z8.literal("status"), from: z8.enum(TASK_STATUSES), to: z8.enum(TASK_STATUSES), resolution: recordedEnum(RESOLUTIONS).optional() }),
|
|
1977
|
+
z8.object({ ...eventBase, kind: z8.literal("priority"), from: recordedEnum(PRIORITIES), to: recordedEnum(PRIORITIES) }),
|
|
1978
|
+
z8.object({ ...eventBase, kind: z8.literal("deleted"), snapshot: taskSnapshotSchema }),
|
|
1979
|
+
z8.object({ ...eventBase, kind: z8.literal("category"), from: recordedEnum(TASK_CATEGORIES).optional(), to: recordedEnum(TASK_CATEGORIES).optional() }),
|
|
1980
|
+
z8.object({ ...eventBase, kind: z8.literal("verified"), source: z8.string().optional(), commit: z8.string().min(1).optional().catch(void 0) }),
|
|
1981
|
+
z8.object({
|
|
1959
1982
|
...eventBase,
|
|
1960
|
-
kind:
|
|
1961
|
-
evidence:
|
|
1983
|
+
kind: z8.literal("candidate"),
|
|
1984
|
+
evidence: z8.enum(CANDIDATE_EVIDENCE),
|
|
1962
1985
|
mode: recordedEnum(CHECK_MODES),
|
|
1963
1986
|
method: recordedEnum(CHECK_METHODS).optional(),
|
|
1964
1987
|
...legacyMethodFlagsSchema.shape,
|
|
1965
1988
|
match: recordedEnum(DUPLICATE_MATCHES).optional(),
|
|
1966
|
-
model:
|
|
1989
|
+
model: z8.string().trim().min(1).optional().catch(void 0)
|
|
1967
1990
|
}),
|
|
1968
|
-
|
|
1969
|
-
|
|
1991
|
+
z8.object({ ...eventBase, kind: z8.literal("candidate-gone"), evidence: z8.enum(CANDIDATE_EVIDENCE) }),
|
|
1992
|
+
z8.object({ ...eventBase, kind: z8.literal("candidate-filtered"), symbol: z8.string() })
|
|
1970
1993
|
]);
|
|
1971
1994
|
var SNAPSHOT_FIELDS = Object.keys(taskSnapshotSchema.shape);
|
|
1972
1995
|
function hasUnknownValue(event) {
|
|
@@ -2197,6 +2220,22 @@ async function appendJournal(projectDir, events, onError) {
|
|
|
2197
2220
|
}
|
|
2198
2221
|
}
|
|
2199
2222
|
var JOURNAL_LOCK_WAIT_MS = 4 * BLOCKED_RETRIES_TOTAL_MS + 10 * SECOND_MS;
|
|
2223
|
+
async function appendDerivedJournalEvents(projectDir, derive, onError) {
|
|
2224
|
+
const path = join8(projectDir, JOURNAL_FILE);
|
|
2225
|
+
try {
|
|
2226
|
+
await withWriteLock(
|
|
2227
|
+
path,
|
|
2228
|
+
async (afterPublish) => {
|
|
2229
|
+
const { values } = await readJsonLines(path, journalEventSchema);
|
|
2230
|
+
const events = derive(values);
|
|
2231
|
+
if (events.length > 0) await appendJsonLines(path, events, afterPublish);
|
|
2232
|
+
},
|
|
2233
|
+
{ onErrorAfterPublish: onError }
|
|
2234
|
+
);
|
|
2235
|
+
} catch (error) {
|
|
2236
|
+
onError(path, error);
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2200
2239
|
async function appendWaitingForLock(path, events, afterPublish) {
|
|
2201
2240
|
try {
|
|
2202
2241
|
await withWriteLock(path, (underLock) => appendJsonLines(path, events, underLock), { ...afterPublish, waitLimitMs: JOURNAL_LOCK_WAIT_MS });
|
|
@@ -2689,6 +2728,7 @@ function applyChanges(task, changes, now, closure) {
|
|
|
2689
2728
|
...pickDefined(changes, CHANGE_FIELDS),
|
|
2690
2729
|
epic: nextOptional(task.epic, changes.epic),
|
|
2691
2730
|
category: nextOptional(task.category, changes.category),
|
|
2731
|
+
probability: nextOptional(task.probability, changes.probability),
|
|
2692
2732
|
anchor: nextAnchor(task, changes)
|
|
2693
2733
|
};
|
|
2694
2734
|
const moved = changes.status === void 0 ? edited : changeStatus(edited, changes.status, now, closure);
|
|
@@ -2883,6 +2923,8 @@ var cliEn = {
|
|
|
2883
2923
|
},
|
|
2884
2924
|
invalidChoice: (label, allowed, value) => `${label}: expected one of ${allowed.join(", ")}, got "${value}"`,
|
|
2885
2925
|
invalidPort: (source, value) => `${source}: expected a number from 1 to 65535, got "${value}"`,
|
|
2926
|
+
invalidProbability: (value) => `Probability must be a whole number from 0 to 100, got "${value}"`,
|
|
2927
|
+
invalidProbabilityFilter: (value) => `--probability expects an inclusive range (20..80, ..80 or 20..) with bounds from 0 to 100, or none, got "${value}"`,
|
|
2886
2928
|
commandFailed: (name, reason) => `Command ${name} failed: ${reason}`,
|
|
2887
2929
|
runNotRecorded: (error) => `Could not record the run: ${error}`,
|
|
2888
2930
|
sweepConflicts: (ids) => `Tasks changed while closed tasks were swept, the sweep will run again in a day: ${ids}`,
|
|
@@ -3030,7 +3072,7 @@ var cliEn = {
|
|
|
3030
3072
|
alertsShownWriteFailed: (error) => `Could not save the shown alerts: ${error}`,
|
|
3031
3073
|
hookTurnClaimFailed: (error) => `Could not record the turn for the double-hook guard: ${error}`,
|
|
3032
3074
|
newUsage: (types, priorities, found, defaultFound) => [
|
|
3033
|
-
`--title <title> [--type ${types}] [--priority ${priorities}] [--tags a,b]`,
|
|
3075
|
+
`--title <title> [--type ${types}] [--priority ${priorities}] [--probability <0..100>] [--tags a,b]`,
|
|
3034
3076
|
`--category <category> (required for tasks) [--found ${found}, default ${defaultFound}]`,
|
|
3035
3077
|
"[--source file:line] [--epic ID] [--blocked-by ID,\u2026] [--related ID,\u2026] [--project id] [--json]",
|
|
3036
3078
|
"[--force \u2014 create anyway even if a similar open task already exists]",
|
|
@@ -3056,7 +3098,7 @@ var cliEn = {
|
|
|
3056
3098
|
fixCommitRequired: 'Provide the fix commit: --reason "Fixed in <sha>: \u2026" (the commit must be in the project repository)',
|
|
3057
3099
|
deletesAtTail: (date) => `. Will be deleted ${date}`,
|
|
3058
3100
|
afterEpicCloses: (epic) => `after epic ${epic} closes`,
|
|
3059
|
-
listUsage: () => "[--query text] [--status s,\u2026] [--tag t,\u2026] [--project id | --all-projects] [--json]",
|
|
3101
|
+
listUsage: () => "[--query text] [--status s,\u2026] [--tag t,\u2026] [--probability <min..max|none>] [--project id | --all-projects] [--json]",
|
|
3060
3102
|
parseErrorLine: (path, problems3) => `Parse error in ${path}: ${problems3}`,
|
|
3061
3103
|
noTasksFound: "No tasks found",
|
|
3062
3104
|
fixedHeader: "Fixed:",
|
|
@@ -3079,6 +3121,8 @@ var cliRu = {
|
|
|
3079
3121
|
},
|
|
3080
3122
|
invalidChoice: (label, allowed, value) => `${label}: \u043E\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044F \u043E\u0434\u043D\u043E \u0438\u0437 ${allowed.join(", ")}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E \xAB${value}\xBB`,
|
|
3081
3123
|
invalidPort: (source, value) => `${source}: \u043E\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044F \u0447\u0438\u0441\u043B\u043E \u043E\u0442 1 \u0434\u043E 65535, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E \xAB${value}\xBB`,
|
|
3124
|
+
invalidProbability: (value) => `\u0412\u0435\u0440\u043E\u044F\u0442\u043D\u043E\u0441\u0442\u044C \u0434\u043E\u043B\u0436\u043D\u0430 \u0431\u044B\u0442\u044C \u0446\u0435\u043B\u044B\u043C \u0447\u0438\u0441\u043B\u043E\u043C \u043E\u0442 0 \u0434\u043E 100, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E \xAB${value}\xBB`,
|
|
3125
|
+
invalidProbabilityFilter: (value) => `\u0414\u043B\u044F --probability \u0443\u043A\u0430\u0436\u0438\u0442\u0435 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D \u0432\u043A\u043B\u044E\u0447\u0438\u0442\u0435\u043B\u044C\u043D\u043E (20..80, ..80 \u0438\u043B\u0438 20..) \u0441 \u0433\u0440\u0430\u043D\u0438\u0446\u0430\u043C\u0438 \u043E\u0442 0 \u0434\u043E 100 \u0438\u043B\u0438 none. \u041F\u043E\u043B\u0443\u0447\u0435\u043D\u043E \xAB${value}\xBB`,
|
|
3082
3126
|
commandFailed: (name, reason) => `\u041A\u043E\u043C\u0430\u043D\u0434\u0430 ${name} \u043D\u0435 \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0430: ${reason}`,
|
|
3083
3127
|
runNotRecorded: (error) => `\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u0437\u0430\u043F\u0443\u0441\u043A: ${error}`,
|
|
3084
3128
|
sweepConflicts: (ids) => `\u0417\u0430\u0434\u0430\u0447\u0438 \u043C\u0435\u043D\u044F\u043B\u0438\u0441\u044C \u0432\u043E \u0432\u0440\u0435\u043C\u044F \u0443\u0431\u043E\u0440\u043A\u0438 \u0437\u0430\u043A\u0440\u044B\u0442\u044B\u0445, \u043E\u043D\u0430 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0441\u044F \u0447\u0435\u0440\u0435\u0437 \u0441\u0443\u0442\u043A\u0438: ${ids}`,
|
|
@@ -3226,7 +3270,7 @@ var cliRu = {
|
|
|
3226
3270
|
alertsShownWriteFailed: (error) => `\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u043F\u043E\u043A\u0430\u0437\u0430\u043D\u043D\u044B\u0435 \u0442\u0440\u0435\u0432\u043E\u0433\u0438: ${error}`,
|
|
3227
3271
|
hookTurnClaimFailed: (error) => `\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0442\u043C\u0435\u0442\u0438\u0442\u044C \u0445\u043E\u0434 \u0432 \u0437\u0430\u0449\u0438\u0442\u0435 \u043E\u0442 \u0434\u0432\u043E\u0439\u043D\u043E\u0433\u043E \u0445\u0443\u043A\u0430: ${error}`,
|
|
3228
3272
|
newUsage: (types, priorities, found, defaultFound) => [
|
|
3229
|
-
`--title <\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A> [--type ${types}] [--priority ${priorities}] [--tags a,b]`,
|
|
3273
|
+
`--title <\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A> [--type ${types}] [--priority ${priorities}] [--probability <0..100>] [--tags a,b]`,
|
|
3230
3274
|
`--category <\u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F> (\u0434\u043B\u044F \u0437\u0430\u0434\u0430\u0447 \u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u0435\u043D) [--found ${found}, \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E ${defaultFound}]`,
|
|
3231
3275
|
"[--source \u0444\u0430\u0439\u043B:\u0441\u0442\u0440\u043E\u043A\u0430] [--epic ID] [--blocked-by ID,\u2026] [--related ID,\u2026] [--project id] [--json]",
|
|
3232
3276
|
"[--force \u2014 \u0441\u043E\u0437\u0434\u0430\u0442\u044C, \u0434\u0430\u0436\u0435 \u0435\u0441\u043B\u0438 \u043F\u043E\u0445\u043E\u0436\u0430\u044F \u043E\u0442\u043A\u0440\u044B\u0442\u0430\u044F \u0437\u0430\u0434\u0430\u0447\u0430 \u0443\u0436\u0435 \u0435\u0441\u0442\u044C]",
|
|
@@ -3252,7 +3296,7 @@ var cliRu = {
|
|
|
3252
3296
|
fixCommitRequired: '\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u043A\u043E\u043C\u043C\u0438\u0442 \u0438\u0441\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F: --reason "\u0418\u0441\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043E \u0432 <sha>: \u2026" (\u043A\u043E\u043C\u043C\u0438\u0442 \u0434\u043E\u043B\u0436\u0435\u043D \u0431\u044B\u0442\u044C \u0432 \u0440\u0435\u043F\u043E\u0437\u0438\u0442\u043E\u0440\u0438\u0438 \u043F\u0440\u043E\u0435\u043A\u0442\u0430)',
|
|
3253
3297
|
deletesAtTail: (date) => `. \u0423\u0434\u0430\u043B\u0438\u0442\u0441\u044F ${date}`,
|
|
3254
3298
|
afterEpicCloses: (epic) => `\u043F\u043E\u0441\u043B\u0435 \u0437\u0430\u043A\u0440\u044B\u0442\u0438\u044F \u044D\u043F\u0438\u043A\u0430 ${epic}`,
|
|
3255
|
-
listUsage: () => "[--query \u0442\u0435\u043A\u0441\u0442] [--status s,\u2026] [--tag t,\u2026] [--project id | --all-projects] [--json]",
|
|
3299
|
+
listUsage: () => "[--query \u0442\u0435\u043A\u0441\u0442] [--status s,\u2026] [--tag t,\u2026] [--probability <min..max|none>] [--project id | --all-projects] [--json]",
|
|
3256
3300
|
parseErrorLine: (path, problems3) => `\u041E\u0448\u0438\u0431\u043A\u0430 \u0440\u0430\u0437\u0431\u043E\u0440\u0430 ${path}: ${problems3}`,
|
|
3257
3301
|
noTasksFound: "\u0417\u0430\u0434\u0430\u0447 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E",
|
|
3258
3302
|
fixedHeader: "\u0418\u0441\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043E:",
|
|
@@ -3391,6 +3435,11 @@ function parseChoice(language, value, allowed, label) {
|
|
|
3391
3435
|
if (match === void 0) throw new UsageError(cliMessages(language).invalidChoice(label, allowed, value));
|
|
3392
3436
|
return match;
|
|
3393
3437
|
}
|
|
3438
|
+
function parseProbabilityValue(language, value) {
|
|
3439
|
+
const probability = parseProbability(value);
|
|
3440
|
+
if (probability === void 0) throw new UsageError(cliMessages(language).invalidProbability(value));
|
|
3441
|
+
return probability;
|
|
3442
|
+
}
|
|
3394
3443
|
function parsePort(language, value) {
|
|
3395
3444
|
return portNumber(value) ?? invalidPort(language, "--port", value);
|
|
3396
3445
|
}
|
|
@@ -4985,6 +5034,7 @@ function draftTask(id, path, { project, input, now }) {
|
|
|
4985
5034
|
type: input.type ?? "task",
|
|
4986
5035
|
status: "backlog",
|
|
4987
5036
|
priority: input.priority ?? "medium",
|
|
5037
|
+
probability: input.probability,
|
|
4988
5038
|
category: input.category,
|
|
4989
5039
|
tags: input.tags ?? [],
|
|
4990
5040
|
epic: input.epic,
|
|
@@ -5659,7 +5709,7 @@ ${task.body}`);
|
|
|
5659
5709
|
function filterTasks(tasks, filter, index) {
|
|
5660
5710
|
const tags = (filter.tags ?? []).map(normalizeTag);
|
|
5661
5711
|
return tasks.filter(
|
|
5662
|
-
(task) => (filter.projectId === void 0 || task.projectId === filter.projectId) && (filter.query === void 0 || matchesQuery(task, filter.query)) && anyOrIncludes(filter.statuses, task.status) && anyOrIncludes(filter.priorities, task.priority) && tags.every((tag) => task.tags.includes(tag)) && matchesEpic(task, filter.epic) && (filter.type === void 0 || task.type === filter.type) && (!filter.onlyUnblocked || !isBlocked(task, index))
|
|
5712
|
+
(task) => (filter.projectId === void 0 || task.projectId === filter.projectId) && (filter.query === void 0 || matchesQuery(task, filter.query)) && anyOrIncludes(filter.statuses, task.status) && anyOrIncludes(filter.priorities, task.priority) && matchesProbability(task.probability, filter.probability) && tags.every((tag) => task.tags.includes(tag)) && matchesEpic(task, filter.epic) && (filter.type === void 0 || task.type === filter.type) && (!filter.onlyUnblocked || !isBlocked(task, index))
|
|
5663
5713
|
);
|
|
5664
5714
|
}
|
|
5665
5715
|
function sortTasks(tasks, sort, index, language) {
|
|
@@ -5716,6 +5766,11 @@ function matchesEpic(task, epic) {
|
|
|
5716
5766
|
if (epic === null) return task.epic === void 0;
|
|
5717
5767
|
return task.epic === epic;
|
|
5718
5768
|
}
|
|
5769
|
+
function matchesProbability(probability, filter) {
|
|
5770
|
+
if (filter === void 0) return true;
|
|
5771
|
+
if (filter === "none") return probability === void 0;
|
|
5772
|
+
return probability !== void 0 && probability >= (filter.min ?? 0) && probability <= (filter.max ?? MAX_PROBABILITY);
|
|
5773
|
+
}
|
|
5719
5774
|
function anyOrIncludes(allowed, value) {
|
|
5720
5775
|
return allowed === void 0 || allowed.includes(value);
|
|
5721
5776
|
}
|
|
@@ -6171,23 +6226,21 @@ function candidateOutcome(reviews) {
|
|
|
6171
6226
|
}
|
|
6172
6227
|
async function recordCandidates(root, tasks, { candidates, filtered, unchecked, unjudged }, { mode, now, projectIds, messages, warn: warn2, model }) {
|
|
6173
6228
|
const projectOf2 = new Map(tasks.map((task) => [task.id, task.projectId]));
|
|
6229
|
+
const endsGone = mode === "full";
|
|
6174
6230
|
for (const projectId of projectIds) {
|
|
6175
|
-
const
|
|
6176
|
-
const found = candidates.filter((candidate) => projectOf2.get(candidate.task.id) === projectId);
|
|
6231
|
+
const sightings = candidates.filter((candidate) => projectOf2.get(candidate.task.id) === projectId).map(sightingOf);
|
|
6177
6232
|
const filteredHere = filtered.filter((sighting) => projectOf2.get(sighting.task) === projectId);
|
|
6178
6233
|
const reviewed = tasks.filter((task) => task.projectId === projectId && isReviewable(task) && !unjudged.has(task.id)).map((task) => task.id);
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
reportFailure2(error);
|
|
6190
|
-
}
|
|
6234
|
+
if (sightings.length === 0 && filteredHere.length === 0 && (!endsGone || reviewed.length === 0)) continue;
|
|
6235
|
+
await appendDerivedJournalEvents(
|
|
6236
|
+
join19(root, projectId),
|
|
6237
|
+
(events) => {
|
|
6238
|
+
const states = episodeStates(events);
|
|
6239
|
+
const gone = endsGone ? candidateGoneEvents({ sightings, reviewed, unchecked: unchecked.get(projectId) ?? [] }, states, now) : [];
|
|
6240
|
+
return [...candidateEvents(sightings, states, now, mode, model), ...gone, ...filteredEvents(filteredHere, states, now)];
|
|
6241
|
+
},
|
|
6242
|
+
(_path, error) => warn2(messages.candidatesRecordFailed(projectId, errorText(error)))
|
|
6243
|
+
);
|
|
6191
6244
|
}
|
|
6192
6245
|
}
|
|
6193
6246
|
function sightingOf(candidate) {
|
|
@@ -6693,7 +6746,7 @@ async function isDirectory(path) {
|
|
|
6693
6746
|
// src/cli/skill-link.ts
|
|
6694
6747
|
import { mkdir as mkdir4, readlink as readlink2, symlink, unlink } from "node:fs/promises";
|
|
6695
6748
|
import { basename as basename8, dirname as dirname7, join as join22, resolve as resolve3 } from "node:path";
|
|
6696
|
-
import { z as
|
|
6749
|
+
import { z as z9 } from "zod";
|
|
6697
6750
|
|
|
6698
6751
|
// src/core/skill-name.ts
|
|
6699
6752
|
var SKILL_NAME = "backlog";
|
|
@@ -6707,7 +6760,7 @@ var SKILL_VARIANTS = {
|
|
|
6707
6760
|
|
|
6708
6761
|
// src/cli/skill-link.ts
|
|
6709
6762
|
var SKILL_SOURCE_DIRS = new Set(Object.values(SKILL_VARIANTS).map((variant) => variant.sourceDir));
|
|
6710
|
-
var packageManifestSchema =
|
|
6763
|
+
var packageManifestSchema = z9.object({ name: z9.string() });
|
|
6711
6764
|
function skillSourceDir(packageRoot2, language) {
|
|
6712
6765
|
return join22(packageRoot2, SKILL_SOURCES_DIR, SKILL_VARIANTS[language].sourceDir);
|
|
6713
6766
|
}
|
|
@@ -6763,10 +6816,10 @@ async function linkAgentSkill(agent, site, link2) {
|
|
|
6763
6816
|
}
|
|
6764
6817
|
|
|
6765
6818
|
// src/cli/agents/claude-plugin.ts
|
|
6766
|
-
import { z as
|
|
6819
|
+
import { z as z10 } from "zod";
|
|
6767
6820
|
var PLUGIN_NAMES = new Set(Object.values(SKILL_VARIANTS).map((variant) => variant.plugin));
|
|
6768
6821
|
var MARKETPLACE_SEPARATOR = "@";
|
|
6769
|
-
var enabledPluginsSchema =
|
|
6822
|
+
var enabledPluginsSchema = z10.object({ enabledPlugins: z10.record(z10.string(), z10.unknown()).optional() });
|
|
6770
6823
|
async function agentPluginReportingFailure(agent, places, onUnreadable) {
|
|
6771
6824
|
const settingsPath = AGENT_SPECS[agent].pluginSettingsPath;
|
|
6772
6825
|
if (settingsPath === null) return { plugin: null };
|
|
@@ -6881,7 +6934,7 @@ import { parseArgs as parseArgs2 } from "node:util";
|
|
|
6881
6934
|
|
|
6882
6935
|
// src/core/store/hook-turns.ts
|
|
6883
6936
|
import { join as join23 } from "node:path";
|
|
6884
|
-
import { z as
|
|
6937
|
+
import { z as z11 } from "zod";
|
|
6885
6938
|
|
|
6886
6939
|
// src/core/store/json-under-lock.ts
|
|
6887
6940
|
function updateJsonUnderLock(path, schema, empty, update, options) {
|
|
@@ -6900,7 +6953,7 @@ function updateJsonUnderLock(path, schema, empty, update, options) {
|
|
|
6900
6953
|
// src/core/store/hook-turns.ts
|
|
6901
6954
|
var HOOK_TURNS_FILE = ".hook-turns.json";
|
|
6902
6955
|
var CLAIM_WINDOW_MS = 6e4;
|
|
6903
|
-
var hookTurnsSchema =
|
|
6956
|
+
var hookTurnsSchema = z11.record(z11.string(), z11.iso.datetime({ offset: true }));
|
|
6904
6957
|
async function claimHookTurn(backlogRoot2, turnKey, { now, onError }) {
|
|
6905
6958
|
const outcome = await updateJsonUnderLock(
|
|
6906
6959
|
join23(backlogRoot2, HOOK_TURNS_FILE),
|
|
@@ -6918,7 +6971,7 @@ async function claimHookTurn(backlogRoot2, turnKey, { now, onError }) {
|
|
|
6918
6971
|
|
|
6919
6972
|
// src/core/store/signals-shown.ts
|
|
6920
6973
|
import { join as join24 } from "node:path";
|
|
6921
|
-
import { z as
|
|
6974
|
+
import { z as z12 } from "zod";
|
|
6922
6975
|
|
|
6923
6976
|
// src/core/model/signals-shown.ts
|
|
6924
6977
|
function markShown(shown, signals, today) {
|
|
@@ -6930,7 +6983,7 @@ function signalsToShow(signals, shown, today) {
|
|
|
6930
6983
|
|
|
6931
6984
|
// src/core/store/signals-shown.ts
|
|
6932
6985
|
var SIGNALS_SHOWN_FILE = ".signals-shown.json";
|
|
6933
|
-
var shownSchema =
|
|
6986
|
+
var shownSchema = z12.record(z12.string(), z12.string());
|
|
6934
6987
|
async function readSignalsShown(projectDir) {
|
|
6935
6988
|
return await readJsonFile(join24(projectDir, SIGNALS_SHOWN_FILE), shownSchema) ?? {};
|
|
6936
6989
|
}
|
|
@@ -6940,11 +6993,11 @@ async function rememberSignalsShown(projectDir, signals, today, onError) {
|
|
|
6940
6993
|
|
|
6941
6994
|
// src/core/store/session-shown.ts
|
|
6942
6995
|
import { join as join25 } from "node:path";
|
|
6943
|
-
import { z as
|
|
6996
|
+
import { z as z13 } from "zod";
|
|
6944
6997
|
var SESSION_SHOWN_FILE = ".candidates-shown.json";
|
|
6945
6998
|
var SESSION_RETENTION_MS = WEEK_MS;
|
|
6946
6999
|
var CODE_STATE_MARK = "@";
|
|
6947
|
-
var sessionsShownSchema =
|
|
7000
|
+
var sessionsShownSchema = z13.record(z13.string(), z13.object({ tasks: z13.array(z13.string()), at: z13.iso.datetime({ offset: true }) }));
|
|
6948
7001
|
function shownKey({ taskId, codeState }) {
|
|
6949
7002
|
return codeState === void 0 ? taskId : `${taskId}${CODE_STATE_MARK}${codeState}`;
|
|
6950
7003
|
}
|
|
@@ -7286,23 +7339,23 @@ function measuredByClosing(evidence2) {
|
|
|
7286
7339
|
|
|
7287
7340
|
// src/cli/agents/stop-event.ts
|
|
7288
7341
|
import { createHash as createHash4 } from "node:crypto";
|
|
7289
|
-
import { z as
|
|
7342
|
+
import { z as z14 } from "zod";
|
|
7290
7343
|
var TURN_DIGEST_LENGTH = 16;
|
|
7291
7344
|
var CURSOR_COMPLETED = "completed";
|
|
7292
|
-
var claudeEventSchema =
|
|
7293
|
-
cwd:
|
|
7294
|
-
session_id:
|
|
7295
|
-
turn_id:
|
|
7296
|
-
stop_hook_active:
|
|
7297
|
-
last_assistant_message:
|
|
7298
|
-
model:
|
|
7345
|
+
var claudeEventSchema = z14.object({
|
|
7346
|
+
cwd: z14.string(),
|
|
7347
|
+
session_id: z14.string().optional(),
|
|
7348
|
+
turn_id: z14.string().optional(),
|
|
7349
|
+
stop_hook_active: z14.boolean().optional(),
|
|
7350
|
+
last_assistant_message: z14.string().nullish(),
|
|
7351
|
+
model: z14.string().trim().min(1).optional().catch(void 0)
|
|
7299
7352
|
});
|
|
7300
|
-
var cursorEventSchema =
|
|
7301
|
-
workspace_roots:
|
|
7302
|
-
conversation_id:
|
|
7303
|
-
generation_id:
|
|
7304
|
-
status:
|
|
7305
|
-
loop_count:
|
|
7353
|
+
var cursorEventSchema = z14.object({
|
|
7354
|
+
workspace_roots: z14.tuple([z14.string()], z14.string()),
|
|
7355
|
+
conversation_id: z14.string().optional(),
|
|
7356
|
+
generation_id: z14.string().optional(),
|
|
7357
|
+
status: z14.string().optional(),
|
|
7358
|
+
loop_count: z14.number().optional()
|
|
7306
7359
|
});
|
|
7307
7360
|
function parseStopEvent(agent, text) {
|
|
7308
7361
|
return AGENT_SPECS[agent].stopProtocol === "cursor" ? parseCursorEvent(text) : parseClaudeEvent(text);
|
|
@@ -7543,12 +7596,15 @@ async function runList(args, io) {
|
|
|
7543
7596
|
query: { type: "string" },
|
|
7544
7597
|
status: { type: "string" },
|
|
7545
7598
|
tag: { type: "string" },
|
|
7599
|
+
probability: { type: "string" },
|
|
7546
7600
|
...SCOPE_OPTIONS,
|
|
7547
7601
|
json: { type: "boolean", default: false }
|
|
7548
7602
|
});
|
|
7549
7603
|
const requestedStatuses = splitList(values.status);
|
|
7550
7604
|
if (requestedStatuses?.length === 0) throw new UsageError(io.cli.invalidChoice("--status", TASK_STATUSES, values.status ?? ""));
|
|
7551
7605
|
const statuses = requestedStatuses?.map((status) => parseChoice(io.language, status, TASK_STATUSES, "--status")) ?? OPEN_STATUSES;
|
|
7606
|
+
const probability = parseProbabilityFilter(values.probability);
|
|
7607
|
+
if (values.probability !== void 0 && probability === void 0) throw new UsageError(io.cli.invalidProbabilityFilter(values.probability));
|
|
7552
7608
|
const loaded = await loadBacklog(io.backlogRoot);
|
|
7553
7609
|
const scope = resolveScope(loaded, io, values);
|
|
7554
7610
|
if (scope === null) return EXIT.notFound;
|
|
@@ -7560,7 +7616,7 @@ async function runList(args, io) {
|
|
|
7560
7616
|
const inScope = new Set(scope.activeIds);
|
|
7561
7617
|
const filtered = filterTasks(
|
|
7562
7618
|
loaded.tasks.filter((task) => inScope.has(task.projectId)),
|
|
7563
|
-
{ projectId, query: values.query, statuses, tags: splitList(values.tag) },
|
|
7619
|
+
{ projectId, query: values.query, statuses, tags: splitList(values.tag), probability },
|
|
7564
7620
|
index
|
|
7565
7621
|
);
|
|
7566
7622
|
const tasks = sortTasks(filtered, { key: "priority", direction: "desc" }, index, io.language);
|
|
@@ -7594,6 +7650,7 @@ var NEW_OPTIONS = {
|
|
|
7594
7650
|
title: { type: "string" },
|
|
7595
7651
|
type: { type: "string" },
|
|
7596
7652
|
priority: { type: "string" },
|
|
7653
|
+
probability: { type: "string" },
|
|
7597
7654
|
tags: { type: "string" },
|
|
7598
7655
|
category: { type: "string" },
|
|
7599
7656
|
found: { type: "string" },
|
|
@@ -7610,6 +7667,7 @@ async function runNew(args, io) {
|
|
|
7610
7667
|
if (values.title === void 0) throw new UsageError(io.cli.titleRequired);
|
|
7611
7668
|
const type = values.type === void 0 ? void 0 : parseChoice(io.language, values.type, TASK_TYPES, "--type");
|
|
7612
7669
|
const priority = values.priority === void 0 ? void 0 : parseChoice(io.language, values.priority, PRIORITIES, "--priority");
|
|
7670
|
+
const probability = values.probability === void 0 ? void 0 : parseProbabilityValue(io.language, values.probability);
|
|
7613
7671
|
const category = values.category === void 0 ? void 0 : parseChoice(io.language, values.category, TASK_CATEGORIES, "--category");
|
|
7614
7672
|
if (category === void 0 && type !== "epic") throw new UsageError(io.cli.categoryRequired);
|
|
7615
7673
|
const found = values.found === void 0 ? DEFAULT_FOUND : parseChoice(io.language, values.found, FOUND_HOW, "--found");
|
|
@@ -7628,6 +7686,7 @@ async function runNew(args, io) {
|
|
|
7628
7686
|
title: values.title,
|
|
7629
7687
|
type,
|
|
7630
7688
|
priority,
|
|
7689
|
+
probability,
|
|
7631
7690
|
category,
|
|
7632
7691
|
tags: splitList(values.tags),
|
|
7633
7692
|
source: values.source,
|
|
@@ -7684,6 +7743,16 @@ var priorityCommand = taskFieldCommand({
|
|
|
7684
7743
|
label: (task) => task.priority
|
|
7685
7744
|
});
|
|
7686
7745
|
|
|
7746
|
+
// src/cli/commands/probability.ts
|
|
7747
|
+
var NO_PROBABILITY = "none";
|
|
7748
|
+
var probabilityCommand = taskFieldCommand({
|
|
7749
|
+
name: "probability",
|
|
7750
|
+
choices: `0..100|${NO_PROBABILITY}`,
|
|
7751
|
+
parse: (language, value) => value === NO_PROBABILITY ? null : parseProbabilityValue(language, value),
|
|
7752
|
+
changes: (probability) => ({ probability }),
|
|
7753
|
+
label: (task) => task.probability === void 0 ? "\u2014" : `${task.probability}%`
|
|
7754
|
+
});
|
|
7755
|
+
|
|
7687
7756
|
// src/cli/commands/project.ts
|
|
7688
7757
|
var ACTIVE_BY_STATE = { active: true, inactive: false };
|
|
7689
7758
|
var projectCommand = {
|
|
@@ -7802,43 +7871,44 @@ import { Hono as Hono2 } from "hono";
|
|
|
7802
7871
|
import { streamSSE } from "hono/streaming";
|
|
7803
7872
|
|
|
7804
7873
|
// src/core/api/contract.ts
|
|
7805
|
-
import { z as
|
|
7806
|
-
var idList =
|
|
7807
|
-
var taskChangesSchema =
|
|
7808
|
-
title:
|
|
7809
|
-
type:
|
|
7810
|
-
status:
|
|
7811
|
-
priority:
|
|
7812
|
-
|
|
7874
|
+
import { z as z15 } from "zod";
|
|
7875
|
+
var idList = z15.array(taskIdSchema);
|
|
7876
|
+
var taskChangesSchema = z15.strictObject({
|
|
7877
|
+
title: z15.string().optional(),
|
|
7878
|
+
type: z15.enum(TASK_TYPES).optional(),
|
|
7879
|
+
status: z15.enum(TASK_STATUSES).optional(),
|
|
7880
|
+
priority: z15.enum(PRIORITIES).optional(),
|
|
7881
|
+
probability: probabilitySchema.nullable().optional(),
|
|
7882
|
+
tags: z15.array(z15.string()).optional(),
|
|
7813
7883
|
epic: taskIdSchema.nullable().optional(),
|
|
7814
7884
|
blockedBy: idList.optional(),
|
|
7815
7885
|
related: idList.optional(),
|
|
7816
|
-
body:
|
|
7817
|
-
category:
|
|
7886
|
+
body: z15.string().optional(),
|
|
7887
|
+
category: z15.enum(TASK_CATEGORIES).nullable().optional()
|
|
7818
7888
|
});
|
|
7819
|
-
var projectActiveSchema =
|
|
7820
|
-
var projectDeleteSchema =
|
|
7821
|
-
var settingsRequestSchema =
|
|
7822
|
-
var updateTaskRequestSchema =
|
|
7823
|
-
version:
|
|
7889
|
+
var projectActiveSchema = z15.strictObject({ active: z15.boolean() });
|
|
7890
|
+
var projectDeleteSchema = z15.strictObject({ confirm: z15.string() });
|
|
7891
|
+
var settingsRequestSchema = z15.strictObject(settingsSchema.shape);
|
|
7892
|
+
var updateTaskRequestSchema = z15.strictObject({
|
|
7893
|
+
version: z15.string().min(1),
|
|
7824
7894
|
changes: taskChangesSchema
|
|
7825
7895
|
});
|
|
7826
|
-
var batchPreviousSchema =
|
|
7827
|
-
status:
|
|
7828
|
-
priority:
|
|
7896
|
+
var batchPreviousSchema = z15.strictObject({
|
|
7897
|
+
status: z15.enum(TASK_STATUSES),
|
|
7898
|
+
priority: z15.enum(PRIORITIES),
|
|
7829
7899
|
epic: taskIdSchema.nullable()
|
|
7830
7900
|
});
|
|
7831
7901
|
var BATCH_TASKS_LIMIT = 500;
|
|
7832
|
-
var batchRequestSchema =
|
|
7833
|
-
tasks:
|
|
7834
|
-
action:
|
|
7835
|
-
|
|
7836
|
-
kind:
|
|
7837
|
-
reason:
|
|
7902
|
+
var batchRequestSchema = z15.strictObject({
|
|
7903
|
+
tasks: z15.array(z15.strictObject({ id: taskIdSchema, version: z15.string().min(1) })).min(1).max(BATCH_TASKS_LIMIT).refine((tasks) => new Set(tasks.map((task) => task.id)).size === tasks.length),
|
|
7904
|
+
action: z15.discriminatedUnion("kind", [
|
|
7905
|
+
z15.strictObject({
|
|
7906
|
+
kind: z15.literal("close"),
|
|
7907
|
+
reason: z15.string().transform(normalizeClosingReason).pipe(z15.string().min(1))
|
|
7838
7908
|
}),
|
|
7839
|
-
|
|
7840
|
-
|
|
7841
|
-
|
|
7909
|
+
z15.strictObject({ kind: z15.literal("priority"), priority: z15.enum(PRIORITIES) }),
|
|
7910
|
+
z15.strictObject({ kind: z15.literal("epic"), epic: taskIdSchema.nullable() }),
|
|
7911
|
+
z15.strictObject({ kind: z15.literal("restore"), changes: z15.record(taskIdSchema, batchPreviousSchema) })
|
|
7842
7912
|
])
|
|
7843
7913
|
});
|
|
7844
7914
|
|
|
@@ -8346,22 +8416,22 @@ var STATS_MEMORY_ROUTE = "/stats/memory";
|
|
|
8346
8416
|
|
|
8347
8417
|
// src/core/code/code-cache.ts
|
|
8348
8418
|
import { join as join28 } from "node:path";
|
|
8349
|
-
import { z as
|
|
8419
|
+
import { z as z16 } from "zod";
|
|
8350
8420
|
var CODE_CACHE_FILE = ".code-cache.json";
|
|
8351
8421
|
var CODE_CACHE_VERSION = 3;
|
|
8352
|
-
var repoScanSchema =
|
|
8353
|
-
head:
|
|
8354
|
-
main:
|
|
8355
|
-
commits:
|
|
8356
|
-
units:
|
|
8357
|
-
lines:
|
|
8422
|
+
var repoScanSchema = z16.object({
|
|
8423
|
+
head: z16.string(),
|
|
8424
|
+
main: z16.string().nullable(),
|
|
8425
|
+
commits: z16.array(z16.object({ date: z16.string(), paths: z16.array(z16.string()) })),
|
|
8426
|
+
units: z16.array(z16.object({ date: z16.string(), lines: z16.number() })),
|
|
8427
|
+
lines: z16.array(z16.object({ path: z16.string(), lines: z16.number() }))
|
|
8358
8428
|
});
|
|
8359
|
-
var fixCommitSchema =
|
|
8360
|
-
var snapshotSchema =
|
|
8361
|
-
version:
|
|
8362
|
-
repos:
|
|
8363
|
-
fixes:
|
|
8364
|
-
unsettled:
|
|
8429
|
+
var fixCommitSchema = z16.object({ date: z16.string(), landedAt: z16.string().optional(), byAgent: z16.boolean(), lines: z16.number(), testLines: z16.number() });
|
|
8430
|
+
var snapshotSchema = z16.object({
|
|
8431
|
+
version: z16.literal(CODE_CACHE_VERSION),
|
|
8432
|
+
repos: z16.record(z16.string(), repoScanSchema),
|
|
8433
|
+
fixes: z16.record(z16.string(), fixCommitSchema),
|
|
8434
|
+
unsettled: z16.record(z16.string(), z16.string().nullable())
|
|
8365
8435
|
});
|
|
8366
8436
|
function emptyCodeCache() {
|
|
8367
8437
|
return { repos: {}, fixes: {}, unsettled: {} };
|
|
@@ -9157,13 +9227,13 @@ function leadTimesIn(histories, span2) {
|
|
|
9157
9227
|
import { join as join30 } from "node:path";
|
|
9158
9228
|
|
|
9159
9229
|
// src/core/stats/cost/token-counts.ts
|
|
9160
|
-
import { z as
|
|
9161
|
-
var tokenCountsSchema =
|
|
9162
|
-
input:
|
|
9163
|
-
cacheWrite5m:
|
|
9164
|
-
cacheWrite1h:
|
|
9165
|
-
cacheRead:
|
|
9166
|
-
output:
|
|
9230
|
+
import { z as z17 } from "zod";
|
|
9231
|
+
var tokenCountsSchema = z17.object({
|
|
9232
|
+
input: z17.number(),
|
|
9233
|
+
cacheWrite5m: z17.number(),
|
|
9234
|
+
cacheWrite1h: z17.number(),
|
|
9235
|
+
cacheRead: z17.number(),
|
|
9236
|
+
output: z17.number()
|
|
9167
9237
|
});
|
|
9168
9238
|
var ZERO_TOKENS = { input: 0, cacheWrite5m: 0, cacheWrite1h: 0, cacheRead: 0, output: 0 };
|
|
9169
9239
|
function addTokens(a, b) {
|
|
@@ -9353,61 +9423,61 @@ function average(values) {
|
|
|
9353
9423
|
// src/core/usage/usage-cache.ts
|
|
9354
9424
|
import { mkdir as mkdir5 } from "node:fs/promises";
|
|
9355
9425
|
import { join as join29 } from "node:path";
|
|
9356
|
-
import { z as
|
|
9426
|
+
import { z as z19 } from "zod";
|
|
9357
9427
|
|
|
9358
9428
|
// src/core/stats/cost/usage-state.ts
|
|
9359
|
-
import { z as
|
|
9360
|
-
var estimatedKindSchema =
|
|
9361
|
-
var usageBucketSchema =
|
|
9362
|
-
slot:
|
|
9363
|
-
cwd:
|
|
9364
|
-
model:
|
|
9365
|
-
kind:
|
|
9429
|
+
import { z as z18 } from "zod";
|
|
9430
|
+
var estimatedKindSchema = z18.enum(["cli", "skill"]);
|
|
9431
|
+
var usageBucketSchema = z18.object({
|
|
9432
|
+
slot: z18.string(),
|
|
9433
|
+
cwd: z18.string(),
|
|
9434
|
+
model: z18.string(),
|
|
9435
|
+
kind: z18.enum(["hook", ...estimatedKindSchema.options]),
|
|
9366
9436
|
tokens: tokenCountsSchema,
|
|
9367
|
-
hookTurns:
|
|
9437
|
+
hookTurns: z18.number()
|
|
9368
9438
|
});
|
|
9369
|
-
var transcriptStateSchema =
|
|
9370
|
-
hookOpen:
|
|
9371
|
-
lastModel:
|
|
9372
|
-
lastMessageId:
|
|
9439
|
+
var transcriptStateSchema = z18.object({
|
|
9440
|
+
hookOpen: z18.boolean(),
|
|
9441
|
+
lastModel: z18.string().nullable(),
|
|
9442
|
+
lastMessageId: z18.string().nullable(),
|
|
9373
9443
|
lastMessageTokens: tokenCountsSchema.nullable().optional(),
|
|
9374
|
-
pending:
|
|
9375
|
-
pendingEstimates:
|
|
9376
|
-
codex:
|
|
9444
|
+
pending: z18.record(z18.string(), estimatedKindSchema),
|
|
9445
|
+
pendingEstimates: z18.array(z18.object({ kind: estimatedKindSchema, chars: z18.number(), slot: z18.string(), cwd: z18.string() })),
|
|
9446
|
+
codex: z18.object({ cwd: z18.string(), total: tokenCountsSchema.nullable(), toolDirectories: z18.record(z18.string(), z18.string()).optional() }).optional()
|
|
9377
9447
|
});
|
|
9378
9448
|
|
|
9379
9449
|
// src/core/usage/usage-cache.ts
|
|
9380
9450
|
var USAGE_CACHE_FILE = ".usage-cache.json";
|
|
9381
9451
|
var USAGE_CACHE_VERSION = 7;
|
|
9382
|
-
var bucketsSchema =
|
|
9383
|
-
var worktreeTenureSchema =
|
|
9452
|
+
var bucketsSchema = z19.array(usageBucketSchema);
|
|
9453
|
+
var worktreeTenureSchema = z19.object({ main: z19.string(), since: z19.number() });
|
|
9384
9454
|
var SINCE_EVER = 0;
|
|
9385
|
-
var worktreeTenuresSchema =
|
|
9386
|
-
var worktreeReposSchema =
|
|
9387
|
-
var usageCacheEntrySchema =
|
|
9388
|
-
size:
|
|
9389
|
-
mtimeMs:
|
|
9390
|
-
offset:
|
|
9391
|
-
fingerprint:
|
|
9455
|
+
var worktreeTenuresSchema = z19.union([z19.array(worktreeTenureSchema), z19.string().transform((main) => [{ main, since: SINCE_EVER }])]);
|
|
9456
|
+
var worktreeReposSchema = z19.record(z19.string(), worktreeTenuresSchema);
|
|
9457
|
+
var usageCacheEntrySchema = z19.object({
|
|
9458
|
+
size: z19.number(),
|
|
9459
|
+
mtimeMs: z19.number().optional(),
|
|
9460
|
+
offset: z19.number(),
|
|
9461
|
+
fingerprint: z19.string(),
|
|
9392
9462
|
state: transcriptStateSchema,
|
|
9393
9463
|
buckets: bucketsSchema
|
|
9394
9464
|
});
|
|
9395
|
-
var usageCacheSchema =
|
|
9396
|
-
version:
|
|
9397
|
-
files:
|
|
9398
|
-
carried:
|
|
9465
|
+
var usageCacheSchema = z19.object({
|
|
9466
|
+
version: z19.literal(USAGE_CACHE_VERSION),
|
|
9467
|
+
files: z19.record(z19.string(), usageCacheEntrySchema),
|
|
9468
|
+
carried: z19.record(z19.string(), bucketsSchema).default({}),
|
|
9399
9469
|
worktreeRepos: worktreeReposSchema.default({})
|
|
9400
9470
|
});
|
|
9401
|
-
var salvagedEntrySchema =
|
|
9402
|
-
var salvagedCacheSchema =
|
|
9403
|
-
files:
|
|
9404
|
-
carried:
|
|
9471
|
+
var salvagedEntrySchema = z19.object({ buckets: bucketsSchema }).transform((entry) => entry.buckets);
|
|
9472
|
+
var salvagedCacheSchema = z19.object({
|
|
9473
|
+
files: z19.record(z19.string(), salvagedEntrySchema.nullable().catch(null)).catch({}),
|
|
9474
|
+
carried: z19.record(z19.string(), bucketsSchema.nullable().catch(null)).catch({}),
|
|
9405
9475
|
worktreeRepos: worktreeReposSchema.catch({})
|
|
9406
9476
|
}).transform(({ files, carried, worktreeRepos }) => {
|
|
9407
9477
|
const salvaged = [...Object.entries(carried), ...Object.entries(files)].flatMap(([path, buckets]) => buckets === null ? [] : [[path, buckets]]);
|
|
9408
9478
|
return { ...emptyUsageCache(), carried: Object.fromEntries(salvaged), worktreeRepos };
|
|
9409
9479
|
});
|
|
9410
|
-
var storedCacheSchema =
|
|
9480
|
+
var storedCacheSchema = z19.union([usageCacheSchema, salvagedCacheSchema]);
|
|
9411
9481
|
function emptyUsageCache() {
|
|
9412
9482
|
return { version: USAGE_CACHE_VERSION, files: {}, carried: {}, worktreeRepos: {} };
|
|
9413
9483
|
}
|
|
@@ -9909,7 +9979,7 @@ import { createHash as createHash6 } from "node:crypto";
|
|
|
9909
9979
|
import { basename as basename9, join as join33 } from "node:path";
|
|
9910
9980
|
|
|
9911
9981
|
// src/core/stats/cost/attribute.ts
|
|
9912
|
-
import { z as
|
|
9982
|
+
import { z as z20 } from "zod";
|
|
9913
9983
|
|
|
9914
9984
|
// src/core/stats/cost/shell-commands.ts
|
|
9915
9985
|
var ENV_ASSIGNMENT = /^[A-Za-z_][A-Za-z0-9_]*=/;
|
|
@@ -10143,21 +10213,21 @@ var PENDING_TOOL_LIMIT = 64;
|
|
|
10143
10213
|
var ZONE_OFFSETS_PER_HOUR = 4;
|
|
10144
10214
|
var ZONE_OFFSET_STEP_MS = HOUR_MS / ZONE_OFFSETS_PER_HOUR;
|
|
10145
10215
|
var BASH_TOOL = "Bash";
|
|
10146
|
-
var usageSchema =
|
|
10147
|
-
input_tokens:
|
|
10148
|
-
output_tokens:
|
|
10149
|
-
cache_read_input_tokens:
|
|
10150
|
-
cache_creation_input_tokens:
|
|
10151
|
-
speed:
|
|
10152
|
-
cache_creation:
|
|
10216
|
+
var usageSchema = z20.object({
|
|
10217
|
+
input_tokens: z20.number().optional(),
|
|
10218
|
+
output_tokens: z20.number().optional(),
|
|
10219
|
+
cache_read_input_tokens: z20.number().optional(),
|
|
10220
|
+
cache_creation_input_tokens: z20.number().optional(),
|
|
10221
|
+
speed: z20.string().optional(),
|
|
10222
|
+
cache_creation: z20.object({ ephemeral_5m_input_tokens: z20.number().optional(), ephemeral_1h_input_tokens: z20.number().optional() }).passthrough().optional()
|
|
10153
10223
|
}).passthrough();
|
|
10154
|
-
var assistantMessageSchema =
|
|
10155
|
-
var userMessageSchema =
|
|
10156
|
-
var toolUseBlockSchema =
|
|
10157
|
-
var toolResultBlockSchema =
|
|
10158
|
-
var textBlockSchema =
|
|
10159
|
-
var bashInputSchema =
|
|
10160
|
-
var transcriptLineSchema =
|
|
10224
|
+
var assistantMessageSchema = z20.object({ id: z20.string().optional(), model: z20.string().optional(), usage: usageSchema.optional(), content: z20.array(z20.unknown()).optional() }).passthrough();
|
|
10225
|
+
var userMessageSchema = z20.object({ content: z20.unknown().optional() }).passthrough();
|
|
10226
|
+
var toolUseBlockSchema = z20.object({ type: z20.literal("tool_use"), id: z20.string(), name: z20.string(), input: z20.unknown().optional() }).passthrough();
|
|
10227
|
+
var toolResultBlockSchema = z20.object({ type: z20.literal("tool_result"), tool_use_id: z20.string().optional(), content: z20.unknown().optional() }).passthrough();
|
|
10228
|
+
var textBlockSchema = z20.object({ type: z20.literal("text"), text: z20.string() }).passthrough();
|
|
10229
|
+
var bashInputSchema = z20.object({ command: z20.string() }).passthrough();
|
|
10230
|
+
var transcriptLineSchema = z20.object({ type: z20.string().optional(), timestamp: z20.string().optional(), cwd: z20.string().optional(), isMeta: z20.boolean().optional(), message: z20.unknown().optional() }).passthrough();
|
|
10161
10231
|
function newTranscriptState() {
|
|
10162
10232
|
return { hookOpen: false, lastModel: null, lastMessageId: null, lastMessageTokens: null, pending: {}, pendingEstimates: [] };
|
|
10163
10233
|
}
|
|
@@ -10282,33 +10352,33 @@ function slotOf(timestamp) {
|
|
|
10282
10352
|
|
|
10283
10353
|
// src/core/usage/attribute-codex.ts
|
|
10284
10354
|
import { resolve as resolve4 } from "node:path";
|
|
10285
|
-
import { z as
|
|
10355
|
+
import { z as z21 } from "zod";
|
|
10286
10356
|
var ROLLOUT_MARKERS = /"type"\s*:\s*"(?:session_meta|turn_context|token_count|message|function_call(?:_output)?|custom_tool_call(?:_output)?)"/u;
|
|
10287
10357
|
var INLINE_SHELL_FIELDS = /\b(cmd|workdir)\s*:\s*("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|`(?:\\[\s\S]|[^`\\])*`)/gu;
|
|
10288
10358
|
var APP_TOOL_CALL = /\btools\.(\w+)\s*\(/gu;
|
|
10289
10359
|
var SKILL_READER = /^\s*(?:cat|sed|head|tail|nl|Get-Content)\b/iu;
|
|
10290
10360
|
var STOP_HOOK_PROMPT = /^<hook_prompt hook_run_id="stop:[^"]+">\s*([\s\S]*?)<\/hook_prompt>$/u;
|
|
10291
|
-
var rolloutSchema =
|
|
10292
|
-
type:
|
|
10293
|
-
timestamp:
|
|
10294
|
-
payload:
|
|
10295
|
-
type:
|
|
10296
|
-
cwd:
|
|
10297
|
-
model:
|
|
10361
|
+
var rolloutSchema = z21.object({
|
|
10362
|
+
type: z21.string(),
|
|
10363
|
+
timestamp: z21.string(),
|
|
10364
|
+
payload: z21.object({
|
|
10365
|
+
type: z21.string().optional(),
|
|
10366
|
+
cwd: z21.string().optional(),
|
|
10367
|
+
model: z21.string().min(1).optional()
|
|
10298
10368
|
}).passthrough()
|
|
10299
10369
|
});
|
|
10300
|
-
var usageSchema2 =
|
|
10301
|
-
input_tokens:
|
|
10302
|
-
cached_input_tokens:
|
|
10303
|
-
cache_write_input_tokens:
|
|
10304
|
-
output_tokens:
|
|
10370
|
+
var usageSchema2 = z21.object({
|
|
10371
|
+
input_tokens: z21.number().nonnegative(),
|
|
10372
|
+
cached_input_tokens: z21.number().nonnegative().default(0),
|
|
10373
|
+
cache_write_input_tokens: z21.number().nonnegative().default(0),
|
|
10374
|
+
output_tokens: z21.number().nonnegative()
|
|
10305
10375
|
});
|
|
10306
|
-
var eventSchema =
|
|
10307
|
-
var messageSchema =
|
|
10308
|
-
var callSchema =
|
|
10309
|
-
var shellSchema =
|
|
10310
|
-
var textOutputSchema =
|
|
10311
|
-
var resultSchema =
|
|
10376
|
+
var eventSchema = z21.object({ info: z21.object({ total_token_usage: usageSchema2, last_token_usage: usageSchema2.optional() }) });
|
|
10377
|
+
var messageSchema = z21.object({ role: z21.string(), content: z21.array(z21.object({ text: z21.string().optional() })) });
|
|
10378
|
+
var callSchema = z21.object({ name: z21.string(), call_id: z21.string(), arguments: z21.string().optional(), input: z21.string().optional() });
|
|
10379
|
+
var shellSchema = z21.object({ cmd: z21.string().optional(), command: z21.string().optional(), workdir: z21.string().optional() });
|
|
10380
|
+
var textOutputSchema = z21.object({ type: z21.literal("input_text"), text: z21.string() });
|
|
10381
|
+
var resultSchema = z21.object({ call_id: z21.string(), output: z21.union([z21.string(), z21.array(z21.unknown())]) });
|
|
10312
10382
|
function attributeCodexLine(line, state) {
|
|
10313
10383
|
if (!ROLLOUT_MARKERS.test(line)) return [];
|
|
10314
10384
|
const event = parseJson(line, rolloutSchema);
|
|
@@ -10393,7 +10463,7 @@ function shellDetails(call) {
|
|
|
10393
10463
|
const workdirs = [];
|
|
10394
10464
|
for (const [, field, literal = ""] of call.input.matchAll(INLINE_SHELL_FIELDS)) {
|
|
10395
10465
|
const fields = field === "cmd" ? commands : workdirs;
|
|
10396
|
-
fields.push(parseJson(literal,
|
|
10466
|
+
fields.push(parseJson(literal, z21.string()) ?? literal.slice(1, -1).replaceAll("\\n", "\n"));
|
|
10397
10467
|
}
|
|
10398
10468
|
if (commands.length !== tools.length || workdirs.length > 0 && commands.length !== 1) return { commands: [] };
|
|
10399
10469
|
return { commands, workdir: workdirs[0] };
|
|
@@ -11196,7 +11266,7 @@ function reportFailure({ failed: failed2, code, output }, io) {
|
|
|
11196
11266
|
}
|
|
11197
11267
|
|
|
11198
11268
|
// src/cli/agents/grouped-stop-hooks.ts
|
|
11199
|
-
import { z as
|
|
11269
|
+
import { z as z22 } from "zod";
|
|
11200
11270
|
|
|
11201
11271
|
// src/cli/agents/json-config.ts
|
|
11202
11272
|
import { mkdir as mkdir10, readFile as readFile4, realpath } from "node:fs/promises";
|
|
@@ -11259,9 +11329,9 @@ function commandOfHook(hook) {
|
|
|
11259
11329
|
const command2 = typeof hook === "object" && hook !== null ? hook.command : void 0;
|
|
11260
11330
|
return typeof command2 === "string" ? command2 : void 0;
|
|
11261
11331
|
}
|
|
11262
|
-
var stopGroupSchema =
|
|
11263
|
-
var groupedConfigSchema =
|
|
11264
|
-
hooks:
|
|
11332
|
+
var stopGroupSchema = z22.object({ hooks: z22.array(z22.unknown()).optional() }).passthrough();
|
|
11333
|
+
var groupedConfigSchema = z22.object({
|
|
11334
|
+
hooks: z22.object({ Stop: z22.array(stopGroupSchema).optional() }).passthrough().optional()
|
|
11265
11335
|
}).passthrough();
|
|
11266
11336
|
function refreshOurHook(lists, hook, { isOurs, isCurrent }) {
|
|
11267
11337
|
const ours = lists.flatMap((list) => list.flatMap((entry, index) => isOurs(entry) ? [{ list, index, entry }] : []));
|
|
@@ -11340,11 +11410,11 @@ function removeClaudeStopHook(settings) {
|
|
|
11340
11410
|
}
|
|
11341
11411
|
|
|
11342
11412
|
// src/cli/agents/cursor-hooks.ts
|
|
11343
|
-
import { z as
|
|
11413
|
+
import { z as z23 } from "zod";
|
|
11344
11414
|
var CURSOR_HOOKS_VERSION = 1;
|
|
11345
|
-
var cursorConfigSchema =
|
|
11346
|
-
version:
|
|
11347
|
-
hooks:
|
|
11415
|
+
var cursorConfigSchema = z23.object({
|
|
11416
|
+
version: z23.number().optional(),
|
|
11417
|
+
hooks: z23.object({ stop: z23.array(z23.unknown()).optional() }).passthrough().optional()
|
|
11348
11418
|
}).passthrough();
|
|
11349
11419
|
function addCursorStopHook(file, hook, ourHook) {
|
|
11350
11420
|
return addStopHookIn(
|
|
@@ -11885,6 +11955,7 @@ var CLI_COMMANDS = [
|
|
|
11885
11955
|
takeCommand,
|
|
11886
11956
|
statusCommand,
|
|
11887
11957
|
priorityCommand,
|
|
11958
|
+
probabilityCommand,
|
|
11888
11959
|
categoryCommand,
|
|
11889
11960
|
epicCommand,
|
|
11890
11961
|
checkCommand,
|