@skrr-ai/cli 0.1.206 → 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/models.d.ts +11 -0
- package/dist/commands/agents/models.js +51 -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/balance/route-premiums.d.ts +9 -0
- package/dist/commands/balance/route-premiums.js +33 -0
- package/dist/commands/code/migrate.js +3 -1
- package/dist/commands/convos/transcript.d.ts +0 -1
- package/dist/commands/convos/transcript.js +0 -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/goals/create.d.ts +1 -0
- package/dist/commands/goals/create.js +8 -0
- package/dist/commands/goals/creation-receipt.d.ts +10 -0
- package/dist/commands/goals/creation-receipt.js +43 -0
- package/dist/commands/goals/key-results/create.d.ts +2 -0
- package/dist/commands/goals/key-results/create.js +14 -0
- package/dist/commands/goals/key-results/creation-receipt.d.ts +13 -0
- package/dist/commands/goals/key-results/creation-receipt.js +51 -0
- package/dist/commands/harnesses/forget.d.ts +2 -0
- package/dist/commands/harnesses/forget.js +31 -0
- package/dist/commands/harnesses/removal-receipt.d.ts +11 -0
- package/dist/commands/harnesses/removal-receipt.js +32 -0
- package/dist/commands/harnesses/removal-review.d.ts +11 -0
- package/dist/commands/harnesses/removal-review.js +28 -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/spaces/loops/release-receipt.d.ts +14 -0
- package/dist/commands/spaces/loops/release-receipt.js +48 -0
- package/dist/commands/spaces/loops/release.js +1 -1
- package/dist/commands/spaces/workflow-templates/archive.d.ts +1 -0
- package/dist/commands/spaces/workflow-templates/archive.js +9 -1
- package/dist/commands/spaces/workflow-templates/show.js +2 -0
- package/dist/commands/spaces/workflow-templates/update.d.ts +1 -0
- package/dist/commands/spaces/workflow-templates/update.js +12 -1
- package/dist/commands/spaces/workflows/publish.d.ts +1 -0
- package/dist/commands/spaces/workflows/publish.js +41 -2
- 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/create.d.ts +2 -0
- package/dist/commands/tasks/create.js +19 -6
- package/dist/commands/tasks/creation-receipt.d.ts +12 -0
- package/dist/commands/tasks/creation-receipt.js +53 -0
- package/dist/commands/tasks/delete.d.ts +1 -0
- package/dist/commands/tasks/delete.js +22 -4
- package/dist/commands/tasks/deletion-receipt.d.ts +12 -0
- package/dist/commands/tasks/deletion-receipt.js +37 -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/execution-target.d.ts +1 -1
- package/dist/lib/execution-target.js +4 -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/harnesses.d.ts +25 -0
- package/dist/lib/harnesses.js +15 -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/request-uuid.d.ts +2 -0
- package/dist/lib/request-uuid.js +10 -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 +13350 -12579
- package/oclif.manifest.json +3044 -563
- package/package.json +5 -2
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../base-command");
|
|
5
|
+
const format_1 = require("../../lib/format");
|
|
6
|
+
const agent_resolver_1 = require("../../lib/agent-resolver");
|
|
7
|
+
const slack_thread_mutes_1 = require("../../lib/slack-thread-mutes");
|
|
8
|
+
class SlackMutes extends base_command_1.BaseCommand {
|
|
9
|
+
static description = 'List the Slack threads an agent left, and who asked it to leave';
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> slack mutes --agent agent_123',
|
|
12
|
+
'<%= config.bin %> slack mutes --json',
|
|
13
|
+
];
|
|
14
|
+
static flags = {
|
|
15
|
+
agent: core_1.Flags.string({
|
|
16
|
+
description: 'Agent ID. Local daemon sessions prefer OVERSKY_SESSION_AGENT_ID and reject mismatches.',
|
|
17
|
+
}),
|
|
18
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
19
|
+
};
|
|
20
|
+
async run() {
|
|
21
|
+
this.requireAuth();
|
|
22
|
+
const { flags } = await this.parse(SlackMutes);
|
|
23
|
+
let agentId;
|
|
24
|
+
try {
|
|
25
|
+
agentId = await (0, agent_resolver_1.resolveAgentId)(flags.agent);
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
this.error(err.message, { exit: 2 });
|
|
29
|
+
}
|
|
30
|
+
let mutes;
|
|
31
|
+
try {
|
|
32
|
+
mutes = await (0, slack_thread_mutes_1.listSlackThreadMutes)(agentId);
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
this.handleApiError(err);
|
|
36
|
+
}
|
|
37
|
+
if (flags.json) {
|
|
38
|
+
this.log(JSON.stringify({ mutes: mutes }, null, 2));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (mutes.length === 0) {
|
|
42
|
+
this.log('This agent has not left any Slack thread.');
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
(0, format_1.renderTable)(mutes.map((mute) => ({
|
|
46
|
+
channel: mute.conversationName
|
|
47
|
+
? `#${mute.conversationName} (${mute.channelId})`
|
|
48
|
+
: mute.channelId,
|
|
49
|
+
thread: mute.threadId,
|
|
50
|
+
askedBy: `${mute.mutedBy.userName || mute.mutedBy.userId || 'unknown'}${mute.mutedBy.role === 'owner' ? ' (owner)' : ''}`,
|
|
51
|
+
since: mute.mutedAt || '',
|
|
52
|
+
})), [
|
|
53
|
+
{ key: 'channel', header: 'CHANNEL', maxWidth: 40 },
|
|
54
|
+
{ key: 'thread', header: 'THREAD TS' },
|
|
55
|
+
{ key: 'askedBy', header: 'ASKED BY', maxWidth: 30 },
|
|
56
|
+
{ key: 'since', header: 'SINCE' },
|
|
57
|
+
], (line) => this.log(line));
|
|
58
|
+
this.log('');
|
|
59
|
+
this.log('A person @mentioning the agent in a thread brings it back. To clear one yourself: skrr slack unmute --channel <id> --thread-ts <ts>');
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.default = SlackMutes;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
export default class SlackUnmute extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
agent: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
channel: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'thread-ts': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../base-command");
|
|
5
|
+
const agent_resolver_1 = require("../../lib/agent-resolver");
|
|
6
|
+
const slack_thread_mutes_1 = require("../../lib/slack-thread-mutes");
|
|
7
|
+
class SlackUnmute extends base_command_1.BaseCommand {
|
|
8
|
+
static description = 'Let an agent follow a Slack thread it left again, without waiting for a mention';
|
|
9
|
+
static examples = [
|
|
10
|
+
'<%= config.bin %> slack unmute --channel C123 --thread-ts 1710000000.000100',
|
|
11
|
+
];
|
|
12
|
+
static flags = {
|
|
13
|
+
agent: core_1.Flags.string({
|
|
14
|
+
description: 'Agent ID. Local daemon sessions prefer OVERSKY_SESSION_AGENT_ID and reject mismatches.',
|
|
15
|
+
}),
|
|
16
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
17
|
+
channel: core_1.Flags.string({ description: 'Slack channel ID of the thread', required: true }),
|
|
18
|
+
'thread-ts': core_1.Flags.string({ description: 'Slack parent thread timestamp', required: true }),
|
|
19
|
+
};
|
|
20
|
+
async run() {
|
|
21
|
+
this.requireAuth();
|
|
22
|
+
const { flags } = await this.parse(SlackUnmute);
|
|
23
|
+
let agentId;
|
|
24
|
+
try {
|
|
25
|
+
agentId = await (0, agent_resolver_1.resolveAgentId)(flags.agent);
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
this.error(err.message, { exit: 2 });
|
|
29
|
+
}
|
|
30
|
+
let result;
|
|
31
|
+
try {
|
|
32
|
+
result = await (0, slack_thread_mutes_1.clearSlackThreadMute)(agentId, flags.channel, flags['thread-ts']);
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
this.handleApiError(err);
|
|
36
|
+
}
|
|
37
|
+
if (flags.json) {
|
|
38
|
+
this.log(JSON.stringify(result, null, 2));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
this.log(`The agent follows thread ${flags['thread-ts']} in ${flags.channel} again. Nothing was posted.`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.default = SlackUnmute;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class SpacesLoopsReleaseReceipt extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
duty: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
link: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
|
+
const base_command_1 = require("../../../base-command");
|
|
6
|
+
class SpacesLoopsReleaseReceipt extends base_command_1.BaseCommand {
|
|
7
|
+
static description = 'Read your recent Space Loop releases or check one exact home link';
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> spaces loops release-receipt <space-id>',
|
|
10
|
+
'<%= config.bin %> spaces loops release-receipt <space-id> --duty <duty-id> --link <home-link-id> --json',
|
|
11
|
+
];
|
|
12
|
+
static args = {
|
|
13
|
+
id: core_1.Args.string({ description: 'Space ID or title', required: true, ignoreStdin: true }),
|
|
14
|
+
};
|
|
15
|
+
static flags = {
|
|
16
|
+
duty: core_1.Flags.string({ description: 'Duty ID from the original release', dependsOn: ['link'] }),
|
|
17
|
+
link: core_1.Flags.string({ description: 'Home link ID from the original release', dependsOn: ['duty'] }),
|
|
18
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
19
|
+
};
|
|
20
|
+
async run() {
|
|
21
|
+
this.requireAuth();
|
|
22
|
+
const { args, flags } = await this.parse(SpacesLoopsReleaseReceipt);
|
|
23
|
+
const spaceId = await this.resolveSpaceReference(args.id);
|
|
24
|
+
try {
|
|
25
|
+
if (flags.duty && flags.link) {
|
|
26
|
+
const receipt = await data_provider_1.dataService.getSpaceLoopReleaseReceipt(spaceId, flags.duty, flags.link);
|
|
27
|
+
if (flags.json)
|
|
28
|
+
return this.printJsonResult(receipt);
|
|
29
|
+
this.log(receipt.state === 'released'
|
|
30
|
+
? `Recorded release for Duty ${receipt.dutyId} and home link ${receipt.linkId}.`
|
|
31
|
+
: 'The server could not confirm that release.');
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const history = await data_provider_1.dataService.listSpaceLoopReleaseReceipts(spaceId);
|
|
35
|
+
if (flags.json)
|
|
36
|
+
return this.printJsonResult(history);
|
|
37
|
+
if (history.receipts.length === 0)
|
|
38
|
+
this.log('No recent releases found for your account.');
|
|
39
|
+
for (const receipt of history.receipts) {
|
|
40
|
+
this.log(`${receipt.releasedAt} ${receipt.dutyId} ${receipt.linkId} cleanup ${receipt.cleanup}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
this.handleApiError(error, { subject: `Space ${spaceId} Loop release receipt` });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.default = SpacesLoopsReleaseReceipt;
|
|
@@ -28,7 +28,7 @@ class SpacesLoopsRelease extends base_command_1.BaseCommand {
|
|
|
28
28
|
const links = await data_provider_1.dataService.listDutyWorkLinksForTarget({ targetType: 'space', targetId: spaceId });
|
|
29
29
|
const homes = links.data.filter((link) => link.dutyId === flags.duty && link.status === 'active' && link.roles.includes('home'));
|
|
30
30
|
if (homes.length !== 1) {
|
|
31
|
-
this.error('No unique active home link found. Supply --link <home-link-id> to release a reviewed link or
|
|
31
|
+
this.error('No unique active home link found. Supply --link <home-link-id> to release a reviewed link, or use `spaces loops release-receipt` to check prior releases.', { exit: 2 });
|
|
32
32
|
}
|
|
33
33
|
linkId = homes[0].id;
|
|
34
34
|
}
|
|
@@ -11,6 +11,7 @@ export default class SpacesWorkflowTemplatesArchive extends BaseCommand {
|
|
|
11
11
|
static flags: {
|
|
12
12
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
13
|
yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
'expected-revision': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
15
|
};
|
|
15
16
|
run(): Promise<void>;
|
|
16
17
|
}
|
|
@@ -19,6 +19,11 @@ class SpacesWorkflowTemplatesArchive extends base_command_1.BaseCommand {
|
|
|
19
19
|
static flags = {
|
|
20
20
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
21
21
|
yes: core_1.Flags.boolean({ char: 'y', description: 'Skip the confirmation prompt' }),
|
|
22
|
+
'expected-revision': core_1.Flags.integer({
|
|
23
|
+
min: 0,
|
|
24
|
+
max: Number.MAX_SAFE_INTEGER,
|
|
25
|
+
description: 'Archive only if the reviewed revision from `workflow-templates show` still matches',
|
|
26
|
+
}),
|
|
22
27
|
};
|
|
23
28
|
async run() {
|
|
24
29
|
this.requireAuth();
|
|
@@ -39,7 +44,10 @@ class SpacesWorkflowTemplatesArchive extends base_command_1.BaseCommand {
|
|
|
39
44
|
return this.log('Cancelled.');
|
|
40
45
|
let result;
|
|
41
46
|
try {
|
|
42
|
-
|
|
47
|
+
const revision = flags['expected-revision'];
|
|
48
|
+
result = revision === undefined
|
|
49
|
+
? await data_provider_1.dataService.archiveSpaceWorkflowTemplate(args.spaceId, args.templateId)
|
|
50
|
+
: await data_provider_1.dataService.archiveReviewedSpaceWorkflowTemplate(args.spaceId, args.templateId, revision);
|
|
43
51
|
}
|
|
44
52
|
catch (error) {
|
|
45
53
|
this.handleApiError(error, { subject: `workflow template ${args.templateId}` });
|
|
@@ -70,6 +70,8 @@ class SpacesWorkflowTemplatesShow extends base_command_1.BaseCommand {
|
|
|
70
70
|
this.log(`Title: ${template.title}`);
|
|
71
71
|
this.log(`Scope: ${template.scope}${template.readOnly ? ' (read-only)' : ''}`);
|
|
72
72
|
this.log(`Published version: ${template.currentVersion || 'not published'}`);
|
|
73
|
+
if (template.revision !== undefined)
|
|
74
|
+
this.log(`Authoring revision: ${template.revision}`);
|
|
73
75
|
this.log(`Nodes / edges: ${template.nodeCount} / ${template.edgeCount}`);
|
|
74
76
|
this.log(`Node types: ${template.nodeTypes.join(', ') || '-'}`);
|
|
75
77
|
this.log(`Entry ports: ${template.ports.entry.join(', ') || '-'}`);
|
|
@@ -15,6 +15,7 @@ export default class SpacesWorkflowTemplatesUpdate extends BaseCommand {
|
|
|
15
15
|
tags: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
16
|
scope: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
17
|
body: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
'expected-revision': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
19
|
};
|
|
19
20
|
run(): Promise<void>;
|
|
20
21
|
}
|
|
@@ -25,6 +25,11 @@ class SpacesWorkflowTemplatesUpdate extends base_command_1.BaseCommand {
|
|
|
25
25
|
tags: core_1.Flags.string({ description: 'Comma list of tags (empty string clears them)' }),
|
|
26
26
|
scope: core_1.Flags.string({ description: 'private, space, or workspace' }),
|
|
27
27
|
body: core_1.Flags.string({ description: 'Path to replacement body JSON ("-" for stdin)' }),
|
|
28
|
+
'expected-revision': core_1.Flags.integer({
|
|
29
|
+
min: 0,
|
|
30
|
+
max: Number.MAX_SAFE_INTEGER,
|
|
31
|
+
description: 'Apply the update only if the reviewed revision from `workflow-templates show` still matches',
|
|
32
|
+
}),
|
|
28
33
|
};
|
|
29
34
|
async run() {
|
|
30
35
|
this.requireAuth();
|
|
@@ -51,7 +56,13 @@ class SpacesWorkflowTemplatesUpdate extends base_command_1.BaseCommand {
|
|
|
51
56
|
this.failWithCliError({ ...plan.error, exit: 2, retryable: false });
|
|
52
57
|
let template;
|
|
53
58
|
try {
|
|
54
|
-
|
|
59
|
+
const revision = flags['expected-revision'];
|
|
60
|
+
template = revision === undefined
|
|
61
|
+
? await data_provider_1.dataService.updateSpaceWorkflowTemplate(args.spaceId, args.templateId, plan.payload)
|
|
62
|
+
: await data_provider_1.dataService.updateReviewedSpaceWorkflowTemplate(args.spaceId, args.templateId, {
|
|
63
|
+
...plan.payload,
|
|
64
|
+
expectedRevision: revision,
|
|
65
|
+
});
|
|
55
66
|
}
|
|
56
67
|
catch (error) {
|
|
57
68
|
this.handleApiError(error, { subject: `workflow template ${args.templateId}` });
|
|
@@ -8,6 +8,7 @@ export default class SpacesWorkflowsPublish extends BaseCommand {
|
|
|
8
8
|
};
|
|
9
9
|
static flags: {
|
|
10
10
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
'reviewed-draft': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
};
|
|
12
13
|
run(): Promise<void>;
|
|
13
14
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
4
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
5
|
const base_command_1 = require("../../../base-command");
|
|
6
|
+
const prompt_1 = require("../../../lib/prompt");
|
|
6
7
|
const space_output_1 = require("../../../lib/space-output");
|
|
7
8
|
const workflow_issues_1 = require("../../../lib/workflow-issues");
|
|
8
9
|
class SpacesWorkflowsPublish extends base_command_1.BaseCommand {
|
|
@@ -12,13 +13,48 @@ class SpacesWorkflowsPublish extends base_command_1.BaseCommand {
|
|
|
12
13
|
spaceId: core_1.Args.string({ required: true, ignoreStdin: true }),
|
|
13
14
|
workflowId: core_1.Args.string({ required: true, ignoreStdin: true }),
|
|
14
15
|
};
|
|
15
|
-
static flags = {
|
|
16
|
+
static flags = {
|
|
17
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
18
|
+
'reviewed-draft': core_1.Flags.string({
|
|
19
|
+
description: 'Publish only the draft in a saved `workflows show --json` file ("-" for stdin)',
|
|
20
|
+
}),
|
|
21
|
+
};
|
|
16
22
|
async run() {
|
|
17
23
|
this.requireAuth();
|
|
18
24
|
const { args, flags } = await this.parse(SpacesWorkflowsPublish);
|
|
25
|
+
let review;
|
|
26
|
+
if (flags['reviewed-draft'] !== undefined) {
|
|
27
|
+
try {
|
|
28
|
+
const snapshot = await (0, prompt_1.readJsonBody)(flags['reviewed-draft']);
|
|
29
|
+
if (snapshot.id !== args.workflowId || snapshot.spaceId !== args.spaceId) {
|
|
30
|
+
throw new Error('The reviewed draft must belong to this Space and workflow.');
|
|
31
|
+
}
|
|
32
|
+
const draft = snapshot.draft;
|
|
33
|
+
const semanticRevision = draft?.semanticRevision;
|
|
34
|
+
const presentationRevision = draft?.presentationRevision;
|
|
35
|
+
const { currentVersion } = snapshot;
|
|
36
|
+
const maxDurationMs = snapshot.maxDurationMs ?? null;
|
|
37
|
+
if (!isRevision(semanticRevision) || !isRevision(presentationRevision) ||
|
|
38
|
+
!isRevision(currentVersion) ||
|
|
39
|
+
(maxDurationMs !== null && (!isRevision(maxDurationMs) || maxDurationMs === 0))) {
|
|
40
|
+
throw new Error('The reviewed draft must include valid revisions, version, and run duration.');
|
|
41
|
+
}
|
|
42
|
+
review = { semanticRevision, presentationRevision, currentVersion, maxDurationMs };
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
this.failWithCliError({
|
|
46
|
+
message: error.message,
|
|
47
|
+
code: 'WORKFLOW_REVIEWED_DRAFT_INVALID',
|
|
48
|
+
exit: 2,
|
|
49
|
+
retryable: false,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
19
53
|
let version;
|
|
20
54
|
try {
|
|
21
|
-
version =
|
|
55
|
+
version = review
|
|
56
|
+
? await data_provider_1.dataService.publishReviewedSpaceWorkflow(args.spaceId, args.workflowId, review)
|
|
57
|
+
: await data_provider_1.dataService.publishSpaceWorkflow(args.spaceId, args.workflowId);
|
|
22
58
|
}
|
|
23
59
|
catch (error) {
|
|
24
60
|
this.handleApiError(error);
|
|
@@ -44,3 +80,6 @@ class SpacesWorkflowsPublish extends base_command_1.BaseCommand {
|
|
|
44
80
|
}
|
|
45
81
|
}
|
|
46
82
|
exports.default = SpacesWorkflowsPublish;
|
|
83
|
+
function isRevision(value) {
|
|
84
|
+
return typeof value === 'number' && Number.isSafeInteger(value) && value >= 0;
|
|
85
|
+
}
|
|
@@ -5,6 +5,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
5
5
|
const base_command_1 = require("../../base-command");
|
|
6
6
|
const task_resolver_1 = require("../../lib/task-resolver");
|
|
7
7
|
const task_operations_1 = require("../../lib/task-operations");
|
|
8
|
+
const task_carriers_1 = require("../../lib/task-carriers");
|
|
8
9
|
class TasksActionability extends base_command_1.BaseCommand {
|
|
9
10
|
static description = 'Show the canonical next actor and why this task can or cannot move';
|
|
10
11
|
static args = {
|
|
@@ -56,6 +57,14 @@ class TasksActionability extends base_command_1.BaseCommand {
|
|
|
56
57
|
if (a.actorRefs?.length) {
|
|
57
58
|
this.log(`Eligible: ${a.actorRefs.map((ref) => `${ref.kind}:${ref.id}`).join(', ')}`);
|
|
58
59
|
}
|
|
60
|
+
// Who is next is not the same as whether anything will act: an Agent can be next on a Task no
|
|
61
|
+
// Run, wake or person will ever move.
|
|
62
|
+
for (const line of (0, task_carriers_1.taskCarrierLines)(a, {
|
|
63
|
+
taskRef: response.identifier || response.taskId,
|
|
64
|
+
bin: this.config.bin,
|
|
65
|
+
})) {
|
|
66
|
+
this.log(line);
|
|
67
|
+
}
|
|
59
68
|
if (a.allowedActions.length) {
|
|
60
69
|
// These are SERVER action names, not commands, and printing them bare as
|
|
61
70
|
// `Actions: retry_task, resolve_task_hold` reads as a list of things to
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type AskTaskHumanInputBody } from '@skrr-ai/data-provider';
|
|
2
|
+
import { BaseCommand } from '../../base-command';
|
|
3
|
+
/**
|
|
4
|
+
* `--expires`: an ISO date-time, or a length of time from now (`30m`, `4h`, `2d`).
|
|
5
|
+
* The server keeps the workspace's longest wait and refuses a later deadline
|
|
6
|
+
* with the limit in its words; this only turns the flag into a time.
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseAskExpiry(value: string | undefined, now?: number): string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* `--option-description <n>=<text>`: what choosing the `--option` at position
|
|
11
|
+
* `n` (counted from 1, as `--recommended` is) means. The position is explicit so
|
|
12
|
+
* a description can never land under another option, whatever the order of the
|
|
13
|
+
* flags; the text is everything after the first `=`. The result is aligned with
|
|
14
|
+
* the options, `''` where an option has none, or `undefined` when none was given.
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseOptionDescriptions(values: string[] | undefined, optionCount: number): string[] | undefined;
|
|
17
|
+
/** The one question a `tasks ask` sends, with `--recommended` counted from 1 as it is shown. */
|
|
18
|
+
export declare function buildAskBody(flags: {
|
|
19
|
+
question: string;
|
|
20
|
+
context?: string;
|
|
21
|
+
option?: string[];
|
|
22
|
+
'option-description'?: string[];
|
|
23
|
+
recommended?: number;
|
|
24
|
+
multi?: boolean;
|
|
25
|
+
header?: string;
|
|
26
|
+
'no-free-text'?: boolean;
|
|
27
|
+
expires?: string;
|
|
28
|
+
key?: string;
|
|
29
|
+
}): AskTaskHumanInputBody;
|
|
30
|
+
export default class TasksAsk extends BaseCommand {
|
|
31
|
+
static description: string;
|
|
32
|
+
static examples: string[];
|
|
33
|
+
static args: {
|
|
34
|
+
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
35
|
+
};
|
|
36
|
+
static flags: {
|
|
37
|
+
question: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
38
|
+
context: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
39
|
+
option: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
40
|
+
'option-description': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
41
|
+
recommended: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
42
|
+
multi: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
43
|
+
header: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
44
|
+
'no-free-text': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
45
|
+
expires: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
46
|
+
key: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
47
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
48
|
+
};
|
|
49
|
+
run(): Promise<void>;
|
|
50
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseAskExpiry = parseAskExpiry;
|
|
4
|
+
exports.parseOptionDescriptions = parseOptionDescriptions;
|
|
5
|
+
exports.buildAskBody = buildAskBody;
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
8
|
+
const base_command_1 = require("../../base-command");
|
|
9
|
+
const show_1 = require("./input/show");
|
|
10
|
+
const RELATIVE_EXPIRY_RE = /^(\d+)\s*(m|h|d)$/i;
|
|
11
|
+
const UNIT_MS = { m: 60_000, h: 3_600_000, d: 86_400_000 };
|
|
12
|
+
/**
|
|
13
|
+
* `--expires`: an ISO date-time, or a length of time from now (`30m`, `4h`, `2d`).
|
|
14
|
+
* The server keeps the workspace's longest wait and refuses a later deadline
|
|
15
|
+
* with the limit in its words; this only turns the flag into a time.
|
|
16
|
+
*/
|
|
17
|
+
function parseAskExpiry(value, now = Date.now()) {
|
|
18
|
+
if (value === undefined)
|
|
19
|
+
return undefined;
|
|
20
|
+
const trimmed = value.trim();
|
|
21
|
+
const relative = trimmed.match(RELATIVE_EXPIRY_RE);
|
|
22
|
+
if (relative) {
|
|
23
|
+
return new Date(now + Number(relative[1]) * UNIT_MS[relative[2].toLowerCase()]).toISOString();
|
|
24
|
+
}
|
|
25
|
+
const at = new Date(trimmed);
|
|
26
|
+
if (!/\d{4}-\d{2}-\d{2}/.test(trimmed) || !Number.isFinite(at.getTime())) {
|
|
27
|
+
throw new Error(`--expires takes an ISO date-time or a length such as 30m, 4h, 2d: ${value}`);
|
|
28
|
+
}
|
|
29
|
+
return at.toISOString();
|
|
30
|
+
}
|
|
31
|
+
const OPTION_DESCRIPTION_RE = /^\s*(\d+)\s*=([\s\S]*)$/;
|
|
32
|
+
/**
|
|
33
|
+
* `--option-description <n>=<text>`: what choosing the `--option` at position
|
|
34
|
+
* `n` (counted from 1, as `--recommended` is) means. The position is explicit so
|
|
35
|
+
* a description can never land under another option, whatever the order of the
|
|
36
|
+
* flags; the text is everything after the first `=`. The result is aligned with
|
|
37
|
+
* the options, `''` where an option has none, or `undefined` when none was given.
|
|
38
|
+
*/
|
|
39
|
+
function parseOptionDescriptions(values, optionCount) {
|
|
40
|
+
if (!values?.length)
|
|
41
|
+
return undefined;
|
|
42
|
+
if (!optionCount)
|
|
43
|
+
throw new Error('--option-description needs the --option it describes');
|
|
44
|
+
const descriptions = new Array(optionCount).fill('');
|
|
45
|
+
for (const value of values) {
|
|
46
|
+
const match = value.match(OPTION_DESCRIPTION_RE);
|
|
47
|
+
if (!match) {
|
|
48
|
+
throw new Error(`--option-description takes the option's position and what choosing it means, as 2="Billed every month, cancel any time": ${value}`);
|
|
49
|
+
}
|
|
50
|
+
const position = Number(match[1]);
|
|
51
|
+
if (position < 1 || position > optionCount) {
|
|
52
|
+
throw new Error(`--option-description names an --option by its position, from 1 to ${optionCount}: ${position}`);
|
|
53
|
+
}
|
|
54
|
+
if (descriptions[position - 1]) {
|
|
55
|
+
throw new Error(`--option-description describes option ${position} twice`);
|
|
56
|
+
}
|
|
57
|
+
const description = match[2].trim();
|
|
58
|
+
if (!description)
|
|
59
|
+
throw new Error(`--option-description ${position}= has no description`);
|
|
60
|
+
if (description.length > data_provider_1.TASK_HUMAN_INPUT_OPTION_DESCRIPTION_MAX) {
|
|
61
|
+
throw new Error(`--option-description takes at most ${data_provider_1.TASK_HUMAN_INPUT_OPTION_DESCRIPTION_MAX} characters (option ${position}'s is ${description.length}): say what choosing it means, and put the rest in --context`);
|
|
62
|
+
}
|
|
63
|
+
descriptions[position - 1] = description;
|
|
64
|
+
}
|
|
65
|
+
return descriptions;
|
|
66
|
+
}
|
|
67
|
+
/** The one question a `tasks ask` sends, with `--recommended` counted from 1 as it is shown. */
|
|
68
|
+
function buildAskBody(flags) {
|
|
69
|
+
const options = (flags.option || []).map((option) => option.trim()).filter(Boolean);
|
|
70
|
+
if (flags.recommended !== undefined) {
|
|
71
|
+
if (!options.length)
|
|
72
|
+
throw new Error('--recommended needs the --option it names');
|
|
73
|
+
if (flags.recommended < 1 || flags.recommended > options.length) {
|
|
74
|
+
throw new Error(`--recommended is the position of an --option, from 1 to ${options.length}: ${flags.recommended}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (flags.multi && options.length < 2)
|
|
78
|
+
throw new Error('--multi needs at least two --option');
|
|
79
|
+
if (flags['no-free-text'] && !options.length) {
|
|
80
|
+
throw new Error('--no-free-text needs --option: the person must be able to answer');
|
|
81
|
+
}
|
|
82
|
+
const context = flags.context?.trim();
|
|
83
|
+
if (context && context.length > data_provider_1.TASK_HUMAN_INPUT_CONTEXT_MAX) {
|
|
84
|
+
throw new Error(`--context takes at most ${data_provider_1.TASK_HUMAN_INPUT_CONTEXT_MAX} characters (this one is ${context.length}): keep the evidence and the trade-off, and leave the rest on the task`);
|
|
85
|
+
}
|
|
86
|
+
const optionDescriptions = parseOptionDescriptions(flags['option-description'], options.length);
|
|
87
|
+
const expiresAt = parseAskExpiry(flags.expires);
|
|
88
|
+
return {
|
|
89
|
+
questions: [
|
|
90
|
+
{
|
|
91
|
+
prompt: flags.question.trim(),
|
|
92
|
+
...(context ? { context } : {}),
|
|
93
|
+
...(flags.header ? { header: flags.header.trim() } : {}),
|
|
94
|
+
...(options.length ? { options } : {}),
|
|
95
|
+
...(optionDescriptions ? { optionDescriptions } : {}),
|
|
96
|
+
...(flags.recommended !== undefined ? { recommendedIndex: flags.recommended - 1 } : {}),
|
|
97
|
+
...(flags.multi ? { multiSelect: true } : {}),
|
|
98
|
+
...(flags['no-free-text'] ? { allowFreeText: false } : {}),
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
...(expiresAt ? { expiresAt } : {}),
|
|
102
|
+
...(flags.key ? { askKey: flags.key } : {}),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
class TasksAsk extends base_command_1.BaseCommand {
|
|
106
|
+
static description = 'Ask a person one question on a task, outside any run. The task keeps the question until it is answered, expires or is dismissed; the answer starts nothing and is read with `tasks input show --request <id> --wait`';
|
|
107
|
+
static examples = [
|
|
108
|
+
'<%= config.bin %> tasks ask OSK-42 --question "Lead the pricing page with annual or monthly prices?" --option Annual --option Monthly --recommended 1 --context "Annual-first lifted team-plan signups 11% in the last test; monthly-first tested better with solo users."',
|
|
109
|
+
'<%= config.bin %> tasks ask OSK-42 --question "Which plan should the trial default to?" --option Team --option Solo --option-description 1="Five seats, billed yearly" --option-description 2="One seat, billed monthly"',
|
|
110
|
+
'<%= config.bin %> tasks ask OSK-42 --question "Is staging safe to reset?" --expires 4h --key reset-staging',
|
|
111
|
+
];
|
|
112
|
+
static args = {
|
|
113
|
+
id: core_1.Args.string({ description: 'Task ID/ref', required: true, ignoreStdin: true }),
|
|
114
|
+
};
|
|
115
|
+
static flags = {
|
|
116
|
+
question: core_1.Flags.string({
|
|
117
|
+
description: 'The question, in one line of 140 characters or fewer. Put the background in --context',
|
|
118
|
+
required: true,
|
|
119
|
+
}),
|
|
120
|
+
context: core_1.Flags.string({
|
|
121
|
+
description: `What the person needs to know to answer: the evidence, the trade-off, why you recommend what you recommend (${data_provider_1.TASK_HUMAN_INPUT_CONTEXT_MAX} characters). Shown beneath the question; the choices go in --option`,
|
|
122
|
+
}),
|
|
123
|
+
option: core_1.Flags.string({ description: 'A choice (repeatable, in order)', multiple: true }),
|
|
124
|
+
'option-description': core_1.Flags.string({
|
|
125
|
+
description: `What choosing an --option means, as <position>=<text> counting from 1 (repeatable; ${data_provider_1.TASK_HUMAN_INPUT_OPTION_DESCRIPTION_MAX} characters each). Shown with that option`,
|
|
126
|
+
multiple: true,
|
|
127
|
+
}),
|
|
128
|
+
recommended: core_1.Flags.integer({
|
|
129
|
+
description: 'The --option you recommend, by its position counting from 1',
|
|
130
|
+
}),
|
|
131
|
+
multi: core_1.Flags.boolean({ description: 'More than one option may be chosen' }),
|
|
132
|
+
header: core_1.Flags.string({ description: 'A short label for the question (80 characters)' }),
|
|
133
|
+
'no-free-text': core_1.Flags.boolean({ description: 'Only the options may be chosen, not words' }),
|
|
134
|
+
expires: core_1.Flags.string({
|
|
135
|
+
description: "When it stops waiting: an ISO date-time or 30m, 4h, 2d (default and maximum: the workspace's policy)",
|
|
136
|
+
}),
|
|
137
|
+
key: core_1.Flags.string({
|
|
138
|
+
description: 'Your key for this question: the same key returns the same question, and names only one',
|
|
139
|
+
}),
|
|
140
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
141
|
+
};
|
|
142
|
+
async run() {
|
|
143
|
+
this.requireAuth();
|
|
144
|
+
const { args, flags } = await this.parse(TasksAsk);
|
|
145
|
+
let body;
|
|
146
|
+
try {
|
|
147
|
+
body = buildAskBody(flags);
|
|
148
|
+
}
|
|
149
|
+
catch (err) {
|
|
150
|
+
this.failWithCliError({
|
|
151
|
+
message: err.message,
|
|
152
|
+
code: 'TASK_HUMAN_INPUT_ASK_INVALID',
|
|
153
|
+
exit: 2,
|
|
154
|
+
retryable: false,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
const taskId = await this.resolveTaskReference(args.id);
|
|
158
|
+
let response;
|
|
159
|
+
try {
|
|
160
|
+
response = await data_provider_1.dataService.askTaskHumanInput(taskId, body);
|
|
161
|
+
}
|
|
162
|
+
catch (err) {
|
|
163
|
+
this.handleApiError(err);
|
|
164
|
+
}
|
|
165
|
+
if (flags.json) {
|
|
166
|
+
this.log(JSON.stringify(response, null, 2));
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const request = response.data;
|
|
170
|
+
const route = (request.replyRoute?.kind || 'poll');
|
|
171
|
+
this.log(`${response.created ? 'Asked' : 'Already asked (same key)'} on ${args.id}: request ${request.requestId}`);
|
|
172
|
+
for (const question of request.questions) {
|
|
173
|
+
this.log(` ${question.header ? `${question.header}: ` : ''}${question.prompt}`);
|
|
174
|
+
for (const line of (0, show_1.humanInputContextLines)(question, ' '))
|
|
175
|
+
this.log(line);
|
|
176
|
+
const options = (0, show_1.humanInputOptionsLine)(question);
|
|
177
|
+
if (options)
|
|
178
|
+
this.log(` Options: ${options}`);
|
|
179
|
+
for (const line of (0, show_1.humanInputOptionDescriptionLines)(question, ' '))
|
|
180
|
+
this.log(line);
|
|
181
|
+
}
|
|
182
|
+
if (request.expiresAt)
|
|
183
|
+
this.log(` Expires: ${new Date(request.expiresAt).toISOString()}`);
|
|
184
|
+
this.log(data_provider_1.TASK_HUMAN_INPUT_REPLY_ROUTE_LABELS[route]);
|
|
185
|
+
this.log(`Read the answer: ${this.config.bin} tasks input show ${args.id} --request ${request.requestId} --wait`);
|
|
186
|
+
if (response.advice?.tip)
|
|
187
|
+
this.log(`Tip for your next question: ${response.advice.tip}`);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
exports.default = TasksAsk;
|
|
@@ -66,6 +66,7 @@ export default class TasksCreate extends BaseCommand {
|
|
|
66
66
|
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
67
67
|
'description-format': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
68
68
|
'external-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
69
|
+
'request-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
69
70
|
'default-agent': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
70
71
|
priority: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
71
72
|
parent: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -109,6 +110,7 @@ export default class TasksCreate extends BaseCommand {
|
|
|
109
110
|
* names API fields (OSK-10219); everything else is the uniform translation.
|
|
110
111
|
*/
|
|
111
112
|
private failTaskCreate;
|
|
113
|
+
private sendCreateRequest;
|
|
112
114
|
private createTaskOrRecover;
|
|
113
115
|
/**
|
|
114
116
|
* Predict the create route's `ASSIGNEE_NOT_IN_SPACE` degradation for a
|