@ethlete/agent-rules 0.1.0-next.14 → 0.1.0-next.15
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 +66 -0
- package/README.md +36 -2
- package/THIRD-PARTY-LICENSES.md +35 -0
- package/content/hooks/context-warning.py +450 -112
- package/content/hooks/subagent-model-policy.py +185 -0
- package/content/rules/subagent-models.md +29 -0
- package/content/skills/codex-subagent/SKILL.md +90 -0
- package/content/skills/codex-subagent/codex-agent.mjs +229 -0
- package/content/skills/design-exploration/SKILL.md +203 -0
- package/content/skills/design-exploration/check-story.mjs +139 -0
- package/content/skills/design-exploration/shoot-template.mjs +61 -0
- package/content/skills/domain-modeling/ADR-FORMAT.md +47 -0
- package/content/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/content/skills/domain-modeling/SKILL.md +80 -0
- package/content/skills/grill-with-docs/SKILL.md +13 -0
- package/content/skills/grilling/SKILL.md +34 -0
- package/content/skills/handoff/SKILL.md +69 -4
- package/content/skills/sdk-update/SKILL.md +2 -1
- package/content/skills/timetrack/SKILL.md +190 -10
- package/package.json +1 -1
- package/src/index.js +2 -1
- package/src/index.js.map +1 -1
- package/src/lib/frontmatter.d.ts +2 -0
- package/src/lib/frontmatter.js +2 -1
- package/src/lib/frontmatter.js.map +1 -1
- package/src/lib/git-flow/config.js +1 -1
- package/src/lib/git-flow/config.js.map +1 -1
- package/src/lib/git.d.ts +37 -0
- package/src/lib/git.js +77 -1
- package/src/lib/git.js.map +1 -1
- package/src/lib/index.d.ts +1 -0
- package/src/lib/index.js +1 -0
- package/src/lib/index.js.map +1 -1
- package/src/lib/plain-text.d.ts +9 -0
- package/src/lib/plain-text.js +22 -0
- package/src/lib/plain-text.js.map +1 -0
- package/src/lib/targets/claude-hooks.js +2 -1
- package/src/lib/targets/claude-hooks.js.map +1 -1
- package/src/lib/targets/codex-hooks.js +2 -1
- package/src/lib/targets/codex-hooks.js.map +1 -1
- package/src/lib/targets/hooks-shared.d.ts +22 -1
- package/src/lib/targets/hooks-shared.js +42 -9
- package/src/lib/targets/hooks-shared.js.map +1 -1
- package/src/lib/targets/shared.js +1 -0
- package/src/lib/targets/shared.js.map +1 -1
- package/src/lib/timetrack-command.js +449 -20
- package/src/lib/timetrack-command.js.map +1 -1
- package/src/lib/timetrack.d.ts +241 -0
- package/src/lib/timetrack.js +83 -2
- package/src/lib/timetrack.js.map +1 -1
package/src/lib/timetrack.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export type TimetrackIssue = {
|
|
|
9
9
|
export type TimetrackStatus = {
|
|
10
10
|
version: number;
|
|
11
11
|
jiraReady: boolean;
|
|
12
|
+
tempoReady: boolean;
|
|
12
13
|
projects: {
|
|
13
14
|
key: string;
|
|
14
15
|
name: string;
|
|
@@ -33,6 +34,191 @@ export type TimetrackRepoProject = {
|
|
|
33
34
|
inherited: boolean;
|
|
34
35
|
suggestedProjectKey?: string;
|
|
35
36
|
};
|
|
37
|
+
/** One standing statement about what work in a context is logged against. */
|
|
38
|
+
export type TimetrackAttributionRule = {
|
|
39
|
+
id: string;
|
|
40
|
+
repoPath?: string;
|
|
41
|
+
branch?: string;
|
|
42
|
+
appId?: string;
|
|
43
|
+
/** The issue the rule names, or nothing when it donates its time or names a stand-in instead. */
|
|
44
|
+
issueKey?: string;
|
|
45
|
+
/** The stand-in the rule names, as an id into what `timetrackStandIns` answers. */
|
|
46
|
+
standInId?: string;
|
|
47
|
+
/** Whether the rule donates its time to the work around it rather than naming an issue. */
|
|
48
|
+
donates: boolean;
|
|
49
|
+
createdAtMs: number;
|
|
50
|
+
};
|
|
51
|
+
/** One standing statement about a path: whether it is work, and which project it files into. */
|
|
52
|
+
export type TimetrackProjectLinkRule = {
|
|
53
|
+
id: string;
|
|
54
|
+
path: string;
|
|
55
|
+
projectKey?: string;
|
|
56
|
+
private: boolean;
|
|
57
|
+
createdAtMs: number;
|
|
58
|
+
};
|
|
59
|
+
/** The settings that decide what a day's work is named. It holds no host, no account and no token. */
|
|
60
|
+
export type TimetrackRules = {
|
|
61
|
+
dayTargetMs: number;
|
|
62
|
+
gapFillMs: number;
|
|
63
|
+
dayStartHour: number;
|
|
64
|
+
attributionRules: TimetrackAttributionRule[];
|
|
65
|
+
projectLinks: TimetrackProjectLinkRule[];
|
|
66
|
+
backgroundProjects: string[];
|
|
67
|
+
noWorkContextApps: string[];
|
|
68
|
+
holdsWorkApps: string[];
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* One name the user gave work that Jira does not hold yet.
|
|
72
|
+
*
|
|
73
|
+
* Nothing in this CLI opens or resolves a stand-in, because the name is the user's own word for their
|
|
74
|
+
* work and the app is where they give it. A delete is allowed: it takes a name away rather than
|
|
75
|
+
* putting one on the day.
|
|
76
|
+
*/
|
|
77
|
+
export type TimetrackStandIn = {
|
|
78
|
+
id: string;
|
|
79
|
+
name: string;
|
|
80
|
+
projectKey?: string;
|
|
81
|
+
state: 'open' | 'resolved';
|
|
82
|
+
/** The issue it resolved to. Absent while it is open. */
|
|
83
|
+
issueKey?: string;
|
|
84
|
+
/** The local day keys that hold bands of it, oldest first. */
|
|
85
|
+
days: string[];
|
|
86
|
+
author: 'user' | 'agent';
|
|
87
|
+
createdAtMs: number;
|
|
88
|
+
/** The checkout the app opened it for. Absent on one the user opened by hand. */
|
|
89
|
+
openedFor?: string;
|
|
90
|
+
/**
|
|
91
|
+
* The branch of that checkout it covers. Absent on a record opened before the grain was the branch,
|
|
92
|
+
* which is why such a record covers the whole checkout and blocks every branch of it.
|
|
93
|
+
*/
|
|
94
|
+
openedForBranch?: string;
|
|
95
|
+
/** The directory of that branch it covers, where the branch names no piece of work of its own. */
|
|
96
|
+
openedForWorkPath?: string;
|
|
97
|
+
};
|
|
98
|
+
/** One commit a split reads a directory out of: the day it counts toward, and its changed files. */
|
|
99
|
+
export type TimetrackWorkCommit = {
|
|
100
|
+
day: string;
|
|
101
|
+
paths: string[];
|
|
102
|
+
};
|
|
103
|
+
/** One directory a split names, with the days of the record that worked in it. */
|
|
104
|
+
export type TimetrackStandInPiece = {
|
|
105
|
+
workPath: string;
|
|
106
|
+
days: string[];
|
|
107
|
+
commits: number;
|
|
108
|
+
};
|
|
109
|
+
/** What a split would do, or did. `candidates` is every directory; `pieces` is what gets written. */
|
|
110
|
+
export type TimetrackStandInSplit = {
|
|
111
|
+
candidates: TimetrackStandInPiece[];
|
|
112
|
+
pieces: TimetrackStandInPiece[];
|
|
113
|
+
/** The days no piece claims, which the record being split keeps rather than the split refusing. */
|
|
114
|
+
remainder: string[];
|
|
115
|
+
standIns: TimetrackStandIn[];
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* What the checkout-wide naming offer says about one day, offers and refusals alike.
|
|
119
|
+
*
|
|
120
|
+
* A card the day screen never draws is the hardest thing to ask about, because every step that can
|
|
121
|
+
* stop it is invisible from the screen. `declines` names the step that stopped.
|
|
122
|
+
*/
|
|
123
|
+
export type TimetrackNaming = {
|
|
124
|
+
day: string;
|
|
125
|
+
/** Whether a Tempo token is stored. Without one every checkout declines with `no-history`. */
|
|
126
|
+
tempoReady: boolean;
|
|
127
|
+
/** How far the read of the user's Tempo history got. */
|
|
128
|
+
history: 'loading' | 'no-token' | 'ready' | 'failed';
|
|
129
|
+
/** How many worklogs the span holds, whatever project they are in. */
|
|
130
|
+
historyWorklogs: number;
|
|
131
|
+
/** What the read failed with. Absent unless `history` is `failed`. */
|
|
132
|
+
historyMessage?: string;
|
|
133
|
+
offers: TimetrackNamingOffer[];
|
|
134
|
+
declines: TimetrackNamingDecline[];
|
|
135
|
+
};
|
|
136
|
+
export type TimetrackNamingOffer = {
|
|
137
|
+
repoPath: string;
|
|
138
|
+
projectKey: string;
|
|
139
|
+
issueKey: string;
|
|
140
|
+
summary: string;
|
|
141
|
+
days: number;
|
|
142
|
+
loggedMs: number;
|
|
143
|
+
/** How much of the project's logged time went to this one issue, from 0 to 1. */
|
|
144
|
+
share: number;
|
|
145
|
+
};
|
|
146
|
+
export type TimetrackNamingDecline = {
|
|
147
|
+
repoPath: string;
|
|
148
|
+
reason: 'already-named' | 'named-by-stand-in' | 'no-project-link' | 'no-history' | 'project-too-small' | 'too-few-days' | 'share-too-low';
|
|
149
|
+
projectKey?: string;
|
|
150
|
+
issueKey?: string;
|
|
151
|
+
days?: number;
|
|
152
|
+
loggedMs?: number;
|
|
153
|
+
projectMs?: number;
|
|
154
|
+
share?: number;
|
|
155
|
+
};
|
|
156
|
+
/** One day's evidence, straight out of the app's encrypted store. `events` is opaque here on purpose. */
|
|
157
|
+
export type TimetrackDayEvents = {
|
|
158
|
+
day: string;
|
|
159
|
+
fromMs: number;
|
|
160
|
+
toMs: number;
|
|
161
|
+
events: unknown[];
|
|
162
|
+
};
|
|
163
|
+
/** One row of a day as the app's own review drew it. Every edit names a row by this `id`. */
|
|
164
|
+
export type TimetrackRow = {
|
|
165
|
+
id: string;
|
|
166
|
+
issueKey?: string;
|
|
167
|
+
standInId?: string;
|
|
168
|
+
description: string;
|
|
169
|
+
fromMs: number;
|
|
170
|
+
toMs: number;
|
|
171
|
+
durationMs: number;
|
|
172
|
+
observedMs: number;
|
|
173
|
+
laneKey?: string;
|
|
174
|
+
state: string;
|
|
175
|
+
confidence: string;
|
|
176
|
+
edited: boolean;
|
|
177
|
+
hidden: boolean;
|
|
178
|
+
};
|
|
179
|
+
/** A day as the screen draws it: the rows, the ones taken off the timeline, and its totals. */
|
|
180
|
+
export type TimetrackDayRows = {
|
|
181
|
+
day: string;
|
|
182
|
+
rows: TimetrackRow[];
|
|
183
|
+
hidden: TimetrackRow[];
|
|
184
|
+
proposedMs: number;
|
|
185
|
+
loggedMs: number;
|
|
186
|
+
targetMs: number;
|
|
187
|
+
unattributedMs: number;
|
|
188
|
+
warnings: {
|
|
189
|
+
kind: string;
|
|
190
|
+
detail: string;
|
|
191
|
+
}[];
|
|
192
|
+
};
|
|
193
|
+
/** One change to one row, named by the id `timetrackDayRows` answered. */
|
|
194
|
+
export type TimetrackRowEdit = {
|
|
195
|
+
kind: 'range';
|
|
196
|
+
rowId: string;
|
|
197
|
+
fromMs: number;
|
|
198
|
+
toMs: number;
|
|
199
|
+
} | {
|
|
200
|
+
kind: 'issue';
|
|
201
|
+
rowId: string;
|
|
202
|
+
issueKey: string;
|
|
203
|
+
} | {
|
|
204
|
+
kind: 'description';
|
|
205
|
+
rowId: string;
|
|
206
|
+
description: string;
|
|
207
|
+
} | {
|
|
208
|
+
kind: 'state';
|
|
209
|
+
rowId: string;
|
|
210
|
+
state: 'accepted' | 'rejected';
|
|
211
|
+
} | {
|
|
212
|
+
kind: 'hidden';
|
|
213
|
+
rowId: string;
|
|
214
|
+
hidden: boolean;
|
|
215
|
+
} | {
|
|
216
|
+
kind: 'reset';
|
|
217
|
+
rowId: string;
|
|
218
|
+
};
|
|
219
|
+
export type TimetrackEditedDay = TimetrackDayRows & {
|
|
220
|
+
applied: number;
|
|
221
|
+
};
|
|
36
222
|
export type TimetrackWorklog = {
|
|
37
223
|
day: string;
|
|
38
224
|
issueKey: string;
|
|
@@ -58,6 +244,7 @@ export declare const askTimetrack: <T>(request: Record<string, unknown> & {
|
|
|
58
244
|
op: string;
|
|
59
245
|
}) => Promise<T>;
|
|
60
246
|
export declare const timetrackStatus: () => Promise<TimetrackStatus>;
|
|
247
|
+
export declare const timetrackNaming: (day: string) => Promise<TimetrackNaming>;
|
|
61
248
|
export declare const timetrackInstance: () => Promise<TimetrackInstance>;
|
|
62
249
|
export declare const timetrackIssue: (key: string) => Promise<TimetrackIssue>;
|
|
63
250
|
export declare const timetrackSearch: (options: {
|
|
@@ -84,3 +271,57 @@ export declare const timetrackAddWorklog: (options: {
|
|
|
84
271
|
fromMs: number;
|
|
85
272
|
durationMs: number;
|
|
86
273
|
}) => Promise<TimetrackWorklog>;
|
|
274
|
+
export declare const timetrackDayEvents: (day: string) => Promise<TimetrackDayEvents>;
|
|
275
|
+
export declare const timetrackDayRows: (day: string) => Promise<TimetrackDayRows>;
|
|
276
|
+
/**
|
|
277
|
+
* Makes the stated edits to a day's rows and answers the day as it reads afterwards.
|
|
278
|
+
*
|
|
279
|
+
* The app moves its own review to that day, so the user sees what changed. `applied` counts the edits
|
|
280
|
+
* that found their row: a day the collectors keep changing can drop a row a caller read a moment ago.
|
|
281
|
+
*/
|
|
282
|
+
export declare const timetrackEditDay: (options: {
|
|
283
|
+
day: string;
|
|
284
|
+
edits: readonly TimetrackRowEdit[];
|
|
285
|
+
}) => Promise<TimetrackEditedDay>;
|
|
286
|
+
export declare const timetrackRules: () => Promise<TimetrackRules>;
|
|
287
|
+
export declare const timetrackStandIns: () => Promise<TimetrackStandIn[]>;
|
|
288
|
+
/**
|
|
289
|
+
* Deletes one placeholder and answers with the list as it reads afterwards.
|
|
290
|
+
*
|
|
291
|
+
* The rule pointing at it goes with it. A record the app opened for one branch refuses that branch as
|
|
292
|
+
* it goes, so no second one opens for it; a record naming no branch refuses nothing, and the next
|
|
293
|
+
* pass may open one at whatever grain the day reads.
|
|
294
|
+
*/
|
|
295
|
+
export declare const timetrackRemoveStandIn: (id: string) => Promise<TimetrackStandIn[]>;
|
|
296
|
+
/**
|
|
297
|
+
* Gives one placeholder another name and answers with the list as it reads afterwards.
|
|
298
|
+
*
|
|
299
|
+
* Only the name changes. The days it holds and the rules that name it stay, which is what a delete
|
|
300
|
+
* and a fresh record would lose.
|
|
301
|
+
*/
|
|
302
|
+
export declare const timetrackRenameStandIn: (options: {
|
|
303
|
+
id: string;
|
|
304
|
+
name: string;
|
|
305
|
+
}) => Promise<TimetrackStandIn[]>;
|
|
306
|
+
/**
|
|
307
|
+
* Cuts one placeholder into one per directory it turned out to cover.
|
|
308
|
+
*
|
|
309
|
+
* Without `apply` it answers the plan and writes nothing. The commits come from the caller: one
|
|
310
|
+
* collected before Timetrack read file paths carries none, so only `git log --name-only` can say.
|
|
311
|
+
* A checkout whose commits name more directories than a grain can hold has no automatic reading,
|
|
312
|
+
* and `paths` is how the user picks which of them are the pieces.
|
|
313
|
+
*/
|
|
314
|
+
export declare const timetrackSplitStandIn: (options: {
|
|
315
|
+
id: string;
|
|
316
|
+
branch: string;
|
|
317
|
+
commits: readonly TimetrackWorkCommit[];
|
|
318
|
+
/** The checkout the directories are in, for a record that names none of its own. */
|
|
319
|
+
repoPath?: string;
|
|
320
|
+
/** The projects the checkout declares, relative to it. They are the grain a piece is cut to. */
|
|
321
|
+
projectRoots: readonly string[];
|
|
322
|
+
/** The directories the user picked as the pieces. Empty lets the automatic reading answer. */
|
|
323
|
+
paths: readonly string[];
|
|
324
|
+
/** The directory that takes every day of the record no commit claims. */
|
|
325
|
+
claim?: string;
|
|
326
|
+
apply: boolean;
|
|
327
|
+
}) => Promise<TimetrackStandInSplit>;
|
package/src/lib/timetrack.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.timetrackAddWorklog = exports.timetrackCreateIssue = exports.timetrackRepoProject = exports.timetrackSearch = exports.timetrackIssue = exports.timetrackInstance = exports.timetrackStatus = exports.askTimetrack = exports.timetrackDiscoveryPath = void 0;
|
|
3
|
+
exports.timetrackSplitStandIn = exports.timetrackRenameStandIn = exports.timetrackRemoveStandIn = exports.timetrackStandIns = exports.timetrackRules = exports.timetrackEditDay = exports.timetrackDayRows = exports.timetrackDayEvents = exports.timetrackAddWorklog = exports.timetrackCreateIssue = exports.timetrackRepoProject = exports.timetrackSearch = exports.timetrackIssue = exports.timetrackInstance = exports.timetrackNaming = exports.timetrackStatus = exports.askTimetrack = exports.timetrackDiscoveryPath = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const crypto_1 = require("crypto");
|
|
5
6
|
const fs_1 = require("fs");
|
|
6
7
|
const os_1 = require("os");
|
|
7
8
|
const path_1 = require("path");
|
|
@@ -12,10 +13,11 @@ const DISCOVERY_FILENAME = 'agent.json';
|
|
|
12
13
|
* The contract version this client speaks. The app writes its own into the discovery file, and a
|
|
13
14
|
* mismatch stops here rather than at a field that is missing for a reason nobody can see.
|
|
14
15
|
*/
|
|
15
|
-
const PROTOCOL_VERSION =
|
|
16
|
+
const PROTOCOL_VERSION = 2;
|
|
16
17
|
/** A Jira search behind a slow instance is the long case; the app's own deadline is 60 seconds. */
|
|
17
18
|
const TIMEOUT_MS = 70000;
|
|
18
19
|
const PATH = '/agent';
|
|
20
|
+
const PROOF_PATH = '/agent/proof';
|
|
19
21
|
const NOT_RUNNING = [
|
|
20
22
|
'Timetrack is not running, so no Jira credentials are reachable.',
|
|
21
23
|
'Start the app — it holds the token for every repository on this machine — then try again.',
|
|
@@ -62,6 +64,38 @@ const readDiscovery = () => {
|
|
|
62
64
|
}
|
|
63
65
|
return { version: discovery.version, port: discovery.port, token: discovery.token };
|
|
64
66
|
};
|
|
67
|
+
const IMPOSTOR = [
|
|
68
|
+
'Something other than Timetrack answers on the port its discovery file names.',
|
|
69
|
+
'The app writes a new port and a new token at every start — restart Timetrack, then try again.',
|
|
70
|
+
].join('\n');
|
|
71
|
+
/**
|
|
72
|
+
* Makes the server prove it holds this run's token, before a request body or that token is sent.
|
|
73
|
+
*
|
|
74
|
+
* The port is ephemeral: once the app stops, anything running as this account can bind the port the
|
|
75
|
+
* discovery file still names, be handed the request and answer invented data. So the token is used as
|
|
76
|
+
* an HMAC key over a nonce this caller picks, and nothing is sent until the answer matches.
|
|
77
|
+
*/
|
|
78
|
+
const proveTheServer = (discovery) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
79
|
+
var _a;
|
|
80
|
+
const nonce = (0, crypto_1.randomBytes)(16).toString('hex');
|
|
81
|
+
const expected = (0, crypto_1.createHmac)('sha256', discovery.token).update(nonce).digest('hex');
|
|
82
|
+
let answered;
|
|
83
|
+
try {
|
|
84
|
+
const response = yield fetch(`http://127.0.0.1:${discovery.port}${PROOF_PATH}?nonce=${nonce}`, {
|
|
85
|
+
redirect: 'error',
|
|
86
|
+
signal: AbortSignal.timeout(TIMEOUT_MS),
|
|
87
|
+
});
|
|
88
|
+
if (response.ok)
|
|
89
|
+
answered = (_a = (yield response.json()).value) === null || _a === void 0 ? void 0 : _a.proof;
|
|
90
|
+
}
|
|
91
|
+
catch (_b) {
|
|
92
|
+
throw new Error(NOT_RUNNING);
|
|
93
|
+
}
|
|
94
|
+
const offered = Buffer.from(answered !== null && answered !== void 0 ? answered : '', 'utf8');
|
|
95
|
+
if (offered.length !== expected.length || !(0, crypto_1.timingSafeEqual)(offered, Buffer.from(expected, 'utf8'))) {
|
|
96
|
+
throw new Error(IMPOSTOR);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
65
99
|
/**
|
|
66
100
|
* Asks the running Timetrack app to carry out one operation.
|
|
67
101
|
*
|
|
@@ -70,12 +104,14 @@ const readDiscovery = () => {
|
|
|
70
104
|
*/
|
|
71
105
|
const askTimetrack = (request) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
72
106
|
const discovery = readDiscovery();
|
|
107
|
+
yield proveTheServer(discovery);
|
|
73
108
|
let response;
|
|
74
109
|
try {
|
|
75
110
|
response = yield fetch(`http://127.0.0.1:${discovery.port}${PATH}`, {
|
|
76
111
|
method: 'POST',
|
|
77
112
|
headers: { authorization: `Bearer ${discovery.token}`, 'content-type': 'application/json' },
|
|
78
113
|
body: JSON.stringify(request),
|
|
114
|
+
redirect: 'error',
|
|
79
115
|
signal: AbortSignal.timeout(TIMEOUT_MS),
|
|
80
116
|
});
|
|
81
117
|
}
|
|
@@ -97,6 +133,8 @@ const askTimetrack = (request) => tslib_1.__awaiter(void 0, void 0, void 0, func
|
|
|
97
133
|
exports.askTimetrack = askTimetrack;
|
|
98
134
|
const timetrackStatus = () => (0, exports.askTimetrack)({ op: 'status' });
|
|
99
135
|
exports.timetrackStatus = timetrackStatus;
|
|
136
|
+
const timetrackNaming = (day) => (0, exports.askTimetrack)({ op: 'naming.offers', day });
|
|
137
|
+
exports.timetrackNaming = timetrackNaming;
|
|
100
138
|
const timetrackInstance = () => (0, exports.askTimetrack)({ op: 'jira.instance' });
|
|
101
139
|
exports.timetrackInstance = timetrackInstance;
|
|
102
140
|
const timetrackIssue = (key) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { return (yield (0, exports.askTimetrack)({ op: 'jira.issue', key })).issue; });
|
|
@@ -109,4 +147,47 @@ const timetrackCreateIssue = (options) => tslib_1.__awaiter(void 0, void 0, void
|
|
|
109
147
|
exports.timetrackCreateIssue = timetrackCreateIssue;
|
|
110
148
|
const timetrackAddWorklog = (options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { return (yield (0, exports.askTimetrack)(Object.assign({ op: 'worklog.add' }, options))).worklog; });
|
|
111
149
|
exports.timetrackAddWorklog = timetrackAddWorklog;
|
|
150
|
+
const timetrackDayEvents = (day) => (0, exports.askTimetrack)({ op: 'day.events', day });
|
|
151
|
+
exports.timetrackDayEvents = timetrackDayEvents;
|
|
152
|
+
const timetrackDayRows = (day) => (0, exports.askTimetrack)({ op: 'day.rows', day });
|
|
153
|
+
exports.timetrackDayRows = timetrackDayRows;
|
|
154
|
+
/**
|
|
155
|
+
* Makes the stated edits to a day's rows and answers the day as it reads afterwards.
|
|
156
|
+
*
|
|
157
|
+
* The app moves its own review to that day, so the user sees what changed. `applied` counts the edits
|
|
158
|
+
* that found their row: a day the collectors keep changing can drop a row a caller read a moment ago.
|
|
159
|
+
*/
|
|
160
|
+
const timetrackEditDay = (options) => (0, exports.askTimetrack)(Object.assign({ op: 'day.edits' }, options));
|
|
161
|
+
exports.timetrackEditDay = timetrackEditDay;
|
|
162
|
+
const timetrackRules = () => (0, exports.askTimetrack)({ op: 'settings.rules' });
|
|
163
|
+
exports.timetrackRules = timetrackRules;
|
|
164
|
+
const timetrackStandIns = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { return (yield (0, exports.askTimetrack)({ op: 'standIn.list' })).standIns; });
|
|
165
|
+
exports.timetrackStandIns = timetrackStandIns;
|
|
166
|
+
/**
|
|
167
|
+
* Deletes one placeholder and answers with the list as it reads afterwards.
|
|
168
|
+
*
|
|
169
|
+
* The rule pointing at it goes with it. A record the app opened for one branch refuses that branch as
|
|
170
|
+
* it goes, so no second one opens for it; a record naming no branch refuses nothing, and the next
|
|
171
|
+
* pass may open one at whatever grain the day reads.
|
|
172
|
+
*/
|
|
173
|
+
const timetrackRemoveStandIn = (id) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { return (yield (0, exports.askTimetrack)({ op: 'standIn.remove', id })).standIns; });
|
|
174
|
+
exports.timetrackRemoveStandIn = timetrackRemoveStandIn;
|
|
175
|
+
/**
|
|
176
|
+
* Gives one placeholder another name and answers with the list as it reads afterwards.
|
|
177
|
+
*
|
|
178
|
+
* Only the name changes. The days it holds and the rules that name it stay, which is what a delete
|
|
179
|
+
* and a fresh record would lose.
|
|
180
|
+
*/
|
|
181
|
+
const timetrackRenameStandIn = (options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { return (yield (0, exports.askTimetrack)(Object.assign({ op: 'standIn.rename' }, options))).standIns; });
|
|
182
|
+
exports.timetrackRenameStandIn = timetrackRenameStandIn;
|
|
183
|
+
/**
|
|
184
|
+
* Cuts one placeholder into one per directory it turned out to cover.
|
|
185
|
+
*
|
|
186
|
+
* Without `apply` it answers the plan and writes nothing. The commits come from the caller: one
|
|
187
|
+
* collected before Timetrack read file paths carries none, so only `git log --name-only` can say.
|
|
188
|
+
* A checkout whose commits name more directories than a grain can hold has no automatic reading,
|
|
189
|
+
* and `paths` is how the user picks which of them are the pieces.
|
|
190
|
+
*/
|
|
191
|
+
const timetrackSplitStandIn = (options) => (0, exports.askTimetrack)(Object.assign({ op: 'standIn.split' }, options));
|
|
192
|
+
exports.timetrackSplitStandIn = timetrackSplitStandIn;
|
|
112
193
|
//# sourceMappingURL=timetrack.js.map
|
package/src/lib/timetrack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timetrack.js","sourceRoot":"","sources":["../../../../../libs/agent-rules/src/lib/tim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