@skrr-ai/cli 0.1.95 → 0.1.97
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 +22 -0
- package/dist/commands/agent/message/send.d.ts +2 -0
- package/dist/commands/agent/message/send.js +75 -5
- package/dist/commands/agents/chat.js +1 -1
- package/dist/commands/agents/create.d.ts +0 -3
- package/dist/commands/agents/create.js +0 -26
- package/dist/commands/agents/egress.d.ts +17 -0
- package/dist/commands/agents/egress.js +84 -0
- package/dist/commands/agents/mailbox/messages.d.ts +14 -0
- package/dist/commands/agents/mailbox/messages.js +52 -0
- package/dist/commands/agents/mailbox/show.d.ts +13 -0
- package/dist/commands/agents/mailbox/show.js +52 -0
- package/dist/commands/agents/operating-plan.js +8 -0
- package/dist/commands/agents/roles/capture.d.ts +16 -0
- package/dist/commands/agents/roles/capture.js +53 -0
- package/dist/commands/agents/roles/install.d.ts +1 -0
- package/dist/commands/agents/roles/install.js +8 -1
- package/dist/commands/agents/roles/preview.d.ts +2 -0
- package/dist/commands/agents/roles/preview.js +27 -3
- package/dist/commands/agents/update.d.ts +0 -3
- package/dist/commands/agents/update.js +1 -31
- package/dist/commands/agents/usage-cap.d.ts +4 -1
- package/dist/commands/agents/usage-cap.js +49 -10
- package/dist/commands/code/jobs/show.js +12 -0
- package/dist/commands/commitments/action-proposals/decide.d.ts +2 -0
- package/dist/commands/commitments/action-proposals/decide.js +12 -0
- package/dist/commands/commitments/action-proposals.js +7 -0
- package/dist/commands/commitments/create.d.ts +1 -0
- package/dist/commands/commitments/create.js +17 -1
- package/dist/commands/commitments/delivery.d.ts +1 -0
- package/dist/commands/commitments/delivery.js +11 -1
- package/dist/commands/commitments/doctor.js +4 -0
- package/dist/commands/commitments/effective-policy.js +26 -0
- package/dist/commands/commitments/endpoints/create.js +5 -2
- package/dist/commands/commitments/observations.d.ts +10 -0
- package/dist/commands/commitments/observations.js +88 -0
- package/dist/commands/commitments/pause.d.ts +1 -1
- package/dist/commands/commitments/pause.js +4 -3
- package/dist/commands/commitments/preflight.js +2 -1
- package/dist/commands/commitments/reports.d.ts +2 -0
- package/dist/commands/commitments/reports.js +22 -4
- package/dist/commands/commitments/update.d.ts +1 -0
- package/dist/commands/commitments/update.js +35 -5
- package/dist/commands/daemon/install.js +1 -1
- package/dist/commands/grants/create.d.ts +1 -0
- package/dist/commands/grants/create.js +8 -0
- package/dist/commands/grants/rotate.d.ts +5 -0
- package/dist/commands/grants/rotate.js +13 -1
- package/dist/commands/grants/update.d.ts +12 -0
- package/dist/commands/grants/update.js +27 -0
- package/dist/commands/machines/hosted/start.js +7 -1
- package/dist/commands/machines/list.js +4 -4
- package/dist/commands/measures/confirm.d.ts +1 -7
- package/dist/commands/measures/confirm.js +15 -14
- package/dist/commands/measures/list.d.ts +1 -7
- package/dist/commands/measures/list.js +1 -7
- package/dist/commands/measures/record.js +4 -4
- package/dist/commands/measures/show.d.ts +11 -0
- package/dist/commands/measures/show.js +26 -0
- package/dist/commands/northstars/governance/configure.d.ts +1 -0
- package/dist/commands/northstars/governance/configure.js +8 -1
- package/dist/commands/proposals/discard.d.ts +5 -0
- package/dist/commands/proposals/discard.js +8 -0
- package/dist/commands/proposals/keep.d.ts +5 -0
- package/dist/commands/proposals/keep.js +8 -0
- package/dist/commands/proposals/list.d.ts +15 -0
- package/dist/commands/proposals/list.js +74 -0
- package/dist/commands/proposals/show.d.ts +12 -0
- package/dist/commands/proposals/show.js +27 -0
- package/dist/commands/proposals/snooze.d.ts +5 -0
- package/dist/commands/proposals/snooze.js +8 -0
- package/dist/commands/signals/monitors/create.d.ts +9 -0
- package/dist/commands/signals/monitors/create.js +29 -0
- package/dist/commands/signals/monitors/list.d.ts +8 -0
- package/dist/commands/signals/monitors/list.js +16 -0
- package/dist/commands/signals/monitors/pause.d.ts +11 -0
- package/dist/commands/signals/monitors/pause.js +17 -0
- package/dist/commands/signals/monitors/resume.d.ts +11 -0
- package/dist/commands/signals/monitors/resume.js +17 -0
- package/dist/commands/signals/monitors/revise.d.ts +12 -0
- package/dist/commands/signals/monitors/revise.js +25 -0
- package/dist/commands/signals/monitors/show.d.ts +11 -0
- package/dist/commands/signals/monitors/show.js +17 -0
- package/dist/commands/signals/monitors/test.d.ts +12 -0
- package/dist/commands/signals/monitors/test.js +25 -0
- package/dist/commands/signals/monitors/transitions.d.ts +11 -0
- package/dist/commands/signals/monitors/transitions.js +17 -0
- package/dist/commands/signals/monitors/validate.d.ts +9 -0
- package/dist/commands/signals/monitors/validate.js +24 -0
- package/dist/commands/signals/schemas/list.d.ts +8 -0
- package/dist/commands/signals/schemas/list.js +16 -0
- package/dist/commands/signals/schemas/show.d.ts +11 -0
- package/dist/commands/signals/schemas/show.js +17 -0
- package/dist/commands/signals/sources/list.d.ts +8 -0
- package/dist/commands/signals/sources/list.js +16 -0
- package/dist/commands/signals/sources/receipts.d.ts +11 -0
- package/dist/commands/signals/sources/receipts.js +17 -0
- package/dist/commands/signals/sources/show.d.ts +11 -0
- package/dist/commands/signals/sources/show.js +17 -0
- package/dist/commands/spaces/usage.d.ts +12 -0
- package/dist/commands/spaces/usage.js +28 -0
- package/dist/commands/spaces/workflows/run.js +3 -0
- package/dist/commands/spaces/workflows/runs.js +2 -1
- package/dist/commands/spaces/workflows/update.d.ts +6 -1
- package/dist/commands/spaces/workflows/update.js +34 -2
- package/dist/commands/tasks/cascade-status.d.ts +2 -0
- package/dist/commands/tasks/cascade-status.js +27 -1
- package/dist/commands/tasks/comments/add.js +29 -20
- package/dist/commands/tasks/complete.js +7 -4
- package/dist/commands/tasks/create.d.ts +4 -0
- package/dist/commands/tasks/create.js +16 -0
- package/dist/commands/tasks/deliverable/add.js +17 -7
- package/dist/commands/tasks/economics-compare.d.ts +15 -0
- package/dist/commands/tasks/economics-compare.js +60 -0
- package/dist/commands/tasks/events/append.js +6 -5
- package/dist/commands/tasks/expectations/assess.js +4 -4
- package/dist/commands/tasks/expectations/evaluate.d.ts +13 -0
- package/dist/commands/tasks/expectations/evaluate.js +43 -0
- package/dist/commands/tasks/list.d.ts +1 -0
- package/dist/commands/tasks/list.js +44 -1
- package/dist/commands/tasks/move.js +15 -11
- package/dist/commands/tasks/report.js +19 -11
- package/dist/commands/tasks/result/submit.js +5 -4
- package/dist/commands/tasks/resume/save.js +5 -4
- package/dist/commands/tasks/review.js +4 -4
- package/dist/commands/tasks/show.d.ts +5 -0
- package/dist/commands/tasks/show.js +17 -0
- package/dist/commands/tasks/update.d.ts +4 -0
- package/dist/commands/tasks/update.js +9 -0
- package/dist/commands/tasks/updates/add.js +5 -4
- package/dist/commands/tasks/workflow-findings.js +2 -2
- package/dist/commands/triggers/create.d.ts +2 -0
- package/dist/commands/triggers/create.js +15 -0
- package/dist/commands/workspaces/grants.d.ts +12 -0
- package/dist/commands/workspaces/grants.js +31 -0
- package/dist/commands/workspaces/stewardship.d.ts +13 -0
- package/dist/commands/workspaces/stewardship.js +34 -0
- package/dist/lib/agent-config.d.ts +0 -12
- package/dist/lib/agent-config.js +1 -27
- package/dist/lib/agent-mailbox.d.ts +35 -0
- package/dist/lib/agent-mailbox.js +55 -0
- package/dist/lib/commitment-endpoints.d.ts +2 -1
- package/dist/lib/commitment-endpoints.js +2 -5
- package/dist/lib/commitment-product.d.ts +3 -1
- package/dist/lib/commitment-product.js +10 -0
- package/dist/lib/commitment-terms.js +1 -1
- package/dist/lib/commitments.d.ts +17 -7
- package/dist/lib/commitments.js +173 -85
- package/dist/lib/compasses.d.ts +14 -0
- package/dist/lib/compasses.js +25 -11
- package/dist/lib/grants.d.ts +5 -1
- package/dist/lib/grants.js +9 -1
- package/dist/lib/hosted-machines.d.ts +7 -0
- package/dist/lib/mailbox-human-command.d.ts +11 -0
- package/dist/lib/mailbox-human-command.js +41 -0
- package/dist/lib/measures.d.ts +28 -2
- package/dist/lib/measures.js +38 -14
- package/dist/lib/message-intent.d.ts +6 -2
- package/dist/lib/message-intent.js +1 -0
- package/dist/lib/northstars.js +2 -1
- package/dist/lib/proposal-decision-command.d.ts +19 -0
- package/dist/lib/proposal-decision-command.js +64 -0
- package/dist/lib/proposals.d.ts +8 -0
- package/dist/lib/proposals.js +22 -0
- package/dist/lib/roles.d.ts +141 -6
- package/dist/lib/roles.js +8 -2
- package/dist/lib/session-task-write.d.ts +18 -0
- package/dist/lib/session-task-write.js +43 -0
- package/dist/lib/signals.d.ts +20 -0
- package/dist/lib/signals.js +24 -0
- package/dist/lib/space-usage.d.ts +3 -0
- package/dist/lib/space-usage.js +17 -0
- package/dist/lib/stewardship-output.d.ts +4 -0
- package/dist/lib/stewardship-output.js +82 -0
- package/dist/lib/task-asset-upload.d.ts +3 -1
- package/dist/lib/task-asset-upload.js +19 -22
- package/dist/lib/task-economics.d.ts +16 -0
- package/dist/lib/task-economics.js +22 -0
- package/dist/lib/triggers.d.ts +11 -3
- package/dist/lib/triggers.js +58 -1
- package/dist/lib/unsupported-managed-task-write.d.ts +2 -0
- package/dist/lib/unsupported-managed-task-write.js +12 -0
- package/dist/lib/usage-discovery.d.ts +10 -0
- package/dist/lib/usage-discovery.js +24 -3
- package/dist/lib/workflow-run-budget.d.ts +12 -0
- package/dist/lib/workflow-run-budget.js +37 -0
- package/dist/lib/workspaces.d.ts +48 -0
- package/dist/lib/workspaces.js +8 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.d.ts +4 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.js +14 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/githubPushRefusal.d.ts +9 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/githubPushRefusal.js +49 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.d.ts +4 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.js +12 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/githubPushRefusal.d.ts +9 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/githubPushRefusal.js +44 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +10 -0
- package/dist/node_modules/@skrr-ai/data-provider/index.js +8017 -7086
- package/oclif.manifest.json +3872 -1167
- package/package.json +22 -1
|
@@ -42,7 +42,7 @@ const base_command_1 = require("../../../base-command");
|
|
|
42
42
|
const task_asset_upload_1 = require("../../../lib/task-asset-upload");
|
|
43
43
|
const outbox_1 = require("../../../lib/outbox");
|
|
44
44
|
const api_fetch_1 = require("../../../lib/api-fetch");
|
|
45
|
-
const
|
|
45
|
+
const session_task_write_1 = require("../../../lib/session-task-write");
|
|
46
46
|
const tasks_1 = require("../../../lib/tasks");
|
|
47
47
|
function defaultDeliverableIdempotencyKey(task, payload) {
|
|
48
48
|
// A retry of one exact observation keeps its key. A new version, provider,
|
|
@@ -192,10 +192,11 @@ class TasksDeliverableAdd extends base_command_1.BaseCommand {
|
|
|
192
192
|
idempotencyKey: flags['idempotency-key'] ||
|
|
193
193
|
defaultDeliverableIdempotencyKey(args.task, observation),
|
|
194
194
|
};
|
|
195
|
-
const
|
|
196
|
-
result =
|
|
197
|
-
? await (0, api_fetch_1.apiFetch)(
|
|
195
|
+
const sessionWrite = await (0, session_task_write_1.sessionTaskWrite)('deliverable', args.task);
|
|
196
|
+
result = sessionWrite
|
|
197
|
+
? await (0, api_fetch_1.apiFetch)(sessionWrite.path, {
|
|
198
198
|
method: 'POST',
|
|
199
|
+
credential: sessionWrite.credential,
|
|
199
200
|
body: payload,
|
|
200
201
|
})
|
|
201
202
|
: await data_provider_1.dataService.addTaskDeliverable(args.task, payload);
|
|
@@ -269,12 +270,21 @@ class TasksDeliverableAdd extends base_command_1.BaseCommand {
|
|
|
269
270
|
this.handleApiError(err);
|
|
270
271
|
return false;
|
|
271
272
|
}
|
|
273
|
+
const { resourceReceipt, ...archived } = asset;
|
|
274
|
+
if (!resourceReceipt?.link.id) {
|
|
275
|
+
this.warn('The file was archived, but this server did not return its Deliverable link. ' +
|
|
276
|
+
`Run skrr tasks deliverable list ${opts.taskId} --json to find the exact version before submitting a Result.`);
|
|
277
|
+
}
|
|
272
278
|
if (opts.json) {
|
|
273
|
-
this.log(JSON.stringify({ archived
|
|
279
|
+
this.log(JSON.stringify({ ...resourceReceipt, archived, identity: opts.identity }, null, 2));
|
|
274
280
|
return true;
|
|
275
281
|
}
|
|
276
|
-
|
|
277
|
-
`
|
|
282
|
+
const recorded = resourceReceipt?.link.id
|
|
283
|
+
? `Recorded Deliverable ${resourceReceipt.link.id}: ${opts.identity}`
|
|
284
|
+
: `Archived ${opts.identity}`;
|
|
285
|
+
const version = resourceReceipt?.version.id ? `version ${resourceReceipt.version.id}; ` : '';
|
|
286
|
+
this.log(`${recorded} — archived copy ${asset.id} ` +
|
|
287
|
+
`(${version}sha256 pinned; observed available; self reported).`);
|
|
278
288
|
if (opts.requestedStatus && opts.requestedStatus !== 'available') {
|
|
279
289
|
// Not silent: the platform WATCHED these bytes land, which is a stronger
|
|
280
290
|
// and verified statement than the one that was asked for. Who vouched
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
export default class TasksEconomicsCompare extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
measure: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
fire: import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
revision: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
|
+
const base_command_1 = require("../../base-command");
|
|
6
|
+
class TasksEconomicsCompare extends base_command_1.BaseCommand {
|
|
7
|
+
static description = 'Show a Task economics estimate beside retained platform readings (no measurement binding is created)';
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> tasks economics-compare <task-id> --measure <id> --fire <fire-id> --revision 3',
|
|
10
|
+
];
|
|
11
|
+
static args = {
|
|
12
|
+
id: core_1.Args.string({ description: 'Task ID', required: true, ignoreStdin: true }),
|
|
13
|
+
};
|
|
14
|
+
static flags = {
|
|
15
|
+
measure: core_1.Flags.string({ description: 'Measure ID', required: true }),
|
|
16
|
+
fire: core_1.Flags.string({
|
|
17
|
+
description: 'Exact retained trigger fire ID (repeat once for a second reading)',
|
|
18
|
+
required: true,
|
|
19
|
+
multiple: true,
|
|
20
|
+
}),
|
|
21
|
+
revision: core_1.Flags.integer({
|
|
22
|
+
description: 'Task economics revision being compared',
|
|
23
|
+
required: true,
|
|
24
|
+
min: 1,
|
|
25
|
+
}),
|
|
26
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
27
|
+
};
|
|
28
|
+
async run() {
|
|
29
|
+
this.requireAuth();
|
|
30
|
+
const { args, flags } = await this.parse(TasksEconomicsCompare);
|
|
31
|
+
const taskRef = await this.resolveEntityRef('task', args.id);
|
|
32
|
+
let response;
|
|
33
|
+
try {
|
|
34
|
+
response = await data_provider_1.dataService.getTaskEconomicsComparison(taskRef, {
|
|
35
|
+
measureId: flags.measure,
|
|
36
|
+
fireIds: flags.fire,
|
|
37
|
+
economicsRevision: flags.revision,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
this.handleApiError(err);
|
|
42
|
+
}
|
|
43
|
+
if (flags.json) {
|
|
44
|
+
this.log(JSON.stringify(response, null, 2));
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const readings = response.platformReadings;
|
|
48
|
+
this.log(`Estimate (revision ${response.economicsRevision}): ${JSON.stringify(response.economics)}`);
|
|
49
|
+
if (readings.status === 'unavailable') {
|
|
50
|
+
this.log(`Platform readings unavailable: ${readings.reason}`);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
const unit = readings.customUnit ?? readings.declaredUnit;
|
|
54
|
+
for (const r of readings.readings)
|
|
55
|
+
this.log(`${r.triggerFireId}: ${r.value} ${unit} at ${r.observedAt}`);
|
|
56
|
+
}
|
|
57
|
+
this.log(`Measurement: ${response.measurement.reason}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.default = TasksEconomicsCompare;
|
|
@@ -5,7 +5,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
5
5
|
const base_command_1 = require("../../../base-command");
|
|
6
6
|
const task_resolver_1 = require("../../../lib/task-resolver");
|
|
7
7
|
const api_fetch_1 = require("../../../lib/api-fetch");
|
|
8
|
-
const
|
|
8
|
+
const session_task_write_1 = require("../../../lib/session-task-write");
|
|
9
9
|
const task_artifact_flags_1 = require("../../../lib/task-artifact-flags");
|
|
10
10
|
const tasks_1 = require("../../../lib/tasks");
|
|
11
11
|
class TasksEventsAppend extends base_command_1.BaseCommand {
|
|
@@ -99,17 +99,18 @@ class TasksEventsAppend extends base_command_1.BaseCommand {
|
|
|
99
99
|
? deliverables.map((ref) => ({ label: 'deliverable', ref }))
|
|
100
100
|
: undefined,
|
|
101
101
|
};
|
|
102
|
-
|
|
102
|
+
let sessionWrite;
|
|
103
103
|
let result;
|
|
104
104
|
try {
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
sessionWrite = await (0, session_task_write_1.sessionTaskWrite)('event', task.id);
|
|
106
|
+
result = sessionWrite
|
|
107
|
+
? await (0, api_fetch_1.apiFetch)(sessionWrite.path, { method: 'POST', body: data, credential: sessionWrite.credential })
|
|
107
108
|
: await data_provider_1.dataService.appendTaskWorkEvent({ taskId: task.id, data: data });
|
|
108
109
|
}
|
|
109
110
|
catch (error) {
|
|
110
111
|
this.handleApiError(error);
|
|
111
112
|
}
|
|
112
|
-
if (
|
|
113
|
+
if (sessionWrite && result && typeof result === 'object' && 'entry' in result)
|
|
113
114
|
result = result.entry;
|
|
114
115
|
if (flags.json)
|
|
115
116
|
return this.log(JSON.stringify(result, null, 2));
|
|
@@ -6,7 +6,7 @@ const base_command_1 = require("../../../base-command");
|
|
|
6
6
|
const outbox_1 = require("../../../lib/outbox");
|
|
7
7
|
const task_resolver_1 = require("../../../lib/task-resolver");
|
|
8
8
|
const api_fetch_1 = require("../../../lib/api-fetch");
|
|
9
|
-
const
|
|
9
|
+
const session_task_write_1 = require("../../../lib/session-task-write");
|
|
10
10
|
class TasksExpectationsAssess extends base_command_1.BaseCommand {
|
|
11
11
|
static description = 'Assess one current Task Expectation with evidence and a reason';
|
|
12
12
|
// Both positionals are declared optional because oclif REJECTS an args table
|
|
@@ -136,9 +136,9 @@ class TasksExpectationsAssess extends base_command_1.BaseCommand {
|
|
|
136
136
|
? flags['idempotency-key']
|
|
137
137
|
: (0, outbox_1.idempotencyKeyFor)('task-expectation-assessment', task.id, JSON.stringify({ expectationId: id, ...payload })),
|
|
138
138
|
};
|
|
139
|
-
const
|
|
140
|
-
return
|
|
141
|
-
? await (0, api_fetch_1.apiFetch)(
|
|
139
|
+
const sessionWrite = await (0, session_task_write_1.sessionTaskWrite)('assessment', task.id);
|
|
140
|
+
return sessionWrite
|
|
141
|
+
? await (0, api_fetch_1.apiFetch)(sessionWrite.path, { method: 'POST', body: data, credential: sessionWrite.credential })
|
|
142
142
|
: await data_provider_1.dataService.assessTaskExpectation({ taskId: task.id, expectationId: id, data });
|
|
143
143
|
};
|
|
144
144
|
if (flags.all) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class TasksExpectationsEvaluate 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
|
+
'spec-version': import("@oclif/core/lib/interfaces").OptionFlag<number | 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,43 @@
|
|
|
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
|
+
class TasksExpectationsEvaluate extends base_command_1.BaseCommand {
|
|
8
|
+
static description = 'Observe authorized Task/Goal states and record met-only facts; never close the Task';
|
|
9
|
+
static args = {
|
|
10
|
+
task: core_1.Args.string({ required: false, ignoreStdin: true, description: 'Task id or ref' }),
|
|
11
|
+
};
|
|
12
|
+
static flags = {
|
|
13
|
+
task: core_1.Flags.string({ description: 'Task id; overrides runtime context' }),
|
|
14
|
+
'spec-version': core_1.Flags.integer({
|
|
15
|
+
min: 1,
|
|
16
|
+
description: 'Expected current specification version',
|
|
17
|
+
}),
|
|
18
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
19
|
+
};
|
|
20
|
+
async run() {
|
|
21
|
+
this.requireAuth();
|
|
22
|
+
const { args, flags } = await this.parse(TasksExpectationsEvaluate);
|
|
23
|
+
const task = (0, task_resolver_1.resolveTaskIdentity)({ positionalId: args.task, flagTask: flags.task });
|
|
24
|
+
try {
|
|
25
|
+
const result = await data_provider_1.dataService.evaluateTaskExpectations({
|
|
26
|
+
taskId: task.id,
|
|
27
|
+
data: { expectedSpecVersion: flags['spec-version'] },
|
|
28
|
+
});
|
|
29
|
+
if (flags.json) {
|
|
30
|
+
this.log(JSON.stringify(result, null, 2));
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
this.log(`Task specification v${result.specVersion}; platform-state snapshot only.`);
|
|
34
|
+
for (const row of result.outcomes) {
|
|
35
|
+
this.log(`${row.expectationId}: ${row.state}${row.reason ? ` (${row.reason})` : ''}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
this.handleApiError(error);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.default = TasksExpectationsEvaluate;
|
|
@@ -74,6 +74,7 @@ export default class TasksList extends BaseCommand {
|
|
|
74
74
|
'actionable-by': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
75
75
|
'actionable-for-agent': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
76
76
|
'needs-me': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
77
|
+
rank: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
77
78
|
sort: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
78
79
|
order: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
79
80
|
'due-before': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -272,7 +272,9 @@ function buildListParams(flags, assigneeUserId) {
|
|
|
272
272
|
// `--compact` asks the server for its own card projection (no activityLog,
|
|
273
273
|
// narrative or ledgers) so the bytes are never sent, then the CLI trims the
|
|
274
274
|
// rest to the navigation set. Only the JSON path reads it.
|
|
275
|
-
...(flag('compact') && !flag('fields')
|
|
275
|
+
...(flag('compact') && !flag('fields') && !flag('rank')
|
|
276
|
+
? { view: 'summary' }
|
|
277
|
+
: {}),
|
|
276
278
|
...(flag('view') ? { taskViewId: flag('view') } : {}),
|
|
277
279
|
limit: flag('limit'),
|
|
278
280
|
cursor: flag('cursor'),
|
|
@@ -374,6 +376,10 @@ class TasksList extends base_command_1.BaseCommand {
|
|
|
374
376
|
'needs-me': core_1.Flags.boolean({
|
|
375
377
|
description: 'Filter to Human-actionable work addressed to you',
|
|
376
378
|
}),
|
|
379
|
+
rank: core_1.Flags.string({
|
|
380
|
+
options: ['economics'],
|
|
381
|
+
description: 'Rank only this fetched page by annualized USD / max(effort hours,0.5) × risk discount; unknown last, never an action policy',
|
|
382
|
+
}),
|
|
377
383
|
sort: core_1.Flags.string({
|
|
378
384
|
description: 'Order by a shared saved-view field',
|
|
379
385
|
options: [...data_provider_1.VIEW_SORT_KEYS],
|
|
@@ -527,6 +533,19 @@ class TasksList extends base_command_1.BaseCommand {
|
|
|
527
533
|
catch (err) {
|
|
528
534
|
this.handleApiError(err);
|
|
529
535
|
}
|
|
536
|
+
if (flags.rank && calendarRange)
|
|
537
|
+
this.error('--rank applies to fetched task pages, not calendar occurrences.', { exit: 2 });
|
|
538
|
+
if (flags.rank &&
|
|
539
|
+
response &&
|
|
540
|
+
typeof response === 'object' &&
|
|
541
|
+
'data' in response &&
|
|
542
|
+
Array.isArray(response.data)) {
|
|
543
|
+
response = {
|
|
544
|
+
...response,
|
|
545
|
+
data: (0, data_provider_1.rankEconomicItems)(response.data),
|
|
546
|
+
rank_applied: { key: 'economics', scope: 'fetched_page' },
|
|
547
|
+
};
|
|
548
|
+
}
|
|
530
549
|
const list = response;
|
|
531
550
|
const statusWarnings = calendarRange
|
|
532
551
|
? []
|
|
@@ -604,6 +623,12 @@ class TasksList extends base_command_1.BaseCommand {
|
|
|
604
623
|
return;
|
|
605
624
|
}
|
|
606
625
|
const rows = items.map((t) => {
|
|
626
|
+
const economics = t.economics;
|
|
627
|
+
const basis = {
|
|
628
|
+
agent_estimate: 'Agent estimate',
|
|
629
|
+
human_confirmed: 'Human confirmed',
|
|
630
|
+
measured: 'Measured',
|
|
631
|
+
};
|
|
607
632
|
const agents = Array.isArray(t.assigneeAgentIds) ? t.assigneeAgentIds.length : 0;
|
|
608
633
|
const users = Array.isArray(t.assigneeUserIds) ? t.assigneeUserIds.length : 0;
|
|
609
634
|
const assignees = agents + users > 0 ? `${agents}a/${users}u` : '-';
|
|
@@ -617,6 +642,14 @@ class TasksList extends base_command_1.BaseCommand {
|
|
|
617
642
|
assignees,
|
|
618
643
|
next: nextActionText(t),
|
|
619
644
|
match: String(t._matchField ?? '-'),
|
|
645
|
+
savings: economics?.savings
|
|
646
|
+
? `${economics.savings.currency} ${economics.savings.amount}/${economics.savings.per}`
|
|
647
|
+
: 'Unknown',
|
|
648
|
+
effort: economics?.effortHours !== undefined ? `${economics.effortHours}h` : 'Unknown',
|
|
649
|
+
risk: economics?.risk ?? 'Unknown',
|
|
650
|
+
basis: economics?.basis && Object.prototype.hasOwnProperty.call(basis, economics.basis)
|
|
651
|
+
? basis[economics.basis]
|
|
652
|
+
: 'Unknown',
|
|
620
653
|
};
|
|
621
654
|
});
|
|
622
655
|
(0, format_1.renderTable)(rows, [
|
|
@@ -624,6 +657,14 @@ class TasksList extends base_command_1.BaseCommand {
|
|
|
624
657
|
{ key: 'title', header: 'TITLE', maxWidth: 50 },
|
|
625
658
|
{ key: 'status', header: 'STATUS' },
|
|
626
659
|
{ key: 'priority', header: 'PRIORITY' },
|
|
660
|
+
...(flags.rank
|
|
661
|
+
? [
|
|
662
|
+
{ key: 'savings', header: 'SAVINGS' },
|
|
663
|
+
{ key: 'effort', header: 'EFFORT' },
|
|
664
|
+
{ key: 'risk', header: 'RISK' },
|
|
665
|
+
{ key: 'basis', header: 'BASIS' },
|
|
666
|
+
]
|
|
667
|
+
: []),
|
|
627
668
|
{ key: 'estimate', header: 'ESTIMATE' },
|
|
628
669
|
{ key: 'assignees', header: 'ASSIGNEES' },
|
|
629
670
|
// Bounded: the reason is a sentence, and an unbounded column wraps the
|
|
@@ -634,6 +675,8 @@ class TasksList extends base_command_1.BaseCommand {
|
|
|
634
675
|
...(flags.q ? [{ key: 'match', header: 'MATCH' }] : []),
|
|
635
676
|
{ key: 'id', header: 'ID' },
|
|
636
677
|
], (line) => this.log(line));
|
|
678
|
+
if (flags.rank)
|
|
679
|
+
this.log('\nRanked only within this fetched page; estimates are claims, not measured savings.');
|
|
637
680
|
if (r?.next_cursor) {
|
|
638
681
|
this.log('');
|
|
639
682
|
this.log(`Next page: --cursor ${r.next_cursor}`);
|
|
@@ -5,7 +5,8 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
5
5
|
const api_fetch_1 = require("../../lib/api-fetch");
|
|
6
6
|
const http_error_1 = require("../../lib/http-error");
|
|
7
7
|
const workflow_state_hint_1 = require("../../lib/workflow-state-hint");
|
|
8
|
-
const
|
|
8
|
+
const unsupported_managed_task_write_1 = require("../../lib/unsupported-managed-task-write");
|
|
9
|
+
const session_task_write_1 = require("../../lib/session-task-write");
|
|
9
10
|
const base_command_1 = require("../../base-command");
|
|
10
11
|
const task_closure_1 = require("../../lib/task-closure");
|
|
11
12
|
const web_url_1 = require("../../lib/web-url");
|
|
@@ -78,6 +79,15 @@ class TasksMove extends base_command_1.BaseCommand {
|
|
|
78
79
|
}
|
|
79
80
|
const taskRef = await this.resolveEntityRef('task', taskIdentity.id);
|
|
80
81
|
const projectId = (0, projects_1.resolveTaskProjectFlag)(flags.project);
|
|
82
|
+
if (projectId !== undefined) {
|
|
83
|
+
try {
|
|
84
|
+
(0, unsupported_managed_task_write_1.refuseUnsupportedManagedTaskWrite)('Project changes', 'mcp__tasks__task_update');
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
this.handleApiError(error);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
81
91
|
if (!flags.status && projectId === undefined) {
|
|
82
92
|
this.failWithCliError({
|
|
83
93
|
message: 'Nothing to move. Pass --status <status>, --project <project-id>, or both.',
|
|
@@ -92,16 +102,10 @@ class TasksMove extends base_command_1.BaseCommand {
|
|
|
92
102
|
let updated;
|
|
93
103
|
try {
|
|
94
104
|
if (flags.status) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
//
|
|
100
|
-
// `null` here is the ordinary answer — a human, or a delegated session
|
|
101
|
-
// still holding a wide credential. See `sessionScopedTaskPath`.
|
|
102
|
-
const sessionPath = await (0, session_task_endpoints_1.sessionScopedTaskPath)('move');
|
|
103
|
-
if (sessionPath) {
|
|
104
|
-
const res = (await (0, api_fetch_1.apiFetch)(sessionPath, {
|
|
105
|
+
const sessionWrite = await (0, session_task_write_1.sessionTaskWrite)('move', taskRef);
|
|
106
|
+
if (sessionWrite) {
|
|
107
|
+
const res = (await (0, api_fetch_1.apiFetch)(sessionWrite.path, {
|
|
108
|
+
credential: sessionWrite.credential,
|
|
105
109
|
method: 'POST',
|
|
106
110
|
body: {
|
|
107
111
|
status: flags.status,
|
|
@@ -8,6 +8,8 @@ const task_report_1 = require("../../lib/task-report");
|
|
|
8
8
|
const task_resolver_1 = require("../../lib/task-resolver");
|
|
9
9
|
const tasks_1 = require("../../lib/tasks");
|
|
10
10
|
const task_artifact_flags_1 = require("../../lib/task-artifact-flags");
|
|
11
|
+
const api_fetch_1 = require("../../lib/api-fetch");
|
|
12
|
+
const session_task_write_1 = require("../../lib/session-task-write");
|
|
11
13
|
const web_url_1 = require("../../lib/web-url");
|
|
12
14
|
/**
|
|
13
15
|
* Compatibility spelling for submitting a versioned Task Result.
|
|
@@ -108,10 +110,13 @@ class TasksReport extends base_command_1.BaseCommand {
|
|
|
108
110
|
continue;
|
|
109
111
|
}
|
|
110
112
|
try {
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
const data = { ...parsed.value, idempotencyKey: (0, outbox_1.idempotencyKeyFor)('task-deliverable', task.id, ref) };
|
|
114
|
+
const sessionWrite = await (0, session_task_write_1.sessionTaskWrite)('deliverable', task.id);
|
|
115
|
+
const recorded = sessionWrite
|
|
116
|
+
? await (0, api_fetch_1.apiFetch)(sessionWrite.path, {
|
|
117
|
+
method: 'POST', body: data, credential: sessionWrite.credential,
|
|
118
|
+
})
|
|
119
|
+
: await data_provider_1.dataService.addTaskDeliverable(task.id, data);
|
|
115
120
|
resourceLinkIds.push(recorded.link.id);
|
|
116
121
|
}
|
|
117
122
|
catch (error) {
|
|
@@ -146,13 +151,16 @@ class TasksReport extends base_command_1.BaseCommand {
|
|
|
146
151
|
};
|
|
147
152
|
let result;
|
|
148
153
|
try {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
const data = {
|
|
155
|
+
...payload,
|
|
156
|
+
idempotencyKey: (0, outbox_1.idempotencyKeyFor)('task-result', task.id, JSON.stringify(payload)),
|
|
157
|
+
};
|
|
158
|
+
const sessionWrite = await (0, session_task_write_1.sessionTaskWrite)('result', task.id);
|
|
159
|
+
result = sessionWrite
|
|
160
|
+
? await (0, api_fetch_1.apiFetch)(sessionWrite.path, {
|
|
161
|
+
method: 'POST', body: data, credential: sessionWrite.credential,
|
|
162
|
+
})
|
|
163
|
+
: await data_provider_1.dataService.submitTaskResult({ taskId: task.id, data });
|
|
156
164
|
}
|
|
157
165
|
catch (error) {
|
|
158
166
|
this.handleApiError(error);
|
|
@@ -41,7 +41,7 @@ const task_resolver_1 = require("../../../lib/task-resolver");
|
|
|
41
41
|
const web_url_1 = require("../../../lib/web-url");
|
|
42
42
|
const api_fetch_1 = require("../../../lib/api-fetch");
|
|
43
43
|
const task_closure_1 = require("../../../lib/task-closure");
|
|
44
|
-
const
|
|
44
|
+
const session_task_write_1 = require("../../../lib/session-task-write");
|
|
45
45
|
function parseJson(value, label) {
|
|
46
46
|
if (!value)
|
|
47
47
|
return undefined;
|
|
@@ -181,10 +181,11 @@ class TasksResultSubmit extends base_command_1.BaseCommand {
|
|
|
181
181
|
idempotencyKey: flags['idempotency-key'] ||
|
|
182
182
|
(0, outbox_1.idempotencyKeyFor)('task-result', task.id, JSON.stringify(payload)),
|
|
183
183
|
};
|
|
184
|
-
const
|
|
185
|
-
result =
|
|
186
|
-
? await (0, api_fetch_1.apiFetch)(
|
|
184
|
+
const sessionWrite = await (0, session_task_write_1.sessionTaskWrite)('result', task.id);
|
|
185
|
+
result = sessionWrite
|
|
186
|
+
? await (0, api_fetch_1.apiFetch)(sessionWrite.path, {
|
|
187
187
|
method: 'POST',
|
|
188
|
+
credential: sessionWrite.credential,
|
|
188
189
|
body: data,
|
|
189
190
|
})
|
|
190
191
|
: await data_provider_1.dataService.submitTaskResult({ taskId: task.id, data });
|
|
@@ -6,7 +6,7 @@ const base_command_1 = require("../../../base-command");
|
|
|
6
6
|
const outbox_1 = require("../../../lib/outbox");
|
|
7
7
|
const task_resolver_1 = require("../../../lib/task-resolver");
|
|
8
8
|
const api_fetch_1 = require("../../../lib/api-fetch");
|
|
9
|
-
const
|
|
9
|
+
const session_task_write_1 = require("../../../lib/session-task-write");
|
|
10
10
|
const prompt_1 = require("../../../lib/prompt");
|
|
11
11
|
class TasksResumeSave extends base_command_1.BaseCommand {
|
|
12
12
|
static description = 'Save recovery state without publishing a visible Task Update';
|
|
@@ -53,10 +53,11 @@ class TasksResumeSave extends base_command_1.BaseCommand {
|
|
|
53
53
|
idempotencyKey: flags['idempotency-key'] ||
|
|
54
54
|
(0, outbox_1.idempotencyKeyFor)('task-resume', task.id, JSON.stringify(resume)),
|
|
55
55
|
};
|
|
56
|
-
const
|
|
57
|
-
result =
|
|
58
|
-
? await (0, api_fetch_1.apiFetch)(
|
|
56
|
+
const sessionWrite = await (0, session_task_write_1.sessionTaskWrite)('resume', task.id);
|
|
57
|
+
result = sessionWrite
|
|
58
|
+
? await (0, api_fetch_1.apiFetch)(sessionWrite.path, {
|
|
59
59
|
method: 'POST',
|
|
60
|
+
credential: sessionWrite.credential,
|
|
60
61
|
body: payload,
|
|
61
62
|
})
|
|
62
63
|
: await data_provider_1.dataService.saveTaskResumePoint({ taskId: task.id, data: payload });
|
|
@@ -6,7 +6,7 @@ const base_command_1 = require("../../base-command");
|
|
|
6
6
|
const outbox_1 = require("../../lib/outbox");
|
|
7
7
|
const task_resolver_1 = require("../../lib/task-resolver");
|
|
8
8
|
const api_fetch_1 = require("../../lib/api-fetch");
|
|
9
|
-
const
|
|
9
|
+
const session_task_write_1 = require("../../lib/session-task-write");
|
|
10
10
|
class TasksReview extends base_command_1.BaseCommand {
|
|
11
11
|
static description = 'Accept or request changes on one exact Task Result';
|
|
12
12
|
static args = {
|
|
@@ -38,9 +38,9 @@ class TasksReview extends base_command_1.BaseCommand {
|
|
|
38
38
|
idempotencyKey: flags['idempotency-key'] ||
|
|
39
39
|
(0, outbox_1.idempotencyKeyFor)('task-review', task.id, JSON.stringify(payload)),
|
|
40
40
|
};
|
|
41
|
-
const
|
|
42
|
-
result =
|
|
43
|
-
? await (0, api_fetch_1.apiFetch)(
|
|
41
|
+
const sessionWrite = await (0, session_task_write_1.sessionTaskWrite)('review', task.id);
|
|
42
|
+
result = sessionWrite
|
|
43
|
+
? await (0, api_fetch_1.apiFetch)(sessionWrite.path, { method: 'POST', body: data, credential: sessionWrite.credential })
|
|
44
44
|
: await data_provider_1.dataService.reviewTaskResult({ taskId: task.id, data });
|
|
45
45
|
}
|
|
46
46
|
catch (error) {
|
|
@@ -63,6 +63,11 @@ export declare function labelsLine(labelIds?: string[], nameById?: Map<string, s
|
|
|
63
63
|
* reassigning the task changes only the implied kind.
|
|
64
64
|
*/
|
|
65
65
|
export declare function taskExecutorLabel(t: Record<string, unknown>, bin?: string): string;
|
|
66
|
+
/**
|
|
67
|
+
* The `Recurrence:` line for a series whose next occurrence was never armed.
|
|
68
|
+
* Silent otherwise: a healthy series has nothing to say here.
|
|
69
|
+
*/
|
|
70
|
+
export declare function recurrenceArmFailureLines(t: Record<string, unknown>, bin?: string): string[];
|
|
66
71
|
/**
|
|
67
72
|
* The failure rows of `tasks show`, when there are any. (S3 dogfood finding)
|
|
68
73
|
*
|
|
@@ -5,6 +5,7 @@ exports.blockerDetailLines = blockerDetailLines;
|
|
|
5
5
|
exports.completionLines = completionLines;
|
|
6
6
|
exports.labelsLine = labelsLine;
|
|
7
7
|
exports.taskExecutorLabel = taskExecutorLabel;
|
|
8
|
+
exports.recurrenceArmFailureLines = recurrenceArmFailureLines;
|
|
8
9
|
exports.taskFailureLines = taskFailureLines;
|
|
9
10
|
const core_1 = require("@oclif/core");
|
|
10
11
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
@@ -137,6 +138,20 @@ function taskExecutorLabel(t, bin = 'skrr') {
|
|
|
137
138
|
return '-';
|
|
138
139
|
}
|
|
139
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* The `Recurrence:` line for a series whose next occurrence was never armed.
|
|
143
|
+
* Silent otherwise: a healthy series has nothing to say here.
|
|
144
|
+
*/
|
|
145
|
+
function recurrenceArmFailureLines(t, bin = 'skrr') {
|
|
146
|
+
const recurrence = t.recurrence;
|
|
147
|
+
const code = recurrence?.armFailure?.code;
|
|
148
|
+
if (typeof code !== 'string' || !code)
|
|
149
|
+
return [];
|
|
150
|
+
return [
|
|
151
|
+
`Recurrence: ${(0, data_provider_1.describeRecurrenceArmFailure)(code)} (${code})`,
|
|
152
|
+
` Reschedule with \`${bin} tasks schedule\` to start the series again.`,
|
|
153
|
+
];
|
|
154
|
+
}
|
|
140
155
|
/**
|
|
141
156
|
* The failure rows of `tasks show`, when there are any. (S3 dogfood finding)
|
|
142
157
|
*
|
|
@@ -321,6 +336,8 @@ class TasksShow extends base_command_1.BaseCommand {
|
|
|
321
336
|
// question and this is the answer to it.
|
|
322
337
|
for (const line of taskFailureLines(t, this.config.bin))
|
|
323
338
|
this.log(line);
|
|
339
|
+
for (const line of recurrenceArmFailureLines(t, this.config.bin))
|
|
340
|
+
this.log(line);
|
|
324
341
|
/*
|
|
325
342
|
* Closing is the actor's call — a Task may be `done` with work still
|
|
326
343
|
* outstanding, and `resolution.closure` is where the server recorded what
|
|
@@ -17,6 +17,10 @@ export default class TasksUpdate extends BaseCommand {
|
|
|
17
17
|
priority: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
18
18
|
'start-date': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
19
19
|
'due-date': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
|
+
savings: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
21
|
+
per: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
22
|
+
effort: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
23
|
+
risk: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
24
|
estimate: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
21
25
|
/**
|
|
22
26
|
* Declared, hidden, and refused — on purpose. (S4 dogfood finding)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
|
+
const task_economics_1 = require("../../lib/task-economics");
|
|
4
5
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
6
|
const base_command_1 = require("../../base-command");
|
|
6
7
|
const web_url_1 = require("../../lib/web-url");
|
|
@@ -62,6 +63,13 @@ class TasksUpdate extends base_command_1.BaseCommand {
|
|
|
62
63
|
}),
|
|
63
64
|
'start-date': core_1.Flags.string({ description: 'New planned start date (ISO string)' }),
|
|
64
65
|
'due-date': core_1.Flags.string({ description: 'New due date (ISO string)' }),
|
|
66
|
+
savings: core_1.Flags.string({ description: 'Expected USD savings (requires --per)' }),
|
|
67
|
+
per: core_1.Flags.string({
|
|
68
|
+
options: ['month', 'year', 'once'],
|
|
69
|
+
description: 'Savings period (requires --savings)',
|
|
70
|
+
}),
|
|
71
|
+
effort: core_1.Flags.string({ description: 'Expected effort in hours, nonnegative' }),
|
|
72
|
+
risk: core_1.Flags.string({ options: ['low', 'medium', 'high'], description: 'Expected risk' }),
|
|
65
73
|
estimate: core_1.Flags.integer({
|
|
66
74
|
description: 'New estimate value from the Space estimate scale. Requires a scale on the Space (or an ' +
|
|
67
75
|
'ancestor it inherits from); with none set, the server drops the value. Set the scale ' +
|
|
@@ -356,6 +364,7 @@ class TasksUpdate extends base_command_1.BaseCommand {
|
|
|
356
364
|
startDate: flags['start-date'],
|
|
357
365
|
dueDate: flags['due-date'],
|
|
358
366
|
estimate: flags.estimate,
|
|
367
|
+
economics: (0, task_economics_1.economicsFromFlags)(flags, body.economics),
|
|
359
368
|
// Never sent: `taskUpdateMutationGuard` refuses any payload carrying
|
|
360
369
|
// `status` before the request is built. It is merged in only so the guard
|
|
361
370
|
// sees it and answers with the sentence that names `tasks move`.
|
|
@@ -39,7 +39,7 @@ const base_command_1 = require("../../../base-command");
|
|
|
39
39
|
const outbox_1 = require("../../../lib/outbox");
|
|
40
40
|
const task_resolver_1 = require("../../../lib/task-resolver");
|
|
41
41
|
const api_fetch_1 = require("../../../lib/api-fetch");
|
|
42
|
-
const
|
|
42
|
+
const session_task_write_1 = require("../../../lib/session-task-write");
|
|
43
43
|
function parseJsonObject(value, label) {
|
|
44
44
|
if (!value)
|
|
45
45
|
return undefined;
|
|
@@ -176,10 +176,11 @@ class TasksUpdatesAdd extends base_command_1.BaseCommand {
|
|
|
176
176
|
resume: resume,
|
|
177
177
|
idempotencyKey,
|
|
178
178
|
};
|
|
179
|
-
const
|
|
180
|
-
result =
|
|
181
|
-
? await (0, api_fetch_1.apiFetch)(
|
|
179
|
+
const sessionWrite = await (0, session_task_write_1.sessionTaskWrite)('update', task.id);
|
|
180
|
+
result = sessionWrite
|
|
181
|
+
? await (0, api_fetch_1.apiFetch)(sessionWrite.path, {
|
|
182
182
|
method: 'POST',
|
|
183
|
+
credential: sessionWrite.credential,
|
|
183
184
|
body: payload,
|
|
184
185
|
})
|
|
185
186
|
: await data_provider_1.dataService.appendTaskUpdate({ taskId: task.id, data: payload });
|