@skrr-ai/cli 0.1.214 → 0.1.216
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/no-reply.d.ts +4 -0
- package/dist/commands/agent/message/no-reply.js +5 -1
- package/dist/commands/agents/always-on/recovery-review.d.ts +12 -0
- package/dist/commands/agents/always-on/recovery-review.js +52 -2
- package/dist/commands/agents/permissions/list.d.ts +12 -0
- package/dist/commands/agents/permissions/list.js +42 -0
- package/dist/commands/agents/permissions/remove.d.ts +15 -0
- package/dist/commands/agents/permissions/remove.js +68 -0
- package/dist/commands/dm/work.js +2 -0
- package/dist/commands/duties/action-proposal.js +7 -1
- package/dist/commands/duties/action-proposals.d.ts +9 -0
- package/dist/commands/duties/action-proposals.js +30 -12
- package/dist/commands/duties/pause.js +20 -2
- package/dist/commands/duties/trigger-status.js +6 -1
- package/dist/commands/duties/update.js +22 -7
- package/dist/commands/tasks/ask.d.ts +3 -2
- package/dist/commands/tasks/ask.js +4 -3
- package/dist/commands/tasks/chat/exchange.d.ts +3 -2
- package/dist/commands/tasks/chat/exchange.js +18 -6
- package/dist/commands/tasks/chat/index.d.ts +11 -0
- package/dist/commands/tasks/chat/index.js +27 -0
- package/dist/commands/tasks/chat/rotate.js +5 -2
- package/dist/commands/tasks/input/answer.d.ts +12 -0
- package/dist/commands/tasks/input/answer.js +59 -5
- package/dist/commands/tasks/operations/show.js +5 -6
- package/dist/commands/tasks/result/show.js +2 -4
- package/dist/commands/tasks/retry-receipt.js +1 -3
- package/dist/commands/tasks/show.d.ts +6 -1
- package/dist/commands/tasks/show.js +19 -5
- package/dist/generated/agent-guides.json +41 -41
- package/dist/lib/compasses.d.ts +5 -0
- package/dist/lib/compasses.js +6 -1
- package/dist/lib/duties.d.ts +27 -0
- package/dist/lib/duties.js +81 -14
- package/dist/lib/permission-rules.d.ts +18 -0
- package/dist/lib/permission-rules.js +62 -0
- package/dist/lib/task-asset-upload.d.ts +7 -0
- package/dist/lib/task-asset-upload.js +114 -44
- package/dist/lib/task-extras.d.ts +19 -0
- package/dist/lib/task-extras.js +13 -0
- package/dist/lib/task-operations.d.ts +16 -0
- package/dist/lib/task-operations.js +39 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.d.ts +16 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +110 -15
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/runtime.d.ts +7 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.d.ts +16 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +179 -17
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/runtime.d.ts +7 -2
- package/dist/node_modules/@skrr-ai/data-provider/index.js +12697 -12082
- package/oclif.manifest.json +224 -9
- package/package.json +5 -2
|
@@ -11,6 +11,14 @@ import { BaseCommand } from '../../../base-command';
|
|
|
11
11
|
* projection across EVERY source that ever fed this task. `skrr tasks transcript`
|
|
12
12
|
* renders one run's conversation — what the agent said on an attempt; this is
|
|
13
13
|
* the whole relationship, including the parts a rotated epoch moved out of view.
|
|
14
|
+
*
|
|
15
|
+
* `--launch-input`, `--run-input <run-id>` and `--handled-output <run-id>` are
|
|
16
|
+
* what the Task page shows beside a run: the brief the launching Agent chat
|
|
17
|
+
* handed the Task, what one run was actually given (specification, brief,
|
|
18
|
+
* messages, files, and how much history), and the reply and Result one handled
|
|
19
|
+
* round produced. They are the same Task-chat VIEW reads the page makes, so a
|
|
20
|
+
* headless operator can answer "what did the Agent see, and what did it say"
|
|
21
|
+
* without opening a browser.
|
|
14
22
|
*/
|
|
15
23
|
export default class TasksChat extends BaseCommand {
|
|
16
24
|
static description: string;
|
|
@@ -25,6 +33,9 @@ export default class TasksChat extends BaseCommand {
|
|
|
25
33
|
runs: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
26
34
|
'transfer-preview': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
27
35
|
history: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
36
|
+
'launch-input': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
37
|
+
'run-input': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
38
|
+
'handled-output': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
28
39
|
limit: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
29
40
|
};
|
|
30
41
|
run(): Promise<void>;
|
|
@@ -1,6 +1,7 @@
|
|
|
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_extras_1 = require("../../../lib/task-extras");
|
|
6
7
|
/**
|
|
@@ -15,6 +16,14 @@ const task_extras_1 = require("../../../lib/task-extras");
|
|
|
15
16
|
* projection across EVERY source that ever fed this task. `skrr tasks transcript`
|
|
16
17
|
* renders one run's conversation — what the agent said on an attempt; this is
|
|
17
18
|
* the whole relationship, including the parts a rotated epoch moved out of view.
|
|
19
|
+
*
|
|
20
|
+
* `--launch-input`, `--run-input <run-id>` and `--handled-output <run-id>` are
|
|
21
|
+
* what the Task page shows beside a run: the brief the launching Agent chat
|
|
22
|
+
* handed the Task, what one run was actually given (specification, brief,
|
|
23
|
+
* messages, files, and how much history), and the reply and Result one handled
|
|
24
|
+
* round produced. They are the same Task-chat VIEW reads the page makes, so a
|
|
25
|
+
* headless operator can answer "what did the Agent see, and what did it say"
|
|
26
|
+
* without opening a browser.
|
|
18
27
|
*/
|
|
19
28
|
class TasksChat extends base_command_1.BaseCommand {
|
|
20
29
|
static description = "Show a task's chat epoch, exchanges, sources or execution runs";
|
|
@@ -24,6 +33,9 @@ class TasksChat extends base_command_1.BaseCommand {
|
|
|
24
33
|
'<%= config.bin %> tasks chat task_abc123 --sources',
|
|
25
34
|
'<%= config.bin %> tasks chat task_abc123 --runs',
|
|
26
35
|
'<%= config.bin %> tasks chat task_abc123 --history',
|
|
36
|
+
'<%= config.bin %> tasks chat task_abc123 --launch-input',
|
|
37
|
+
'<%= config.bin %> tasks chat task_abc123 --run-input run_abc123',
|
|
38
|
+
'<%= config.bin %> tasks chat task_abc123 --handled-output run_abc123',
|
|
27
39
|
];
|
|
28
40
|
static args = {
|
|
29
41
|
id: core_1.Args.string({ ignoreStdin: true, description: 'Task ID', required: true }),
|
|
@@ -39,6 +51,15 @@ class TasksChat extends base_command_1.BaseCommand {
|
|
|
39
51
|
history: core_1.Flags.boolean({
|
|
40
52
|
description: "The full task-history projection across every source (not one run's transcript)",
|
|
41
53
|
}),
|
|
54
|
+
'launch-input': core_1.Flags.boolean({
|
|
55
|
+
description: 'The brief the launching Agent chat handed this task (null when none)',
|
|
56
|
+
}),
|
|
57
|
+
'run-input': core_1.Flags.string({
|
|
58
|
+
description: 'What the execution run with this id was given: specification, brief, messages, files and history',
|
|
59
|
+
}),
|
|
60
|
+
'handled-output': core_1.Flags.string({
|
|
61
|
+
description: 'The reply and Result id the handled Agent round with this run id produced',
|
|
62
|
+
}),
|
|
42
63
|
limit: core_1.Flags.integer({ description: 'Max rows', min: 1, max: 200 }),
|
|
43
64
|
};
|
|
44
65
|
async run() {
|
|
@@ -57,6 +78,12 @@ class TasksChat extends base_command_1.BaseCommand {
|
|
|
57
78
|
result = await task_extras_1.taskChatApi.transferPreview(taskId);
|
|
58
79
|
else if (flags.history)
|
|
59
80
|
result = await task_extras_1.taskChatApi.taskHistory(taskId, { limit: flags.limit });
|
|
81
|
+
else if (flags['launch-input'])
|
|
82
|
+
result = await data_provider_1.dataService.getTaskChatLaunchInput(taskId);
|
|
83
|
+
else if (flags['run-input'])
|
|
84
|
+
result = await data_provider_1.dataService.getTaskExecutionRunInput(taskId, flags['run-input']);
|
|
85
|
+
else if (flags['handled-output'])
|
|
86
|
+
result = await data_provider_1.dataService.getTaskExecutionRunHandledOutput(taskId, flags['handled-output']);
|
|
60
87
|
else
|
|
61
88
|
result = await task_extras_1.taskChatApi.chat(taskId);
|
|
62
89
|
}
|
|
@@ -15,14 +15,17 @@ class TasksChatRotate extends base_command_1.BaseCommand {
|
|
|
15
15
|
static description = 'Start a fresh chat epoch (old transcript stays in history)';
|
|
16
16
|
static examples = [
|
|
17
17
|
'<%= config.bin %> tasks chat rotate task_abc123',
|
|
18
|
-
'<%= config.bin %> tasks chat rotate task_abc123 --reason
|
|
18
|
+
'<%= config.bin %> tasks chat rotate task_abc123 --reason deleted_repair --yes',
|
|
19
19
|
];
|
|
20
20
|
static args = {
|
|
21
21
|
id: core_1.Args.string({ ignoreStdin: true, description: 'Task ID', required: true }),
|
|
22
22
|
};
|
|
23
23
|
static flags = {
|
|
24
24
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
25
|
-
reason: core_1.Flags.string({
|
|
25
|
+
reason: core_1.Flags.string({
|
|
26
|
+
description: 'Why it is rotated (the server accepts only these two; default fresh_context)',
|
|
27
|
+
options: ['fresh_context', 'deleted_repair'],
|
|
28
|
+
}),
|
|
26
29
|
yes: core_1.Flags.boolean({ char: 'y', description: 'Skip confirmation prompt' }),
|
|
27
30
|
};
|
|
28
31
|
async run() {
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* `--select` picks option labels: `questionId=Label` (repeat to pick several), or a bare `Label`
|
|
4
|
+
* for a request with one question. An approval ("Allow once" / "Deny") is answered only this way:
|
|
5
|
+
* the server reads the decision from `selectedOptions`, never from text. An approval may also offer
|
|
6
|
+
* "Always allow …": choosing it here allows the call once and saves no rule, which is granted only on
|
|
7
|
+
* the card in the app (OSK-33440); the command prints what came of it.
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseSelections(values: string[] | undefined, onlyQuestionId: string | undefined): Array<{
|
|
10
|
+
questionId: string;
|
|
11
|
+
selectedOptions: string[];
|
|
12
|
+
}>;
|
|
2
13
|
export default class TasksInputAnswer extends BaseCommand {
|
|
3
14
|
static description: string;
|
|
4
15
|
static args: {
|
|
@@ -9,6 +20,7 @@ export default class TasksInputAnswer extends BaseCommand {
|
|
|
9
20
|
request: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
21
|
text: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
22
|
answer: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
select: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
24
|
'command-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
25
|
};
|
|
14
26
|
run(): Promise<void>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseSelections = parseSelections;
|
|
3
4
|
const node_crypto_1 = require("node:crypto");
|
|
4
5
|
const core_1 = require("@oclif/core");
|
|
5
6
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
7
|
const base_command_1 = require("../../../base-command");
|
|
8
|
+
const permission_rules_1 = require("../../../lib/permission-rules");
|
|
7
9
|
function parseAnswers(values) {
|
|
8
10
|
return (values || []).map((value) => {
|
|
9
11
|
const separator = value.indexOf('=');
|
|
@@ -15,6 +17,27 @@ function parseAnswers(values) {
|
|
|
15
17
|
};
|
|
16
18
|
});
|
|
17
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* `--select` picks option labels: `questionId=Label` (repeat to pick several), or a bare `Label`
|
|
22
|
+
* for a request with one question. An approval ("Allow once" / "Deny") is answered only this way:
|
|
23
|
+
* the server reads the decision from `selectedOptions`, never from text. An approval may also offer
|
|
24
|
+
* "Always allow …": choosing it here allows the call once and saves no rule, which is granted only on
|
|
25
|
+
* the card in the app (OSK-33440); the command prints what came of it.
|
|
26
|
+
*/
|
|
27
|
+
function parseSelections(values, onlyQuestionId) {
|
|
28
|
+
const byQuestion = new Map();
|
|
29
|
+
for (const raw of values || []) {
|
|
30
|
+
const separator = raw.indexOf('=');
|
|
31
|
+
const questionId = separator > 0 ? raw.slice(0, separator) : onlyQuestionId;
|
|
32
|
+
const option = (separator > 0 ? raw.slice(separator + 1) : raw).trim();
|
|
33
|
+
if (!questionId)
|
|
34
|
+
throw new Error('--select needs questionId=option when the request has several questions');
|
|
35
|
+
if (!option)
|
|
36
|
+
throw new Error('--select needs an option label');
|
|
37
|
+
byQuestion.set(questionId, [...(byQuestion.get(questionId) || []), option]);
|
|
38
|
+
}
|
|
39
|
+
return [...byQuestion].map(([questionId, selectedOptions]) => ({ questionId, selectedOptions }));
|
|
40
|
+
}
|
|
18
41
|
class TasksInputAnswer extends base_command_1.BaseCommand {
|
|
19
42
|
static description = 'Answer an open Human-input request. A Run-carried question starts the next exchange; a question asked outside a Run is answered in place';
|
|
20
43
|
static args = {
|
|
@@ -28,6 +51,10 @@ class TasksInputAnswer extends base_command_1.BaseCommand {
|
|
|
28
51
|
description: 'Structured answer as questionId=text (repeatable)',
|
|
29
52
|
multiple: true,
|
|
30
53
|
}),
|
|
54
|
+
select: core_1.Flags.string({
|
|
55
|
+
description: 'Choose an option by label: questionId=Label, or just Label for a one-question request (repeatable). An approval is answered this way, e.g. --select "Allow once" or --select Deny',
|
|
56
|
+
multiple: true,
|
|
57
|
+
}),
|
|
31
58
|
'command-id': core_1.Flags.string({ description: 'Stable idempotency key for retries' }),
|
|
32
59
|
};
|
|
33
60
|
async run() {
|
|
@@ -41,16 +68,39 @@ class TasksInputAnswer extends base_command_1.BaseCommand {
|
|
|
41
68
|
catch (err) {
|
|
42
69
|
this.error(err.message, { exit: 2 });
|
|
43
70
|
}
|
|
44
|
-
if (!flags.text && answers.length === 0) {
|
|
45
|
-
this.error('Pass --text or at least one --answer questionId=text', { exit: 2 });
|
|
71
|
+
if (!flags.text && answers.length === 0 && !flags.select?.length) {
|
|
72
|
+
this.error('Pass --text, --select, or at least one --answer questionId=text', { exit: 2 });
|
|
46
73
|
}
|
|
47
74
|
let requestId = flags.request;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
requestId
|
|
75
|
+
let current;
|
|
76
|
+
try {
|
|
77
|
+
if (!requestId) {
|
|
78
|
+
current = await data_provider_1.dataService.getTaskHumanInput(taskId);
|
|
79
|
+
requestId = current.data?.requestId;
|
|
80
|
+
}
|
|
81
|
+
else if (flags.select?.length) {
|
|
82
|
+
current = await data_provider_1.dataService.getTaskHumanInputRequest(taskId, requestId);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
this.handleApiError(err);
|
|
51
87
|
}
|
|
52
88
|
if (!requestId)
|
|
53
89
|
this.error('No open Human-input request exists for this task', { exit: 4 });
|
|
90
|
+
const questions = current?.data?.questions || [];
|
|
91
|
+
try {
|
|
92
|
+
for (const selection of parseSelections(flags.select, questions.length === 1 ? questions[0].questionId : undefined)) {
|
|
93
|
+
// One entry per question: a selection joins the text given for the same question.
|
|
94
|
+
const existing = answers.find((a) => a.questionId === selection.questionId);
|
|
95
|
+
if (existing)
|
|
96
|
+
existing.selectedOptions = selection.selectedOptions;
|
|
97
|
+
else
|
|
98
|
+
answers.push(selection);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
catch (err) {
|
|
102
|
+
this.error(err.message, { exit: 2 });
|
|
103
|
+
}
|
|
54
104
|
let result;
|
|
55
105
|
try {
|
|
56
106
|
result = await data_provider_1.dataService.answerTaskHumanInput(taskId, requestId, {
|
|
@@ -72,6 +122,10 @@ class TasksInputAnswer extends base_command_1.BaseCommand {
|
|
|
72
122
|
(('replyRoute' in result &&
|
|
73
123
|
data_provider_1.TASK_HUMAN_INPUT_REPLY_ROUTE_LABELS[result.replyRoute]) ||
|
|
74
124
|
''));
|
|
125
|
+
// An approval answered "Always allow …": whether a rule was saved.
|
|
126
|
+
const rule = flags.json ? null : (0, data_provider_1.parsePermissionRuleGrantOutcome)(result.alwaysAllow);
|
|
127
|
+
if (rule)
|
|
128
|
+
this.log((0, permission_rules_1.ruleOutcomeLine)(rule));
|
|
75
129
|
}
|
|
76
130
|
}
|
|
77
131
|
exports.default = TasksInputAnswer;
|
|
@@ -53,15 +53,14 @@ class TasksOperationsShow extends base_command_1.BaseCommand {
|
|
|
53
53
|
// turns whatever it picked into something the API can resolve — a UUID and
|
|
54
54
|
// an OSK-2423 ref pass through untouched, a title is searched.
|
|
55
55
|
const taskId = await this.resolveTaskReference(taskIdentity.id);
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
const service = data_provider_1.dataService;
|
|
56
|
+
// Called directly, not through a compatibility cast: the CLI ships its
|
|
57
|
+
// data-provider vendored (scripts/vendor-monorepo-deps.js), so the declaration
|
|
58
|
+
// cannot lag the runtime, and a cast hides these reads from the parity checks.
|
|
60
59
|
let operation;
|
|
61
60
|
try {
|
|
62
61
|
operation = operationId
|
|
63
|
-
? await
|
|
64
|
-
: await
|
|
62
|
+
? await data_provider_1.dataService.getTaskOperation(taskId, operationId)
|
|
63
|
+
: await data_provider_1.dataService.getTaskOperationByRequest(taskId, requestId);
|
|
65
64
|
}
|
|
66
65
|
catch (error) {
|
|
67
66
|
this.handleApiError(error, { subject: `Task ${taskId} operation` });
|
|
@@ -6,7 +6,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
6
6
|
const base_command_1 = require("../../../base-command");
|
|
7
7
|
const task_resolver_1 = require("../../../lib/task-resolver");
|
|
8
8
|
const task_legacy_1 = require("../../../lib/task-legacy");
|
|
9
|
-
const
|
|
9
|
+
const task_extras_1 = require("../../../lib/task-extras");
|
|
10
10
|
/**
|
|
11
11
|
* What a reviewer needs to accept ONE exact Result (OSK-15430). `result show` printed the summary and
|
|
12
12
|
* the conclusion, and kept the Result id (the value `tasks review --result-id` requires), the linked
|
|
@@ -84,10 +84,8 @@ class TasksResultShow extends base_command_1.BaseCommand {
|
|
|
84
84
|
const spaceId = process.env.OVERSKY_SESSION_SPACE_ID;
|
|
85
85
|
if (scopeKey && !spaceId)
|
|
86
86
|
this.error('This evidence read requires a bound Space.', { exit: 2 });
|
|
87
|
-
const query = scopeKey && spaceId ? `?${new URLSearchParams({ [scopeKey]: spaceId })}` : '';
|
|
88
|
-
const path = `/api/tasks/${encodeURIComponent(task.id)}/results/${encodeURIComponent(flags.result)}`;
|
|
89
87
|
try {
|
|
90
|
-
const exact = await (0,
|
|
88
|
+
const exact = await (0, task_extras_1.readExactTaskResult)(task.id, flags.result, scopeKey && spaceId ? { [scopeKey]: spaceId } : {});
|
|
91
89
|
if (flags.json)
|
|
92
90
|
return this.printJsonResult(exact);
|
|
93
91
|
return this.log([
|
|
@@ -47,11 +47,9 @@ class TasksRetryReceipt extends base_command_1.BaseCommand {
|
|
|
47
47
|
// turns whatever it picked into something the API can resolve — a UUID and
|
|
48
48
|
// an OSK-2423 ref pass through untouched, a title is searched.
|
|
49
49
|
const taskId = await this.resolveTaskReference(taskIdentity.id);
|
|
50
|
-
const getTaskRetryReceipt = data_provider_1.dataService
|
|
51
|
-
.getTaskRetryReceipt;
|
|
52
50
|
let receipt;
|
|
53
51
|
try {
|
|
54
|
-
receipt = await getTaskRetryReceipt(taskId, flags['request-id']);
|
|
52
|
+
receipt = await data_provider_1.dataService.getTaskRetryReceipt(taskId, flags['request-id']);
|
|
55
53
|
}
|
|
56
54
|
catch (err) {
|
|
57
55
|
this.handleApiError(err, { subject: `Task ${taskId} retry receipt` });
|
|
@@ -70,7 +70,8 @@ export declare function labelsLine(labelIds?: string[], nameById?: Map<string, s
|
|
|
70
70
|
*/
|
|
71
71
|
export declare function taskExecutorLabel(t: Record<string, unknown>, bin?: string): string;
|
|
72
72
|
/**
|
|
73
|
-
* The `Next step:` lines for a Task that nobody has been chosen to do
|
|
73
|
+
* The `Next step:` lines for a Task that nobody has been chosen to do, or whose Result is waiting
|
|
74
|
+
* on a Review.
|
|
74
75
|
*
|
|
75
76
|
* `Why:` said "Choose an executor and assignee before this Task can start" (or,
|
|
76
77
|
* for a started Task, that nobody is assigned) and nothing said how
|
|
@@ -80,6 +81,10 @@ export declare function taskExecutorLabel(t: Record<string, unknown>, bin?: stri
|
|
|
80
81
|
* started Task nobody is assigned to that carries a Result); the rest are listed by
|
|
81
82
|
* `tasks actionability`.
|
|
82
83
|
*
|
|
84
|
+
* The one other reason that prints is `review_required`: `Moved by:` said a person owns the next
|
|
85
|
+
* step and nothing said what it was (OSK-33352). Its commands need the Result's id, which only
|
|
86
|
+
* the Task carries, so they come from `reviewDecisionRemedies` rather than the action map.
|
|
87
|
+
*
|
|
83
88
|
* Pure and exported so the wording is testable without an oclif runtime.
|
|
84
89
|
*/
|
|
85
90
|
export declare function nextStepLines(t: Record<string, unknown>, bin?: string): string[];
|
|
@@ -165,8 +165,11 @@ const ASSIGNMENT_ACTIONS = new Set(['assign_task', 'set_execution_mode']);
|
|
|
165
165
|
* started with nobody assigned (OSK-20258), where the assignment says who is doing it.
|
|
166
166
|
*/
|
|
167
167
|
const ASSIGNMENT_REASONS = new Set(['assignment_required', 'started_without_assignee']);
|
|
168
|
+
/** The reason whose next step is a Review of the current Result (OSK-33352). */
|
|
169
|
+
const REVIEW_REASON = 'review_required';
|
|
168
170
|
/**
|
|
169
|
-
* The `Next step:` lines for a Task that nobody has been chosen to do
|
|
171
|
+
* The `Next step:` lines for a Task that nobody has been chosen to do, or whose Result is waiting
|
|
172
|
+
* on a Review.
|
|
170
173
|
*
|
|
171
174
|
* `Why:` said "Choose an executor and assignee before this Task can start" (or,
|
|
172
175
|
* for a started Task, that nobody is assigned) and nothing said how
|
|
@@ -176,6 +179,10 @@ const ASSIGNMENT_REASONS = new Set(['assignment_required', 'started_without_assi
|
|
|
176
179
|
* started Task nobody is assigned to that carries a Result); the rest are listed by
|
|
177
180
|
* `tasks actionability`.
|
|
178
181
|
*
|
|
182
|
+
* The one other reason that prints is `review_required`: `Moved by:` said a person owns the next
|
|
183
|
+
* step and nothing said what it was (OSK-33352). Its commands need the Result's id, which only
|
|
184
|
+
* the Task carries, so they come from `reviewDecisionRemedies` rather than the action map.
|
|
185
|
+
*
|
|
179
186
|
* Pure and exported so the wording is testable without an oclif runtime.
|
|
180
187
|
*/
|
|
181
188
|
function nextStepLines(t, bin = 'skrr') {
|
|
@@ -183,6 +190,16 @@ function nextStepLines(t, bin = 'skrr') {
|
|
|
183
190
|
if (!actionability || actionability.state === 'terminal')
|
|
184
191
|
return [];
|
|
185
192
|
const allowed = (Array.isArray(actionability.allowedActions) ? actionability.allowedActions : []).filter((row) => Boolean(row) && typeof row.action === 'string');
|
|
193
|
+
const ref = (typeof t.identifier === 'string' && t.identifier) ||
|
|
194
|
+
(typeof t.id === 'string' && t.id) ||
|
|
195
|
+
'<task-id>';
|
|
196
|
+
const asNextStep = (rows) => rows.map((row, index) => `${index === 0 ? 'Next step:' : ''}`.padEnd(13) + row);
|
|
197
|
+
if (actionability.reasonCode === REVIEW_REASON) {
|
|
198
|
+
const resultId = typeof t.currentResultId === 'string' && t.currentResultId ? t.currentResultId : undefined;
|
|
199
|
+
return asNextStep((0, task_operations_1.taskActionRemedyRows)((0, task_operations_1.reviewDecisionRemedies)(ref, resultId, bin, {
|
|
200
|
+
closable: allowed.some((row) => row.action === 'complete_task'),
|
|
201
|
+
})));
|
|
202
|
+
}
|
|
186
203
|
// A started Task nobody is assigned to that carries a Result may simply be done: the server
|
|
187
204
|
// offers closing it beside the assignment, and its reason names closing first (OSK-20258).
|
|
188
205
|
const closable = actionability.reasonCode === 'started_without_assignee';
|
|
@@ -191,15 +208,12 @@ function nextStepLines(t, bin = 'skrr') {
|
|
|
191
208
|
!actions.some((row) => row.action === 'assign_task')) {
|
|
192
209
|
actions.unshift({ action: 'assign_task' });
|
|
193
210
|
}
|
|
194
|
-
const ref = (typeof t.identifier === 'string' && t.identifier) ||
|
|
195
|
-
(typeof t.id === 'string' && t.id) ||
|
|
196
|
-
'<task-id>';
|
|
197
211
|
const rows = (0, task_operations_1.taskActionRemedyRows)(actions.flatMap((row) => (0, task_operations_1.taskActionRemedies)(row.action, ref, row.targetId, bin, {
|
|
198
212
|
allowedActions: allowed,
|
|
199
213
|
task: t,
|
|
200
214
|
reasonCode: actionability.reasonCode,
|
|
201
215
|
})));
|
|
202
|
-
return rows
|
|
216
|
+
return asNextStep(rows);
|
|
203
217
|
}
|
|
204
218
|
function resolverLabel(by, names) {
|
|
205
219
|
if (!by || typeof by !== 'object' || !by.kind)
|