@skrr-ai/cli 0.1.207 → 0.1.208
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/commands/agent/message/resolve.d.ts +31 -0
- package/dist/commands/agent/message/resolve.js +111 -0
- package/dist/commands/agent/message/send.d.ts +17 -5
- package/dist/commands/agent/message/send.js +77 -26
- package/dist/commands/agent/request/list.d.ts +15 -0
- package/dist/commands/agent/request/list.js +82 -0
- package/dist/commands/agent/request/send.d.ts +18 -0
- package/dist/commands/agent/request/send.js +56 -0
- package/dist/commands/agents/access/approve.d.ts +17 -0
- package/dist/commands/agents/access/approve.js +94 -0
- package/dist/commands/agents/access/deny.d.ts +10 -0
- package/dist/commands/agents/access/deny.js +36 -0
- package/dist/commands/agents/access/list.d.ts +10 -0
- package/dist/commands/agents/access/list.js +53 -0
- package/dist/commands/agents/access/reach.d.ts +13 -0
- package/dist/commands/agents/access/reach.js +53 -0
- package/dist/commands/agents/access/revoke.d.ts +13 -0
- package/dist/commands/agents/access/revoke.js +50 -0
- package/dist/commands/agents/import.d.ts +15 -1
- package/dist/commands/agents/import.js +211 -23
- package/dist/commands/agents/intuitions/accept.d.ts +0 -1
- package/dist/commands/agents/intuitions/accept.js +22 -7
- package/dist/commands/agents/intuitions/generate.d.ts +0 -1
- package/dist/commands/agents/intuitions/generate.js +4 -16
- package/dist/commands/agents/intuitions/list.js +9 -3
- package/dist/commands/agents/intuitions/resume.d.ts +11 -0
- package/dist/commands/agents/intuitions/resume.js +37 -0
- package/dist/commands/agents/shared-memory.d.ts +24 -0
- package/dist/commands/agents/shared-memory.js +67 -0
- package/dist/commands/agents/visibility.d.ts +1 -0
- package/dist/commands/agents/visibility.js +14 -0
- package/dist/commands/code/migrate.js +3 -1
- package/dist/commands/duties/advance-next.js +15 -6
- package/dist/commands/followups/show.js +9 -0
- package/dist/commands/followups/watch-pr.d.ts +27 -0
- package/dist/commands/followups/watch-pr.js +123 -0
- package/dist/commands/memory/consolidation/index.d.ts +20 -0
- package/dist/commands/memory/consolidation/index.js +78 -0
- package/dist/commands/memory/consolidation/resume.d.ts +14 -0
- package/dist/commands/memory/consolidation/resume.js +46 -0
- package/dist/commands/memory/consolidation/undo.d.ts +18 -0
- package/dist/commands/memory/consolidation/undo.js +60 -0
- package/dist/commands/slack/mutes.d.ts +10 -0
- package/dist/commands/slack/mutes.js +62 -0
- package/dist/commands/slack/unmute.d.ts +12 -0
- package/dist/commands/slack/unmute.js +44 -0
- package/dist/commands/tasks/actionability.js +9 -0
- package/dist/commands/tasks/ask.d.ts +50 -0
- package/dist/commands/tasks/ask.js +190 -0
- package/dist/commands/tasks/handover.js +14 -0
- package/dist/commands/tasks/input/answer.js +8 -2
- package/dist/commands/tasks/input/show.d.ts +26 -0
- package/dist/commands/tasks/input/show.js +185 -17
- package/dist/commands/tasks/move.d.ts +11 -0
- package/dist/commands/tasks/move.js +82 -1
- package/dist/commands/tasks/result/submit.js +3 -0
- package/dist/commands/tasks/runs.d.ts +4 -1
- package/dist/commands/tasks/runs.js +22 -3
- package/dist/commands/tasks/show.js +22 -1
- package/dist/commands/tasks/update.d.ts +1 -0
- package/dist/commands/tasks/update.js +52 -1
- package/dist/commands/tasks/updates/add.js +3 -0
- package/dist/commands/tasks/wait.d.ts +20 -0
- package/dist/commands/tasks/wait.js +102 -1
- package/dist/generated/agent-guides.json +501 -92
- package/dist/generated/managed-instruction-guides.json +1 -1
- package/dist/lib/agent-access-command.d.ts +19 -0
- package/dist/lib/agent-access-command.js +44 -0
- package/dist/lib/agent-access.d.ts +18 -0
- package/dist/lib/agent-access.js +48 -0
- package/dist/lib/agent-import/apply.d.ts +50 -0
- package/dist/lib/agent-import/apply.js +85 -0
- package/dist/lib/agent-import/plan.d.ts +132 -0
- package/dist/lib/agent-import/plan.js +504 -0
- package/dist/lib/agent-import/reader.d.ts +94 -0
- package/dist/lib/agent-import/reader.js +326 -0
- package/dist/lib/agent-import/schedule.d.ts +46 -0
- package/dist/lib/agent-import/schedule.js +220 -0
- package/dist/lib/agent-import/sources.d.ts +124 -0
- package/dist/lib/agent-import/sources.js +797 -0
- package/dist/lib/followups.d.ts +61 -0
- package/dist/lib/followups.js +39 -0
- package/dist/lib/handover-interview.d.ts +18 -0
- package/dist/lib/handover-interview.js +53 -0
- package/dist/lib/input-queue.js +2 -1
- package/dist/lib/intuition-look.d.ts +10 -0
- package/dist/lib/intuition-look.js +64 -0
- package/dist/lib/record-output.d.ts +1 -1
- package/dist/lib/record-output.js +2 -0
- package/dist/lib/skill-import.d.ts +19 -0
- package/dist/lib/skill-import.js +34 -0
- package/dist/lib/slack-thread-mutes.d.ts +25 -0
- package/dist/lib/slack-thread-mutes.js +12 -0
- package/dist/lib/task-carriers.d.ts +18 -0
- package/dist/lib/task-carriers.js +43 -0
- package/dist/lib/task-extras.d.ts +5 -0
- package/dist/lib/task-extras.js +5 -0
- package/dist/lib/task-recurrence-summary.d.ts +15 -0
- package/dist/lib/task-recurrence-summary.js +22 -0
- package/dist/lib/task-version.d.ts +44 -0
- package/dist/lib/task-version.js +73 -0
- package/dist/lib/task-write-attribution.d.ts +7 -0
- package/dist/lib/task-write-attribution.js +14 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/turnPacing.d.ts +75 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/turnPacing.js +124 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/turnPacing.d.ts +75 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/turnPacing.js +141 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +10 -0
- package/dist/node_modules/@skrr-ai/data-provider/index.js +13323 -12577
- package/oclif.manifest.json +1787 -107
- package/package.json +5 -2
|
@@ -218,6 +218,9 @@ class TasksUpdatesAdd extends base_command_1.BaseCommand {
|
|
|
218
218
|
}, outcome)) {
|
|
219
219
|
this.log(line);
|
|
220
220
|
}
|
|
221
|
+
const started = (0, task_write_attribution_1.taskStartedLine)(result, task.id);
|
|
222
|
+
if (started)
|
|
223
|
+
this.log(started);
|
|
221
224
|
}
|
|
222
225
|
}
|
|
223
226
|
exports.default = TasksUpdatesAdd;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { BaseCommand } from '../../base-command';
|
|
2
|
+
import { type FollowUpRow } from '../../lib/followups';
|
|
2
3
|
export default class TasksWait extends BaseCommand {
|
|
4
|
+
static summary: string;
|
|
3
5
|
static description: string;
|
|
4
6
|
static examples: string[];
|
|
5
7
|
static args: {
|
|
@@ -14,6 +16,24 @@ export default class TasksWait extends BaseCommand {
|
|
|
14
16
|
'fail-on': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
17
|
interval: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
18
|
timeout: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
on: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
where: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
deadline: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
agent: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
why: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
'max-fix-attempts': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
25
|
+
'reset-attempts': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
26
|
};
|
|
18
27
|
run(): Promise<void>;
|
|
28
|
+
private armWait;
|
|
29
|
+
}
|
|
30
|
+
export interface TaskWaitResponse {
|
|
31
|
+
task?: {
|
|
32
|
+
id?: string;
|
|
33
|
+
identifier?: string;
|
|
34
|
+
status?: string;
|
|
35
|
+
};
|
|
36
|
+
followup?: FollowUpRow | null;
|
|
37
|
+
reused?: boolean;
|
|
38
|
+
alreadyBlocked?: boolean;
|
|
19
39
|
}
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
4
5
|
const base_command_1 = require("../../base-command");
|
|
5
6
|
const task_resolver_1 = require("../../lib/task-resolver");
|
|
7
|
+
const task_extras_1 = require("../../lib/task-extras");
|
|
8
|
+
const tasks_1 = require("../../lib/tasks");
|
|
9
|
+
const followups_1 = require("../../lib/followups");
|
|
6
10
|
const task_execution_1 = require("../../lib/task-execution");
|
|
7
11
|
const PARSE_DURATION_MS_RE = /^(\d+)(ms|s|m|h)?$/i;
|
|
8
12
|
class TasksWait extends base_command_1.BaseCommand {
|
|
9
|
-
static
|
|
13
|
+
static summary = 'Block a task on a pull request or events, or wait for tasks to reach a status';
|
|
14
|
+
static description = [
|
|
15
|
+
'With --on, this arms a wait and blocks the task on it in one call: the task moves to blocked with the wait recorded as what it waits on, and moves back when the wait wakes its agent. --on owner/repo#n watches that pull request to the end (CI on its head, a conflict, a review, the merge or a close; fix attempts held by the server, as `skrr followups watch-pr`). --on <entity.event> (repeatable) wakes on the first of those events, filtered with --where field=value.',
|
|
16
|
+
'Without --on, this polls until the tasks reach a target status (--until), for scripts.',
|
|
17
|
+
].join('\n\n');
|
|
10
18
|
static examples = [
|
|
11
19
|
'<%= config.bin %> tasks wait <task-id> --until done',
|
|
12
20
|
'<%= config.bin %> tasks wait --until done',
|
|
13
21
|
'<%= config.bin %> tasks wait <task-id> --task <other-task-id> --until terminal',
|
|
14
22
|
'<%= config.bin %> tasks wait <root-task-id> --descendants --timeout 30m',
|
|
23
|
+
'<%= config.bin %> tasks wait OSK-42 --on acme/api#17',
|
|
24
|
+
'<%= config.bin %> tasks wait OSK-42 --on github.pull_request_merged --on github.pull_request_closed --where prNumber=17 --deadline 2d',
|
|
15
25
|
];
|
|
16
26
|
static args = {
|
|
17
27
|
id: core_1.Args.string({
|
|
@@ -37,6 +47,26 @@ class TasksWait extends base_command_1.BaseCommand {
|
|
|
37
47
|
}),
|
|
38
48
|
interval: core_1.Flags.integer({ description: 'Polling interval in seconds', default: 5 }),
|
|
39
49
|
timeout: core_1.Flags.string({ description: 'Timeout such as 30s, 10m, 2h' }),
|
|
50
|
+
on: core_1.Flags.string({
|
|
51
|
+
description: 'Block the task until this happens: a pull request (owner/repo#n or its URL), or an event <entity.event> (repeatable; the first to arrive wakes the agent)',
|
|
52
|
+
multiple: true,
|
|
53
|
+
}),
|
|
54
|
+
where: core_1.Flags.string({
|
|
55
|
+
description: 'With --on <event>: the event field that must equal a value, field=value (such as prNumber=17)',
|
|
56
|
+
}),
|
|
57
|
+
deadline: core_1.Flags.string({
|
|
58
|
+
description: 'With --on: when the wait stops if nothing arrived, 10m to 7d (default 6h)',
|
|
59
|
+
}),
|
|
60
|
+
agent: core_1.Flags.string({
|
|
61
|
+
description: "With --on: the agent the wait wakes (default: the session's agent, else the task's assignee)",
|
|
62
|
+
}),
|
|
63
|
+
why: core_1.Flags.string({ description: 'With --on: why the task waits, in one line' }),
|
|
64
|
+
'max-fix-attempts': core_1.Flags.integer({
|
|
65
|
+
description: `With --on <pr>: set the fix-attempt budget (1-${data_provider_1.PULL_REQUEST_WATCH_MAX_FIX_ATTEMPTS}). The owner's to set`,
|
|
66
|
+
}),
|
|
67
|
+
'reset-attempts': core_1.Flags.boolean({
|
|
68
|
+
description: "With --on <pr>: start the fix-attempt count again. The owner's to set",
|
|
69
|
+
}),
|
|
40
70
|
};
|
|
41
71
|
async run() {
|
|
42
72
|
this.requireAuth();
|
|
@@ -56,6 +86,21 @@ class TasksWait extends base_command_1.BaseCommand {
|
|
|
56
86
|
});
|
|
57
87
|
}
|
|
58
88
|
const taskRef = await this.resolveEntityRef('task', taskIdentity.id);
|
|
89
|
+
// What the person typed, for the sentences; the resolved id for the request.
|
|
90
|
+
const shownRef = args.id || taskRef;
|
|
91
|
+
if (flags.on?.length) {
|
|
92
|
+
await this.armWait(taskRef, shownRef, flags);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const onlyWithOn = ['where', 'deadline', 'agent', 'why', 'max-fix-attempts', 'reset-attempts'].filter((name) => flags[name] !== undefined && flags[name] !== false);
|
|
96
|
+
if (onlyWithOn.length) {
|
|
97
|
+
this.failWithCliError({
|
|
98
|
+
message: `--${onlyWithOn[0]} belongs to a wait on something: add --on <owner/repo#n> or --on <entity.event>, for example \`skrr tasks wait ${shownRef} --on acme/api#17\`.`,
|
|
99
|
+
code: 'TASK_WAIT_ON_REQUIRED',
|
|
100
|
+
exit: 2,
|
|
101
|
+
retryable: false,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
59
104
|
const failOn = (0, task_execution_1.parseStatusSet)(flags['fail-on'], task_execution_1.DEFAULT_FAIL_STATUSES);
|
|
60
105
|
let timeoutMs = null;
|
|
61
106
|
try {
|
|
@@ -118,8 +163,64 @@ class TasksWait extends base_command_1.BaseCommand {
|
|
|
118
163
|
await (0, task_execution_1.sleep)(intervalMs);
|
|
119
164
|
}
|
|
120
165
|
}
|
|
166
|
+
async armWait(taskRef, shownRef, flags) {
|
|
167
|
+
const polling = POLLING_FLAGS.find((flag) => this.argv.some((token) => token === flag || token.startsWith(`${flag}=`)));
|
|
168
|
+
if (polling) {
|
|
169
|
+
this.failWithCliError({
|
|
170
|
+
message: `${polling} polls for a status and cannot be combined with --on, which arms a wait and returns at once. Run \`skrr tasks wait ${shownRef} --on ${flags.on[0]}\` alone, or drop --on to poll.`,
|
|
171
|
+
code: 'TASK_WAIT_MIXED_FORMS',
|
|
172
|
+
exit: 2,
|
|
173
|
+
retryable: false,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
const sessionAgent = (0, tasks_1.boundSessionAgentId)();
|
|
177
|
+
let response;
|
|
178
|
+
try {
|
|
179
|
+
response = (await task_extras_1.taskLookupApi.waitOn(taskRef, {
|
|
180
|
+
on: flags.on,
|
|
181
|
+
producer: sessionAgent ? 'agent_in_turn' : 'user_explicit',
|
|
182
|
+
...(flags.agent || sessionAgent ? { agentId: flags.agent || sessionAgent } : {}),
|
|
183
|
+
...(flags.where ? { where: flags.where } : {}),
|
|
184
|
+
...(flags.deadline ? { deadline: flags.deadline } : {}),
|
|
185
|
+
...(flags.why ? { why: flags.why } : {}),
|
|
186
|
+
...(flags['max-fix-attempts'] !== undefined
|
|
187
|
+
? { maxFixAttempts: flags['max-fix-attempts'] }
|
|
188
|
+
: {}),
|
|
189
|
+
...(flags['reset-attempts'] ? { resetAttempts: true } : {}),
|
|
190
|
+
}));
|
|
191
|
+
}
|
|
192
|
+
catch (err) {
|
|
193
|
+
this.handleApiError(err);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (flags.json) {
|
|
197
|
+
this.log(JSON.stringify(response, null, 2));
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
for (const line of armedWaitLines(shownRef, response))
|
|
201
|
+
this.log(line);
|
|
202
|
+
}
|
|
121
203
|
}
|
|
122
204
|
exports.default = TasksWait;
|
|
205
|
+
/** Polling flags that mean nothing to an armed wait, which returns at once. */
|
|
206
|
+
const POLLING_FLAGS = [
|
|
207
|
+
'--until',
|
|
208
|
+
'--fail-on',
|
|
209
|
+
'--interval',
|
|
210
|
+
'--timeout',
|
|
211
|
+
'--task',
|
|
212
|
+
'--descendants',
|
|
213
|
+
'--children-only',
|
|
214
|
+
];
|
|
215
|
+
function armedWaitLines(taskRef, response) {
|
|
216
|
+
const row = response.followup;
|
|
217
|
+
const what = row ? ((0, followups_1.pullRequestLine)(row) ?? row.why ?? 'the wait') : 'the wait';
|
|
218
|
+
return [
|
|
219
|
+
`${response.reused ? 'Already waiting' : 'Blocked'}: ${response.task?.identifier ?? taskRef} is ${response.task?.status ?? 'blocked'} until ${what}${row?.deadlineAt ? `, or until ${row.deadlineAt}` : ''}.`,
|
|
220
|
+
`Wait ${row?.id ?? '—'} wakes the agent once and moves the task back; \`skrr followups show ${row?.id ?? '<id>'}\` says what woke it, or why it stopped.`,
|
|
221
|
+
...(row && (0, followups_1.stopReasonLine)(row) ? [(0, followups_1.stopReasonLine)(row)] : []),
|
|
222
|
+
];
|
|
223
|
+
}
|
|
123
224
|
function formatProgress(snapshot) {
|
|
124
225
|
const statuses = Object.entries(snapshot.counts)
|
|
125
226
|
.sort(([a], [b]) => a.localeCompare(b))
|