@skrr-ai/cli 0.1.91 → 0.1.93
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/base-command.d.ts +44 -0
- package/dist/base-command.js +96 -0
- package/dist/commands/agents/badge.d.ts +41 -0
- package/dist/commands/agents/badge.js +158 -0
- package/dist/commands/agents/create.d.ts +24 -0
- package/dist/commands/agents/create.js +212 -0
- package/dist/commands/agents/embed.d.ts +20 -0
- package/dist/commands/agents/embed.js +61 -0
- package/dist/commands/agents/share.d.ts +27 -0
- package/dist/commands/agents/share.js +100 -0
- package/dist/commands/agents/vanity.d.ts +21 -0
- package/dist/commands/agents/vanity.js +77 -0
- package/dist/commands/agents/visibility.d.ts +21 -1
- package/dist/commands/agents/visibility.js +112 -0
- package/dist/commands/commands.d.ts +1 -0
- package/dist/commands/commands.js +22 -9
- package/dist/commands/earnings/attributions.d.ts +17 -0
- package/dist/commands/earnings/attributions.js +82 -0
- package/dist/commands/earnings/index.js +2 -1
- package/dist/commands/generate-recovery-code.js +4 -3
- package/dist/commands/github/allow-tools.d.ts +1 -0
- package/dist/commands/github/app/install.d.ts +1 -0
- package/dist/commands/github/app/status.d.ts +1 -0
- package/dist/commands/github/connect.d.ts +1 -0
- package/dist/commands/github/connections.d.ts +1 -0
- package/dist/commands/github/disconnect.d.ts +1 -0
- package/dist/commands/github/finalize.d.ts +1 -0
- package/dist/commands/github/reconnect.d.ts +1 -0
- package/dist/commands/github/run.d.ts +1 -0
- package/dist/commands/github/tools.d.ts +1 -0
- package/dist/commands/integrations/connections/connect.d.ts +1 -0
- package/dist/commands/integrations/connections/disconnect.d.ts +1 -0
- package/dist/commands/integrations/connections/finalize.d.ts +1 -0
- package/dist/commands/integrations/connections/list.d.ts +1 -0
- package/dist/commands/integrations/connections/reconnect.d.ts +1 -0
- package/dist/commands/integrations/execute.d.ts +1 -0
- package/dist/commands/integrations/search.d.ts +1 -0
- package/dist/commands/integrations/toolkits.d.ts +1 -0
- package/dist/commands/integrations/tools/allow.d.ts +1 -0
- package/dist/commands/integrations/tools/list.d.ts +1 -0
- package/dist/commands/login.js +12 -0
- package/dist/commands/machines/dedicated/logs.d.ts +19 -0
- package/dist/commands/machines/dedicated/logs.js +103 -0
- package/dist/commands/machines/dedicated/power/index.js +3 -2
- package/dist/commands/machines/dedicated/power/set.js +1 -1
- package/dist/commands/machines/dedicated/power/waiting.d.ts +13 -0
- package/dist/commands/machines/dedicated/power/waiting.js +36 -0
- package/dist/commands/open.d.ts +24 -0
- package/dist/commands/open.js +74 -0
- package/dist/commands/projects/archive.d.ts +1 -0
- package/dist/commands/projects/archive.js +23 -0
- package/dist/commands/projects/delete.d.ts +1 -0
- package/dist/commands/projects/delete.js +23 -0
- package/dist/commands/projects/list.d.ts +3 -0
- package/dist/commands/projects/list.js +12 -2
- package/dist/commands/spaces/actions/add.js +4 -3
- package/dist/commands/spaces/actions/available.js +3 -2
- package/dist/commands/spaces/actions/list.js +5 -4
- package/dist/commands/spaces/actions/replace.js +6 -5
- package/dist/commands/spaces/archive.js +3 -2
- package/dist/commands/spaces/auto-executor/preview.js +4 -3
- package/dist/commands/spaces/auto-executor/run.js +4 -3
- package/dist/commands/spaces/auto-executor/runs.js +3 -2
- package/dist/commands/spaces/auto-executor/update.js +4 -3
- package/dist/commands/spaces/bootstrap.js +3 -2
- package/dist/commands/spaces/briefs/delete.js +3 -2
- package/dist/commands/spaces/briefs/get.js +3 -2
- package/dist/commands/spaces/briefs/list.js +3 -2
- package/dist/commands/spaces/briefs/set.js +5 -4
- package/dist/commands/spaces/capacity.js +5 -4
- package/dist/commands/spaces/conversations.js +3 -2
- package/dist/commands/spaces/cycles/create.js +3 -2
- package/dist/commands/spaces/cycles/graph.js +2 -1
- package/dist/commands/spaces/cycles/list.js +3 -2
- package/dist/commands/spaces/cycles/settings.js +4 -3
- package/dist/commands/spaces/cycles/show.js +3 -2
- package/dist/commands/spaces/cycles/update.js +3 -2
- package/dist/commands/spaces/delete.js +4 -3
- package/dist/commands/spaces/expertise-suggestions.js +4 -3
- package/dist/commands/spaces/files/delete.js +3 -2
- package/dist/commands/spaces/files/folders/create.js +3 -2
- package/dist/commands/spaces/files/folders/delete.js +3 -2
- package/dist/commands/spaces/files/folders/list.js +3 -2
- package/dist/commands/spaces/files/folders/update.js +3 -2
- package/dist/commands/spaces/files/list.js +3 -2
- package/dist/commands/spaces/files/move.js +3 -2
- package/dist/commands/spaces/files/rename.js +3 -2
- package/dist/commands/spaces/files/upload.js +6 -5
- package/dist/commands/spaces/github-automations/set.js +3 -2
- package/dist/commands/spaces/github-automations/show.js +3 -2
- package/dist/commands/spaces/goals.js +2 -1
- package/dist/commands/spaces/heartbeats/create.js +4 -3
- package/dist/commands/spaces/heartbeats/delete.js +4 -3
- package/dist/commands/spaces/heartbeats/list.js +4 -3
- package/dist/commands/spaces/heartbeats/status.js +3 -2
- package/dist/commands/spaces/heartbeats/update.js +4 -3
- package/dist/commands/spaces/insights.js +5 -4
- package/dist/commands/spaces/labels/add.js +4 -3
- package/dist/commands/spaces/labels/list.js +2 -1
- package/dist/commands/spaces/labels/remove.js +4 -3
- package/dist/commands/spaces/list.d.ts +3 -0
- package/dist/commands/spaces/list.js +11 -2
- package/dist/commands/spaces/live/cards/create.js +3 -2
- package/dist/commands/spaces/live/cards/list.js +3 -2
- package/dist/commands/spaces/live/cards/reorder.js +7 -2
- package/dist/commands/spaces/live/scene.js +4 -3
- package/dist/commands/spaces/members/add.js +7 -6
- package/dist/commands/spaces/members/list.js +4 -3
- package/dist/commands/spaces/members/remove.js +7 -6
- package/dist/commands/spaces/move.js +3 -2
- package/dist/commands/spaces/pin.js +5 -4
- package/dist/commands/spaces/preferences/show.js +4 -3
- package/dist/commands/spaces/preferences/tabs.js +4 -3
- package/dist/commands/spaces/revisions.js +3 -2
- package/dist/commands/spaces/room/ensure.js +5 -4
- package/dist/commands/spaces/room/messages.js +3 -2
- package/dist/commands/spaces/room/show.js +5 -4
- package/dist/commands/spaces/skills/add.js +4 -3
- package/dist/commands/spaces/skills/list.js +3 -2
- package/dist/commands/spaces/skills/pin.js +4 -3
- package/dist/commands/spaces/skills/remove.js +4 -3
- package/dist/commands/spaces/snapshot.js +3 -2
- package/dist/commands/spaces/states/archive.js +3 -2
- package/dist/commands/spaces/states/create.js +3 -2
- package/dist/commands/spaces/states/list.js +3 -2
- package/dist/commands/spaces/states/reorder.js +2 -1
- package/dist/commands/spaces/states/update.js +3 -2
- package/dist/commands/spaces/summary.js +4 -3
- package/dist/commands/spaces/tasks.d.ts +3 -0
- package/dist/commands/spaces/tasks.js +14 -3
- package/dist/commands/spaces/triggers/delete.js +5 -4
- package/dist/commands/spaces/triggers/set.js +4 -3
- package/dist/commands/spaces/triggers/show.js +4 -3
- package/dist/commands/spaces/unarchive.js +3 -2
- package/dist/commands/spaces/update.js +5 -4
- package/dist/commands/spaces/views/create.js +3 -2
- package/dist/commands/spaces/views/list.js +3 -2
- package/dist/commands/spaces/views/reorder.js +6 -3
- package/dist/commands/spaces/views/subscribe.js +2 -1
- package/dist/commands/spaces/views/subscriptions.js +1 -0
- package/dist/commands/spaces/views/unsubscribe.js +2 -1
- package/dist/commands/spaces/widgets/add.js +4 -3
- package/dist/commands/spaces/widgets/list.js +3 -2
- package/dist/commands/spaces/widgets/remove.js +5 -4
- package/dist/commands/spaces/work-graph.js +2 -1
- package/dist/commands/store/install.d.ts +1 -1
- package/dist/commands/store/install.js +24 -8
- package/dist/commands/store/show.d.ts +25 -0
- package/dist/commands/store/show.js +203 -0
- package/dist/commands/store/stats.d.ts +33 -0
- package/dist/commands/store/stats.js +258 -0
- package/dist/commands/tasks/actions/attach.js +1 -1
- package/dist/commands/tasks/actions/detach.js +4 -3
- package/dist/commands/tasks/activity.js +3 -2
- package/dist/commands/tasks/ancestors.js +2 -1
- package/dist/commands/tasks/approvals/create.js +2 -1
- package/dist/commands/tasks/approvals/delete.js +3 -2
- package/dist/commands/tasks/approvals/list.js +5 -4
- package/dist/commands/tasks/approvals/resolve.js +2 -1
- package/dist/commands/tasks/archive.js +3 -2
- package/dist/commands/tasks/assign.js +4 -3
- package/dist/commands/tasks/attachments/delete.js +3 -2
- package/dist/commands/tasks/attachments/download.d.ts +1 -0
- package/dist/commands/tasks/attachments/download.js +20 -1
- package/dist/commands/tasks/attachments/list.js +2 -1
- package/dist/commands/tasks/attachments/set-role.js +2 -1
- package/dist/commands/tasks/attachments/upload.js +2 -1
- package/dist/commands/tasks/bulk-update.d.ts +1 -0
- package/dist/commands/tasks/bulk-update.js +106 -15
- package/dist/commands/tasks/cancel-cascade.d.ts +1 -0
- package/dist/commands/tasks/cancel-cascade.js +13 -3
- package/dist/commands/tasks/cascade-status.js +2 -1
- package/dist/commands/tasks/chat/send.d.ts +44 -0
- package/dist/commands/tasks/chat/send.js +112 -0
- package/dist/commands/tasks/checkout.js +3 -2
- package/dist/commands/tasks/children.js +2 -1
- package/dist/commands/tasks/comments/add.js +7 -6
- package/dist/commands/tasks/comments/anchor.js +8 -7
- package/dist/commands/tasks/comments/delete.js +3 -2
- package/dist/commands/tasks/comments/list.js +2 -1
- package/dist/commands/tasks/comments/reopen.js +3 -2
- package/dist/commands/tasks/comments/resolve.js +3 -2
- package/dist/commands/tasks/create-tree.d.ts +63 -0
- package/dist/commands/tasks/create-tree.js +197 -4
- package/dist/commands/tasks/delete.js +5 -4
- package/dist/commands/tasks/descendants.js +2 -1
- package/dist/commands/tasks/dri-plan.js +3 -2
- package/dist/commands/tasks/dri-run.js +3 -2
- package/dist/commands/tasks/dri-status.js +2 -1
- package/dist/commands/tasks/duplicate-pipeline.js +2 -1
- package/dist/commands/tasks/execution-summary.js +2 -1
- package/dist/commands/tasks/execution-timeline.js +2 -1
- package/dist/commands/tasks/fork.js +1 -0
- package/dist/commands/tasks/forward.js +4 -3
- package/dist/commands/tasks/handover.js +1 -0
- package/dist/commands/tasks/interrupt.js +3 -2
- package/dist/commands/tasks/labels/attach.js +4 -3
- package/dist/commands/tasks/labels/detach.js +4 -3
- package/dist/commands/tasks/labels/suggest.js +5 -4
- package/dist/commands/tasks/list.d.ts +27 -1
- package/dist/commands/tasks/list.js +101 -3
- package/dist/commands/tasks/move.js +4 -3
- package/dist/commands/tasks/output.js +6 -5
- package/dist/commands/tasks/pause-schedule.js +3 -2
- package/dist/commands/tasks/promote.js +1 -0
- package/dist/commands/tasks/prompt-log.js +2 -1
- package/dist/commands/tasks/release.js +5 -4
- package/dist/commands/tasks/remind.js +2 -1
- package/dist/commands/tasks/replay.js +3 -2
- package/dist/commands/tasks/report.js +1 -0
- package/dist/commands/tasks/resume-schedule.js +3 -2
- package/dist/commands/tasks/retry-schedule.js +3 -2
- package/dist/commands/tasks/retry.js +10 -9
- package/dist/commands/tasks/revisions.js +2 -1
- package/dist/commands/tasks/runs.js +6 -5
- package/dist/commands/tasks/schedule.js +3 -2
- package/dist/commands/tasks/self-schedule.js +6 -5
- package/dist/commands/tasks/skills/pin.js +3 -2
- package/dist/commands/tasks/skills/unpin.js +3 -2
- package/dist/commands/tasks/snooze.js +6 -5
- package/dist/commands/tasks/start-all.js +5 -4
- package/dist/commands/tasks/subscribe.js +1 -0
- package/dist/commands/tasks/tags/add.js +4 -3
- package/dist/commands/tasks/tags/remove.js +4 -3
- package/dist/commands/tasks/timeline.js +3 -2
- package/dist/commands/tasks/today.d.ts +4 -1
- package/dist/commands/tasks/today.js +12 -2
- package/dist/commands/tasks/transcript.js +6 -5
- package/dist/commands/tasks/unschedule.js +3 -2
- package/dist/commands/tasks/unsnooze.js +3 -2
- package/dist/commands/tasks/unsubscribe.js +2 -1
- package/dist/commands/tasks/update.js +5 -4
- package/dist/commands/tasks/wait.js +5 -4
- package/dist/lib/agent-distribution.d.ts +37 -0
- package/dist/lib/agent-distribution.js +63 -0
- package/dist/lib/agent-ref.d.ts +69 -0
- package/dist/lib/agent-ref.js +168 -0
- package/dist/lib/api-fetch.d.ts +2 -0
- package/dist/lib/api-fetch.js +14 -3
- package/dist/lib/command-hygiene.d.ts +13 -0
- package/dist/lib/command-hygiene.js +62 -2
- package/dist/lib/dedicated-power.d.ts +16 -1
- package/dist/lib/dedicated-power.js +153 -2
- package/dist/lib/dry-run-plans.d.ts +50 -0
- package/dist/lib/dry-run-plans.js +85 -0
- package/dist/lib/json-output.d.ts +31 -0
- package/dist/lib/json-output.js +78 -0
- package/dist/lib/list-output.d.ts +75 -0
- package/dist/lib/list-output.js +266 -0
- package/dist/lib/machine-daemon-log.d.ts +36 -0
- package/dist/lib/machine-daemon-log.js +78 -0
- package/dist/lib/node-adapter.js +10 -1
- package/dist/lib/open-target.d.ts +12 -0
- package/dist/lib/open-target.js +108 -0
- package/dist/lib/rate-limit-retry.d.ts +45 -0
- package/dist/lib/rate-limit-retry.js +88 -0
- package/dist/lib/store-listing.d.ts +45 -0
- package/dist/lib/store-listing.js +186 -0
- package/dist/lib/task-batch.d.ts +67 -0
- package/dist/lib/task-batch.js +227 -0
- package/dist/lib/terminal-qr.d.ts +55 -0
- package/dist/lib/terminal-qr.js +119 -0
- package/dist/lib/web-url.d.ts +11 -0
- package/dist/lib/web-url.js +24 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +68 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +47 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +68 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +46 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +6615 -6112
- package/oclif.manifest.json +41499 -32585
- package/package.json +2 -1
|
@@ -31,11 +31,12 @@ class TasksLabelsSuggest extends base_command_1.BaseCommand {
|
|
|
31
31
|
async run() {
|
|
32
32
|
this.requireAuth();
|
|
33
33
|
const { args, flags } = await this.parse(TasksLabelsSuggest);
|
|
34
|
+
const taskRef = await this.resolveEntityRef('task', args.id);
|
|
34
35
|
let response;
|
|
35
36
|
try {
|
|
36
37
|
// The URL lives in the lib — a command that builds its own `/api/...`
|
|
37
38
|
// string is invisible to the CLI↔API parity check.
|
|
38
|
-
response = await (0, task_extras_1.taskLabelSuggestion)(
|
|
39
|
+
response = await (0, task_extras_1.taskLabelSuggestion)(taskRef);
|
|
39
40
|
}
|
|
40
41
|
catch (err) {
|
|
41
42
|
this.handleApiError(err);
|
|
@@ -47,7 +48,7 @@ class TasksLabelsSuggest extends base_command_1.BaseCommand {
|
|
|
47
48
|
const suggestions = (response?.suggestions ?? []).filter((s) => Boolean(s?.id && s?.name));
|
|
48
49
|
const ref = response?.identifier ? ` (${response.identifier})` : '';
|
|
49
50
|
if (suggestions.length === 0) {
|
|
50
|
-
this.log(`No label suggestions for task ${
|
|
51
|
+
this.log(`No label suggestions for task ${taskRef}${ref} — ` +
|
|
51
52
|
// The server counts the vocabulary AFTER excluding the labels this
|
|
52
53
|
// task already wears, so 0 means nothing left to propose, not that
|
|
53
54
|
// the registry is empty.
|
|
@@ -57,13 +58,13 @@ class TasksLabelsSuggest extends base_command_1.BaseCommand {
|
|
|
57
58
|
' "No label" is a correct answer.');
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
60
|
-
this.log(`Suggested labels for task ${
|
|
61
|
+
this.log(`Suggested labels for task ${taskRef}${ref}:`);
|
|
61
62
|
(0, format_1.renderTable)(suggestions.map((s) => ({ id: s.id, name: s.name })), [
|
|
62
63
|
{ key: 'id', header: 'ID' },
|
|
63
64
|
{ key: 'name', header: 'NAME' },
|
|
64
65
|
], (line) => this.log(line));
|
|
65
66
|
this.log(`A suggestion is a proposal, not a write — attach with ` +
|
|
66
|
-
`\`skrr tasks labels attach ${
|
|
67
|
+
`\`skrr tasks labels attach ${taskRef} --label <id>\` if one fits.`);
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
exports.default = TasksLabelsSuggest;
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import type { TaskListParams } from '@skrr-ai/data-provider';
|
|
2
2
|
import { BaseCommand } from '../../base-command';
|
|
3
|
+
import { type ListWarning } from '../../lib/list-output';
|
|
3
4
|
type ListFlags = Record<string, unknown>;
|
|
5
|
+
/**
|
|
6
|
+
* E12: inside an agent session an unfiltered `tasks list --json` returned the
|
|
7
|
+
* first page of EVERYTHING, which in practice was cancelled test tasks. When the
|
|
8
|
+
* caller is an agent (a session agent id in the environment) asking for machine
|
|
9
|
+
* output and has named no state filter of its own, default to open work and SAY
|
|
10
|
+
* so, as data (`filter_applied`) and not only in prose. `--all` is the opt-out;
|
|
11
|
+
* any filter the caller wrote leaves the default off, since they have decided.
|
|
12
|
+
* A person at a terminal is untouched.
|
|
13
|
+
*/
|
|
14
|
+
export declare function agentSessionOpenDefault(flags: ListFlags, env?: NodeJS.ProcessEnv): {
|
|
15
|
+
open: true;
|
|
16
|
+
reason: 'agent_session_default';
|
|
17
|
+
hint: string;
|
|
18
|
+
} | undefined;
|
|
4
19
|
/**
|
|
5
20
|
* What the zero-row case is allowed to say. The bare `No tasks.` was step 3
|
|
6
21
|
* of `GETTING_STARTED.md` and named no next step; a new user reading it hit
|
|
@@ -31,10 +46,21 @@ export declare function taskRef(t: Record<string, unknown>): string;
|
|
|
31
46
|
* the command; this function is deliberately pure for reuse and parity tests.
|
|
32
47
|
*/
|
|
33
48
|
export declare function buildListParams(flags: ListFlags, assigneeUserId?: string): TaskListParams;
|
|
49
|
+
/**
|
|
50
|
+
* P4: `--status bogus` exits 0 with an empty list, and text mode explains why
|
|
51
|
+
* while `--json` said nothing, so an agent could not tell "no matches" from
|
|
52
|
+
* "invalid filter". Same facts, as data.
|
|
53
|
+
*/
|
|
54
|
+
export declare function statusFilterWarnings(flags: ListFlags, rowCount: number): ListWarning[];
|
|
34
55
|
export default class TasksList extends BaseCommand {
|
|
35
56
|
static description: string;
|
|
36
57
|
static examples: string[];
|
|
37
58
|
static flags: {
|
|
59
|
+
strict: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
60
|
+
calendar: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
61
|
+
fields: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
62
|
+
compact: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
63
|
+
ndjson: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
38
64
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
39
65
|
space: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
40
66
|
goal: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -75,7 +101,7 @@ export default class TasksList extends BaseCommand {
|
|
|
75
101
|
view: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
76
102
|
limit: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
77
103
|
cursor: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
78
|
-
|
|
104
|
+
all: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
79
105
|
};
|
|
80
106
|
run(): Promise<void>;
|
|
81
107
|
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.agentSessionOpenDefault = agentSessionOpenDefault;
|
|
3
4
|
exports.emptyTasksMessage = emptyTasksMessage;
|
|
4
5
|
exports.nextActionText = nextActionText;
|
|
5
6
|
exports.taskRef = taskRef;
|
|
6
7
|
exports.buildListParams = buildListParams;
|
|
8
|
+
exports.statusFilterWarnings = statusFilterWarnings;
|
|
7
9
|
const core_1 = require("@oclif/core");
|
|
8
10
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
9
11
|
const base_command_1 = require("../../base-command");
|
|
10
12
|
const web_url_1 = require("../../lib/web-url");
|
|
11
13
|
const format_1 = require("../../lib/format");
|
|
14
|
+
const list_output_1 = require("../../lib/list-output");
|
|
12
15
|
const tasks_1 = require("../../lib/tasks");
|
|
13
16
|
/**
|
|
14
17
|
* Names of `tasks list` flags that narrow the result set. Used to distinguish
|
|
@@ -53,6 +56,33 @@ const FILTER_FLAGS = new Set([
|
|
|
53
56
|
'q',
|
|
54
57
|
'view',
|
|
55
58
|
]);
|
|
59
|
+
/**
|
|
60
|
+
* E12: inside an agent session an unfiltered `tasks list --json` returned the
|
|
61
|
+
* first page of EVERYTHING, which in practice was cancelled test tasks. When the
|
|
62
|
+
* caller is an agent (a session agent id in the environment) asking for machine
|
|
63
|
+
* output and has named no state filter of its own, default to open work and SAY
|
|
64
|
+
* so, as data (`filter_applied`) and not only in prose. `--all` is the opt-out;
|
|
65
|
+
* any filter the caller wrote leaves the default off, since they have decided.
|
|
66
|
+
* A person at a terminal is untouched.
|
|
67
|
+
*/
|
|
68
|
+
function agentSessionOpenDefault(flags, env = process.env) {
|
|
69
|
+
const inAgentSession = Boolean(env.OVERSKY_SESSION_AGENT_ID?.trim() || env.OVERSKY_AGENT_ID?.trim());
|
|
70
|
+
if (!inAgentSession || flags.all || flags.calendar)
|
|
71
|
+
return undefined;
|
|
72
|
+
if (!flags.json && !flags.ndjson)
|
|
73
|
+
return undefined;
|
|
74
|
+
for (const name of FILTER_FLAGS) {
|
|
75
|
+
const value = flags[name];
|
|
76
|
+
if (Array.isArray(value) ? value.length > 0 : value !== undefined && value !== false) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
open: true,
|
|
82
|
+
reason: 'agent_session_default',
|
|
83
|
+
hint: 'Closed tasks are hidden for agent sessions by default. Pass --all to include them, or --status / --status-type to choose.',
|
|
84
|
+
};
|
|
85
|
+
}
|
|
56
86
|
/**
|
|
57
87
|
* What the zero-row case is allowed to say. The bare `No tasks.` was step 3
|
|
58
88
|
* of `GETTING_STARTED.md` and named no next step; a new user reading it hit
|
|
@@ -239,11 +269,36 @@ function buildListParams(flags, assigneeUserId) {
|
|
|
239
269
|
? { labelIds: flag('label-id') }
|
|
240
270
|
: {}),
|
|
241
271
|
q: flag('q'),
|
|
272
|
+
// `--compact` asks the server for its own card projection (no activityLog,
|
|
273
|
+
// narrative or ledgers) so the bytes are never sent, then the CLI trims the
|
|
274
|
+
// rest to the navigation set. Only the JSON path reads it.
|
|
275
|
+
...(flag('compact') && !flag('fields') ? { view: 'summary' } : {}),
|
|
242
276
|
...(flag('view') ? { taskViewId: flag('view') } : {}),
|
|
243
277
|
limit: flag('limit'),
|
|
244
278
|
cursor: flag('cursor'),
|
|
245
279
|
};
|
|
246
280
|
}
|
|
281
|
+
/**
|
|
282
|
+
* P4: `--status bogus` exits 0 with an empty list, and text mode explains why
|
|
283
|
+
* while `--json` said nothing, so an agent could not tell "no matches" from
|
|
284
|
+
* "invalid filter". Same facts, as data.
|
|
285
|
+
*/
|
|
286
|
+
function statusFilterWarnings(flags, rowCount) {
|
|
287
|
+
if (rowCount > 0 || flags['execution-state'])
|
|
288
|
+
return [];
|
|
289
|
+
const builtin = data_provider_1.TASK_STATUSES;
|
|
290
|
+
return statusList(flags).map((value) => builtin.includes(value)
|
|
291
|
+
? {
|
|
292
|
+
code: 'STATUS_FILTER_EMPTY',
|
|
293
|
+
value,
|
|
294
|
+
hint: `Nothing matched --status ${value}. A status is a workflow-state id the Space owns, so a board need not use this one; try --status-type or drop --status to see what the scope holds.`,
|
|
295
|
+
}
|
|
296
|
+
: {
|
|
297
|
+
code: 'STATUS_NOT_BUILTIN',
|
|
298
|
+
value,
|
|
299
|
+
hint: `"${value}" is not a built-in status id (${data_provider_1.TASK_STATUSES.join(', ')}). It only matches a Space that defines a state with exactly this id; otherwise use --status-type (${[...data_provider_1.TASK_WORKFLOW_TYPE_BANDS.open].join(', ')} ...) or --open.`,
|
|
300
|
+
});
|
|
301
|
+
}
|
|
247
302
|
class TasksList extends base_command_1.BaseCommand {
|
|
248
303
|
static description = 'List tasks';
|
|
249
304
|
static examples = [
|
|
@@ -267,6 +322,9 @@ class TasksList extends base_command_1.BaseCommand {
|
|
|
267
322
|
'<%= config.bin %> tasks list --dri me',
|
|
268
323
|
'<%= config.bin %> tasks list --view <task-view-id>',
|
|
269
324
|
'<%= config.bin %> tasks list --calendar 2026-08-01..2026-08-31 --json',
|
|
325
|
+
'<%= config.bin %> tasks list --open --compact --json',
|
|
326
|
+
'<%= config.bin %> tasks list --space <space-id> --fields id,ref,title,status --json',
|
|
327
|
+
'<%= config.bin %> tasks list --open --ndjson | jq -r .ref',
|
|
270
328
|
];
|
|
271
329
|
static flags = {
|
|
272
330
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
@@ -393,6 +451,13 @@ class TasksList extends base_command_1.BaseCommand {
|
|
|
393
451
|
}),
|
|
394
452
|
limit: core_1.Flags.integer({ description: 'Max results', default: 50 }),
|
|
395
453
|
cursor: core_1.Flags.string({ description: 'Pagination cursor from a previous page' }),
|
|
454
|
+
all: core_1.Flags.boolean({
|
|
455
|
+
description: 'Include closed tasks even inside an agent session (where --json defaults to open work and reports filter_applied)',
|
|
456
|
+
}),
|
|
457
|
+
...list_output_1.listOutputFlags,
|
|
458
|
+
strict: core_1.Flags.boolean({
|
|
459
|
+
description: 'Exit 2 when --status names a value that is not a built-in state id and matches nothing (instead of an empty success).',
|
|
460
|
+
}),
|
|
396
461
|
calendar: core_1.Flags.string({
|
|
397
462
|
description: 'Expand the human task calendar for an inclusive range (YYYY-MM-DD..YYYY-MM-DD or ISO instants). Includes due dates and agent schedule occurrences.',
|
|
398
463
|
}),
|
|
@@ -443,6 +508,9 @@ class TasksList extends base_command_1.BaseCommand {
|
|
|
443
508
|
}
|
|
444
509
|
flags.dri = driId;
|
|
445
510
|
flags['dri-kind'] = driKind;
|
|
511
|
+
const filterApplied = agentSessionOpenDefault(flags);
|
|
512
|
+
if (filterApplied)
|
|
513
|
+
flags.open = true;
|
|
446
514
|
let response;
|
|
447
515
|
try {
|
|
448
516
|
response = calendarRange
|
|
@@ -459,12 +527,27 @@ class TasksList extends base_command_1.BaseCommand {
|
|
|
459
527
|
catch (err) {
|
|
460
528
|
this.handleApiError(err);
|
|
461
529
|
}
|
|
462
|
-
|
|
530
|
+
const list = response;
|
|
531
|
+
const statusWarnings = calendarRange
|
|
532
|
+
? []
|
|
533
|
+
: statusFilterWarnings(flags, Array.isArray(list?.data) ? list.data.length : 0);
|
|
534
|
+
if (flags.strict && statusWarnings.some((w) => w.code === 'STATUS_NOT_BUILTIN')) {
|
|
535
|
+
const bad = statusWarnings.find((w) => w.code === 'STATUS_NOT_BUILTIN');
|
|
536
|
+
this.failWithCliError({
|
|
537
|
+
message: bad.hint,
|
|
538
|
+
code: 'TASK_STATUS_FILTER_NO_MATCH',
|
|
539
|
+
exit: 2,
|
|
540
|
+
retryable: false,
|
|
541
|
+
details: {
|
|
542
|
+
suggestion: 'Use --status-type or --open, or a state id from `spaces states list`.',
|
|
543
|
+
},
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
if (flags.json || flags.ndjson) {
|
|
463
547
|
// The table renders REF and NEXT, but the raw payload names them
|
|
464
548
|
// `identifier` and `actionability` — under `--json` an agent scanning 43
|
|
465
549
|
// keys could not find either (OSK-10692). Alias them to the names the
|
|
466
550
|
// table prints so the machine view answers the same questions.
|
|
467
|
-
const list = response;
|
|
468
551
|
const enriched = list && Array.isArray(list.data)
|
|
469
552
|
? {
|
|
470
553
|
...list,
|
|
@@ -475,7 +558,19 @@ class TasksList extends base_command_1.BaseCommand {
|
|
|
475
558
|
})),
|
|
476
559
|
}
|
|
477
560
|
: response;
|
|
478
|
-
|
|
561
|
+
const withUrls = (0, web_url_1.withDataUrls)(this.cliConfig.baseURL, enriched, web_url_1.taskUrlFrom);
|
|
562
|
+
// The calendar response is occurrences, not tasks: leave its shape alone.
|
|
563
|
+
const out = calendarRange
|
|
564
|
+
? withUrls
|
|
565
|
+
: (0, list_output_1.shapeListResponse)(withUrls, {
|
|
566
|
+
resource: 'task',
|
|
567
|
+
fields: flags.fields,
|
|
568
|
+
compact: flags.compact,
|
|
569
|
+
requestedLimit: flags.limit,
|
|
570
|
+
warnings: statusWarnings,
|
|
571
|
+
...(filterApplied ? { filterApplied } : {}),
|
|
572
|
+
});
|
|
573
|
+
this.printList(out, Boolean(flags.ndjson));
|
|
479
574
|
return;
|
|
480
575
|
}
|
|
481
576
|
if (calendarRange) {
|
|
@@ -543,6 +638,9 @@ class TasksList extends base_command_1.BaseCommand {
|
|
|
543
638
|
this.log('');
|
|
544
639
|
this.log(`Next page: --cursor ${r.next_cursor}`);
|
|
545
640
|
}
|
|
641
|
+
const note = (0, list_output_1.limitNote)(flags.limit, items.length, Boolean(r?.has_more));
|
|
642
|
+
for (const line of (0, list_output_1.warningLines)(note.warning ? [note.warning] : []))
|
|
643
|
+
this.log(line);
|
|
546
644
|
}
|
|
547
645
|
}
|
|
548
646
|
exports.default = TasksList;
|
|
@@ -76,6 +76,7 @@ class TasksMove extends base_command_1.BaseCommand {
|
|
|
76
76
|
details: { suggestion: failure.suggestion, context: failure.details },
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
+
const taskRef = await this.resolveEntityRef('task', taskIdentity.id);
|
|
79
80
|
const projectId = (0, projects_1.resolveTaskProjectFlag)(flags.project);
|
|
80
81
|
if (!flags.status && projectId === undefined) {
|
|
81
82
|
this.failWithCliError({
|
|
@@ -113,7 +114,7 @@ class TasksMove extends base_command_1.BaseCommand {
|
|
|
113
114
|
}
|
|
114
115
|
else {
|
|
115
116
|
updated = await data_provider_1.dataService.moveTask({
|
|
116
|
-
taskId:
|
|
117
|
+
taskId: taskRef,
|
|
117
118
|
status: flags.status,
|
|
118
119
|
reason: flags.reason,
|
|
119
120
|
resolutionActor: flags['resolution-actor'],
|
|
@@ -125,7 +126,7 @@ class TasksMove extends base_command_1.BaseCommand {
|
|
|
125
126
|
// Project membership is an ordinary task field — PATCH /tasks/:id.
|
|
126
127
|
// `--project none` sends `projectId: null`, which detaches.
|
|
127
128
|
updated = await data_provider_1.dataService.updateTask({
|
|
128
|
-
taskId:
|
|
129
|
+
taskId: taskRef,
|
|
129
130
|
data: { projectId },
|
|
130
131
|
});
|
|
131
132
|
}
|
|
@@ -154,7 +155,7 @@ class TasksMove extends base_command_1.BaseCommand {
|
|
|
154
155
|
if (projectId !== undefined) {
|
|
155
156
|
destinations.push(await this.describeProjectDestination(projectId, t));
|
|
156
157
|
}
|
|
157
|
-
this.log(`Moved task ${t.id ?? t._id ??
|
|
158
|
+
this.log(`Moved task ${t.id ?? t._id ?? taskRef}${ref ? ` (${ref})` : ''} → ${destinations.join(', ')}`);
|
|
158
159
|
/*
|
|
159
160
|
* Closing is the actor's call — the server does not refuse outstanding
|
|
160
161
|
* work, it records it on `resolution.closure`. If the close just written
|
|
@@ -52,27 +52,28 @@ class TasksOutput extends base_command_1.BaseCommand {
|
|
|
52
52
|
details: { suggestion: failure.suggestion },
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
+
const taskRef = await this.resolveEntityRef('task', identity.id);
|
|
55
56
|
let task;
|
|
56
57
|
try {
|
|
57
|
-
task = (await data_provider_1.dataService.getTask(
|
|
58
|
+
task = (await data_provider_1.dataService.getTask(taskRef, { enrich: false }));
|
|
58
59
|
}
|
|
59
60
|
catch (error) {
|
|
60
61
|
this.handleApiError(error);
|
|
61
62
|
}
|
|
62
63
|
const conversationId = task.conversationId ? String(task.conversationId) : null;
|
|
63
64
|
const [resultBundle, resources, updates, latestRun, messages] = await Promise.all([
|
|
64
|
-
data_provider_1.dataService.listTaskResults(
|
|
65
|
+
data_provider_1.dataService.listTaskResults(taskRef).catch(() => ({
|
|
65
66
|
currentResultId: null,
|
|
66
67
|
currentSpecVersion: 1,
|
|
67
68
|
results: [],
|
|
68
69
|
reviews: [],
|
|
69
70
|
})),
|
|
70
|
-
data_provider_1.dataService.listTaskResources(
|
|
71
|
-
data_provider_1.dataService.listTaskUpdates(
|
|
71
|
+
data_provider_1.dataService.listTaskResources(taskRef).catch(() => ({ data: [] })),
|
|
72
|
+
data_provider_1.dataService.listTaskUpdates(taskRef, { limit: 10 }).catch(() => ({
|
|
72
73
|
data: [],
|
|
73
74
|
nextCursor: null,
|
|
74
75
|
})),
|
|
75
|
-
(0, task_transcript_1.fetchLatestRun)(
|
|
76
|
+
(0, task_transcript_1.fetchLatestRun)(taskRef).catch(() => null),
|
|
76
77
|
conversationId
|
|
77
78
|
? (0, task_transcript_1.fetchTranscript)(conversationId).catch(() => [])
|
|
78
79
|
: Promise.resolve([]),
|
|
@@ -19,9 +19,10 @@ class TasksPauseSchedule extends base_command_1.BaseCommand {
|
|
|
19
19
|
async run() {
|
|
20
20
|
this.requireAuth();
|
|
21
21
|
const { args, flags } = await this.parse(TasksPauseSchedule);
|
|
22
|
+
const taskRef = await this.resolveEntityRef('task', args.id);
|
|
22
23
|
let result;
|
|
23
24
|
try {
|
|
24
|
-
result = await data_provider_1.dataService.pauseSchedule(
|
|
25
|
+
result = await data_provider_1.dataService.pauseSchedule(taskRef);
|
|
25
26
|
}
|
|
26
27
|
catch (err) {
|
|
27
28
|
this.handleApiError(err);
|
|
@@ -32,7 +33,7 @@ class TasksPauseSchedule extends base_command_1.BaseCommand {
|
|
|
32
33
|
}
|
|
33
34
|
const t = result;
|
|
34
35
|
const ref = t.identifier ?? (t.taskNumber ? `#${t.taskNumber}` : '');
|
|
35
|
-
this.log(`Paused schedule on task ${t.id ?? t._id ??
|
|
36
|
+
this.log(`Paused schedule on task ${t.id ?? t._id ?? taskRef}${ref ? ` (${ref})` : ''}`);
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
exports.default = TasksPauseSchedule;
|
|
@@ -54,6 +54,7 @@ class TasksPromote extends base_command_1.BaseCommand {
|
|
|
54
54
|
details: { suggestion: failure.suggestion, context: failure.details },
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
+
const taskRef = await this.resolveEntityRef('task', taskIdentity.id);
|
|
57
58
|
const taskId = taskIdentity.id;
|
|
58
59
|
// The route resolves the GROUP from the addressed run, then requires the
|
|
59
60
|
// canonical run to be a member of it. Addressing by the canonical run
|
|
@@ -18,9 +18,10 @@ class TasksPromptLog extends base_command_1.BaseCommand {
|
|
|
18
18
|
async run() {
|
|
19
19
|
this.requireAuth();
|
|
20
20
|
const { args, flags } = await this.parse(TasksPromptLog);
|
|
21
|
+
const taskRef = await this.resolveEntityRef('task', args.id);
|
|
21
22
|
let result;
|
|
22
23
|
try {
|
|
23
|
-
result = await data_provider_1.dataService.getTaskPromptLog(
|
|
24
|
+
result = await data_provider_1.dataService.getTaskPromptLog(taskRef);
|
|
24
25
|
}
|
|
25
26
|
catch (err) {
|
|
26
27
|
this.handleApiError(err);
|
|
@@ -18,9 +18,10 @@ class TasksRelease extends base_command_1.BaseCommand {
|
|
|
18
18
|
async run() {
|
|
19
19
|
this.requireAuth();
|
|
20
20
|
const { args, flags } = await this.parse(TasksRelease);
|
|
21
|
+
const taskRef = await this.resolveEntityRef('task', args.id);
|
|
21
22
|
let result;
|
|
22
23
|
try {
|
|
23
|
-
result = await data_provider_1.dataService.releaseTask(
|
|
24
|
+
result = await data_provider_1.dataService.releaseTask(taskRef);
|
|
24
25
|
}
|
|
25
26
|
catch (err) {
|
|
26
27
|
this.handleApiError(err);
|
|
@@ -29,7 +30,7 @@ class TasksRelease extends base_command_1.BaseCommand {
|
|
|
29
30
|
this.log(JSON.stringify(result, null, 2));
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
32
|
-
this.log(`Released task ${
|
|
33
|
+
this.log(`Released task ${taskRef}`);
|
|
33
34
|
// OSK-3816 — releasing frees the CHECKOUT; it does not change the STATUS.
|
|
34
35
|
// A task left at `in_progress` is still unstartable ("This Task is marked in
|
|
35
36
|
// progress and cannot start another Agent execution"), so an operator who
|
|
@@ -39,8 +40,8 @@ class TasksRelease extends base_command_1.BaseCommand {
|
|
|
39
40
|
const status = result?.status;
|
|
40
41
|
if (status === 'in_progress') {
|
|
41
42
|
this.log(`Still marked in_progress — the checkout is free but the status blocks a new run.\n` +
|
|
42
|
-
` Return it to the working set with: skrr tasks move ${
|
|
43
|
-
` Or do both at once with: skrr tasks retry ${
|
|
43
|
+
` Return it to the working set with: skrr tasks move ${taskRef} --status todo\n` +
|
|
44
|
+
` Or do both at once with: skrr tasks retry ${taskRef}`);
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
}
|
|
@@ -24,6 +24,7 @@ class TasksRemind extends base_command_1.BaseCommand {
|
|
|
24
24
|
async run() {
|
|
25
25
|
this.requireAuth();
|
|
26
26
|
const { args, flags } = await this.parse(TasksRemind);
|
|
27
|
+
const taskRef = await this.resolveEntityRef('task', args.taskId);
|
|
27
28
|
const at = new Date(flags.at);
|
|
28
29
|
if (Number.isNaN(at.getTime()) || !/^\d{4}-\d{2}-\d{2}T/.test(flags.at)) {
|
|
29
30
|
this.error('--at must be an ISO-8601 instant, for example 2026-08-25T16:00:00Z.', {
|
|
@@ -33,7 +34,7 @@ class TasksRemind extends base_command_1.BaseCommand {
|
|
|
33
34
|
let task;
|
|
34
35
|
let reminder;
|
|
35
36
|
try {
|
|
36
|
-
task = (await data_provider_1.dataService.getTask(
|
|
37
|
+
task = (await data_provider_1.dataService.getTask(taskRef, { enrich: false }));
|
|
37
38
|
reminder = await data_provider_1.request.post('/api/triggers', {
|
|
38
39
|
scope: {
|
|
39
40
|
kind: 'entity_reminder',
|
|
@@ -20,9 +20,10 @@ class TasksReplay extends base_command_1.BaseCommand {
|
|
|
20
20
|
async run() {
|
|
21
21
|
this.requireAuth();
|
|
22
22
|
const { args, flags } = await this.parse(TasksReplay);
|
|
23
|
+
const taskRef = await this.resolveEntityRef('task', args.id);
|
|
23
24
|
let result;
|
|
24
25
|
try {
|
|
25
|
-
result = await data_provider_1.dataService.getTaskReplay(
|
|
26
|
+
result = await data_provider_1.dataService.getTaskReplay(taskRef, flags.run);
|
|
26
27
|
}
|
|
27
28
|
catch (err) {
|
|
28
29
|
const e = err;
|
|
@@ -30,7 +31,7 @@ class TasksReplay extends base_command_1.BaseCommand {
|
|
|
30
31
|
// Distinguish "task has no runs yet" from "task ID doesn't exist" —
|
|
31
32
|
// the server's generic 404 doesn't, but this surface lets a user
|
|
32
33
|
// running `skrr tasks replay <fresh-task>` know what to do next.
|
|
33
|
-
this.error(`No execution runs found for task ${
|
|
34
|
+
this.error(`No execution runs found for task ${taskRef}. Start the task first with \`${this.config.bin} tasks start ${taskRef}\`.`, { exit: 4 });
|
|
34
35
|
}
|
|
35
36
|
this.handleApiError(err);
|
|
36
37
|
}
|
|
@@ -75,6 +75,7 @@ class TasksReport extends base_command_1.BaseCommand {
|
|
|
75
75
|
details: { suggestion: failure.suggestion, context: failure.details },
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
+
const taskRef = await this.resolveEntityRef('task', task.id);
|
|
78
79
|
let report;
|
|
79
80
|
try {
|
|
80
81
|
report = (0, task_report_1.buildTaskReport)({
|
|
@@ -19,9 +19,10 @@ class TasksResumeSchedule extends base_command_1.BaseCommand {
|
|
|
19
19
|
async run() {
|
|
20
20
|
this.requireAuth();
|
|
21
21
|
const { args, flags } = await this.parse(TasksResumeSchedule);
|
|
22
|
+
const taskRef = await this.resolveEntityRef('task', args.id);
|
|
22
23
|
let result;
|
|
23
24
|
try {
|
|
24
|
-
result = await data_provider_1.dataService.resumeSchedule(
|
|
25
|
+
result = await data_provider_1.dataService.resumeSchedule(taskRef);
|
|
25
26
|
}
|
|
26
27
|
catch (err) {
|
|
27
28
|
this.handleApiError(err);
|
|
@@ -32,7 +33,7 @@ class TasksResumeSchedule extends base_command_1.BaseCommand {
|
|
|
32
33
|
}
|
|
33
34
|
const t = result;
|
|
34
35
|
const ref = t.identifier ?? (t.taskNumber ? `#${t.taskNumber}` : '');
|
|
35
|
-
this.log(`Resumed schedule on task ${t.id ?? t._id ??
|
|
36
|
+
this.log(`Resumed schedule on task ${t.id ?? t._id ?? taskRef}${ref ? ` (${ref})` : ''}`);
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
exports.default = TasksResumeSchedule;
|
|
@@ -22,10 +22,11 @@ class TasksRetrySchedule extends base_command_1.BaseCommand {
|
|
|
22
22
|
async run() {
|
|
23
23
|
this.requireAuth();
|
|
24
24
|
const { args, flags } = await this.parse(TasksRetrySchedule);
|
|
25
|
+
const taskRef = await this.resolveEntityRef('task', args.id);
|
|
25
26
|
let result;
|
|
26
27
|
try {
|
|
27
28
|
result = await data_provider_1.dataService.retryScheduledTask({
|
|
28
|
-
taskId:
|
|
29
|
+
taskId: taskRef,
|
|
29
30
|
scheduledFor: flags.at,
|
|
30
31
|
});
|
|
31
32
|
}
|
|
@@ -39,7 +40,7 @@ class TasksRetrySchedule extends base_command_1.BaseCommand {
|
|
|
39
40
|
const t = result;
|
|
40
41
|
const ref = t.identifier ?? (t.taskNumber ? `#${t.taskNumber}` : '');
|
|
41
42
|
const when = flags.at ?? t.scheduledFor ?? '(server default)';
|
|
42
|
-
this.log(`Re-armed schedule for task ${t.id ?? t._id ??
|
|
43
|
+
this.log(`Re-armed schedule for task ${t.id ?? t._id ?? taskRef}${ref ? ` (${ref})` : ''} → ${when}`);
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
exports.default = TasksRetrySchedule;
|
|
@@ -68,41 +68,42 @@ class TasksRetry extends base_command_1.BaseCommand {
|
|
|
68
68
|
details: { suggestion: failure.suggestion, context: failure.details },
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
+
const taskRef = await this.resolveEntityRef('task', taskIdentity.id);
|
|
71
72
|
// Step 1 — clear the terminal state. `todo` rather than `backlog`: the task
|
|
72
73
|
// was already triaged into the working set once, and a retry is not a
|
|
73
74
|
// decision to deprioritise it.
|
|
74
75
|
try {
|
|
75
76
|
await data_provider_1.dataService.moveTask({
|
|
76
|
-
taskId:
|
|
77
|
+
taskId: taskRef,
|
|
77
78
|
status: 'todo',
|
|
78
79
|
});
|
|
79
80
|
}
|
|
80
81
|
catch (err) {
|
|
81
|
-
this.handleApiError(err, { subject: `Task ${
|
|
82
|
+
this.handleApiError(err, { subject: `Task ${taskRef}` });
|
|
82
83
|
}
|
|
83
84
|
if (flags['no-start']) {
|
|
84
85
|
if (flags.json) {
|
|
85
|
-
this.log(JSON.stringify({ taskId:
|
|
86
|
+
this.log(JSON.stringify({ taskId: taskRef, status: 'todo', started: false }));
|
|
86
87
|
return;
|
|
87
88
|
}
|
|
88
|
-
this.log(`Cleared failed state on ${
|
|
89
|
-
this.log(`Start it with: skrr tasks start ${
|
|
89
|
+
this.log(`Cleared failed state on ${taskRef} — now todo, not started.`);
|
|
90
|
+
this.log(`Start it with: skrr tasks start ${taskRef}`);
|
|
90
91
|
return;
|
|
91
92
|
}
|
|
92
93
|
let result;
|
|
93
94
|
try {
|
|
94
|
-
result = await data_provider_1.dataService.startTask(
|
|
95
|
+
result = await data_provider_1.dataService.startTask(taskRef, flags.skill ? { skillId: flags.skill } : undefined);
|
|
95
96
|
}
|
|
96
97
|
catch (err) {
|
|
97
98
|
this.handleApiError(err, {
|
|
98
|
-
subject: `Task ${
|
|
99
|
+
subject: `Task ${taskRef} (failed state was cleared — it is now 'todo')`,
|
|
99
100
|
});
|
|
100
101
|
}
|
|
101
102
|
if (flags.json) {
|
|
102
|
-
this.log(JSON.stringify({ ...result, taskId:
|
|
103
|
+
this.log(JSON.stringify({ ...result, taskId: taskRef, status: 'todo', started: true }, null, 2));
|
|
103
104
|
return;
|
|
104
105
|
}
|
|
105
|
-
this.log(`Retried task ${
|
|
106
|
+
this.log(`Retried task ${taskRef}`);
|
|
106
107
|
this.log(`Conversation: ${result.conversationId}`);
|
|
107
108
|
this.log(`Session: ${result.sessionId}`);
|
|
108
109
|
}
|
|
@@ -19,9 +19,10 @@ class TasksRevisions extends base_command_1.BaseCommand {
|
|
|
19
19
|
async run() {
|
|
20
20
|
this.requireAuth();
|
|
21
21
|
const { args, flags } = await this.parse(TasksRevisions);
|
|
22
|
+
const taskRef = await this.resolveEntityRef('task', args.id);
|
|
22
23
|
let result;
|
|
23
24
|
try {
|
|
24
|
-
result = await data_provider_1.dataService.getTaskRevisions(
|
|
25
|
+
result = await data_provider_1.dataService.getTaskRevisions(taskRef);
|
|
25
26
|
}
|
|
26
27
|
catch (err) {
|
|
27
28
|
this.handleApiError(err);
|
|
@@ -157,9 +157,10 @@ class TasksRuns extends base_command_1.BaseCommand {
|
|
|
157
157
|
async run() {
|
|
158
158
|
this.requireAuth();
|
|
159
159
|
const { args, flags } = await this.parse(TasksRuns);
|
|
160
|
+
const taskRef = await this.resolveEntityRef('task', args.id);
|
|
160
161
|
let response;
|
|
161
162
|
try {
|
|
162
|
-
response = await data_provider_1.dataService.getTaskRuns(
|
|
163
|
+
response = await data_provider_1.dataService.getTaskRuns(taskRef);
|
|
163
164
|
}
|
|
164
165
|
catch (err) {
|
|
165
166
|
this.handleApiError(err);
|
|
@@ -178,8 +179,8 @@ class TasksRuns extends base_command_1.BaseCommand {
|
|
|
178
179
|
// scripted caller still learns where the message actually lives.
|
|
179
180
|
if (unexplained) {
|
|
180
181
|
this.warn('A failed run here carries `errors` but no `failureReason` — this server predates that ' +
|
|
181
|
-
`field. Read it from \`${this.config.bin} tasks show ${
|
|
182
|
-
`\`${this.config.bin} tasks activity ${
|
|
182
|
+
`field. Read it from \`${this.config.bin} tasks show ${taskRef} --json\` (executionError) or ` +
|
|
183
|
+
`\`${this.config.bin} tasks activity ${taskRef} --json\` (details.error, keyed by runId).`);
|
|
183
184
|
}
|
|
184
185
|
this.log(JSON.stringify(response, null, 2));
|
|
185
186
|
return;
|
|
@@ -217,7 +218,7 @@ class TasksRuns extends base_command_1.BaseCommand {
|
|
|
217
218
|
return;
|
|
218
219
|
let failures = new Map();
|
|
219
220
|
try {
|
|
220
|
-
const activity = (await data_provider_1.dataService.getTaskActivity(
|
|
221
|
+
const activity = (await data_provider_1.dataService.getTaskActivity(taskRef, 200));
|
|
221
222
|
failures = (0, activity_1.runFailuresFromActivity)(activity?.data);
|
|
222
223
|
}
|
|
223
224
|
catch {
|
|
@@ -226,7 +227,7 @@ class TasksRuns extends base_command_1.BaseCommand {
|
|
|
226
227
|
// block below then says "no reason recorded", which is true of what we
|
|
227
228
|
// can see.
|
|
228
229
|
}
|
|
229
|
-
for (const line of renderRunFailures(items, failures, this.config.bin,
|
|
230
|
+
for (const line of renderRunFailures(items, failures, this.config.bin, taskRef)) {
|
|
230
231
|
this.log(line);
|
|
231
232
|
}
|
|
232
233
|
}
|
|
@@ -42,6 +42,7 @@ class TasksSchedule extends base_command_1.BaseCommand {
|
|
|
42
42
|
async run() {
|
|
43
43
|
this.requireAuth();
|
|
44
44
|
const { args, flags } = await this.parse(TasksSchedule);
|
|
45
|
+
const taskRef = await this.resolveEntityRef('task', args.id);
|
|
45
46
|
let body = {};
|
|
46
47
|
try {
|
|
47
48
|
body = await (0, prompt_1.readJsonBody)(flags['from-json']);
|
|
@@ -67,7 +68,7 @@ class TasksSchedule extends base_command_1.BaseCommand {
|
|
|
67
68
|
let result;
|
|
68
69
|
try {
|
|
69
70
|
result = await data_provider_1.dataService.scheduleTask({
|
|
70
|
-
taskId:
|
|
71
|
+
taskId: taskRef,
|
|
71
72
|
data: payload,
|
|
72
73
|
});
|
|
73
74
|
}
|
|
@@ -80,7 +81,7 @@ class TasksSchedule extends base_command_1.BaseCommand {
|
|
|
80
81
|
}
|
|
81
82
|
const t = result;
|
|
82
83
|
const ref = t.identifier ?? (t.taskNumber ? `#${t.taskNumber}` : '');
|
|
83
|
-
this.log(`Scheduled task ${t.id ?? t._id ??
|
|
84
|
+
this.log(`Scheduled task ${t.id ?? t._id ?? taskRef}${ref ? ` (${ref})` : ''} for ${payload.scheduledFor}`);
|
|
84
85
|
if (t.recurrence?.pattern) {
|
|
85
86
|
const tz = t.recurrence.timezone ? ` (${t.recurrence.timezone})` : '';
|
|
86
87
|
this.log(`Recurrence: ${t.recurrence.pattern}${tz}`);
|