@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
|
@@ -0,0 +1,64 @@
|
|
|
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 task_legacy_1 = require("../../../lib/task-legacy");
|
|
8
|
+
class TasksResultShow extends base_command_1.BaseCommand {
|
|
9
|
+
static description = 'Show the current Task Result and its exact Review';
|
|
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
|
+
history: core_1.Flags.boolean({ description: 'Include superseded Result versions' }),
|
|
16
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
17
|
+
};
|
|
18
|
+
async run() {
|
|
19
|
+
this.requireAuth();
|
|
20
|
+
const { args, flags } = await this.parse(TasksResultShow);
|
|
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.listTaskResults(task.id, { includeSuperseded: flags.history });
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
this.handleApiError(error);
|
|
28
|
+
}
|
|
29
|
+
if (flags.json)
|
|
30
|
+
return this.log(JSON.stringify(result, null, 2));
|
|
31
|
+
const current = result.results.find((row) => row.id === result.currentResultId);
|
|
32
|
+
if (!current)
|
|
33
|
+
return this.log(await (0, task_legacy_1.emptyCanonicalView)(task.id, 'Result'));
|
|
34
|
+
const review = result.reviews.find((row) => row.resultId === current.id);
|
|
35
|
+
this.log(`Result v${current.version}\n${current.summary}`);
|
|
36
|
+
if (current.conclusion)
|
|
37
|
+
this.log(`Conclusion (${current.conclusion.type}): ${JSON.stringify(current.conclusion.value)}`);
|
|
38
|
+
// Only "awaiting" while a review can still be recorded. A closed Task
|
|
39
|
+
// refuses one outright (`TASK_REOPEN_REQUIRED`), so the old wording named a
|
|
40
|
+
// state nothing could ever leave — and a reader could not tell it from a
|
|
41
|
+
// review that is genuinely pending. The extra read happens only on the
|
|
42
|
+
// no-review path, where the distinction is the whole point.
|
|
43
|
+
let reviewLine = 'awaiting review';
|
|
44
|
+
if (review) {
|
|
45
|
+
reviewLine = review.decision;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
const full = (await data_provider_1.dataService
|
|
49
|
+
.getTask(task.id, { enrich: false })
|
|
50
|
+
.catch(() => undefined));
|
|
51
|
+
if (['completed', 'cancelled'].includes(String(full?.statusType ?? ''))) {
|
|
52
|
+
reviewLine = 'none recorded — the Task is closed';
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
this.log(`Review: ${reviewLine}`);
|
|
56
|
+
if (flags.history && result.results.length > 1) {
|
|
57
|
+
this.log(`Superseded versions: ${result.results
|
|
58
|
+
.slice(1)
|
|
59
|
+
.map((row) => `v${row.version}`)
|
|
60
|
+
.join(', ')}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.default = TasksResultShow;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class TasksResultSubmit extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
task: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
task: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
summary: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
body: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
'conclusion-type': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
'conclusion-json': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
'structured-schema': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
'structured-json': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
|
+
deliverable: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
|
+
evidence: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
18
|
+
remaining: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
19
|
+
'run-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
|
+
'source-run': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
21
|
+
'spec-version': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
22
|
+
'idempotency-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
23
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
24
|
+
};
|
|
25
|
+
run(): Promise<void>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
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 task_resolver_1 = require("../../../lib/task-resolver");
|
|
8
|
+
const web_url_1 = require("../../../lib/web-url");
|
|
9
|
+
const api_fetch_1 = require("../../../lib/api-fetch");
|
|
10
|
+
const session_task_endpoints_1 = require("../../../lib/session-task-endpoints");
|
|
11
|
+
function parseJson(value, label) {
|
|
12
|
+
if (!value)
|
|
13
|
+
return undefined;
|
|
14
|
+
try {
|
|
15
|
+
return JSON.parse(value);
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
throw new Error(`${label} must be valid JSON`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
class TasksResultSubmit extends base_command_1.BaseCommand {
|
|
22
|
+
static description = 'Submit the Task Result; this does not self-accept it or turn a domain conclusion into a Review';
|
|
23
|
+
static examples = [
|
|
24
|
+
'<%= config.bin %> tasks result submit <task> --summary "NO-SHIP until Gates A-D pass" --conclusion-type release_recommendation --conclusion-json \'{"posture":"no_ship"}\'',
|
|
25
|
+
];
|
|
26
|
+
static args = {
|
|
27
|
+
task: core_1.Args.string({ required: false, ignoreStdin: true, description: 'Task id or ref' }),
|
|
28
|
+
};
|
|
29
|
+
static flags = {
|
|
30
|
+
task: core_1.Flags.string({ description: 'Task id; overrides runtime context' }),
|
|
31
|
+
summary: core_1.Flags.string({ required: true, description: 'The answer in one readable paragraph' }),
|
|
32
|
+
body: core_1.Flags.string({ description: 'Long-form Result body' }),
|
|
33
|
+
'conclusion-type': core_1.Flags.string({ description: 'Domain conclusion type' }),
|
|
34
|
+
'conclusion-json': core_1.Flags.string({ description: 'JSON value for the domain conclusion' }),
|
|
35
|
+
'structured-schema': core_1.Flags.string({ description: 'Schema name for --structured-json' }),
|
|
36
|
+
'structured-json': core_1.Flags.string({ description: 'Task-type-specific structured Result JSON' }),
|
|
37
|
+
deliverable: core_1.Flags.string({
|
|
38
|
+
multiple: true,
|
|
39
|
+
description: 'Task Resource link id (repeatable)',
|
|
40
|
+
}),
|
|
41
|
+
evidence: core_1.Flags.string({
|
|
42
|
+
multiple: true,
|
|
43
|
+
description: 'Evidence reference as <kind>:<id-or-uri>',
|
|
44
|
+
}),
|
|
45
|
+
remaining: core_1.Flags.string({ multiple: true, description: 'Remaining work item (repeatable)' }),
|
|
46
|
+
'run-id': core_1.Flags.string({ description: 'Canonical Task Run that produced this Result' }),
|
|
47
|
+
'source-run': core_1.Flags.string({ multiple: true, description: 'Contributing Run id (repeatable)' }),
|
|
48
|
+
'spec-version': core_1.Flags.integer({
|
|
49
|
+
description: 'Task specification version this Result answers',
|
|
50
|
+
}),
|
|
51
|
+
'idempotency-key': core_1.Flags.string({ description: 'Stable retry key for this exact Result' }),
|
|
52
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
53
|
+
};
|
|
54
|
+
async run() {
|
|
55
|
+
this.requireAuth();
|
|
56
|
+
const { args, flags } = await this.parse(TasksResultSubmit);
|
|
57
|
+
const task = (0, task_resolver_1.resolveTaskIdentity)({ positionalId: args.task, flagTask: flags.task });
|
|
58
|
+
if (Boolean(flags['conclusion-type']) !== Boolean(flags['conclusion-json'])) {
|
|
59
|
+
this.error('--conclusion-type and --conclusion-json must be supplied together', { exit: 1 });
|
|
60
|
+
}
|
|
61
|
+
if (Boolean(flags['structured-schema']) !== Boolean(flags['structured-json'])) {
|
|
62
|
+
this.error('--structured-schema and --structured-json must be supplied together', {
|
|
63
|
+
exit: 1,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
let conclusionValue;
|
|
67
|
+
let structuredValue;
|
|
68
|
+
try {
|
|
69
|
+
conclusionValue = parseJson(flags['conclusion-json'], '--conclusion-json');
|
|
70
|
+
structuredValue = parseJson(flags['structured-json'], '--structured-json');
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
this.error(error.message, { exit: 1 });
|
|
74
|
+
}
|
|
75
|
+
if (structuredValue &&
|
|
76
|
+
(typeof structuredValue !== 'object' || Array.isArray(structuredValue))) {
|
|
77
|
+
this.error('--structured-json must contain a JSON object', { exit: 1 });
|
|
78
|
+
}
|
|
79
|
+
const evidenceRefs = (flags.evidence || []).map((raw) => {
|
|
80
|
+
const split = raw.indexOf(':');
|
|
81
|
+
if (split < 1)
|
|
82
|
+
this.error('--evidence must be <kind>:<id-or-uri>', { exit: 1 });
|
|
83
|
+
const kind = raw.slice(0, split);
|
|
84
|
+
const value = raw.slice(split + 1);
|
|
85
|
+
return /^https?:|^file:/.test(value) ? { kind, uri: value } : { kind, id: value };
|
|
86
|
+
});
|
|
87
|
+
const payload = {
|
|
88
|
+
summary: flags.summary,
|
|
89
|
+
body: flags.body,
|
|
90
|
+
expectedSpecVersion: flags['spec-version'],
|
|
91
|
+
runId: flags['run-id'],
|
|
92
|
+
sourceRunIds: flags['source-run'],
|
|
93
|
+
resourceLinkIds: flags.deliverable,
|
|
94
|
+
evidenceRefs,
|
|
95
|
+
remainingWork: (flags.remaining || []).map((summary) => ({ summary })),
|
|
96
|
+
...(flags['conclusion-type']
|
|
97
|
+
? { conclusion: { type: flags['conclusion-type'], value: conclusionValue } }
|
|
98
|
+
: {}),
|
|
99
|
+
...(flags['structured-schema']
|
|
100
|
+
? {
|
|
101
|
+
structuredContent: {
|
|
102
|
+
schema: flags['structured-schema'],
|
|
103
|
+
value: structuredValue,
|
|
104
|
+
},
|
|
105
|
+
}
|
|
106
|
+
: {}),
|
|
107
|
+
};
|
|
108
|
+
let result;
|
|
109
|
+
try {
|
|
110
|
+
const data = {
|
|
111
|
+
...payload,
|
|
112
|
+
idempotencyKey: flags['idempotency-key'] ||
|
|
113
|
+
(0, outbox_1.idempotencyKeyFor)('task-result', task.id, JSON.stringify(payload)),
|
|
114
|
+
};
|
|
115
|
+
const sessionPath = await (0, session_task_endpoints_1.sessionScopedTaskPath)('result');
|
|
116
|
+
result = sessionPath
|
|
117
|
+
? await (0, api_fetch_1.apiFetch)(sessionPath, {
|
|
118
|
+
method: 'POST',
|
|
119
|
+
body: data,
|
|
120
|
+
})
|
|
121
|
+
: await data_provider_1.dataService.submitTaskResult({ taskId: task.id, data });
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
this.handleApiError(error);
|
|
125
|
+
}
|
|
126
|
+
const url = (0, web_url_1.taskUrlFrom)(this.cliConfig.baseURL, { id: task.id });
|
|
127
|
+
if (flags.json)
|
|
128
|
+
return this.log(JSON.stringify({ ...result, url }, null, 2));
|
|
129
|
+
this.log(`Submitted Result v${result.result.version} for ${task.id}; it is ready for review.`);
|
|
130
|
+
if (url)
|
|
131
|
+
this.log(`Task: ${url}`);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.default = TasksResultSubmit;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class TasksResumeSave 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
|
+
'run-id': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
snapshot: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
'spec-version': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
'idempotency-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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 task_resolver_1 = require("../../../lib/task-resolver");
|
|
8
|
+
const api_fetch_1 = require("../../../lib/api-fetch");
|
|
9
|
+
const session_task_endpoints_1 = require("../../../lib/session-task-endpoints");
|
|
10
|
+
class TasksResumeSave extends base_command_1.BaseCommand {
|
|
11
|
+
static description = 'Save recovery state without publishing a visible Task Update';
|
|
12
|
+
static args = {
|
|
13
|
+
task: core_1.Args.string({ required: false, ignoreStdin: true, description: 'Task id or ref' }),
|
|
14
|
+
};
|
|
15
|
+
static flags = {
|
|
16
|
+
task: core_1.Flags.string({ description: 'Task id; overrides runtime context' }),
|
|
17
|
+
'run-id': core_1.Flags.string({ required: true, description: 'Canonical Task Run' }),
|
|
18
|
+
snapshot: core_1.Flags.string({
|
|
19
|
+
required: true,
|
|
20
|
+
description: 'Resume Point JSON snapshot. ' +
|
|
21
|
+
'Every field is optional. `completed`, `nextActions` and `currentFocus` accept either a ' +
|
|
22
|
+
'plain sentence or {summary,sourceRefs} — the object form is canonical and a bare string ' +
|
|
23
|
+
'is lifted into it, so the same sentence you put in an Update’s nextActions works here ' +
|
|
24
|
+
'unchanged. Shape: {completed:[], currentFocus, nextActions:[], ' +
|
|
25
|
+
'openQuestions:[{question,sourceRef?}], relevantUpdateIds:[], evidenceRefs:[], ' +
|
|
26
|
+
'deliverableRefs:[], childHeads:[{runId,resumePointId,status}], workspaceStateRef}. ' +
|
|
27
|
+
'Never put a credential, token or lease in a snapshot — the server refuses one.',
|
|
28
|
+
}),
|
|
29
|
+
'spec-version': core_1.Flags.integer({ description: 'Task specification version' }),
|
|
30
|
+
'idempotency-key': core_1.Flags.string({ description: 'Stable retry key' }),
|
|
31
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
32
|
+
};
|
|
33
|
+
async run() {
|
|
34
|
+
this.requireAuth();
|
|
35
|
+
const { args, flags } = await this.parse(TasksResumeSave);
|
|
36
|
+
const task = (0, task_resolver_1.resolveTaskIdentity)({ positionalId: args.task, flagTask: flags.task });
|
|
37
|
+
let resume;
|
|
38
|
+
try {
|
|
39
|
+
resume = JSON.parse(flags.snapshot);
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
this.error('--snapshot must be a JSON object', { exit: 1 });
|
|
43
|
+
}
|
|
44
|
+
let result;
|
|
45
|
+
try {
|
|
46
|
+
const payload = {
|
|
47
|
+
runId: flags['run-id'],
|
|
48
|
+
expectedSpecVersion: flags['spec-version'],
|
|
49
|
+
resume: resume,
|
|
50
|
+
idempotencyKey: flags['idempotency-key'] ||
|
|
51
|
+
(0, outbox_1.idempotencyKeyFor)('task-resume', task.id, JSON.stringify(resume)),
|
|
52
|
+
};
|
|
53
|
+
const sessionPath = await (0, session_task_endpoints_1.sessionScopedTaskPath)('resume');
|
|
54
|
+
result = sessionPath
|
|
55
|
+
? await (0, api_fetch_1.apiFetch)(sessionPath, {
|
|
56
|
+
method: 'POST',
|
|
57
|
+
body: payload,
|
|
58
|
+
})
|
|
59
|
+
: await data_provider_1.dataService.saveTaskResumePoint({ taskId: task.id, data: payload });
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
this.handleApiError(error);
|
|
63
|
+
}
|
|
64
|
+
if (flags.json)
|
|
65
|
+
return this.log(JSON.stringify(result, null, 2));
|
|
66
|
+
this.log(`Saved Resume Point ${result.resumePoint.id} for Run ${flags['run-id']}.`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.default = TasksResumeSave;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class TasksResumeShow 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
|
+
'run-id': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 api_fetch_1 = require("../../../lib/api-fetch");
|
|
8
|
+
const session_task_endpoints_1 = require("../../../lib/session-task-endpoints");
|
|
9
|
+
class TasksResumeShow extends base_command_1.BaseCommand {
|
|
10
|
+
static description = 'Build the bounded context needed to resume one Task Run';
|
|
11
|
+
static args = {
|
|
12
|
+
task: core_1.Args.string({ required: false, ignoreStdin: true, description: 'Task id or ref' }),
|
|
13
|
+
};
|
|
14
|
+
static flags = {
|
|
15
|
+
task: core_1.Flags.string({ description: 'Task id; overrides runtime context' }),
|
|
16
|
+
'run-id': core_1.Flags.string({ required: true, description: 'Canonical Task Run' }),
|
|
17
|
+
json: core_1.Flags.boolean({ default: true, description: 'Output the Resume Context as JSON' }),
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
this.requireAuth();
|
|
21
|
+
const { args, flags } = await this.parse(TasksResumeShow);
|
|
22
|
+
const task = (0, task_resolver_1.resolveTaskIdentity)({ positionalId: args.task, flagTask: flags.task });
|
|
23
|
+
try {
|
|
24
|
+
const sessionPath = await (0, session_task_endpoints_1.sessionScopedTaskPath)('resumeRead');
|
|
25
|
+
const result = sessionPath
|
|
26
|
+
? await (0, api_fetch_1.apiFetch)(sessionPath, { method: 'GET' })
|
|
27
|
+
: await data_provider_1.dataService.getTaskResumeContext(task.id, flags['run-id']);
|
|
28
|
+
this.log(JSON.stringify(result, null, 2));
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
this.handleApiError(error);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.default = TasksResumeShow;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
export default class TasksReview 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
|
+
'result-id': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
decision: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
rationale: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
'run-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
'idempotency-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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 task_resolver_1 = require("../../lib/task-resolver");
|
|
8
|
+
const api_fetch_1 = require("../../lib/api-fetch");
|
|
9
|
+
const session_task_endpoints_1 = require("../../lib/session-task-endpoints");
|
|
10
|
+
class TasksReview extends base_command_1.BaseCommand {
|
|
11
|
+
static description = 'Accept or request changes on one exact Task Result';
|
|
12
|
+
static args = {
|
|
13
|
+
task: core_1.Args.string({ required: false, ignoreStdin: true, description: 'Task id or ref' }),
|
|
14
|
+
};
|
|
15
|
+
static flags = {
|
|
16
|
+
task: core_1.Flags.string({ description: 'Task id; overrides runtime context' }),
|
|
17
|
+
'result-id': core_1.Flags.string({ required: true, description: 'Exact Result version id' }),
|
|
18
|
+
decision: core_1.Flags.string({ required: true, options: ['accepted', 'changes_requested'] }),
|
|
19
|
+
rationale: core_1.Flags.string({ description: 'Why this Result was accepted or needs changes' }),
|
|
20
|
+
'run-id': core_1.Flags.string({ description: 'Canonical reviewer Run for a generic API call' }),
|
|
21
|
+
'idempotency-key': core_1.Flags.string({ description: 'Stable retry key' }),
|
|
22
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
23
|
+
};
|
|
24
|
+
async run() {
|
|
25
|
+
this.requireAuth();
|
|
26
|
+
const { args, flags } = await this.parse(TasksReview);
|
|
27
|
+
const task = (0, task_resolver_1.resolveTaskIdentity)({ positionalId: args.task, flagTask: flags.task });
|
|
28
|
+
const payload = {
|
|
29
|
+
resultId: flags['result-id'],
|
|
30
|
+
runId: flags['run-id'],
|
|
31
|
+
decision: flags.decision,
|
|
32
|
+
rationale: flags.rationale,
|
|
33
|
+
};
|
|
34
|
+
let result;
|
|
35
|
+
try {
|
|
36
|
+
const data = {
|
|
37
|
+
...payload,
|
|
38
|
+
idempotencyKey: flags['idempotency-key'] ||
|
|
39
|
+
(0, outbox_1.idempotencyKeyFor)('task-review', task.id, JSON.stringify(payload)),
|
|
40
|
+
};
|
|
41
|
+
const sessionPath = await (0, session_task_endpoints_1.sessionScopedTaskPath)('review');
|
|
42
|
+
result = sessionPath
|
|
43
|
+
? await (0, api_fetch_1.apiFetch)(sessionPath, { method: 'POST', body: data })
|
|
44
|
+
: await data_provider_1.dataService.reviewTaskResult({ taskId: task.id, data });
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
this.handleApiError(error);
|
|
48
|
+
}
|
|
49
|
+
if (flags.json)
|
|
50
|
+
return this.log(JSON.stringify(result, null, 2));
|
|
51
|
+
this.log(`Recorded Review: ${flags.decision} for Result ${flags['result-id']}.`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.default = TasksReview;
|
|
@@ -23,6 +23,11 @@ function formatTime(value) {
|
|
|
23
23
|
* daemon id was not recorded). `-` when the row predates executor stamping.
|
|
24
24
|
*/
|
|
25
25
|
function formatRunExecutor(run) {
|
|
26
|
+
const executor = run.executor;
|
|
27
|
+
if (executor?.kind === 'agent' && typeof executor.agentId === 'string') {
|
|
28
|
+
const release = typeof executor.agentReleaseId === 'string' ? ` @ ${executor.agentReleaseId}` : '';
|
|
29
|
+
return `Agent ${executor.agentId}${release}`;
|
|
30
|
+
}
|
|
26
31
|
const daemonId = run.daemonId;
|
|
27
32
|
if (typeof daemonId === 'string' && daemonId.trim() !== '') {
|
|
28
33
|
return `daemon ${daemonId}`;
|
|
@@ -31,10 +31,13 @@ class TasksSelfSchedule extends base_command_1.BaseCommand {
|
|
|
31
31
|
at: core_1.Flags.string({ description: 'Absolute return time (ISO-8601 UTC)' }),
|
|
32
32
|
in: core_1.Flags.string({ description: 'Relative return time such as 90m, 2h, 3d' }),
|
|
33
33
|
note: core_1.Flags.string({
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
|
|
34
|
+
// This DOES reach the run now. It is read by `buildTaskExecutionPrompt`,
|
|
35
|
+
// the one place every dispatch path assembles a task prompt, and rendered
|
|
36
|
+
// as `### Why You Parked This Task` alongside the instant it was parked
|
|
37
|
+
// for. For a while it was recorded and never delivered, and the help said
|
|
38
|
+
// so; both halves are fixed rather than only the sentence.
|
|
39
|
+
description: 'Why you are coming back. Delivered to the agent on the return as its own ' +
|
|
40
|
+
'prompt section, and readable any time with --show',
|
|
38
41
|
}),
|
|
39
42
|
'max-per-day': core_1.Flags.integer({
|
|
40
43
|
description: 'Cap on self-initiated returns per day (1-24, default 4)',
|
|
@@ -262,6 +262,25 @@ class TasksShow extends base_command_1.BaseCommand {
|
|
|
262
262
|
this.log(`Created: ${formatTime(t.createdAt)}`);
|
|
263
263
|
if (t.updatedAt)
|
|
264
264
|
this.log(`Updated: ${formatTime(t.updatedAt)}`);
|
|
265
|
+
/**
|
|
266
|
+
* Say which Task model this row belongs to, on the one surface everybody
|
|
267
|
+
* reads first.
|
|
268
|
+
*
|
|
269
|
+
* Canonical Task Model v1 deliberately migrated nothing, so a Task created
|
|
270
|
+
* before it is a second class of object with visibly different behaviour —
|
|
271
|
+
* no Updates, no Result, no Activity, no timeline. The only marker was
|
|
272
|
+
* `specVersion` being ABSENT under `--json`, and absence-as-a-marker is not
|
|
273
|
+
* something a reader can notice: you have to already know the field exists
|
|
274
|
+
* to observe that it does not. So `tasks show` said nothing, and the user
|
|
275
|
+
* found out by watching four other commands report emptiness about a Task
|
|
276
|
+
* with years of history.
|
|
277
|
+
*
|
|
278
|
+
* Printed only for the legacy class. A canonical Task needs no line saying
|
|
279
|
+
* it is ordinary.
|
|
280
|
+
*/
|
|
281
|
+
if (t.specVersion === undefined || t.specVersion === null) {
|
|
282
|
+
this.log('Model: predates the canonical Task model — no Result, Updates, Activity or timeline');
|
|
283
|
+
}
|
|
265
284
|
if (t.description) {
|
|
266
285
|
this.log('');
|
|
267
286
|
this.log('Description:');
|
|
@@ -15,8 +15,8 @@ export default class TasksTimeline extends BaseCommand {
|
|
|
15
15
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
16
|
limit: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
17
|
cursor: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
type: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
19
|
+
execution: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
20
|
actor: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
21
21
|
};
|
|
22
22
|
run(): Promise<void>;
|
|
@@ -5,7 +5,7 @@ const core_1 = require("@oclif/core");
|
|
|
5
5
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
6
|
const base_command_1 = require("../../base-command");
|
|
7
7
|
const format_1 = require("../../lib/format");
|
|
8
|
-
const
|
|
8
|
+
const task_legacy_1 = require("../../lib/task-legacy");
|
|
9
9
|
/**
|
|
10
10
|
* `<action> (<k=v ...>)`, or just the preview when there is nothing to add.
|
|
11
11
|
*
|
|
@@ -14,11 +14,11 @@ const tasks_1 = require("../../lib/tasks");
|
|
|
14
14
|
*/
|
|
15
15
|
function withDetails(item) {
|
|
16
16
|
const preview = String(item.preview ?? '-');
|
|
17
|
-
const details = (0, format_1.formatCell)(item.details, '');
|
|
17
|
+
const details = (0, format_1.formatCell)(item.data ?? item.details, '');
|
|
18
18
|
return details ? `${preview} (${details})` : preview;
|
|
19
19
|
}
|
|
20
20
|
class TasksTimeline extends base_command_1.BaseCommand {
|
|
21
|
-
static description = 'Show the
|
|
21
|
+
static description = 'Show the immutable multi-actor Task Activity timeline';
|
|
22
22
|
static args = {
|
|
23
23
|
id: core_1.Args.string({ description: 'Task ID', required: true, ignoreStdin: true }),
|
|
24
24
|
};
|
|
@@ -26,16 +26,9 @@ class TasksTimeline extends base_command_1.BaseCommand {
|
|
|
26
26
|
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
27
27
|
limit: core_1.Flags.integer({ default: 50 }),
|
|
28
28
|
cursor: core_1.Flags.string(),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
// declaring the options here refuses a typo before it costs a round trip.
|
|
33
|
-
kind: core_1.Flags.string({
|
|
34
|
-
description: 'Show only work events of this kind (excludes comments, lifecycle, execution)',
|
|
35
|
-
options: [...tasks_1.TASK_WORK_EVENT_KINDS],
|
|
36
|
-
}),
|
|
37
|
-
run: core_1.Flags.string(),
|
|
38
|
-
actor: core_1.Flags.string({ options: ['user', 'agent', 'system'] }),
|
|
29
|
+
type: core_1.Flags.string({ description: 'Exact Activity event type, e.g. task.result.submitted' }),
|
|
30
|
+
execution: core_1.Flags.string({ description: 'Bounded Task execution id' }),
|
|
31
|
+
actor: core_1.Flags.string({ options: ['human', 'agent', 'system', 'integration'] }),
|
|
39
32
|
};
|
|
40
33
|
async run() {
|
|
41
34
|
this.requireAuth();
|
|
@@ -45,8 +38,8 @@ class TasksTimeline extends base_command_1.BaseCommand {
|
|
|
45
38
|
result = await data_provider_1.dataService.getTaskTimeline(args.id, {
|
|
46
39
|
limit: flags.limit,
|
|
47
40
|
cursor: flags.cursor,
|
|
48
|
-
|
|
49
|
-
|
|
41
|
+
type: flags.type,
|
|
42
|
+
executionId: flags.execution,
|
|
50
43
|
actor: flags.actor,
|
|
51
44
|
});
|
|
52
45
|
}
|
|
@@ -57,16 +50,18 @@ class TasksTimeline extends base_command_1.BaseCommand {
|
|
|
57
50
|
this.log(JSON.stringify(result, null, 2));
|
|
58
51
|
return;
|
|
59
52
|
}
|
|
60
|
-
|
|
53
|
+
const rows = result.data ?? [];
|
|
54
|
+
if (rows.length === 0) {
|
|
55
|
+
// `renderTable([])` prints NOTHING — no header, no empty state, exit 0 —
|
|
56
|
+
// which is indistinguishable from a broken command. Say what happened.
|
|
57
|
+
this.log(await (0, task_legacy_1.emptyCanonicalView)(args.id, 'timeline entries'));
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
(0, format_1.renderTable)(rows.map((item) => ({
|
|
61
61
|
time: String(item.occurredAt ?? '-')
|
|
62
62
|
.replace('T', ' ')
|
|
63
63
|
.slice(0, 19),
|
|
64
|
-
|
|
65
|
-
// source alone collapsed blocker, decision, checkpoint and evidence
|
|
66
|
-
// into one indistinguishable `work_event`.
|
|
67
|
-
source: item.eventKind
|
|
68
|
-
? `${String(item.kind ?? '-')}:${String(item.eventKind)}`
|
|
69
|
-
: String(item.kind ?? '-'),
|
|
64
|
+
source: String(item.type ?? '-'),
|
|
70
65
|
actor: String(item.actor?.kind ?? '-'),
|
|
71
66
|
// A lifecycle row's preview is the bare action, so `status_changed`
|
|
72
67
|
// appeared three times in a row without ever naming a status. The
|
|
@@ -75,13 +70,13 @@ class TasksTimeline extends base_command_1.BaseCommand {
|
|
|
75
70
|
// substituted: the action is still what happened, `details` is what
|
|
76
71
|
// it happened to.
|
|
77
72
|
detail: (0, format_1.truncate)(withDetails(item), 90),
|
|
78
|
-
run: String(item.
|
|
73
|
+
run: String(item.executionId ?? '-'),
|
|
79
74
|
})), [
|
|
80
75
|
{ key: 'time', header: 'TIME' },
|
|
81
76
|
{ key: 'source', header: 'SOURCE' },
|
|
82
77
|
{ key: 'actor', header: 'ACTOR' },
|
|
83
78
|
{ key: 'detail', header: 'DETAIL', maxWidth: 90 },
|
|
84
|
-
{ key: 'run', header: '
|
|
79
|
+
{ key: 'run', header: 'EXECUTION', maxWidth: 24 },
|
|
85
80
|
], (line) => this.log(line));
|
|
86
81
|
if (result.next_cursor)
|
|
87
82
|
this.log(`Next page: --cursor ${result.next_cursor}`);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class TasksUpdatesAdd extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
task: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
task: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
type: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
summary: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
data: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
resume: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
'run-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
'spec-version': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
|
+
supersedes: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
|
+
reference: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
18
|
+
'idempotency-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
19
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
};
|
|
21
|
+
run(): Promise<void>;
|
|
22
|
+
}
|