@tomradex/night-shift 0.28.0 → 0.29.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/brief.d.ts +15 -1
- package/dist/plan.d.ts +46 -3
- package/dist/service.d.ts +6 -0
- package/dist/words.d.ts +16 -0
- package/dist/work-rules.d.ts +5 -0
- package/package.json +14 -13
package/dist/brief.d.ts
CHANGED
|
@@ -36,6 +36,20 @@ export declare const judgeUser: (ticket: {
|
|
|
36
36
|
stat: string;
|
|
37
37
|
patch: string;
|
|
38
38
|
}) => string;
|
|
39
|
+
/** One line of the report's spend: what the runs of a ticket or an agent cost, and how many said nothing. */
|
|
40
|
+
export interface SpendLine {
|
|
41
|
+
/** Null when no run reported a cost — never a made-up zero. */
|
|
42
|
+
usd: number | null;
|
|
43
|
+
runs: number;
|
|
44
|
+
unpriced: number;
|
|
45
|
+
}
|
|
46
|
+
/** What the shift's runs cost, by ticket (item id) and by agent title. */
|
|
47
|
+
export interface BriefSpend {
|
|
48
|
+
tickets: Map<string, SpendLine>;
|
|
49
|
+
agents: (SpendLine & {
|
|
50
|
+
title: string;
|
|
51
|
+
})[];
|
|
52
|
+
}
|
|
39
53
|
/** The report itself: plain Markdown, and every section is left out when it has nothing to say. */
|
|
40
|
-
export declare function renderBrief(shift: NightShiftView, deliveries: Map<string, Delivery>, w: BriefWords, dateLabel: string): string;
|
|
54
|
+
export declare function renderBrief(shift: NightShiftView, deliveries: Map<string, Delivery>, w: BriefWords, dateLabel: string, spend?: BriefSpend): string;
|
|
41
55
|
//# sourceMappingURL=brief.d.ts.map
|
package/dist/plan.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { Item } from "@tomradex/domain";
|
|
3
|
+
import type { Match } from "@tomradex/dispatch";
|
|
3
4
|
/** What a model may say; a reply it mangles costs the part it mangled, not the plan. */
|
|
4
5
|
export declare const PlanReply: z.ZodObject<{
|
|
5
6
|
summary: z.ZodCatch<z.ZodString>;
|
|
@@ -15,6 +16,11 @@ export declare const PlanReply: z.ZodObject<{
|
|
|
15
16
|
}, z.core.$strip>>>;
|
|
16
17
|
concurrency: z.ZodCatch<z.ZodNullable<z.ZodNumber>>;
|
|
17
18
|
concurrencyWhy: z.ZodCatch<z.ZodString>;
|
|
19
|
+
devices: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
20
|
+
key: z.ZodString;
|
|
21
|
+
device: z.ZodString;
|
|
22
|
+
why: z.ZodCatch<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>>>;
|
|
18
24
|
}, z.core.$strip>;
|
|
19
25
|
export type PlanReply = z.infer<typeof PlanReply>;
|
|
20
26
|
export interface PlanNode {
|
|
@@ -23,6 +29,27 @@ export interface PlanNode {
|
|
|
23
29
|
suggested: boolean;
|
|
24
30
|
/** Why it is left out, when something says so. */
|
|
25
31
|
why: string | null;
|
|
32
|
+
/** Another of the account's computers it would run on. A suggestion: nothing is sent until the person says so. */
|
|
33
|
+
device?: PlanDevice | null;
|
|
34
|
+
/** Why it stays here although its label asks for another computer. */
|
|
35
|
+
deviceNote?: string | null;
|
|
36
|
+
}
|
|
37
|
+
export interface PlanDevice {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
/** `wait`: that computer is off or full now; sent, the ticket waits there. */
|
|
41
|
+
kind: "send" | "wait";
|
|
42
|
+
/** `rule`: the ticket's label says so. `model`: the planner's idea. */
|
|
43
|
+
source: "rule" | "model";
|
|
44
|
+
/** In the person's language. */
|
|
45
|
+
why: string;
|
|
46
|
+
}
|
|
47
|
+
/** One of the account's other computers, as the planner is told of it: what does not change from minute to minute. */
|
|
48
|
+
export interface PlannerDevice {
|
|
49
|
+
name: string;
|
|
50
|
+
platform: string;
|
|
51
|
+
agents: string[];
|
|
52
|
+
repos: number;
|
|
26
53
|
}
|
|
27
54
|
/** A dependency the model thinks is missing: nothing is written unless the person takes it. */
|
|
28
55
|
export interface PlanEdge {
|
|
@@ -45,12 +72,28 @@ export interface ShiftPlan {
|
|
|
45
72
|
proposed: PlanEdge[];
|
|
46
73
|
}
|
|
47
74
|
export declare const planCandidates: (items: Item[]) => Item[];
|
|
48
|
-
export declare const planSystem: (language: string) => string;
|
|
49
|
-
export declare const planUser: (items: Item[], brief: string | null) => string;
|
|
75
|
+
export declare const planSystem: (language: string, devices?: boolean) => string;
|
|
76
|
+
export declare const planUser: (items: Item[], brief: string | null, devices?: readonly PlannerDevice[]) => string;
|
|
77
|
+
/** Where a ticket would run, as rules and then the planner's pick say; the words are the caller's. */
|
|
78
|
+
export type Placer = (item: Item, picked: {
|
|
79
|
+
device: string;
|
|
80
|
+
why: string;
|
|
81
|
+
} | null) => Pick<PlanNode, "device" | "deviceNote">;
|
|
82
|
+
/** A match as the plan shows it. `say` gives the words for a rule's reasons; a model's reason is its own. */
|
|
83
|
+
export declare function placed(found: Match, picked: {
|
|
84
|
+
why: string;
|
|
85
|
+
} | null, say: {
|
|
86
|
+
label: string;
|
|
87
|
+
offline(name: string): string;
|
|
88
|
+
busy(name: string): string;
|
|
89
|
+
none(found: Extract<Match, {
|
|
90
|
+
kind: "none";
|
|
91
|
+
}>): string;
|
|
92
|
+
}): Pick<PlanNode, "device" | "deviceNote">;
|
|
50
93
|
/**
|
|
51
94
|
* The plan the person sees. A model's word only ever narrows what its facts allow: general work never runs unattended,
|
|
52
95
|
* a key it made up is dropped, and a dependency that repeats one or would close a loop is not offered. Without a reply
|
|
53
96
|
* the plan is the backlog's own: the coding tickets in To Do.
|
|
54
97
|
*/
|
|
55
|
-
export declare function readPlan(items: Item[], reply: PlanReply | null, notCoding: string, why?: string | null): ShiftPlan;
|
|
98
|
+
export declare function readPlan(items: Item[], reply: PlanReply | null, notCoding: string, why?: string | null, place?: Placer): ShiftPlan;
|
|
56
99
|
//# sourceMappingURL=plan.d.ts.map
|
package/dist/service.d.ts
CHANGED
|
@@ -219,6 +219,10 @@ export declare class NightShifts extends Service {
|
|
|
219
219
|
ruleMatches(projectId: string): Record<string, string>;
|
|
220
220
|
/** The person's starting point for a run. It always answers: with no model, or a model that fails, it is the backlog's own facts. */
|
|
221
221
|
plan(projectId: string, fresh?: boolean): Promise<ShiftPlan>;
|
|
222
|
+
/** The account's computers as its service last read them; none where there is no account. */
|
|
223
|
+
private devices;
|
|
224
|
+
/** The repository a ticket's workstream stands for, by its address. */
|
|
225
|
+
private remoteOf;
|
|
222
226
|
private askPlan;
|
|
223
227
|
/** As in a conversation, the default engine does a run's thinking; one that runs on Tomrade's profiles leaves it to the worker. */
|
|
224
228
|
private defaultAgent;
|
|
@@ -272,6 +276,8 @@ export declare class NightShifts extends Service {
|
|
|
272
276
|
private tell;
|
|
273
277
|
/** One model call per delivery, all at once and within one deadline, and a report that stands without any of them. */
|
|
274
278
|
private deliveries;
|
|
279
|
+
/** What the shift's runs cost by ticket and by agent; the report leaves the section out when nothing ran in the app. */
|
|
280
|
+
private spend;
|
|
275
281
|
/** Writes the morning report into the project's Files and tells the person; returns where it went. */
|
|
276
282
|
brief(shift: NightShift): Promise<string | null>;
|
|
277
283
|
private act;
|
package/dist/words.d.ts
CHANGED
|
@@ -71,6 +71,14 @@ export declare const NIGHT_SHIFT_WORDS: import("@tomradex/domain").WordBook<{
|
|
|
71
71
|
readonly failedNext: "Read why on the ticket, then start it again.";
|
|
72
72
|
readonly skipped: "Not started";
|
|
73
73
|
readonly details: "Ticket by ticket";
|
|
74
|
+
readonly spendSection: "What it cost";
|
|
75
|
+
readonly spendCoverage: "Agents in terminal panes, and some engines, report no cost; these are the runs that did.";
|
|
76
|
+
readonly spendByAgent: "By agent";
|
|
77
|
+
readonly spendByTicket: "By ticket";
|
|
78
|
+
readonly spendRuns: "{{amount}} over {{runs}} runs";
|
|
79
|
+
readonly spendPartly: "{{amount}} over {{runs}} runs ({{unpriced}} reported no cost)";
|
|
80
|
+
readonly spendUnknown: "cost not reported";
|
|
81
|
+
readonly spendNoRuns: "No in-app runs recorded for {{keys}}";
|
|
74
82
|
readonly pullRequest: "Pull request";
|
|
75
83
|
readonly notJudged: "Not judged: read from git only.";
|
|
76
84
|
readonly riskLabel: "Worth a look";
|
|
@@ -87,6 +95,14 @@ export declare const NIGHT_SHIFT_WORDS: import("@tomradex/domain").WordBook<{
|
|
|
87
95
|
readonly notCoding: "Not coding work: it needs a person";
|
|
88
96
|
readonly planNoEngine: "No agent or model is available, so this plan comes from the tickets alone.";
|
|
89
97
|
readonly planFailed: "The analysis failed, so this plan comes from the tickets alone: {{detail}}";
|
|
98
|
+
readonly placeLabel: "Its label asks for that computer.";
|
|
99
|
+
readonly placeOffline: "Its label asks for {{name}}, which is off: sent, it waits there.";
|
|
100
|
+
readonly placeBusy: "Its label asks for {{name}}, which is busy: sent, it waits there.";
|
|
101
|
+
readonly placeNobody: "Its label asks for “{{wanted}}”, and none of your computers is one: it stays here.";
|
|
102
|
+
readonly placeNotAccepting: "Its label asks for {{name}}, which does not accept work: it stays here.";
|
|
103
|
+
readonly placeProject: "Its label asks for {{name}}, which does not accept work for this project: it stays here.";
|
|
104
|
+
readonly placeNoAgent: "Its label asks for {{name}}, which has no coding agent ready: it stays here.";
|
|
105
|
+
readonly placeExcluded: "Its label asks for {{name}}, and a rule keeps this work off it: it stays here.";
|
|
90
106
|
readonly ruleSkipped: "Left out by the rule “{{name}}”";
|
|
91
107
|
readonly engineLost: "{{engine}} could not run, so this went as the run does";
|
|
92
108
|
readonly switchedLimit: "{{from}} hit its usage limit, so {{to}} took over";
|
package/dist/work-rules.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export declare const RuleThen: z.ZodObject<{
|
|
|
19
19
|
engine: z.ZodOptional<z.ZodString>;
|
|
20
20
|
permissionMode: z.ZodOptional<z.ZodString>;
|
|
21
21
|
autoMerge: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
notOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
22
23
|
}, z.core.$strip>;
|
|
23
24
|
export declare const WorkRule: z.ZodObject<{
|
|
24
25
|
id: z.ZodString;
|
|
@@ -41,6 +42,7 @@ export declare const WorkRule: z.ZodObject<{
|
|
|
41
42
|
engine: z.ZodOptional<z.ZodString>;
|
|
42
43
|
permissionMode: z.ZodOptional<z.ZodString>;
|
|
43
44
|
autoMerge: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
notOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
44
46
|
}, z.core.$strip>;
|
|
45
47
|
}, z.core.$strip>;
|
|
46
48
|
export type WorkRule = z.infer<typeof WorkRule>;
|
|
@@ -65,9 +67,12 @@ export declare const WorkRules: z.ZodArray<z.ZodObject<{
|
|
|
65
67
|
engine: z.ZodOptional<z.ZodString>;
|
|
66
68
|
permissionMode: z.ZodOptional<z.ZodString>;
|
|
67
69
|
autoMerge: z.ZodOptional<z.ZodBoolean>;
|
|
70
|
+
notOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
68
71
|
}, z.core.$strip>;
|
|
69
72
|
}, z.core.$strip>>;
|
|
70
73
|
/** Rules run top to bottom and the first that matches is the one: their order is how the person ranks them. */
|
|
71
74
|
export declare const ruleFor: (rules: readonly WorkRule[], item: Item) => WorkRule | null;
|
|
75
|
+
/** The computers a ticket is never sent to: every rule that matches it adds its own, whichever rule sets how it runs. */
|
|
76
|
+
export declare const keptFrom: (rules: readonly WorkRule[], item: Item) => string[];
|
|
72
77
|
export declare function ruleConfig(rule: WorkRule): NodeConfig;
|
|
73
78
|
//# sourceMappingURL=work-rules.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomradex/night-shift",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "Haoyuan Tang",
|
|
6
6
|
"engines": {
|
|
@@ -27,19 +27,20 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@tomradex/agent": "0.
|
|
31
|
-
"@tomradex/alerts": "0.
|
|
32
|
-
"@tomradex/code-link": "0.
|
|
33
|
-
"@tomradex/contracts": "0.
|
|
34
|
-
"@tomradex/contributions": "0.
|
|
35
|
-
"@tomradex/db": "0.
|
|
30
|
+
"@tomradex/agent": "0.29.0",
|
|
31
|
+
"@tomradex/alerts": "0.29.0",
|
|
32
|
+
"@tomradex/code-link": "0.29.0",
|
|
33
|
+
"@tomradex/contracts": "0.29.0",
|
|
34
|
+
"@tomradex/contributions": "0.29.0",
|
|
35
|
+
"@tomradex/db": "0.29.0",
|
|
36
|
+
"@tomradex/dispatch": "0.29.0",
|
|
36
37
|
"@tomradex/domain": "0.2.33",
|
|
37
|
-
"@tomradex/files": "0.
|
|
38
|
-
"@tomradex/ipc": "0.
|
|
39
|
-
"@tomradex/items": "0.
|
|
40
|
-
"@tomradex/llm": "0.
|
|
41
|
-
"@tomradex/settings": "0.
|
|
42
|
-
"@tomradex/tools": "0.
|
|
38
|
+
"@tomradex/files": "0.29.0",
|
|
39
|
+
"@tomradex/ipc": "0.29.0",
|
|
40
|
+
"@tomradex/items": "0.29.0",
|
|
41
|
+
"@tomradex/llm": "0.29.0",
|
|
42
|
+
"@tomradex/settings": "0.29.0",
|
|
43
|
+
"@tomradex/tools": "0.29.0",
|
|
43
44
|
"cordis": "4.0.0-rc.8",
|
|
44
45
|
"zod": "^4.4.3"
|
|
45
46
|
}
|