@skrr-ai/cli 0.1.22 → 0.1.24
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/README.md +83 -73
- package/bin/dev-fallback.js +221 -0
- package/bin/run.js +96 -0
- package/dist/base-command.d.ts +15 -0
- package/dist/base-command.js +145 -11
- package/dist/commands/agents/attach-harness.d.ts +37 -0
- package/dist/commands/agents/attach-harness.js +102 -3
- package/dist/commands/agents/chat.d.ts +69 -1
- package/dist/commands/agents/chat.js +202 -22
- package/dist/commands/agents/create.d.ts +38 -0
- package/dist/commands/agents/create.js +95 -2
- package/dist/commands/agents/schedule-trace.js +11 -0
- package/dist/commands/agents/show.js +29 -1
- package/dist/commands/api-keys/create.d.ts +24 -0
- package/dist/commands/api-keys/create.js +80 -0
- package/dist/commands/api-keys/list.d.ts +11 -0
- package/dist/commands/api-keys/list.js +42 -0
- package/dist/commands/api-keys/revoke.d.ts +14 -0
- package/dist/commands/api-keys/revoke.js +33 -0
- package/dist/commands/api-keys/rotate.d.ts +19 -0
- package/dist/commands/api-keys/rotate.js +42 -0
- package/dist/commands/balance/index.d.ts +18 -0
- package/dist/commands/balance/index.js +29 -0
- package/dist/commands/balance/show.d.ts +25 -0
- package/dist/commands/balance/show.js +60 -0
- package/dist/commands/balance/statement.d.ts +19 -0
- package/dist/commands/balance/statement.js +52 -0
- package/dist/commands/browser/doctor.d.ts +11 -0
- package/dist/commands/browser/doctor.js +11 -0
- package/dist/commands/code/jobs/approve.d.ts +25 -0
- package/dist/commands/code/jobs/approve.js +52 -0
- package/dist/commands/code/jobs/cancel.d.ts +12 -0
- package/dist/commands/code/jobs/cancel.js +39 -0
- package/dist/commands/code/jobs/index.d.ts +19 -0
- package/dist/commands/code/jobs/index.js +38 -0
- package/dist/commands/code/jobs/list.d.ts +12 -0
- package/dist/commands/code/jobs/list.js +87 -0
- package/dist/commands/code/jobs/run.d.ts +32 -0
- package/dist/commands/code/jobs/run.js +151 -0
- package/dist/commands/code/jobs/show.d.ts +12 -0
- package/dist/commands/code/jobs/show.js +86 -0
- package/dist/commands/commitments/preflight.js +18 -4
- package/dist/commands/commitments/receipt-metrics.d.ts +39 -0
- package/dist/commands/commitments/receipt-metrics.js +78 -0
- package/dist/commands/convos/search.js +5 -5
- package/dist/commands/harnesses/leases/list.d.ts +3 -0
- package/dist/commands/harnesses/leases/list.js +59 -12
- package/dist/commands/harnesses/leases/show.js +36 -0
- package/dist/commands/harnesses/list.d.ts +18 -0
- package/dist/commands/harnesses/list.js +30 -0
- package/dist/commands/harnesses/products.js +49 -3
- package/dist/commands/harnesses/quota.d.ts +16 -0
- package/dist/commands/harnesses/quota.js +26 -1
- package/dist/commands/harnesses/usage.js +17 -0
- package/dist/commands/inbox/index.d.ts +2 -1
- package/dist/commands/inbox/index.js +27 -4
- package/dist/commands/login.js +4 -1
- package/dist/commands/machines/dedicated/create.d.ts +18 -0
- package/dist/commands/machines/dedicated/create.js +90 -0
- package/dist/commands/machines/dedicated/destroy.d.ts +14 -0
- package/dist/commands/machines/dedicated/destroy.js +56 -0
- package/dist/commands/machines/dedicated/grow.d.ts +13 -0
- package/dist/commands/machines/dedicated/grow.js +46 -0
- package/dist/commands/machines/dedicated/health-check.d.ts +12 -0
- package/dist/commands/machines/dedicated/health-check.js +42 -0
- package/dist/commands/machines/dedicated/incident-close.d.ts +12 -0
- package/dist/commands/machines/dedicated/incident-close.js +42 -0
- package/dist/commands/machines/dedicated/index.d.ts +6 -0
- package/dist/commands/machines/dedicated/index.js +39 -0
- package/dist/commands/machines/dedicated/list.d.ts +11 -0
- package/dist/commands/machines/dedicated/list.js +58 -0
- package/dist/commands/machines/dedicated/restart.d.ts +12 -0
- package/dist/commands/machines/dedicated/restart.js +42 -0
- package/dist/commands/machines/dedicated/show.d.ts +12 -0
- package/dist/commands/machines/dedicated/show.js +58 -0
- package/dist/commands/machines/dedicated/snapshot.d.ts +12 -0
- package/dist/commands/machines/dedicated/snapshot.js +42 -0
- package/dist/commands/machines/dedicated/start.d.ts +12 -0
- package/dist/commands/machines/dedicated/start.js +42 -0
- package/dist/commands/machines/dedicated/stop.d.ts +12 -0
- package/dist/commands/machines/dedicated/stop.js +42 -0
- package/dist/commands/machines/hosted/index.js +4 -1
- package/dist/commands/machines/list.d.ts +1 -0
- package/dist/commands/machines/list.js +33 -5
- package/dist/commands/memory/approvals/issue.d.ts +18 -0
- package/dist/commands/memory/approvals/issue.js +63 -0
- package/dist/commands/memory/commit.js +5 -2
- package/dist/commands/memory/context.d.ts +3 -2
- package/dist/commands/memory/context.js +9 -11
- package/dist/commands/memory/delete.d.ts +1 -1
- package/dist/commands/memory/list.d.ts +1 -1
- package/dist/commands/memory/list.js +1 -1
- package/dist/commands/memory/mounts/resolve.d.ts +10 -0
- package/dist/commands/memory/mounts/resolve.js +27 -0
- package/dist/commands/memory/proposals/commit.d.ts +18 -0
- package/dist/commands/memory/proposals/commit.js +32 -0
- package/dist/commands/memory/proposals/create.d.ts +18 -0
- package/dist/commands/memory/proposals/create.js +56 -0
- package/dist/commands/memory/proposals/list.d.ts +13 -0
- package/dist/commands/memory/proposals/list.js +31 -0
- package/dist/commands/memory/proposals/promote.d.ts +22 -0
- package/dist/commands/memory/proposals/promote.js +33 -0
- package/dist/commands/memory/proposals/reject.d.ts +16 -0
- package/dist/commands/memory/proposals/reject.js +28 -0
- package/dist/commands/memory/rebuild-index.d.ts +20 -0
- package/dist/commands/memory/rebuild-index.js +25 -0
- package/dist/commands/memory/save.d.ts +1 -1
- package/dist/commands/memory/save.js +1 -1
- package/dist/commands/memory/search.d.ts +6 -3
- package/dist/commands/memory/search.js +27 -3
- package/dist/commands/memory/show.d.ts +1 -1
- package/dist/commands/memory/stores/archive.d.ts +14 -0
- package/dist/commands/memory/stores/archive.js +31 -0
- package/dist/commands/memory/stores/create.d.ts +12 -0
- package/dist/commands/memory/stores/create.js +30 -0
- package/dist/commands/memory/stores/delete.d.ts +15 -0
- package/dist/commands/memory/stores/delete.js +38 -0
- package/dist/commands/memory/stores/list.d.ts +10 -0
- package/dist/commands/memory/stores/list.js +29 -0
- package/dist/commands/memory/stores/show.d.ts +12 -0
- package/dist/commands/memory/stores/show.js +14 -0
- package/dist/commands/memory/stores/update.d.ts +15 -0
- package/dist/commands/memory/stores/update.js +39 -0
- package/dist/commands/memory/sync/delete.d.ts +13 -0
- package/dist/commands/memory/sync/delete.js +35 -0
- package/dist/commands/memory/sync/pull.d.ts +19 -0
- package/dist/commands/memory/sync/pull.js +52 -0
- package/dist/commands/memory/sync/push.d.ts +18 -0
- package/dist/commands/memory/sync/push.js +115 -0
- package/dist/commands/memory/sync/resolve.d.ts +23 -0
- package/dist/commands/memory/sync/resolve.js +27 -0
- package/dist/commands/memory/sync/status.d.ts +9 -0
- package/dist/commands/memory/sync/status.js +22 -0
- package/dist/commands/memory/topics/archive.d.ts +20 -0
- package/dist/commands/memory/topics/archive.js +29 -0
- package/dist/commands/memory/topics/create.d.ts +23 -0
- package/dist/commands/memory/topics/create.js +46 -0
- package/dist/commands/memory/topics/delete.d.ts +22 -0
- package/dist/commands/memory/topics/delete.js +30 -0
- package/dist/commands/memory/topics/forget.d.ts +22 -0
- package/dist/commands/memory/topics/forget.js +29 -0
- package/dist/commands/memory/topics/list.d.ts +13 -0
- package/dist/commands/memory/topics/list.js +22 -0
- package/dist/commands/memory/topics/move.d.ts +22 -0
- package/dist/commands/memory/topics/move.js +26 -0
- package/dist/commands/memory/topics/show.d.ts +17 -0
- package/dist/commands/memory/topics/show.js +21 -0
- package/dist/commands/memory/topics/update.d.ts +23 -0
- package/dist/commands/memory/topics/update.js +27 -0
- package/dist/commands/memory/tree.d.ts +5 -2
- package/dist/commands/memory/tree.js +20 -2
- package/dist/commands/memory/update.d.ts +1 -1
- package/dist/commands/memory/versions/list.d.ts +16 -0
- package/dist/commands/memory/versions/list.js +22 -0
- package/dist/commands/memory/versions/redact.d.ts +21 -0
- package/dist/commands/memory/versions/redact.js +22 -0
- package/dist/commands/memory/versions/restore.d.ts +20 -0
- package/dist/commands/memory/versions/restore.js +16 -0
- package/dist/commands/memory/versions/show.d.ts +15 -0
- package/dist/commands/memory/versions/show.js +17 -0
- package/dist/commands/messages/list.js +25 -8
- package/dist/commands/messages/show.js +10 -0
- package/dist/commands/spaces/update.js +16 -12
- package/dist/commands/spaces/work-sync/reconcile.d.ts +38 -0
- package/dist/commands/spaces/work-sync/reconcile.js +90 -0
- package/dist/commands/spaces/work-sync/telemetry.d.ts +29 -0
- package/dist/commands/spaces/work-sync/telemetry.js +96 -0
- package/dist/commands/store/install.js +5 -1
- package/dist/commands/store/releases.js +1 -1
- package/dist/commands/store/update.js +5 -1
- package/dist/commands/subscriptions/cancel.js +5 -1
- package/dist/commands/subscriptions/health.js +5 -1
- package/dist/commands/subscriptions/status.js +5 -1
- package/dist/commands/subscriptions/subscribe.js +5 -1
- package/dist/commands/tasks/activity.d.ts +2 -3
- package/dist/commands/tasks/activity.js +20 -6
- package/dist/commands/tasks/complete.d.ts +22 -150
- package/dist/commands/tasks/complete.js +174 -599
- package/dist/commands/tasks/create.d.ts +6 -0
- package/dist/commands/tasks/create.js +114 -4
- package/dist/commands/tasks/deliverable/add.d.ts +8 -0
- package/dist/commands/tasks/deliverable/add.js +62 -11
- package/dist/commands/tasks/deliverable/confirm.d.ts +5 -5
- package/dist/commands/tasks/deliverable/confirm.js +9 -18
- package/dist/commands/tasks/deliverable/list.d.ts +12 -0
- package/dist/commands/tasks/deliverable/list.js +58 -0
- package/dist/commands/tasks/events/append.d.ts +2 -0
- package/dist/commands/tasks/events/append.js +41 -6
- package/dist/commands/tasks/events/list.d.ts +1 -0
- package/dist/commands/tasks/events/list.js +1 -0
- package/dist/commands/tasks/events/tail.d.ts +1 -0
- package/dist/commands/tasks/events/tail.js +1 -0
- package/dist/commands/tasks/expectations/assess.d.ts +21 -0
- package/dist/commands/tasks/expectations/assess.js +103 -0
- package/dist/commands/tasks/expectations.js +121 -25
- package/dist/commands/tasks/judge.d.ts +1 -0
- package/dist/commands/tasks/judge.js +2 -1
- package/dist/commands/tasks/output.d.ts +1 -11
- package/dist/commands/tasks/output.js +80 -141
- package/dist/commands/tasks/report.d.ts +3 -3
- package/dist/commands/tasks/report.js +66 -41
- package/dist/commands/tasks/resource/add.d.ts +23 -0
- package/dist/commands/tasks/resource/add.js +76 -0
- package/dist/commands/tasks/resource/list.d.ts +13 -0
- package/dist/commands/tasks/resource/list.js +41 -0
- package/dist/commands/tasks/result/show.d.ts +13 -0
- package/dist/commands/tasks/result/show.js +64 -0
- package/dist/commands/tasks/result/submit.d.ts +26 -0
- package/dist/commands/tasks/result/submit.js +134 -0
- package/dist/commands/tasks/resume/save.d.ts +16 -0
- package/dist/commands/tasks/resume/save.js +69 -0
- package/dist/commands/tasks/resume/show.d.ts +13 -0
- package/dist/commands/tasks/resume/show.js +35 -0
- package/dist/commands/tasks/review.d.ts +17 -0
- package/dist/commands/tasks/review.js +54 -0
- package/dist/commands/tasks/runs.js +5 -0
- package/dist/commands/tasks/self-schedule.js +7 -4
- package/dist/commands/tasks/show.js +19 -0
- package/dist/commands/tasks/timeline.d.ts +2 -2
- package/dist/commands/tasks/timeline.js +19 -24
- package/dist/commands/tasks/updates/add.d.ts +22 -0
- package/dist/commands/tasks/updates/add.js +122 -0
- package/dist/commands/tasks/updates/list.d.ts +15 -0
- package/dist/commands/tasks/updates/list.js +57 -0
- package/dist/commands/tasks/waive.d.ts +1 -0
- package/dist/commands/tasks/waive.js +2 -1
- package/dist/lib/agentic-stream.d.ts +257 -0
- package/dist/lib/agentic-stream.js +490 -33
- package/dist/lib/balance.d.ts +8 -0
- package/dist/lib/commitment-product.d.ts +10 -1
- package/dist/lib/commitment-product.js +66 -2
- package/dist/lib/commitments.d.ts +2 -1
- package/dist/lib/commitments.js +1 -0
- package/dist/lib/conversation-search.d.ts +3 -0
- package/dist/lib/conversation-search.js +75 -0
- package/dist/lib/dedicated-machines.d.ts +66 -0
- package/dist/lib/dedicated-machines.js +161 -0
- package/dist/lib/execution-target.d.ts +21 -0
- package/dist/lib/execution-target.js +22 -6
- package/dist/lib/harnesses.d.ts +87 -6
- package/dist/lib/harnesses.js +32 -1
- package/dist/lib/hosted-machines.js +9 -0
- package/dist/lib/inbox.d.ts +2 -1
- package/dist/lib/machines.d.ts +17 -0
- package/dist/lib/machines.js +29 -0
- package/dist/lib/managed-agent-keys.d.ts +104 -0
- package/dist/lib/managed-agent-keys.js +50 -0
- package/dist/lib/memory-scope.d.ts +4 -3
- package/dist/lib/memory-scope.js +9 -9
- package/dist/lib/memory-sync.d.ts +114 -0
- package/dist/lib/memory-sync.js +730 -0
- package/dist/lib/message-provenance.d.ts +42 -0
- package/dist/lib/message-provenance.js +89 -0
- package/dist/lib/scoped-memory-command.d.ts +68 -0
- package/dist/lib/scoped-memory-command.js +183 -0
- package/dist/lib/session-task-endpoints.d.ts +1 -1
- package/dist/lib/session-task-endpoints.js +7 -0
- package/dist/lib/sky-code-broker.d.ts +47 -0
- package/dist/lib/sky-code-broker.js +50 -0
- package/dist/lib/sky-code-doctor.js +10 -1
- package/dist/lib/task-artifact-flags.d.ts +2 -0
- package/dist/lib/task-artifact-flags.js +7 -0
- package/dist/lib/task-execution.d.ts +4 -5
- package/dist/lib/task-execution.js +4 -5
- package/dist/lib/task-extras.d.ts +1 -5
- package/dist/lib/task-extras.js +1 -5
- package/dist/lib/task-legacy.d.ts +24 -0
- package/dist/lib/task-legacy.js +48 -0
- package/dist/lib/task-transcript.d.ts +5 -7
- package/dist/lib/task-transcript.js +8 -16
- package/dist/lib/tasks.d.ts +39 -21
- package/dist/lib/tasks.js +64 -21
- package/dist/lib/triggers.d.ts +39 -1
- package/dist/lib/triggers.js +70 -2
- package/dist/lib/usage-discovery.d.ts +17 -1
- package/dist/lib/usage-discovery.js +17 -1
- package/dist/lib/work-sync.d.ts +70 -0
- package/dist/lib/work-sync.js +29 -0
- package/dist/node_modules/@skrr-ai/data-provider/index.js +3760 -3621
- package/oclif.manifest.json +14653 -7813
- package/package.json +26 -5
|
@@ -6,200 +6,139 @@ const base_command_1 = require("../../base-command");
|
|
|
6
6
|
const task_resolver_1 = require("../../lib/task-resolver");
|
|
7
7
|
const web_url_1 = require("../../lib/web-url");
|
|
8
8
|
const task_transcript_1 = require("../../lib/task-transcript");
|
|
9
|
+
/** Compatibility command name. The authoritative object is Result, not output. */
|
|
9
10
|
/**
|
|
10
|
-
* "
|
|
11
|
+
* "awaiting review" is only true while a review can still be recorded.
|
|
11
12
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* piped into `messages list` for the agent's actual words. This command joins
|
|
16
|
-
* them and states plainly when a piece is missing.
|
|
13
|
+
* A closed Task refuses one outright (`TASK_REOPEN_REQUIRED`), so printing
|
|
14
|
+
* "awaiting" described a state that could never be left — and the reader has no
|
|
15
|
+
* way to tell that from a review that is genuinely pending.
|
|
17
16
|
*/
|
|
17
|
+
function reviewLine(review, task) {
|
|
18
|
+
if (review?.decision)
|
|
19
|
+
return review.decision;
|
|
20
|
+
const terminal = ['completed', 'cancelled'].includes(String(task?.statusType ?? ''));
|
|
21
|
+
return terminal ? 'none recorded — the Task is closed' : 'awaiting review';
|
|
22
|
+
}
|
|
18
23
|
class TasksOutput extends base_command_1.BaseCommand {
|
|
19
|
-
static
|
|
20
|
-
static
|
|
21
|
-
'<%= config.bin %> tasks output <task-id>',
|
|
22
|
-
'<%= config.bin %> tasks output',
|
|
23
|
-
'<%= config.bin %> tasks output <task-id> --json',
|
|
24
|
-
'<%= config.bin %> tasks output <task-id> --full',
|
|
25
|
-
];
|
|
24
|
+
static hidden = true;
|
|
25
|
+
static description = 'Show the current Result, Review, Deliverables, and final Run reply';
|
|
26
26
|
static args = {
|
|
27
27
|
id: core_1.Args.string({
|
|
28
|
-
description: 'Task ID; defaults to
|
|
28
|
+
description: 'Task ID; defaults to the task runtime context',
|
|
29
29
|
required: false,
|
|
30
30
|
ignoreStdin: true,
|
|
31
31
|
}),
|
|
32
32
|
};
|
|
33
33
|
static flags = {
|
|
34
|
-
json: core_1.Flags.boolean({ description: 'Output
|
|
35
|
-
task: core_1.Flags.string({ description: 'Task ID; overrides
|
|
36
|
-
full: core_1.Flags.boolean({
|
|
37
|
-
description: "Print the agent's final message in full instead of a 40-line preview",
|
|
38
|
-
default: false,
|
|
39
|
-
}),
|
|
34
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
35
|
+
task: core_1.Flags.string({ description: 'Task ID; overrides runtime context' }),
|
|
36
|
+
full: core_1.Flags.boolean({ description: 'Print the final Run message in full', default: false }),
|
|
40
37
|
};
|
|
41
38
|
async run() {
|
|
42
39
|
this.requireAuth();
|
|
43
40
|
const { args, flags } = await this.parse(TasksOutput);
|
|
44
|
-
let
|
|
41
|
+
let identity;
|
|
45
42
|
try {
|
|
46
|
-
|
|
43
|
+
identity = (0, task_resolver_1.resolveTaskIdentity)({ positionalId: args.id, flagTask: flags.task });
|
|
47
44
|
}
|
|
48
|
-
catch (
|
|
49
|
-
const failure = (0, task_resolver_1.taskResolutionFailure)(
|
|
45
|
+
catch (error) {
|
|
46
|
+
const failure = (0, task_resolver_1.taskResolutionFailure)(error);
|
|
50
47
|
this.failWithCliError({
|
|
51
48
|
message: failure.message,
|
|
52
49
|
code: failure.code,
|
|
53
50
|
exit: 2,
|
|
54
51
|
retryable: false,
|
|
55
|
-
details: { suggestion: failure.suggestion
|
|
52
|
+
details: { suggestion: failure.suggestion },
|
|
56
53
|
});
|
|
57
54
|
}
|
|
58
55
|
let task;
|
|
59
56
|
try {
|
|
60
|
-
task = (await data_provider_1.dataService.getTask(
|
|
57
|
+
task = (await data_provider_1.dataService.getTask(identity.id, { enrich: false }));
|
|
61
58
|
}
|
|
62
|
-
catch (
|
|
63
|
-
this.handleApiError(
|
|
59
|
+
catch (error) {
|
|
60
|
+
this.handleApiError(error);
|
|
64
61
|
}
|
|
65
62
|
const conversationId = task.conversationId ? String(task.conversationId) : null;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
63
|
+
const [resultBundle, resources, updates, latestRun, messages] = await Promise.all([
|
|
64
|
+
data_provider_1.dataService.listTaskResults(identity.id).catch(() => ({
|
|
65
|
+
currentResultId: null,
|
|
66
|
+
currentSpecVersion: 1,
|
|
67
|
+
results: [],
|
|
68
|
+
reviews: [],
|
|
69
|
+
})),
|
|
70
|
+
data_provider_1.dataService.listTaskResources(identity.id).catch(() => ({ data: [] })),
|
|
71
|
+
data_provider_1.dataService.listTaskUpdates(identity.id, { limit: 10 }).catch(() => ({
|
|
72
|
+
data: [],
|
|
73
|
+
nextCursor: null,
|
|
74
|
+
})),
|
|
75
|
+
(0, task_transcript_1.fetchLatestRun)(identity.id).catch(() => null),
|
|
72
76
|
conversationId
|
|
73
77
|
? (0, task_transcript_1.fetchTranscript)(conversationId).catch(() => [])
|
|
74
78
|
: Promise.resolve([]),
|
|
75
|
-
data_provider_1.dataService.listTaskWorkEvents(taskIdentity.id, { limit: 50 }).catch(() => ({ data: [] })),
|
|
76
79
|
]);
|
|
80
|
+
const result = resultBundle.results.find((item) => item.id === resultBundle.currentResultId) || null;
|
|
81
|
+
const review = result
|
|
82
|
+
? resultBundle.reviews.find((item) => item.resultId === result.id) || null
|
|
83
|
+
: null;
|
|
77
84
|
const finalMessage = (0, task_transcript_1.lastAssistantMessage)(messages);
|
|
78
|
-
const
|
|
79
|
-
const latestReport = latestReportEvent ? (0, data_provider_1.taskReportFromWorkEvent)(latestReportEvent) : null;
|
|
85
|
+
const url = (0, web_url_1.taskUrlFrom)(this.cliConfig.baseURL, task);
|
|
80
86
|
if (flags.json) {
|
|
81
87
|
this.log(JSON.stringify({
|
|
82
|
-
object: '
|
|
83
|
-
task: {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
assigneeAgentIds: task.assigneeAgentIds ?? [],
|
|
89
|
-
conversationId,
|
|
90
|
-
url: (0, web_url_1.taskUrlFrom)(this.cliConfig.baseURL, task),
|
|
91
|
-
},
|
|
88
|
+
object: 'skrr.task_result',
|
|
89
|
+
task: { ...task, url },
|
|
90
|
+
result,
|
|
91
|
+
review,
|
|
92
|
+
deliverables: resources.data.filter((item) => item.role === 'deliverable'),
|
|
93
|
+
recentUpdates: updates.data,
|
|
92
94
|
latestRun,
|
|
93
|
-
taskReport: latestReport
|
|
94
|
-
? { report: latestReport, occurredAt: latestReportEvent?.occurredAt }
|
|
95
|
-
: null,
|
|
96
|
-
taskOutput: outputComment,
|
|
97
|
-
// Present in JSON as well, so a script can detect a task closed
|
|
98
|
-
// more than once without diffing comment bodies.
|
|
99
|
-
completionCount: outputComment ? outputComment.supersededCount + 1 : 0,
|
|
100
95
|
finalMessage,
|
|
101
|
-
messageCount: messages.length,
|
|
102
96
|
}, null, 2));
|
|
103
97
|
return;
|
|
104
98
|
}
|
|
105
|
-
this.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
latestRun,
|
|
109
|
-
latestReport,
|
|
110
|
-
latestReportAt: latestReportEvent?.occurredAt ? String(latestReportEvent.occurredAt) : null,
|
|
111
|
-
outputComment,
|
|
112
|
-
finalMessage,
|
|
113
|
-
full: flags.full,
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
renderHuman({ task, conversationId, latestRun, latestReport, latestReportAt, outputComment, finalMessage, full, }) {
|
|
117
|
-
const ref = String(task.identifier ?? task.id ?? '-');
|
|
118
|
-
const agents = Array.isArray(task.assigneeAgentIds) ? task.assigneeAgentIds : [];
|
|
119
|
-
this.log(`Task: ${ref} — ${task.title ?? '-'}`);
|
|
120
|
-
this.log(`Status: ${task.status ?? '-'}`);
|
|
121
|
-
this.log(`Agent: ${agents.length > 0 ? agents.join(', ') : '-'}`);
|
|
122
|
-
this.log(`Last run: ${latestRun
|
|
123
|
-
? `${latestRun.status} (${(0, task_transcript_1.formatTime)(latestRun.startedAt)}${latestRun.durationMs != null ? `, ${latestRun.durationMs}ms` : ''})`
|
|
124
|
-
: 'never executed'}`);
|
|
99
|
+
this.log(`Task: ${task.identifier ?? task.id} — ${task.title ?? '-'}`);
|
|
100
|
+
this.log(`Status: ${task.status ?? '-'}`);
|
|
101
|
+
this.log(`Run: ${latestRun ? `${latestRun.status} · ${(0, task_transcript_1.formatTime)(latestRun.startedAt)}` : 'none'}`);
|
|
125
102
|
this.log('');
|
|
126
|
-
if (
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
// invisible.
|
|
132
|
-
const reportAt = latestReportAt ? ` · ${(0, task_transcript_1.formatTime)(latestReportAt)}` : '';
|
|
133
|
-
this.log(`Outcome (task report${reportAt}):`);
|
|
134
|
-
this.log(` ${latestReport.outcome}`);
|
|
135
|
-
this.log(' findings:');
|
|
136
|
-
for (const finding of latestReport.findings)
|
|
137
|
-
this.log(` - ${finding}`);
|
|
138
|
-
if (latestReport.evidence.length > 0) {
|
|
139
|
-
this.log(' evidence:');
|
|
140
|
-
for (const evidence of latestReport.evidence)
|
|
141
|
-
this.log(` - ${evidence}`);
|
|
142
|
-
}
|
|
143
|
-
if (latestReport.nextActions.length > 0) {
|
|
144
|
-
this.log(' next actions:');
|
|
145
|
-
for (const next of latestReport.nextActions)
|
|
146
|
-
this.log(` - ${next}`);
|
|
103
|
+
if (result) {
|
|
104
|
+
this.log(`Result v${result.version} · ${(0, task_transcript_1.formatTime)(result.submittedAt)}`);
|
|
105
|
+
this.log(` ${result.summary}`);
|
|
106
|
+
if (result.conclusion) {
|
|
107
|
+
this.log(` conclusion (${result.conclusion.type}): ${JSON.stringify(result.conclusion.value)}`);
|
|
147
108
|
}
|
|
148
|
-
this.log(
|
|
109
|
+
this.log(`Review: ${reviewLine(review, task)}`);
|
|
110
|
+
if (review?.rationale)
|
|
111
|
+
this.log(` ${review.rationale}`);
|
|
149
112
|
}
|
|
150
|
-
if (
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
this.log(
|
|
155
|
-
this.log(`
|
|
156
|
-
if (parsed.summary) {
|
|
157
|
-
this.log(' summary:');
|
|
158
|
-
for (const line of parsed.summary.split('\n'))
|
|
159
|
-
this.log(` ${line}`);
|
|
160
|
-
}
|
|
161
|
-
// The field parser is single-line per field (see task-transcript.ts). If the
|
|
162
|
-
// block carried anything else, say so rather than presenting a partial verdict.
|
|
163
|
-
if (outputComment.unattributed.length > 0) {
|
|
164
|
-
this.log(` (+${outputComment.unattributed.length} unparsed block line(s) — see \`skrr tasks comments list\`)`);
|
|
165
|
-
}
|
|
166
|
-
// Reconcile the three signals a parked run shows — `completed`,
|
|
167
|
-
// `UNVERIFIED`, and `Last run: failed` — which otherwise read as a
|
|
168
|
-
// contradiction. (OSK-4945)
|
|
169
|
-
if (outputComment.supersededCount > 0) {
|
|
170
|
-
// `tasks complete` succeeds on an already-done task and posts another
|
|
171
|
-
// block, so the canonical-looking screen can be assembled from several
|
|
172
|
-
// closeouts. Say so rather than presenting it as one record.
|
|
173
|
-
const total = outputComment.supersededCount + 1;
|
|
174
|
-
const earlier = outputComment.supersededCount === 1 ? 'block' : 'blocks';
|
|
175
|
-
this.log(` note: completed ${total} times — ${outputComment.supersededCount} earlier TASK_OUTPUT ${earlier} exist.`);
|
|
176
|
-
this.log(' The Outcome above may come from a different completion than this');
|
|
177
|
-
this.log(' Verdict. `skrr tasks comments list` shows every one.');
|
|
178
|
-
}
|
|
179
|
-
const note = (0, task_transcript_1.unverifiedOutcomeNote)(parsed.verdict);
|
|
180
|
-
if (note)
|
|
181
|
-
this.log(` note: ${note}`);
|
|
113
|
+
else if (task.specVersion === undefined) {
|
|
114
|
+
// A Task predating the canonical model has no TaskResult row and never
|
|
115
|
+
// will. "none submitted" reads as "the work was never reported", which
|
|
116
|
+
// for a completed legacy Task is the opposite of the truth.
|
|
117
|
+
this.log('Result: not recorded under the canonical model (this Task predates it)');
|
|
118
|
+
this.log(' its closeout is in `skrr tasks comments list` / `tasks transcript`');
|
|
182
119
|
}
|
|
183
120
|
else {
|
|
184
|
-
this.log('
|
|
121
|
+
this.log('Result: none submitted');
|
|
185
122
|
}
|
|
123
|
+
const deliverables = resources.data.filter((item) => item.role === 'deliverable');
|
|
186
124
|
this.log('');
|
|
125
|
+
this.log(`Deliverables: ${deliverables.length}`);
|
|
126
|
+
for (const item of deliverables) {
|
|
127
|
+
this.log(` ${item.title || item.identity || item.kind} · ${item.location || 'no locator'} · ${item.status}/${item.evidenceLevel}`);
|
|
128
|
+
}
|
|
187
129
|
if (finalMessage) {
|
|
188
130
|
const lines = (finalMessage.text || '(empty message)').split('\n');
|
|
189
|
-
const preview = full ? lines : lines.slice(0, 40);
|
|
190
|
-
this.log(
|
|
131
|
+
const preview = flags.full ? lines : lines.slice(0, 40);
|
|
132
|
+
this.log('');
|
|
133
|
+
this.log(`Final Run reply (${(0, task_transcript_1.formatTime)(finalMessage.createdAt)}):`);
|
|
191
134
|
for (const line of preview)
|
|
192
135
|
this.log(` ${line}`);
|
|
193
|
-
if (preview.length < lines.length)
|
|
194
|
-
this.log(
|
|
195
|
-
this.log(` … ${lines.length - preview.length} more line(s). Use --full, or \`skrr tasks transcript ${task.id ?? ref}\`.`);
|
|
196
|
-
}
|
|
136
|
+
if (preview.length < lines.length)
|
|
137
|
+
this.log(` … ${lines.length - preview.length} more line(s)`);
|
|
197
138
|
}
|
|
198
|
-
|
|
199
|
-
this.log('
|
|
200
|
-
|
|
201
|
-
else {
|
|
202
|
-
this.log('Final agent message: task has no execution conversation yet.');
|
|
139
|
+
if (url) {
|
|
140
|
+
this.log('');
|
|
141
|
+
this.log(`Task: ${url}#task-result`);
|
|
203
142
|
}
|
|
204
143
|
}
|
|
205
144
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { BaseCommand } from '../../base-command';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* It deliberately does not finish the task: reports can be checkpoints,
|
|
5
|
-
* proposals, or the handoff immediately before `tasks complete`.
|
|
3
|
+
* Compatibility spelling for submitting a versioned Task Result.
|
|
6
4
|
*/
|
|
7
5
|
export default class TasksReport extends BaseCommand {
|
|
6
|
+
static hidden: boolean;
|
|
8
7
|
static description: string;
|
|
9
8
|
static examples: string[];
|
|
10
9
|
static args: {
|
|
@@ -19,6 +18,7 @@ export default class TasksReport extends BaseCommand {
|
|
|
19
18
|
evidence: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
19
|
next: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
21
20
|
deliverable: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
21
|
+
artifact: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
22
22
|
};
|
|
23
23
|
run(): Promise<void>;
|
|
24
24
|
}
|
|
@@ -3,23 +3,23 @@ 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 api_fetch_1 = require("../../lib/api-fetch");
|
|
7
6
|
const outbox_1 = require("../../lib/outbox");
|
|
8
7
|
const task_report_1 = require("../../lib/task-report");
|
|
9
8
|
const task_resolver_1 = require("../../lib/task-resolver");
|
|
10
9
|
const tasks_1 = require("../../lib/tasks");
|
|
11
|
-
const
|
|
10
|
+
const task_artifact_flags_1 = require("../../lib/task-artifact-flags");
|
|
12
11
|
const web_url_1 = require("../../lib/web-url");
|
|
13
12
|
/**
|
|
14
|
-
*
|
|
15
|
-
* It deliberately does not finish the task: reports can be checkpoints,
|
|
16
|
-
* proposals, or the handoff immediately before `tasks complete`.
|
|
13
|
+
* Compatibility spelling for submitting a versioned Task Result.
|
|
17
14
|
*/
|
|
18
15
|
class TasksReport extends base_command_1.BaseCommand {
|
|
19
|
-
static
|
|
16
|
+
static hidden = true;
|
|
17
|
+
static description = 'DEPRECATED compatibility spelling for `tasks result submit`. Every call submits a ' +
|
|
18
|
+
'versioned Result; `--kind` is ignored. Use `tasks result submit` (submit only) or ' +
|
|
19
|
+
'`tasks complete` (submit and close).';
|
|
20
20
|
static examples = [
|
|
21
|
-
'<%= config.bin %> tasks report <task-id> --outcome "Adopt the event ledger" --finding "The task page omits work-event details" --evidence "Task detail reads only legacy activity" --next "Add
|
|
22
|
-
'<%= config.bin %> tasks report <task-id> --kind handoff --outcome "Ready for review" --finding "All
|
|
21
|
+
'<%= config.bin %> tasks report <task-id> --outcome "Adopt the event ledger" --finding "The task page omits work-event details" --evidence "Task detail reads only legacy activity" --next "Add a Result section"',
|
|
22
|
+
'<%= config.bin %> tasks report <task-id> --kind handoff --outcome "Ready for review" --finding "All expectations are met" --deliverable "file:src/task.ts" --json',
|
|
23
23
|
];
|
|
24
24
|
static args = {
|
|
25
25
|
id: core_1.Args.string({
|
|
@@ -32,7 +32,7 @@ class TasksReport extends base_command_1.BaseCommand {
|
|
|
32
32
|
task: core_1.Flags.string({ description: 'Task ID; overrides daemon runtime context' }),
|
|
33
33
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
34
34
|
kind: core_1.Flags.string({
|
|
35
|
-
description: '
|
|
35
|
+
description: 'Deprecated compatibility option; every report is now a Result submission',
|
|
36
36
|
options: ['decision', 'handoff'],
|
|
37
37
|
default: 'decision',
|
|
38
38
|
}),
|
|
@@ -53,6 +53,10 @@ class TasksReport extends base_command_1.BaseCommand {
|
|
|
53
53
|
description: 'Durable file, commit, PR, or URL (repeatable)',
|
|
54
54
|
multiple: true,
|
|
55
55
|
}),
|
|
56
|
+
artifact: core_1.Flags.string({
|
|
57
|
+
description: 'Compatibility alias for --deliverable used by older managed instruction blocks',
|
|
58
|
+
multiple: true,
|
|
59
|
+
}),
|
|
56
60
|
};
|
|
57
61
|
async run() {
|
|
58
62
|
this.requireAuth();
|
|
@@ -88,56 +92,77 @@ class TasksReport extends base_command_1.BaseCommand {
|
|
|
88
92
|
retryable: false,
|
|
89
93
|
});
|
|
90
94
|
}
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
kind,
|
|
95
|
-
...(0, task_report_1.taskReportEventFields)(report),
|
|
96
|
-
artifacts: flags.deliverable?.map((ref) => ({ label: 'deliverable', ref })),
|
|
97
|
-
};
|
|
98
|
-
// THE SAME BRIDGE `tasks complete` CARRIES, for the same reason.
|
|
99
|
-
//
|
|
100
|
-
// `--deliverable` here is prose for a work event's `artifacts` list, and
|
|
101
|
-
// the ledger the completion gate reads is written by `tasks deliverable
|
|
102
|
-
// add`. Three commands in this CLI answer to the word and only one of them
|
|
103
|
-
// writes the ledger — and the project's own operating instructions teach
|
|
104
|
-
// this spelling. So a value that is unambiguously a coordinate is forwarded
|
|
105
|
-
// to the ledger too; prose is left exactly as it was, because guessing a
|
|
106
|
-
// coordinate out of prose fills the ledger with rows nobody can look up.
|
|
107
|
-
for (const ref of flags.deliverable ?? []) {
|
|
95
|
+
const deliverables = (0, task_artifact_flags_1.mergeTaskArtifactFlags)(flags.deliverable, flags.artifact);
|
|
96
|
+
const resourceLinkIds = [];
|
|
97
|
+
for (const ref of deliverables) {
|
|
108
98
|
const parsed = (0, tasks_1.parseDeliverableCoordinate)(ref);
|
|
109
99
|
if (!parsed.ok) {
|
|
100
|
+
this.failWithCliError({
|
|
101
|
+
message: parsed.error,
|
|
102
|
+
code: 'INVALID_DELIVERABLE_COORDINATE',
|
|
103
|
+
exit: 1,
|
|
104
|
+
retryable: false,
|
|
105
|
+
details: { deliverable: ref },
|
|
106
|
+
});
|
|
110
107
|
continue;
|
|
111
108
|
}
|
|
112
109
|
try {
|
|
113
|
-
await data_provider_1.dataService.addTaskDeliverable(task.id,
|
|
110
|
+
const recorded = await data_provider_1.dataService.addTaskDeliverable(task.id, {
|
|
111
|
+
...parsed.value,
|
|
112
|
+
idempotencyKey: (0, outbox_1.idempotencyKeyFor)('task-deliverable', task.id, ref),
|
|
113
|
+
});
|
|
114
|
+
resourceLinkIds.push(recorded.link.id);
|
|
114
115
|
}
|
|
115
|
-
catch {
|
|
116
|
-
|
|
117
|
-
// fails, and the completion gate's refusal names the command that
|
|
118
|
-
// writes it.
|
|
116
|
+
catch (error) {
|
|
117
|
+
this.handleApiError(error);
|
|
119
118
|
}
|
|
120
119
|
}
|
|
121
|
-
const
|
|
120
|
+
const payload = {
|
|
121
|
+
summary: report.outcome,
|
|
122
|
+
body: [
|
|
123
|
+
report.findings.length
|
|
124
|
+
? `Findings\n${report.findings.map((item) => `- ${item}`).join('\n')}`
|
|
125
|
+
: '',
|
|
126
|
+
report.evidence.length
|
|
127
|
+
? `Evidence\n${report.evidence.map((item) => `- ${item}`).join('\n')}`
|
|
128
|
+
: '',
|
|
129
|
+
report.nextActions.length
|
|
130
|
+
? `Next\n${report.nextActions.map((item) => `- ${item}`).join('\n')}`
|
|
131
|
+
: '',
|
|
132
|
+
]
|
|
133
|
+
.filter(Boolean)
|
|
134
|
+
.join('\n\n'),
|
|
135
|
+
structuredContent: {
|
|
136
|
+
schema: 'skrr.task-report/v1',
|
|
137
|
+
value: {
|
|
138
|
+
findings: report.findings,
|
|
139
|
+
evidence: report.evidence,
|
|
140
|
+
nextActions: report.nextActions,
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
resourceLinkIds,
|
|
144
|
+
remainingWork: [],
|
|
145
|
+
};
|
|
122
146
|
let result;
|
|
123
147
|
try {
|
|
124
|
-
result =
|
|
125
|
-
|
|
126
|
-
:
|
|
148
|
+
result = await data_provider_1.dataService.submitTaskResult({
|
|
149
|
+
taskId: task.id,
|
|
150
|
+
data: {
|
|
151
|
+
...payload,
|
|
152
|
+
idempotencyKey: (0, outbox_1.idempotencyKeyFor)('task-result', task.id, JSON.stringify(payload)),
|
|
153
|
+
},
|
|
154
|
+
});
|
|
127
155
|
}
|
|
128
156
|
catch (error) {
|
|
129
157
|
this.handleApiError(error);
|
|
130
158
|
}
|
|
131
|
-
if (sessionPath && result && typeof result === 'object' && 'entry' in result) {
|
|
132
|
-
result = result.entry;
|
|
133
|
-
}
|
|
134
159
|
const taskUrl = (0, web_url_1.taskUrlFrom)(this.cliConfig.baseURL, { id: task.id });
|
|
135
|
-
const url = taskUrl ? `${taskUrl}#task-
|
|
160
|
+
const url = taskUrl ? `${taskUrl}#task-result` : null;
|
|
136
161
|
if (flags.json) {
|
|
137
|
-
this.log(JSON.stringify({
|
|
162
|
+
this.log(JSON.stringify({ ...result, url }, null, 2));
|
|
138
163
|
return;
|
|
139
164
|
}
|
|
140
|
-
this.log(`
|
|
165
|
+
this.log(`Submitted Result v${result.result.version} on task ${task.id}.${url ? ` ${url}` : ''}`);
|
|
141
166
|
}
|
|
142
167
|
}
|
|
143
168
|
exports.default = TasksReport;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class TasksResourceAdd extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
task: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
role: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
+
coordinate: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
9
|
+
};
|
|
10
|
+
static flags: {
|
|
11
|
+
status: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
title: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
provider: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
version: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
'content-digest': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
|
+
expectation: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
|
+
'result-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
18
|
+
'run-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
19
|
+
'idempotency-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
21
|
+
};
|
|
22
|
+
run(): Promise<void>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
const outbox_1 = require("../../../lib/outbox");
|
|
7
|
+
const tasks_1 = require("../../../lib/tasks");
|
|
8
|
+
const RESOURCE_ROLES = ['input', 'reference', 'evidence', 'attachment', 'deliverable'];
|
|
9
|
+
class TasksResourceAdd extends base_command_1.BaseCommand {
|
|
10
|
+
static description = 'Link an exact input, reference, evidence item, attachment, or deliverable to a task';
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> tasks resource add <task-id> input file/pdf:brief@Drive/Briefs',
|
|
13
|
+
'<%= config.bin %> tasks resource add <task-id> evidence code:a1b2c3d@origin/main --provider github',
|
|
14
|
+
];
|
|
15
|
+
static args = {
|
|
16
|
+
task: core_1.Args.string({ description: 'Task id or ref', required: true, ignoreStdin: true }),
|
|
17
|
+
role: core_1.Args.string({
|
|
18
|
+
description: 'How the resource relates to this task',
|
|
19
|
+
required: true,
|
|
20
|
+
options: [...RESOURCE_ROLES],
|
|
21
|
+
ignoreStdin: true,
|
|
22
|
+
}),
|
|
23
|
+
coordinate: core_1.Args.string({
|
|
24
|
+
description: '<kind>[/<format>]:<identity>[@<location>]',
|
|
25
|
+
required: true,
|
|
26
|
+
ignoreStdin: true,
|
|
27
|
+
}),
|
|
28
|
+
};
|
|
29
|
+
static flags = {
|
|
30
|
+
status: core_1.Flags.string({
|
|
31
|
+
options: ['unknown', 'local', 'in_review', 'available', 'unavailable', 'superseded'],
|
|
32
|
+
description: 'Observed availability. Evidence strength is recorded separately.',
|
|
33
|
+
}),
|
|
34
|
+
title: core_1.Flags.string({ description: 'Human-readable Resource name' }),
|
|
35
|
+
provider: core_1.Flags.string({ description: 'Provider, such as github or drive' }),
|
|
36
|
+
version: core_1.Flags.string({ description: 'Exact provider version, such as a full commit SHA' }),
|
|
37
|
+
'content-digest': core_1.Flags.string({ description: 'Integrity digest for this exact version' }),
|
|
38
|
+
expectation: core_1.Flags.string({ multiple: true, description: 'Expectation id this supports' }),
|
|
39
|
+
'result-id': core_1.Flags.string({ description: 'Result version this Resource supports' }),
|
|
40
|
+
'run-id': core_1.Flags.string({ description: 'Run that produced or observed it' }),
|
|
41
|
+
'idempotency-key': core_1.Flags.string({ description: 'Stable retry key' }),
|
|
42
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
43
|
+
};
|
|
44
|
+
async run() {
|
|
45
|
+
this.requireAuth();
|
|
46
|
+
const { args, flags } = await this.parse(TasksResourceAdd);
|
|
47
|
+
const parsed = (0, tasks_1.parseDeliverableCoordinate)(args.coordinate);
|
|
48
|
+
if (!parsed.ok)
|
|
49
|
+
this.error(parsed.error, { exit: 1 });
|
|
50
|
+
const payload = {
|
|
51
|
+
...parsed.value,
|
|
52
|
+
role: args.role,
|
|
53
|
+
status: flags.status,
|
|
54
|
+
title: flags.title,
|
|
55
|
+
provider: flags.provider,
|
|
56
|
+
version: flags.version,
|
|
57
|
+
contentDigest: flags['content-digest'],
|
|
58
|
+
expectationIds: flags.expectation,
|
|
59
|
+
resultId: flags['result-id'],
|
|
60
|
+
runId: flags['run-id'],
|
|
61
|
+
idempotencyKey: flags['idempotency-key'] ||
|
|
62
|
+
(0, outbox_1.idempotencyKeyFor)('task-resource', args.task, JSON.stringify({ role: args.role, coordinate: parsed.value, status: flags.status })),
|
|
63
|
+
};
|
|
64
|
+
let result;
|
|
65
|
+
try {
|
|
66
|
+
result = await data_provider_1.dataService.recordTaskResource(args.task, payload);
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
this.handleApiError(error);
|
|
70
|
+
}
|
|
71
|
+
if (flags.json)
|
|
72
|
+
return this.log(JSON.stringify(result, null, 2));
|
|
73
|
+
this.log(`Linked ${args.role} Resource ${result.link.id}: ${parsed.value.kind}:${parsed.value.identity}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.default = TasksResourceAdd;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class TasksResourceList extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
task: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static flags: {
|
|
8
|
+
task: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
role: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
const task_resolver_1 = require("../../../lib/task-resolver");
|
|
7
|
+
const RESOURCE_ROLES = ['input', 'reference', 'evidence', 'attachment', 'deliverable'];
|
|
8
|
+
class TasksResourceList extends base_command_1.BaseCommand {
|
|
9
|
+
static description = 'List the exact Resources linked to a task, including their role and evidence state';
|
|
10
|
+
static args = {
|
|
11
|
+
task: core_1.Args.string({ required: false, ignoreStdin: true, description: 'Task id or ref' }),
|
|
12
|
+
};
|
|
13
|
+
static flags = {
|
|
14
|
+
task: core_1.Flags.string({ description: 'Task id; overrides runtime context' }),
|
|
15
|
+
role: core_1.Flags.string({ options: [...RESOURCE_ROLES], description: 'Only show one Task role' }),
|
|
16
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
17
|
+
};
|
|
18
|
+
async run() {
|
|
19
|
+
this.requireAuth();
|
|
20
|
+
const { args, flags } = await this.parse(TasksResourceList);
|
|
21
|
+
const task = (0, task_resolver_1.resolveTaskIdentity)({ positionalId: args.task, flagTask: flags.task });
|
|
22
|
+
let result;
|
|
23
|
+
try {
|
|
24
|
+
result = await data_provider_1.dataService.listTaskResources(task.id, {
|
|
25
|
+
role: flags.role,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
this.handleApiError(error);
|
|
30
|
+
}
|
|
31
|
+
if (flags.json)
|
|
32
|
+
return this.log(JSON.stringify(result, null, 2));
|
|
33
|
+
if (!result.data.length)
|
|
34
|
+
return this.log('No Resources linked.');
|
|
35
|
+
for (const item of result.data) {
|
|
36
|
+
this.log(`${item.linkId} · ${item.role} · ${item.title || item.identity || item.kind}\n` +
|
|
37
|
+
` ${item.location || 'no locator'} · ${item.versionFidelity} · ${item.status} · ${item.evidenceLevel}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.default = TasksResourceList;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class TasksResultShow extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
task: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static flags: {
|
|
8
|
+
task: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
history: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|