@wirecat/cli-memo 0.131.74 → 0.131.75
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/bin/memo.js +2 -2
- package/dist/bundle/{app-server-2LQJZC7Z.js → app-server-TRRARE66.js} +6 -6
- package/dist/bundle/{auto-OCCPDCFY.js → auto-AQAKW55Z.js} +12 -12
- package/dist/bundle/{chunk-6Q3JHCU7.js → chunk-2QND7VJS.js} +3 -3
- package/dist/bundle/{chunk-3BEJUJEL.js → chunk-346PWQJF.js} +2 -2
- package/dist/bundle/{chunk-WM7MVKGU.js → chunk-4XI7S3PO.js} +2 -2
- package/dist/bundle/{chunk-GPXHGG67.js → chunk-5CTOWPOL.js} +1 -1
- package/dist/bundle/{chunk-P6FPRA3P.js → chunk-5RLCKP5E.js} +1 -1
- package/dist/bundle/{chunk-AHAW3TOS.js → chunk-6VMIMAZ2.js} +1 -1
- package/dist/bundle/{chunk-HEYIBJ5I.js → chunk-7Y4HUYI3.js} +17 -5
- package/dist/bundle/{chunk-VRL5WRRQ.js → chunk-AOHT5FNX.js} +3 -3
- package/dist/bundle/{chunk-WBCY7WHV.js → chunk-EWRHTZD3.js} +2 -2
- package/dist/bundle/{chunk-BNJ2XK7D.js → chunk-FGMFJUHR.js} +53 -10
- package/dist/bundle/{chunk-EML43XLJ.js → chunk-GFVSZY4J.js} +25 -1
- package/dist/bundle/{chunk-GWNLLQBD.js → chunk-OWUEEVF6.js} +1 -1
- package/dist/bundle/{chunk-WFXRR2JT.js → chunk-RZS24U4N.js} +2 -2
- package/dist/bundle/{chunk-3OVYPDT6.js → chunk-VFKCZJFT.js} +3 -3
- package/dist/bundle/{chunk-QCR5WJ7R.js → chunk-W64FO6DD.js} +6 -6
- package/dist/bundle/{chunk-BR4DCOA5.js → chunk-WKLF7CAM.js} +5 -5
- package/dist/bundle/{chunk-OOKMABOJ.js → chunk-ZISVFVQU.js} +2 -0
- package/dist/bundle/{chunk-CWWUZK2U.js → chunk-ZP2XI5DR.js} +3 -3
- package/dist/bundle/{entry-7EYT2OA3.js → entry-TBOYUMWB.js} +1 -1
- package/dist/bundle/{failure-YQJ43YFG.js → failure-EKMEAYZH.js} +10 -10
- package/dist/bundle/{first-run-C7L7IACA.js → first-run-HQ4GA4EF.js} +1 -1
- package/dist/bundle/{mcp-UCDMODSA.js → mcp-DEY765VA.js} +4 -4
- package/dist/bundle/memo.js +6 -6
- package/dist/bundle/{program-RHPSSKFA.js → program-OGDARQTX.js} +2930 -2445
- package/dist/bundle/{server-3TQJ47Q6.js → server-3UX245DY.js} +6 -6
- package/dist/bundle/{server-SHHKLBS2.js → server-6G5XF3V5.js} +4 -4
- package/dist/bundle/{server-FX7RKPL4.js → server-ADPO4V4B.js} +15 -15
- package/dist/bundle/{store-K45RFKGF.js → store-GSZAXU3A.js} +1 -1
- package/dist/bundle/{store-maintenance-command-EOTKQ3E5.js → store-maintenance-command-QMTALGSQ.js} +4 -4
- package/dist/bundle/{update-PW77Y4DM.js → update-HDJ23IV5.js} +11 -11
- package/dist/digest/backfill.d.ts +1 -1
- package/dist/digest/backfill.d.ts.map +1 -1
- package/dist/digest/backfill.js +71 -42
- package/dist/digest/backfill.js.map +1 -1
- package/dist/digest/brief.d.ts +14 -3
- package/dist/digest/brief.d.ts.map +1 -1
- package/dist/digest/brief.js +84 -34
- package/dist/digest/brief.js.map +1 -1
- package/dist/digest/command.d.ts +3 -0
- package/dist/digest/command.d.ts.map +1 -1
- package/dist/digest/command.js +23 -0
- package/dist/digest/command.js.map +1 -1
- package/dist/digest/digest-commands.d.ts +6 -0
- package/dist/digest/digest-commands.d.ts.map +1 -0
- package/dist/digest/digest-commands.js +241 -0
- package/dist/digest/digest-commands.js.map +1 -0
- package/dist/digest/digest.d.ts +5 -2
- package/dist/digest/digest.d.ts.map +1 -1
- package/dist/digest/digest.js +29 -8
- package/dist/digest/digest.js.map +1 -1
- package/dist/digest/digests.d.ts +72 -0
- package/dist/digest/digests.d.ts.map +1 -0
- package/dist/digest/digests.js +122 -0
- package/dist/digest/digests.js.map +1 -0
- package/dist/digest/tasks.d.ts +7 -4
- package/dist/digest/tasks.d.ts.map +1 -1
- package/dist/digest/tasks.js +13 -5
- package/dist/digest/tasks.js.map +1 -1
- package/dist/examples.d.ts.map +1 -1
- package/dist/examples.js +15 -1
- package/dist/examples.js.map +1 -1
- package/dist/people/command.d.ts +0 -1
- package/dist/people/command.d.ts.map +1 -1
- package/dist/people/command.js +114 -12
- package/dist/people/command.js.map +1 -1
- package/dist/program.d.ts +4 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +9 -5
- package/dist/program.js.map +1 -1
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +24 -0
- package/dist/reasons.js.map +1 -1
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +13 -1
- package/dist/rows.js.map +1 -1
- package/dist/schedule/command.d.ts +8 -0
- package/dist/schedule/command.d.ts.map +1 -1
- package/dist/schedule/command.js +4 -2
- package/dist/schedule/command.js.map +1 -1
- package/dist/search/people.d.ts +2 -0
- package/dist/search/people.d.ts.map +1 -1
- package/dist/search/people.js +11 -4
- package/dist/search/people.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
envelope,
|
|
7
7
|
serveOverHttpUntilStopped,
|
|
8
8
|
serveOverStdio
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WKLF7CAM.js";
|
|
10
10
|
import "./chunk-ZXW5FPH2.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-5RLCKP5E.js";
|
|
12
12
|
import "./chunk-V7BDQIZS.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-VFKCZJFT.js";
|
|
14
14
|
import "./chunk-YLYZNPAZ.js";
|
|
15
15
|
import "./chunk-C6MWOBEL.js";
|
|
16
16
|
import "./chunk-MM5NVP7F.js";
|
|
@@ -18,15 +18,15 @@ import "./chunk-KDBAY5JZ.js";
|
|
|
18
18
|
import "./chunk-3X4JM3ZR.js";
|
|
19
19
|
import "./chunk-LX3OSTBD.js";
|
|
20
20
|
import "./chunk-H3ZN4YLB.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-4XI7S3PO.js";
|
|
22
|
+
import "./chunk-6VMIMAZ2.js";
|
|
23
23
|
import "./chunk-6I4DOBSD.js";
|
|
24
24
|
import "./chunk-ZL63GL3Y.js";
|
|
25
25
|
import "./chunk-ZTZLAGZA.js";
|
|
26
26
|
import "./chunk-KEBL3PY4.js";
|
|
27
27
|
import "./chunk-OYKQX4H3.js";
|
|
28
28
|
import "./chunk-E2PSOSTN.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-ZISVFVQU.js";
|
|
30
30
|
import "./chunk-MPZBV5RL.js";
|
|
31
31
|
import "./chunk-XQ3RZU3J.js";
|
|
32
32
|
import "./chunk-SJD4KTK2.js";
|
|
@@ -3,21 +3,21 @@ const require = __bundleRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
createBotServer,
|
|
5
5
|
serveBotOverStdio
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RZS24U4N.js";
|
|
7
7
|
import "./chunk-E74VWHZ2.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-5RLCKP5E.js";
|
|
9
9
|
import "./chunk-V7BDQIZS.js";
|
|
10
10
|
import "./chunk-C6MWOBEL.js";
|
|
11
11
|
import "./chunk-MM5NVP7F.js";
|
|
12
12
|
import "./chunk-3X4JM3ZR.js";
|
|
13
13
|
import "./chunk-H3ZN4YLB.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-6VMIMAZ2.js";
|
|
15
15
|
import "./chunk-6I4DOBSD.js";
|
|
16
16
|
import "./chunk-ZTZLAGZA.js";
|
|
17
17
|
import "./chunk-KEBL3PY4.js";
|
|
18
18
|
import "./chunk-OYKQX4H3.js";
|
|
19
19
|
import "./chunk-E2PSOSTN.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-ZISVFVQU.js";
|
|
21
21
|
import "./chunk-MPZBV5RL.js";
|
|
22
22
|
import "./chunk-XQ3RZU3J.js";
|
|
23
23
|
import "./chunk-SJD4KTK2.js";
|
|
@@ -6,22 +6,22 @@ import {
|
|
|
6
6
|
memoLevels,
|
|
7
7
|
readOnly,
|
|
8
8
|
refuseUnknownPermissions
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-346PWQJF.js";
|
|
10
10
|
import {
|
|
11
11
|
itemAnswer
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7Y4HUYI3.js";
|
|
13
13
|
import {
|
|
14
14
|
grantLevels
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-W64FO6DD.js";
|
|
16
16
|
import "./chunk-YDTGYYOR.js";
|
|
17
17
|
import "./chunk-QP3KNC5D.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-RZS24U4N.js";
|
|
19
19
|
import {
|
|
20
20
|
errorObject,
|
|
21
21
|
mcpFailure,
|
|
22
22
|
throwParseFailures
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-5CTOWPOL.js";
|
|
24
|
+
import "./chunk-FGMFJUHR.js";
|
|
25
25
|
import "./chunk-E74VWHZ2.js";
|
|
26
26
|
import "./chunk-KA5MDFLU.js";
|
|
27
27
|
import "./chunk-IQIM4UC7.js";
|
|
@@ -32,11 +32,11 @@ import {
|
|
|
32
32
|
registerCommands,
|
|
33
33
|
runCommandForAgent,
|
|
34
34
|
toolsFromCommands
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-5RLCKP5E.js";
|
|
36
36
|
import {
|
|
37
37
|
callingAgent
|
|
38
38
|
} from "./chunk-V7BDQIZS.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-VFKCZJFT.js";
|
|
40
40
|
import "./chunk-YLYZNPAZ.js";
|
|
41
41
|
import {
|
|
42
42
|
UNTRUSTED_INSTRUCTION,
|
|
@@ -48,23 +48,23 @@ import "./chunk-LX3OSTBD.js";
|
|
|
48
48
|
import {
|
|
49
49
|
McpServer
|
|
50
50
|
} from "./chunk-H3ZN4YLB.js";
|
|
51
|
-
import "./chunk-
|
|
52
|
-
import "./chunk-
|
|
53
|
-
import "./chunk-
|
|
51
|
+
import "./chunk-AOHT5FNX.js";
|
|
52
|
+
import "./chunk-4XI7S3PO.js";
|
|
53
|
+
import "./chunk-6VMIMAZ2.js";
|
|
54
54
|
import "./chunk-6I4DOBSD.js";
|
|
55
55
|
import "./chunk-ZL63GL3Y.js";
|
|
56
56
|
import "./chunk-ZTZLAGZA.js";
|
|
57
57
|
import "./chunk-WZHCQ4VZ.js";
|
|
58
58
|
import "./chunk-HTQTIKWP.js";
|
|
59
|
-
import "./chunk-
|
|
59
|
+
import "./chunk-EWRHTZD3.js";
|
|
60
60
|
import "./chunk-KEBL3PY4.js";
|
|
61
61
|
import "./chunk-OYKQX4H3.js";
|
|
62
|
-
import "./chunk-
|
|
62
|
+
import "./chunk-OWUEEVF6.js";
|
|
63
63
|
import "./chunk-XPSXVUZG.js";
|
|
64
64
|
import "./chunk-E2PSOSTN.js";
|
|
65
65
|
import {
|
|
66
66
|
openStore
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-ZISVFVQU.js";
|
|
68
68
|
import "./chunk-MPZBV5RL.js";
|
|
69
69
|
import "./chunk-XQ3RZU3J.js";
|
|
70
70
|
import "./chunk-SJD4KTK2.js";
|
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
APP,
|
|
75
75
|
STORE_CLIENT,
|
|
76
76
|
VERSION
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-GFVSZY4J.js";
|
|
78
78
|
import "./chunk-NT5IOEEK.js";
|
|
79
79
|
import "./chunk-D72URWJE.js";
|
|
80
80
|
import "./chunk-XPCTY6XV.js";
|
package/dist/bundle/{store-maintenance-command-EOTKQ3E5.js → store-maintenance-command-QMTALGSQ.js}
RENAMED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
buildStems,
|
|
5
5
|
storeMaintenanceCommands,
|
|
6
6
|
storeSummary
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-AOHT5FNX.js";
|
|
8
|
+
import "./chunk-4XI7S3PO.js";
|
|
9
|
+
import "./chunk-6VMIMAZ2.js";
|
|
10
10
|
import "./chunk-6I4DOBSD.js";
|
|
11
11
|
import "./chunk-ZL63GL3Y.js";
|
|
12
12
|
import "./chunk-ZTZLAGZA.js";
|
|
@@ -15,7 +15,7 @@ import "./chunk-KEBL3PY4.js";
|
|
|
15
15
|
import "./chunk-OYKQX4H3.js";
|
|
16
16
|
import "./chunk-XPSXVUZG.js";
|
|
17
17
|
import "./chunk-E2PSOSTN.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-ZISVFVQU.js";
|
|
19
19
|
import "./chunk-MPZBV5RL.js";
|
|
20
20
|
import "./chunk-XQ3RZU3J.js";
|
|
21
21
|
import "./chunk-SJD4KTK2.js";
|
|
@@ -7,37 +7,37 @@ import {
|
|
|
7
7
|
runUpdate,
|
|
8
8
|
updateNotice,
|
|
9
9
|
upgradeCommand
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-2QND7VJS.js";
|
|
11
|
+
import "./chunk-W64FO6DD.js";
|
|
12
12
|
import "./chunk-QP3KNC5D.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-FGMFJUHR.js";
|
|
14
14
|
import "./chunk-E74VWHZ2.js";
|
|
15
15
|
import "./chunk-KA5MDFLU.js";
|
|
16
16
|
import "./chunk-BDVM5652.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-VFKCZJFT.js";
|
|
18
18
|
import "./chunk-YLYZNPAZ.js";
|
|
19
19
|
import "./chunk-C6MWOBEL.js";
|
|
20
20
|
import "./chunk-LX3OSTBD.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-AOHT5FNX.js";
|
|
22
|
+
import "./chunk-4XI7S3PO.js";
|
|
23
|
+
import "./chunk-6VMIMAZ2.js";
|
|
24
24
|
import "./chunk-6I4DOBSD.js";
|
|
25
25
|
import "./chunk-ZL63GL3Y.js";
|
|
26
26
|
import "./chunk-ZTZLAGZA.js";
|
|
27
27
|
import "./chunk-WZHCQ4VZ.js";
|
|
28
28
|
import "./chunk-HTQTIKWP.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-EWRHTZD3.js";
|
|
30
30
|
import "./chunk-KEBL3PY4.js";
|
|
31
31
|
import "./chunk-OYKQX4H3.js";
|
|
32
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-OWUEEVF6.js";
|
|
33
33
|
import "./chunk-XPSXVUZG.js";
|
|
34
34
|
import "./chunk-E2PSOSTN.js";
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-ZISVFVQU.js";
|
|
36
36
|
import "./chunk-MPZBV5RL.js";
|
|
37
37
|
import "./chunk-XQ3RZU3J.js";
|
|
38
38
|
import "./chunk-SJD4KTK2.js";
|
|
39
39
|
import "./chunk-SIOPF2UG.js";
|
|
40
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-GFVSZY4J.js";
|
|
41
41
|
import "./chunk-NT5IOEEK.js";
|
|
42
42
|
import "./chunk-D72URWJE.js";
|
|
43
43
|
import "./chunk-XPCTY6XV.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Streams } from "@wirecat/cli-base";
|
|
2
|
-
import type
|
|
2
|
+
import { type Command } from "commander";
|
|
3
3
|
/**
|
|
4
4
|
* `digest backfill`: the morning digest each past day would have had, built by the schedule's own agent with the
|
|
5
5
|
* agenda as of that day's run time, kept as that day's run and sent nowhere. Each day is a paid model call, so it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backfill.d.ts","sourceRoot":"","sources":["../../src/digest/backfill.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"backfill.d.ts","sourceRoot":"","sources":["../../src/digest/backfill.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAe1D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAA;AAqEhD;;;;GAIG;AACH,eAAO,MAAM,aAAa,YAAa,OAAO,WAAW,OAAO,OAAO,MAAM,CAAC,UAAU,KAAG,IAoJ1F,CAAA"}
|
package/dist/digest/backfill.js
CHANGED
|
@@ -2,14 +2,18 @@ import { existsSync, readdirSync } from "node:fs";
|
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { CliError } from "@wirecat/cli-base";
|
|
4
4
|
import { annotate } from "@wirecat/cli-base/commands";
|
|
5
|
-
import { backfillScheduleRun, LOCAL_WRITE, readSchedule, SCHEDULE_DEFAULTS, scheduleFile, spentToday, } from "@wirecat/cli-core/cli";
|
|
5
|
+
import { backfillScheduleRun, isCalendar, LOCAL_WRITE, nextRun, readSchedule, runsBetween, SCHEDULE_DEFAULTS, scheduleFile, slotsOf, spentToday, } from "@wirecat/cli-core/cli";
|
|
6
|
+
import { Option } from "commander";
|
|
6
7
|
import { answers, itemAnswer } from "../answer.js";
|
|
7
8
|
import { APP } from "../app.js";
|
|
8
9
|
import { fromAppOption, whoRuns } from "../author.js";
|
|
9
10
|
import { scheduleLimits } from "../config.js";
|
|
10
11
|
import { briefCommand } from "./brief.js";
|
|
12
|
+
import { digestCommands } from "./digest-commands.js";
|
|
13
|
+
import { agendaFlags, isDigest, readDefinition, windowStart } from "./digests.js";
|
|
11
14
|
import { DIGEST_SCHEDULE, digestSchedule, runTime } from "./tasks.js";
|
|
12
15
|
const DAY = 86_400_000;
|
|
16
|
+
const MINUTE = 60_000;
|
|
13
17
|
const DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
14
18
|
const localDate = (at) => {
|
|
15
19
|
const day = new Date(at);
|
|
@@ -22,20 +26,25 @@ const dateOf = (value, flag) => {
|
|
|
22
26
|
throw new CliError("validation_error", `${flag} takes a date, YYYY-MM-DD, not "${value}"`, { param: flag });
|
|
23
27
|
return date;
|
|
24
28
|
};
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return
|
|
29
|
+
/**
|
|
30
|
+
* Each run the digest's timer would have started from the first day to the last, with the window it reads: from its
|
|
31
|
+
* previous time, so a weekly digest reads a week and one at 08:30 and 18:00 reads since the other time.
|
|
32
|
+
*/
|
|
33
|
+
const runsOf = (when, from, to) => {
|
|
34
|
+
const end = new Date(to);
|
|
35
|
+
end.setDate(end.getDate() + 1);
|
|
36
|
+
// Two runs on one day are told apart by their time; a digest that runs once a day keeps the plain date.
|
|
37
|
+
const timed = new Set(slotsOf(when).map((slot) => slot.at)).size > 1;
|
|
38
|
+
return runsBetween(when, from.getTime(), end.getTime()).map((at) => ({
|
|
39
|
+
date: localDate(at),
|
|
40
|
+
label: timed ? `${localDate(at)} ${new Date(at).toTimeString().slice(0, 5)}` : localDate(at),
|
|
41
|
+
at,
|
|
42
|
+
since: windowStart(when, at),
|
|
43
|
+
next: nextRun(when, at) ?? at + DAY,
|
|
44
|
+
}));
|
|
35
45
|
};
|
|
36
46
|
/** What the agent reads first: which day it writes and the window its agenda reads, as the skill expects them. */
|
|
37
|
-
const inputOf = (date, at) => `backfill: ${date}\n
|
|
38
|
-
`window: --since-time ${new Date(at - DAY).toISOString()} --before-time ${new Date(at).toISOString()}\n`;
|
|
47
|
+
const inputOf = (date, at, since, sources) => `backfill: ${date}\nwindow: ${agendaFlags(since, sources)} --before-time ${new Date(at).toISOString()}\n`;
|
|
39
48
|
const usd = (value) => `$${value.toFixed(2)}`;
|
|
40
49
|
const cents = (value) => Math.round(value * 100) / 100;
|
|
41
50
|
/**
|
|
@@ -47,51 +56,71 @@ export const digestCommand = (program, streams, env) => {
|
|
|
47
56
|
const { print } = answers(program, streams, env);
|
|
48
57
|
const digest = program
|
|
49
58
|
.command("digest")
|
|
50
|
-
.description("
|
|
51
|
-
|
|
59
|
+
.description("your digests: each a name, its times, what it reads, where it is sent and your brief; run one now, pause it, " +
|
|
60
|
+
"and build past days")
|
|
61
|
+
.summary("your digests: times, sources, routes, brief, past days");
|
|
52
62
|
briefCommand(digest, print, env);
|
|
63
|
+
digestCommands(digest, print, env);
|
|
53
64
|
fromAppOption(annotate(digest.command("backfill"), { effects: LOCAL_WRITE }))
|
|
54
|
-
.summary("build
|
|
55
|
-
.description("build
|
|
56
|
-
"
|
|
57
|
-
"kept as that
|
|
58
|
-
"or mail. A
|
|
59
|
-
"the estimate: the
|
|
60
|
-
"today's runs cost the schedule's daily cap or a
|
|
65
|
+
.summary("build a digest's past runs, without sending them")
|
|
66
|
+
.description("build each past run a digest would have had: its schedule's agent runs as its timer does (the same skill, " +
|
|
67
|
+
"flags and cost caps), reading the agenda as of that run's time and from the digest's previous time, and the " +
|
|
68
|
+
"result is kept as that run, marked backfill, for WireCat Desktop's digests screen. It is never sent to " +
|
|
69
|
+
"Telegram or mail. A run that already has a digest is skipped. Without --yes it only prints what it would " +
|
|
70
|
+
"build and the estimate: the runs times the last run's cost. Each run is a paid model call: it stops once " +
|
|
71
|
+
"today's runs cost the schedule's daily cap or a run fails, and only you run it, never an agent. The store " +
|
|
61
72
|
"keeps what holds now, so a chat answered since reads as answered")
|
|
62
|
-
.
|
|
63
|
-
.
|
|
73
|
+
.argument("[digest]", `the digest's name, as \`memo digest list\` shows it; ${DIGEST_SCHEDULE} when left out`)
|
|
74
|
+
.option("--since-time <time>", "the first day, YYYY-MM-DD")
|
|
75
|
+
.option("--until-time <time>", "the last day, YYYY-MM-DD; not a day whose run time is still ahead")
|
|
76
|
+
// WireCat Desktop before 0.131.73's rename sends these; kept so an older app still builds past days.
|
|
77
|
+
.addOption(new Option("--from <date>").hideHelp())
|
|
78
|
+
.addOption(new Option("--to <date>").hideHelp())
|
|
64
79
|
.option("--yes", "build them; without it, only the estimate is printed")
|
|
65
80
|
.option("--json", "print JSON")
|
|
66
|
-
.action(async (given, command) => {
|
|
67
|
-
const
|
|
68
|
-
const
|
|
81
|
+
.action(async (name, given, command) => {
|
|
82
|
+
const since = given.sinceTime ?? given.from;
|
|
83
|
+
const until = given.untilTime ?? given.to;
|
|
84
|
+
if (since === undefined || until === undefined)
|
|
85
|
+
throw new CliError("validation_error", "say which days: --since-time YYYY-MM-DD --until-time YYYY-MM-DD", {
|
|
86
|
+
param: since === undefined ? "--since-time" : "--until-time",
|
|
87
|
+
});
|
|
88
|
+
const from = dateOf(since, "--since-time");
|
|
89
|
+
const to = dateOf(until, "--until-time");
|
|
69
90
|
if (from > to)
|
|
70
91
|
throw new CliError("validation_error", "--since-time is after --until-time", { param: "--since-time" });
|
|
71
|
-
const
|
|
92
|
+
const digestName = name ?? DIGEST_SCHEDULE;
|
|
93
|
+
if (digestName !== DIGEST_SCHEDULE && !isDigest(env, digestName))
|
|
94
|
+
throw new CliError("not_found", `no digest ${digestName} — \`memo digest list\` names them`, {
|
|
95
|
+
reason: "digest.not-found",
|
|
96
|
+
});
|
|
97
|
+
const { state, schedule } = digestSchedule(env, digestName);
|
|
72
98
|
if (!schedule)
|
|
73
|
-
throw new CliError("not_found", `no ${
|
|
99
|
+
throw new CliError("not_found", `no ${digestName} schedule to build from — memo skill show morning-digest says how to make one`, { reason: "backfill.no-schedule" });
|
|
74
100
|
const file = scheduleFile(state, schedule.name);
|
|
75
101
|
const when = readSchedule(file).when;
|
|
76
|
-
if (!(
|
|
77
|
-
throw new CliError("validation_error", `${schedule.name} does not run at
|
|
102
|
+
if (!isCalendar(when))
|
|
103
|
+
throw new CliError("validation_error", `${schedule.name} does not run at set times, so it has no past runs`, {
|
|
78
104
|
reason: "backfill.not-daily",
|
|
79
105
|
schedule: schedule.name,
|
|
80
106
|
});
|
|
81
|
-
const
|
|
107
|
+
const sources = readDefinition(env, digestName)?.sources ?? [];
|
|
108
|
+
const all = runsOf(when, from, to);
|
|
82
109
|
if ((all.at(-1)?.at ?? 0) > Date.now())
|
|
83
|
-
throw new CliError("validation_error", `the ${
|
|
110
|
+
throw new CliError("validation_error", `the ${until} digest's time has not come yet; --until-time an earlier day`, {
|
|
84
111
|
param: "--until-time",
|
|
85
112
|
});
|
|
86
113
|
const runs = join(file, "..", "runs");
|
|
87
|
-
const
|
|
88
|
-
.filter((
|
|
89
|
-
.map(
|
|
90
|
-
|
|
91
|
-
const
|
|
114
|
+
const reported = (existsSync(runs) ? readdirSync(runs) : [])
|
|
115
|
+
.filter((file) => file.endsWith(".report.json"))
|
|
116
|
+
.map(runTime);
|
|
117
|
+
// A run its timer started late, or a backfill a minute off, still counts as that time's digest.
|
|
118
|
+
const done = (run) => reported.some((at) => at >= run.at - MINUTE && at < run.next);
|
|
119
|
+
const days = all.filter((day) => !done(day));
|
|
120
|
+
const skipped = all.filter(done).map((day) => day.label);
|
|
92
121
|
const lastCost = schedule.last?.costUsd;
|
|
93
122
|
const estimate = {
|
|
94
|
-
days: days.map((day) => day.
|
|
123
|
+
days: days.map((day) => day.label),
|
|
95
124
|
skipped,
|
|
96
125
|
estimateUsd: typeof lastCost === "number" ? cents(days.length * lastCost) : null,
|
|
97
126
|
};
|
|
@@ -119,14 +148,14 @@ export const digestCommand = (program, streams, env) => {
|
|
|
119
148
|
for (const day of days) {
|
|
120
149
|
const failed = built.some((one) => one.exitCode !== 0);
|
|
121
150
|
if (left.length || failed || (cap > 0 && spentToday(file) >= cap)) {
|
|
122
|
-
left.push(day.
|
|
151
|
+
left.push(day.label);
|
|
123
152
|
continue;
|
|
124
153
|
}
|
|
125
154
|
const run = await backfillScheduleRun(command, APP, env, file, {
|
|
126
155
|
at: new Date(day.at),
|
|
127
|
-
input: inputOf(day.date, day.at),
|
|
156
|
+
input: inputOf(day.date, day.at, day.since, sources),
|
|
128
157
|
});
|
|
129
|
-
built.push({ date: day.
|
|
158
|
+
built.push({ date: day.label, at: run.at, exitCode: run.exitCode, costUsd: run.costUsd ?? null });
|
|
130
159
|
}
|
|
131
160
|
const costUsd = cents(built.reduce((sum, one) => sum + (one.costUsd ?? 0), 0));
|
|
132
161
|
if (built.some((one) => one.exitCode !== 0))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backfill.js","sourceRoot":"","sources":["../../src/digest/backfill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAgB,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACrD,OAAO,EACL,mBAAmB,
|
|
1
|
+
{"version":3,"file":"backfill.js","sourceRoot":"","sources":["../../src/digest/backfill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAgB,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACrD,OAAO,EACL,mBAAmB,EAEnB,UAAU,EACV,WAAW,EACX,OAAO,EACP,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,OA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qB;SAC3C,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAA;IACH,CAAC,CAAC,CAAA;AACN,CAAC,CAAA"}
|
package/dist/digest/brief.d.ts
CHANGED
|
@@ -3,11 +3,22 @@ import { Command } from "commander";
|
|
|
3
3
|
/** The brief goes into every scheduled run's prompt, so its size is its cost. */
|
|
4
4
|
export declare const BRIEF_LIMIT = 4000;
|
|
5
5
|
type Print = (json: boolean | undefined, body: Body, text?: string) => void;
|
|
6
|
-
/**
|
|
7
|
-
export declare const readBrief: (env: NodeJS.ProcessEnv) => Promise<string | undefined>;
|
|
6
|
+
/** A digest's brief, or undefined; a machine with no store yet has none, and reading it creates no store. */
|
|
7
|
+
export declare const readBrief: (env: NodeJS.ProcessEnv, name?: string) => Promise<string | undefined>;
|
|
8
|
+
/** Checks a brief the owner gives and saves it; the body it replaces stays in the history. */
|
|
9
|
+
export declare const checkedBrief: (given: string, kept?: string) => string;
|
|
8
10
|
/** The morning-digest skill with the owner's brief after it, as the last word (NEED-2457). */
|
|
9
|
-
export declare const withBrief: (skill: string, brief: string | undefined) => string;
|
|
11
|
+
export declare const withBrief: (skill: string, brief: string | undefined, digest?: string) => string;
|
|
12
|
+
/**
|
|
13
|
+
* What `skill show morning-digest` adds for the digest a scheduled run belongs to (`MEMO_SCHEDULED`): its window and
|
|
14
|
+
* sources when it is a named digest, and its brief. The morning digest made before names existed gets its brief alone.
|
|
15
|
+
*/
|
|
16
|
+
export declare const digestAddendum: (env: NodeJS.ProcessEnv, now?: number) => Promise<{
|
|
17
|
+
brief: string | undefined;
|
|
18
|
+
digest: string | undefined;
|
|
19
|
+
}>;
|
|
10
20
|
declare const systemEditor: (path: string, env: NodeJS.ProcessEnv) => void;
|
|
21
|
+
export declare const refuseAgent: (env: NodeJS.ProcessEnv) => void;
|
|
11
22
|
/** `digest brief`: the owner's own words on what the morning digest collects, added to its skill. */
|
|
12
23
|
export declare const briefCommand: (digest: Command, print: Print, env: NodeJS.ProcessEnv, editor?: typeof systemEditor) => void;
|
|
13
24
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brief.d.ts","sourceRoot":"","sources":["../../src/digest/brief.ts"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"brief.d.ts","sourceRoot":"","sources":["../../src/digest/brief.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,IAAI,EAOV,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAA;AAwB3C,iFAAiF;AACjF,eAAO,MAAM,WAAW,OAAO,CAAA;AAE/B,KAAK,KAAK,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;AAE3E,6GAA6G;AAC7G,eAAO,MAAM,SAAS,QAAe,MAAM,CAAC,UAAU,oBAA0B,OAAO,CAAC,MAAM,GAAG,SAAS,CAGzG,CAAA;AAED,8FAA8F;AAC9F,eAAO,MAAM,YAAY,UAAW,MAAM,oBAAc,MAcvD,CAAA;AAED,8FAA8F;AAC9F,eAAO,MAAM,SAAS,UAAW,MAAM,SAAS,MAAM,GAAG,SAAS,WAAW,MAAM,KAAG,MAOrF,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,QACpB,MAAM,CAAC,UAAU,mBAErB,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAsBnE,CAAA;AAED,QAAA,MAAM,YAAY,SAAU,MAAM,OAAO,MAAM,CAAC,UAAU,KAAG,IAU5D,CAAA;AAED,eAAO,MAAM,WAAW,QAAS,MAAM,CAAC,UAAU,KAAG,IAMpD,CAAA;AAgBD,qGAAqG;AACrG,eAAO,MAAM,YAAY,WAAY,OAAO,SAAS,KAAK,OAAO,MAAM,CAAC,UAAU,mCAA0B,IAwG3G,CAAA"}
|