@robbeverhelst/do 1.11.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/do.js +38 -33
- package/package.json +1 -1
package/dist/do.js
CHANGED
|
@@ -20824,6 +20824,38 @@ var insightsOverviewSchema = exports_external.object({
|
|
|
20824
20824
|
correlations: exports_external.array(insightsCorrelationSchema),
|
|
20825
20825
|
streaks: exports_external.array(insightsStreakSchema)
|
|
20826
20826
|
});
|
|
20827
|
+
// ../../packages/schema/src/capture.ts
|
|
20828
|
+
var TAG_RE = /(?:^|\s)#([\p{L}\p{N}][\p{L}\p{N}_-]*)/gu;
|
|
20829
|
+
var PRIORITY_RE = /(?:^|\s)!([\p{L}]+)/gu;
|
|
20830
|
+
var PRIORITY_ALIASES = {
|
|
20831
|
+
none: "none",
|
|
20832
|
+
n: "none",
|
|
20833
|
+
low: "low",
|
|
20834
|
+
l: "low",
|
|
20835
|
+
med: "medium",
|
|
20836
|
+
medium: "medium",
|
|
20837
|
+
m: "medium",
|
|
20838
|
+
high: "high",
|
|
20839
|
+
h: "high",
|
|
20840
|
+
hi: "high"
|
|
20841
|
+
};
|
|
20842
|
+
function parseCapture(input) {
|
|
20843
|
+
const tags = [];
|
|
20844
|
+
for (const match of input.matchAll(TAG_RE)) {
|
|
20845
|
+
const tag = match[1]?.toLowerCase();
|
|
20846
|
+
if (tag && !tags.includes(tag))
|
|
20847
|
+
tags.push(tag);
|
|
20848
|
+
}
|
|
20849
|
+
let priority;
|
|
20850
|
+
for (const match of input.matchAll(PRIORITY_RE)) {
|
|
20851
|
+
const token = match[1]?.toLowerCase();
|
|
20852
|
+
const mapped = token ? PRIORITY_ALIASES[token] : undefined;
|
|
20853
|
+
if (mapped)
|
|
20854
|
+
priority = mapped;
|
|
20855
|
+
}
|
|
20856
|
+
const title = input.replace(TAG_RE, " ").replace(PRIORITY_RE, " ").replace(/\s+/g, " ").trim();
|
|
20857
|
+
return { title, tags, ...priority ? { priority } : {} };
|
|
20858
|
+
}
|
|
20827
20859
|
// ../../node_modules/.bun/ulidx@2.4.1/node_modules/ulidx/dist/node/index.js
|
|
20828
20860
|
import crypto from "crypto";
|
|
20829
20861
|
|
|
@@ -21066,44 +21098,17 @@ var usageError = (message, detail) => new CliError("usage", message, EXIT.USAGE,
|
|
|
21066
21098
|
var configError = (message) => new CliError("config", message, EXIT.CONFIG);
|
|
21067
21099
|
|
|
21068
21100
|
// src/capture.ts
|
|
21069
|
-
|
|
21070
|
-
|
|
21071
|
-
|
|
21072
|
-
none: "none",
|
|
21073
|
-
n: "none",
|
|
21074
|
-
low: "low",
|
|
21075
|
-
l: "low",
|
|
21076
|
-
med: "medium",
|
|
21077
|
-
medium: "medium",
|
|
21078
|
-
m: "medium",
|
|
21079
|
-
high: "high",
|
|
21080
|
-
h: "high",
|
|
21081
|
-
hi: "high"
|
|
21082
|
-
};
|
|
21083
|
-
function parseCapture(input) {
|
|
21084
|
-
const tags = [];
|
|
21085
|
-
for (const match of input.matchAll(TAG_RE)) {
|
|
21086
|
-
const tag = match[1];
|
|
21087
|
-
if (tag && !tags.includes(tag))
|
|
21088
|
-
tags.push(tag);
|
|
21089
|
-
}
|
|
21090
|
-
let priority;
|
|
21091
|
-
for (const match of input.matchAll(PRIORITY_RE)) {
|
|
21092
|
-
const token = match[1]?.toLowerCase();
|
|
21093
|
-
const mapped = token ? PRIORITY_ALIASES[token] : undefined;
|
|
21094
|
-
if (mapped)
|
|
21095
|
-
priority = mapped;
|
|
21096
|
-
}
|
|
21097
|
-
const title = input.replace(TAG_RE, " ").replace(PRIORITY_RE, " ").replace(/\s+/g, " ").trim();
|
|
21098
|
-
if (title.length === 0) {
|
|
21101
|
+
function parseCapture2(input) {
|
|
21102
|
+
const parsed = parseCapture(input);
|
|
21103
|
+
if (parsed.title.length === 0) {
|
|
21099
21104
|
throw usageError("capture needs some text for the task title");
|
|
21100
21105
|
}
|
|
21101
|
-
return
|
|
21106
|
+
return parsed;
|
|
21102
21107
|
}
|
|
21103
21108
|
|
|
21104
21109
|
// src/meta.ts
|
|
21105
21110
|
var CLI_NAME = "do";
|
|
21106
|
-
var VERSION = "1.
|
|
21111
|
+
var VERSION = "1.13.0";
|
|
21107
21112
|
var API_PREFIX = "/api/v1";
|
|
21108
21113
|
var DEFAULT_API_URL = "http://localhost:3001";
|
|
21109
21114
|
|
|
@@ -22216,7 +22221,7 @@ var HANDLERS = {
|
|
|
22216
22221
|
const text2 = args.join(" ").trim();
|
|
22217
22222
|
if (text2.length === 0)
|
|
22218
22223
|
throw usageError('capture needs some text, e.g. `do capture "call mum #family"`');
|
|
22219
|
-
const parsed =
|
|
22224
|
+
const parsed = parseCapture2(text2);
|
|
22220
22225
|
const input = parseInput(createTaskInputSchema, {
|
|
22221
22226
|
id: ulid3(),
|
|
22222
22227
|
title: parsed.title,
|