@skrr-ai/cli 0.1.94 → 0.1.96
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 +175 -165
- package/bin/run.js +32 -0
- package/bin/update-npm-runner.cjs +33 -0
- package/bin/update-session.cjs +194 -0
- package/bin/update-worker.cjs +208 -0
- package/dist/base-command.js +0 -15
- 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/doctor.d.ts +1 -0
- package/dist/commands/code/doctor.js +6 -0
- package/dist/commands/code/index.js +4 -0
- package/dist/commands/code/install.d.ts +5 -62
- package/dist/commands/code/install.js +86 -279
- package/dist/commands/code/jobs/show.js +12 -0
- package/dist/commands/code/rollback.d.ts +8 -0
- package/dist/commands/code/rollback.js +20 -0
- package/dist/commands/code/update.d.ts +8 -37
- package/dist/commands/code/update.js +134 -213
- 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 +4 -0
- package/dist/commands/generate-recovery-code.d.ts +13 -1
- package/dist/commands/generate-recovery-code.js +146 -13
- 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/instructions/guide.d.ts +20 -0
- package/dist/commands/instructions/guide.js +84 -0
- package/dist/commands/instructions/install.js +57 -33
- package/dist/commands/instructions/setup.d.ts +14 -0
- package/dist/commands/instructions/setup.js +72 -0
- package/dist/commands/integrations/execute.js +1 -1
- package/dist/commands/login.d.ts +5 -6
- package/dist/commands/login.js +27 -11
- package/dist/commands/logout.js +7 -7
- 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/security/overview.d.ts +11 -0
- package/dist/commands/security/overview.js +158 -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/claim.d.ts +12 -0
- package/dist/commands/spaces/claim.js +42 -0
- package/dist/commands/spaces/ownership.d.ts +12 -0
- package/dist/commands/spaces/ownership.js +46 -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/cancel-cascade.js +1 -1
- package/dist/commands/tasks/cascade-status.d.ts +2 -0
- package/dist/commands/tasks/cascade-status.js +27 -1
- package/dist/commands/tasks/create-tree.d.ts +5 -1
- package/dist/commands/tasks/create-tree.js +35 -7
- package/dist/commands/tasks/create.d.ts +4 -0
- package/dist/commands/tasks/create.js +16 -0
- package/dist/commands/tasks/deliverable/add.js +12 -3
- package/dist/commands/tasks/economics-compare.d.ts +15 -0
- package/dist/commands/tasks/economics-compare.js +60 -0
- package/dist/commands/tasks/expectations/evaluate.d.ts +13 -0
- package/dist/commands/tasks/expectations/evaluate.js +43 -0
- package/dist/commands/tasks/interrupt.js +2 -2
- package/dist/commands/tasks/list.d.ts +1 -0
- package/dist/commands/tasks/list.js +44 -1
- package/dist/commands/tasks/pause-schedule.js +1 -1
- 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/workflow-findings.js +2 -2
- package/dist/commands/token/list.d.ts +3 -5
- package/dist/commands/token/list.js +99 -57
- package/dist/commands/triggers/create.d.ts +2 -0
- package/dist/commands/triggers/create.js +15 -0
- package/dist/commands/update.d.ts +14 -0
- package/dist/commands/update.js +61 -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/generated/managed-instruction-guides.json +9 -0
- package/dist/hooks/init.d.ts +5 -0
- package/dist/hooks/init.js +27 -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 -15
- package/dist/lib/commitments.js +173 -137
- package/dist/lib/compasses.d.ts +14 -0
- package/dist/lib/compasses.js +25 -11
- package/dist/lib/daemon-installer.d.ts +2 -0
- package/dist/lib/daemon-installer.js +100 -24
- package/dist/lib/first-party-harness-doctor.js +31 -1
- package/dist/lib/first-party-harness-remote-install.d.ts +71 -0
- package/dist/lib/first-party-harness-remote-install.js +310 -0
- package/dist/lib/first-party-harness-remote-update.d.ts +46 -0
- package/dist/lib/first-party-harness-remote-update.js +242 -0
- package/dist/lib/first-party-harness-startup-update.d.ts +26 -0
- package/dist/lib/first-party-harness-startup-update.js +166 -0
- package/dist/lib/first-party-harness-update.d.ts +46 -0
- package/dist/lib/first-party-harness-update.js +289 -0
- package/dist/lib/first-party-harness.js +7 -4
- 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/managed-instruction-local.d.ts +12 -0
- package/dist/lib/managed-instruction-local.js +58 -0
- package/dist/lib/managed-instruction-setup.d.ts +35 -0
- package/dist/lib/managed-instruction-setup.js +306 -0
- package/dist/lib/measures.d.ts +28 -2
- package/dist/lib/measures.js +38 -14
- package/dist/lib/memory-sync.d.ts +1 -0
- package/dist/lib/memory-sync.js +279 -68
- 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/platform-update-local.d.ts +2 -0
- package/dist/lib/platform-update-local.js +113 -0
- package/dist/lib/platform-update.d.ts +39 -0
- package/dist/lib/platform-update.js +84 -0
- package/dist/lib/profile-machine-identity-guard.d.ts +2 -0
- package/dist/lib/profile-machine-identity-guard.js +13 -0
- package/dist/lib/prompt.d.ts +1 -0
- package/dist/lib/prompt.js +4 -3
- 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/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 +1 -0
- package/dist/lib/task-batch.d.ts +9 -0
- package/dist/lib/task-batch.js +94 -17
- package/dist/lib/task-economics.d.ts +16 -0
- package/dist/lib/task-economics.js +22 -0
- package/dist/lib/task-instruction-offer.d.ts +1 -4
- package/dist/lib/task-instruction-offer.js +3 -129
- package/dist/lib/triggers.d.ts +11 -3
- package/dist/lib/triggers.js +58 -1
- package/dist/lib/update-check.d.ts +61 -53
- package/dist/lib/update-check.js +453 -314
- 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/firstPartyHarnessChannels.d.ts +3 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.js +3 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessReleaseKeys.d.ts +82 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessReleaseKeys.js +105 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessUpdater.d.ts +110 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessUpdater.js +945 -0
- 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/cjs/harnessPermissionControls.d.ts +32 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessPermissionControls.js +62 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +4 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.js +35 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releasePolicy.d.ts +63 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releasePolicy.js +169 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseVersions.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseVersions.js +44 -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/firstPartyHarnessChannels.d.ts +3 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.js +3 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessReleaseKeys.d.ts +82 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessReleaseKeys.js +102 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessUpdater.d.ts +110 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessUpdater.js +923 -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/dist/esm/harnessPermissionControls.d.ts +32 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessPermissionControls.js +59 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.js +35 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releasePolicy.d.ts +63 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releasePolicy.js +163 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseVersions.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseVersions.js +41 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +41 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +8069 -7121
- package/docs/v1/README.md +28 -0
- package/docs/v1/api.md +55 -0
- package/docs/v1/changelog.md +16 -0
- package/docs/v1/check-examples.mjs +178 -0
- package/docs/v1/examples/api-readonly.mjs +144 -0
- package/docs/v1/operations.md +87 -0
- package/docs/v1/quickstart.md +71 -0
- package/oclif.manifest.json +49424 -46174
- package/package.json +34 -11
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseWorkflowDuration = parseWorkflowDuration;
|
|
3
4
|
exports.buildWorkflowUpdatePayload = buildWorkflowUpdatePayload;
|
|
4
5
|
const core_1 = require("@oclif/core");
|
|
5
6
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
7
|
const base_command_1 = require("../../../base-command");
|
|
7
8
|
const prompt_1 = require("../../../lib/prompt");
|
|
8
9
|
const space_output_1 = require("../../../lib/space-output");
|
|
9
|
-
|
|
10
|
+
/** `90m`, `4h`, `2d` to milliseconds; null when malformed or outside the shared bounds. */
|
|
11
|
+
function parseWorkflowDuration(text) {
|
|
12
|
+
const match = /^(\d+)\s*([mhd])$/i.exec(text.trim());
|
|
13
|
+
if (!match)
|
|
14
|
+
return null;
|
|
15
|
+
const unit = { m: 60_000, h: 3_600_000, d: 86_400_000 }[match[2].toLowerCase()];
|
|
16
|
+
const ms = Number(match[1]) * unit;
|
|
17
|
+
return (0, data_provider_1.isValidWorkflowMaxDurationMs)(ms) ? ms : null;
|
|
18
|
+
}
|
|
19
|
+
function buildWorkflowUpdatePayload({ body, title, description, clearDescription, graph, draft, semanticRevision, presentationRevision, maxDurationMs, }) {
|
|
10
20
|
return (0, prompt_1.mergeDefined)(body, {
|
|
11
21
|
title,
|
|
12
22
|
description: clearDescription ? null : description,
|
|
@@ -14,6 +24,7 @@ function buildWorkflowUpdatePayload({ body, title, description, clearDescription
|
|
|
14
24
|
draft,
|
|
15
25
|
expectedSemanticRevision: semanticRevision,
|
|
16
26
|
expectedPresentationRevision: presentationRevision,
|
|
27
|
+
maxDurationMs,
|
|
17
28
|
});
|
|
18
29
|
}
|
|
19
30
|
/** Update metadata or the mutable draft; executable changes use optimistic concurrency. */
|
|
@@ -23,6 +34,8 @@ class SpacesWorkflowsUpdate extends base_command_1.BaseCommand {
|
|
|
23
34
|
'<%= config.bin %> spaces workflows update <space-id> <workflow-id> --title "Release train"',
|
|
24
35
|
'<%= config.bin %> spaces workflows update <space-id> <workflow-id> --graph workflow.json',
|
|
25
36
|
'<%= config.bin %> spaces workflows update <space-id> <workflow-id> --draft canvas-draft.json --json',
|
|
37
|
+
'<%= config.bin %> spaces workflows update <space-id> <workflow-id> --max-duration 4h',
|
|
38
|
+
'<%= config.bin %> spaces workflows update <space-id> <workflow-id> --clear-max-duration',
|
|
26
39
|
];
|
|
27
40
|
static args = {
|
|
28
41
|
spaceId: core_1.Args.string({ description: 'Owning Space ID', required: true, ignoreStdin: true }),
|
|
@@ -45,6 +58,10 @@ class SpacesWorkflowsUpdate extends base_command_1.BaseCommand {
|
|
|
45
58
|
'semantic-revision': core_1.Flags.integer({
|
|
46
59
|
description: 'Expected semantic revision; defaults to the latest server value',
|
|
47
60
|
}),
|
|
61
|
+
'max-duration': core_1.Flags.string({
|
|
62
|
+
description: 'Run duration limit, e.g. 90m, 4h or 2d. A run still open past it is cancelled with WORKFLOW_RUN_DEADLINE. Applies from the next publish; runs already started keep their deadline',
|
|
63
|
+
}),
|
|
64
|
+
'clear-max-duration': core_1.Flags.boolean({ description: 'Remove the run duration limit' }),
|
|
48
65
|
'presentation-revision': core_1.Flags.integer({
|
|
49
66
|
description: 'Expected presentation revision; defaults to the latest server value',
|
|
50
67
|
}),
|
|
@@ -57,6 +74,20 @@ class SpacesWorkflowsUpdate extends base_command_1.BaseCommand {
|
|
|
57
74
|
if (flags.description !== undefined && flags['clear-description']) {
|
|
58
75
|
this.error('Pass either --description or --clear-description, not both.', { exit: 2 });
|
|
59
76
|
}
|
|
77
|
+
if (flags['max-duration'] !== undefined && flags['clear-max-duration']) {
|
|
78
|
+
this.error('Pass either --max-duration or --clear-max-duration, not both.', { exit: 2 });
|
|
79
|
+
}
|
|
80
|
+
let maxDurationMs;
|
|
81
|
+
if (flags['clear-max-duration'])
|
|
82
|
+
maxDurationMs = null;
|
|
83
|
+
else if (flags['max-duration'] !== undefined) {
|
|
84
|
+
const parsedDuration = parseWorkflowDuration(flags['max-duration']);
|
|
85
|
+
if (parsedDuration === null) {
|
|
86
|
+
this.error(`--max-duration must look like 90m, 4h or 2d, between ${(0, data_provider_1.describeWorkflowDuration)(data_provider_1.WORKFLOW_MAX_DURATION_MIN_MS)} and ${(0, data_provider_1.describeWorkflowDuration)(data_provider_1.WORKFLOW_MAX_DURATION_MAX_MS)}.`, { exit: 2 });
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
maxDurationMs = parsedDuration;
|
|
90
|
+
}
|
|
60
91
|
if ((flags['semantic-revision'] === undefined) !==
|
|
61
92
|
(flags['presentation-revision'] === undefined)) {
|
|
62
93
|
this.error('Pass both --semantic-revision and --presentation-revision together.', {
|
|
@@ -86,9 +117,10 @@ class SpacesWorkflowsUpdate extends base_command_1.BaseCommand {
|
|
|
86
117
|
draft,
|
|
87
118
|
semanticRevision: flags['semantic-revision'],
|
|
88
119
|
presentationRevision: flags['presentation-revision'],
|
|
120
|
+
maxDurationMs,
|
|
89
121
|
});
|
|
90
122
|
if (Object.keys(patch).length === 0) {
|
|
91
|
-
this.error('Nothing to update. Pass metadata, --graph, --draft, or --from-json.', {
|
|
123
|
+
this.error('Nothing to update. Pass metadata, --max-duration, --graph, --draft, or --from-json.', {
|
|
92
124
|
exit: 2,
|
|
93
125
|
});
|
|
94
126
|
}
|
|
@@ -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 prompt_1 = require("../../lib/prompt");
|
|
7
7
|
class TasksCancelCascade extends base_command_1.BaseCommand {
|
|
8
|
-
static description = 'Cancel
|
|
8
|
+
static description = 'Cancel running and queued work in the active cascade; future schedules stay enabled';
|
|
9
9
|
static examples = [
|
|
10
10
|
'<%= config.bin %> tasks cancel-cascade <task-id>',
|
|
11
11
|
'<%= config.bin %> tasks cancel-cascade <task-id> --yes',
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from '../../base-command';
|
|
2
|
+
/** Skip counts, the stall reason and per-task join reasons, as printed lines. */
|
|
3
|
+
export declare function cascadeSkipLines(s: Record<string, unknown>): string[];
|
|
2
4
|
export default class TasksCascadeStatus extends BaseCommand {
|
|
3
5
|
static description: string;
|
|
4
6
|
static examples: string[];
|
|
@@ -1,8 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cascadeSkipLines = cascadeSkipLines;
|
|
3
4
|
const core_1 = require("@oclif/core");
|
|
4
5
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
6
|
const base_command_1 = require("../../base-command");
|
|
7
|
+
/** Skip counts, the stall reason and per-task join reasons, as printed lines. */
|
|
8
|
+
function cascadeSkipLines(s) {
|
|
9
|
+
const lines = [
|
|
10
|
+
`Skipped: ${s.skipped ?? 0}`,
|
|
11
|
+
`Skipped duplicate: ${s.skippedDuplicate ?? 0}`,
|
|
12
|
+
`Waiting for Human: ${s.humanBlocked ?? s.humanWaitingCount ?? s.waitingForHuman ?? '-'}`,
|
|
13
|
+
];
|
|
14
|
+
if (s.stalledReason)
|
|
15
|
+
lines.push(`Waiting reason: ${s.stalledReason}`);
|
|
16
|
+
if (s.stalledReason === 'waiting_on_timed_out_human')
|
|
17
|
+
lines.push(" a person's task timed out and was never completed; the cascade stopped");
|
|
18
|
+
if (Number(s.unresolvedHumanCount) > 0)
|
|
19
|
+
lines.push(`Unresolved human: ${s.unresolvedHumanCount} (finished without a person completing these tasks)`);
|
|
20
|
+
const tasks = (Array.isArray(s.tasks) ? s.tasks : []);
|
|
21
|
+
for (const task of tasks) {
|
|
22
|
+
if (task.abortUnconfirmed)
|
|
23
|
+
lines.push(`${task.identifier || task.taskId}: cancelled; the task may still be running - check it`);
|
|
24
|
+
else if (task.cancelUnconfirmed)
|
|
25
|
+
lines.push(`${task.identifier || task.taskId}: cancelled (not confirmed in the run record; the stored row may still read otherwise)`);
|
|
26
|
+
else if (task.reason || task.joinNote)
|
|
27
|
+
lines.push(`${task.identifier || task.taskId}: ${task.reason || task.joinNote}`);
|
|
28
|
+
}
|
|
29
|
+
return lines;
|
|
30
|
+
}
|
|
6
31
|
class TasksCascadeStatus extends base_command_1.BaseCommand {
|
|
7
32
|
static description = 'Show cascade pipeline status for a task';
|
|
8
33
|
static examples = [
|
|
@@ -36,7 +61,8 @@ class TasksCascadeStatus extends base_command_1.BaseCommand {
|
|
|
36
61
|
this.log(`Total Tasks: ${s.totalTasks ?? s.total ?? '-'}`);
|
|
37
62
|
this.log(`Completed: ${s.completedTasks ?? s.completed ?? '-'}`);
|
|
38
63
|
this.log(`Failed: ${s.failedTasks ?? s.failed ?? '-'}`);
|
|
39
|
-
|
|
64
|
+
for (const line of cascadeSkipLines(s))
|
|
65
|
+
this.log(line);
|
|
40
66
|
}
|
|
41
67
|
}
|
|
42
68
|
exports.default = TasksCascadeStatus;
|
|
@@ -52,9 +52,13 @@ export declare function partialFailureResult(args: {
|
|
|
52
52
|
failedAt: TreeFailure;
|
|
53
53
|
total: number;
|
|
54
54
|
prefix?: string;
|
|
55
|
+
keyed?: boolean;
|
|
55
56
|
warnings: Array<Record<string, unknown>>;
|
|
57
|
+
failures?: Array<Record<string, unknown>>;
|
|
56
58
|
}): {
|
|
57
59
|
warnings?: Record<string, unknown>[] | undefined;
|
|
60
|
+
rerun: string;
|
|
61
|
+
failures?: Record<string, unknown>[] | undefined;
|
|
58
62
|
object: string;
|
|
59
63
|
ok: boolean;
|
|
60
64
|
count: number;
|
|
@@ -69,7 +73,6 @@ export declare function partialFailureResult(args: {
|
|
|
69
73
|
}[];
|
|
70
74
|
mapping: Record<string, string>;
|
|
71
75
|
failedAt: TreeFailure;
|
|
72
|
-
rerun: string;
|
|
73
76
|
};
|
|
74
77
|
export default class TasksCreateTree extends BaseCommand {
|
|
75
78
|
static description: string;
|
|
@@ -80,6 +83,7 @@ export default class TasksCreateTree extends BaseCommand {
|
|
|
80
83
|
'dry-run': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
81
84
|
'external-key-prefix': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
82
85
|
fresh: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
86
|
+
resume: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
83
87
|
'default-agent': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
84
88
|
space: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
85
89
|
goal: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -78,8 +78,9 @@ function partialFailureResult(args) {
|
|
|
78
78
|
})),
|
|
79
79
|
mapping,
|
|
80
80
|
failedAt,
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
...(args.failures ? { failures: args.failures } : {}),
|
|
82
|
+
rerun: prefix || args.keyed
|
|
83
|
+
? 'Re-run the same keyed file with --resume to confirm existing IDs and create only missing nodes. A submitted write may still finish; stable keys prevent duplicates.'
|
|
83
84
|
: 'Re-running creates un-keyed nodes again. Use mapping to continue by hand, or re-run with --external-key-prefix.',
|
|
84
85
|
...(warnings.length > 0 ? { warnings } : {}),
|
|
85
86
|
};
|
|
@@ -105,6 +106,10 @@ class TasksCreateTree extends base_command_1.BaseCommand {
|
|
|
105
106
|
fresh: core_1.Flags.boolean({
|
|
106
107
|
description: 'Do not derive a key prefix from the file: create a new copy even if this exact file was applied before',
|
|
107
108
|
}),
|
|
109
|
+
resume: core_1.Flags.boolean({
|
|
110
|
+
description: 'Confirm existing stable-key nodes without patching them, then create only missing nodes. Use the unchanged keyed file after an incomplete result.',
|
|
111
|
+
exclusive: ['fresh'],
|
|
112
|
+
}),
|
|
108
113
|
'default-agent': core_1.Flags.string({
|
|
109
114
|
description: 'Override the automatic assignee for nodes with no assignee. Use "auto" to inherit the space lead agent; children inherit parent assignees first.',
|
|
110
115
|
}),
|
|
@@ -212,6 +217,8 @@ class TasksCreateTree extends base_command_1.BaseCommand {
|
|
|
212
217
|
}
|
|
213
218
|
const errors = [
|
|
214
219
|
...defaultAgentErrors,
|
|
220
|
+
...(flags.resume && unkeyedNodes(planned).length
|
|
221
|
+
? ['--resume requires an externalKey for every node; supply --external-key-prefix and do not use --fresh'] : []),
|
|
215
222
|
...planned.flatMap(({ key, payload }) => (0, tasks_1.validateTaskCreatePayload)(payload).map((error) => `${key}: ${error}`)),
|
|
216
223
|
];
|
|
217
224
|
if (errors.length > 0) {
|
|
@@ -267,15 +274,17 @@ class TasksCreateTree extends base_command_1.BaseCommand {
|
|
|
267
274
|
const mapping = {};
|
|
268
275
|
const results = [];
|
|
269
276
|
// A half-applied tree reports the ids it did create; the only way back.
|
|
270
|
-
const reportPartial = (item, failure, err) => {
|
|
271
|
-
if (results.length === 0)
|
|
277
|
+
const reportPartial = (item, failure, err, failures) => {
|
|
278
|
+
if (results.length === 0 && !failures)
|
|
272
279
|
this.handleApiError(err);
|
|
273
280
|
const partial = partialFailureResult({
|
|
274
281
|
results,
|
|
275
282
|
mapping,
|
|
276
283
|
total: planned.length,
|
|
277
284
|
prefix: keyPrefix,
|
|
285
|
+
keyed: unkeyedNodes(planned).length === 0,
|
|
278
286
|
warnings,
|
|
287
|
+
failures,
|
|
279
288
|
failedAt: {
|
|
280
289
|
tempId: item.key,
|
|
281
290
|
...(item.parentKey ? { parentTempId: item.parentKey } : {}),
|
|
@@ -288,10 +297,18 @@ class TasksCreateTree extends base_command_1.BaseCommand {
|
|
|
288
297
|
process.exitCode = partial.failedAt.error.retryable ? 5 : 1;
|
|
289
298
|
this.exit(partial.failedAt.error.retryable ? 5 : 1);
|
|
290
299
|
}
|
|
291
|
-
this.log(`
|
|
300
|
+
this.log(`Confirmed ${results.length} of ${planned.length} task(s); stopped at "${item.key}":`);
|
|
292
301
|
for (const [tempId, id] of Object.entries(mapping))
|
|
293
302
|
this.log(`- ${tempId} -> ${id}`);
|
|
294
303
|
this.log(partial.rerun);
|
|
304
|
+
if (failures) {
|
|
305
|
+
for (const row of failures) {
|
|
306
|
+
const detail = row.error;
|
|
307
|
+
this.log(`- ${String(row.tempId)}: ${String(row.outcome)} — ${detail.message}`);
|
|
308
|
+
}
|
|
309
|
+
this.exit(failure.retryable ? 5 : 1);
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
295
312
|
this.handleApiError(err);
|
|
296
313
|
};
|
|
297
314
|
// The serial path: one request per node. Used for updates of existing keyed
|
|
@@ -381,7 +398,11 @@ class TasksCreateTree extends base_command_1.BaseCommand {
|
|
|
381
398
|
...(failure.error.status ? { status: failure.error.status } : {}),
|
|
382
399
|
...(failure.error.code ? { code: failure.error.code } : {}),
|
|
383
400
|
});
|
|
384
|
-
reportPartial(node, failure.error, err)
|
|
401
|
+
reportPartial(node, failure.error, err, outcome.failures.map((f) => ({
|
|
402
|
+
tempId: f.key, outcome: f.outcome ?? (f.skipped ? 'not_attempted' : 'failed'),
|
|
403
|
+
externalKey: f.externalKey ?? byKey.get(f.key)?.payload.externalKey,
|
|
404
|
+
error: f.error,
|
|
405
|
+
})));
|
|
385
406
|
}
|
|
386
407
|
return;
|
|
387
408
|
}
|
|
@@ -395,7 +416,14 @@ class TasksCreateTree extends base_command_1.BaseCommand {
|
|
|
395
416
|
if (existingTask) {
|
|
396
417
|
// An update must see its parent's id, and a later create its own parent's.
|
|
397
418
|
await flushPending();
|
|
398
|
-
|
|
419
|
+
if (flags.resume) {
|
|
420
|
+
const id = (0, tasks_1.taskId)(existingTask);
|
|
421
|
+
mapping[item.key] = id;
|
|
422
|
+
results.push({ tempId: item.key, parentTempId: item.parentKey, id, action: 'existing',
|
|
423
|
+
externalKey: item.payload.externalKey, title: existingTask.title ?? item.payload.title, task: existingTask });
|
|
424
|
+
}
|
|
425
|
+
else
|
|
426
|
+
await applySerial(item);
|
|
399
427
|
}
|
|
400
428
|
else {
|
|
401
429
|
pending.push(item);
|
|
@@ -67,6 +67,10 @@ export default class TasksCreate extends BaseCommand {
|
|
|
67
67
|
'execution-mode': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
68
68
|
'start-date': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
69
69
|
'due-date': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
70
|
+
savings: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
71
|
+
per: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
72
|
+
effort: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
73
|
+
risk: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
70
74
|
estimate: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
71
75
|
tag: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
72
76
|
'label-id': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -5,6 +5,7 @@ exports.droppedEstimateWarning = droppedEstimateWarning;
|
|
|
5
5
|
exports.taskCreateMayHaveCommitted = taskCreateMayHaveCommitted;
|
|
6
6
|
exports.taskMatchesCreateIdentity = taskMatchesCreateIdentity;
|
|
7
7
|
const core_1 = require("@oclif/core");
|
|
8
|
+
const task_economics_1 = require("../../lib/task-economics");
|
|
8
9
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
9
10
|
const base_command_1 = require("../../base-command");
|
|
10
11
|
const label_ref_1 = require("../../lib/label-ref");
|
|
@@ -223,6 +224,13 @@ class TasksCreate extends base_command_1.BaseCommand {
|
|
|
223
224
|
}),
|
|
224
225
|
'start-date': core_1.Flags.string({ description: 'Planned start date (ISO string)' }),
|
|
225
226
|
'due-date': core_1.Flags.string({ description: 'Due date (ISO string)' }),
|
|
227
|
+
savings: core_1.Flags.string({ description: 'Expected USD savings (requires --per)' }),
|
|
228
|
+
per: core_1.Flags.string({
|
|
229
|
+
options: ['month', 'year', 'once'],
|
|
230
|
+
description: 'Savings period (requires --savings)',
|
|
231
|
+
}),
|
|
232
|
+
effort: core_1.Flags.string({ description: 'Expected effort in hours, nonnegative' }),
|
|
233
|
+
risk: core_1.Flags.string({ options: ['low', 'medium', 'high'], description: 'Expected risk' }),
|
|
226
234
|
estimate: core_1.Flags.integer({
|
|
227
235
|
// Names the prerequisite AND how to satisfy it. The first version of this
|
|
228
236
|
// help said the scale was reachable only from the web UI, which was true
|
|
@@ -320,6 +328,14 @@ class TasksCreate extends base_command_1.BaseCommand {
|
|
|
320
328
|
? parsedExpectations.value
|
|
321
329
|
: undefined,
|
|
322
330
|
});
|
|
331
|
+
try {
|
|
332
|
+
const economics = (0, task_economics_1.economicsFromFlags)(flags, body.economics);
|
|
333
|
+
if (economics)
|
|
334
|
+
payload.economics = economics;
|
|
335
|
+
}
|
|
336
|
+
catch (error) {
|
|
337
|
+
this.error(error instanceof Error ? error.message : 'Invalid economics', { exit: 2 });
|
|
338
|
+
}
|
|
323
339
|
const isTemplateInstantiation = typeof payload.templateId === 'string' && payload.templateId.length > 0;
|
|
324
340
|
// Template defaults (including its assigned agents) are part of the saved
|
|
325
341
|
// resource. Do not let the ordinary "who owns an empty task?" policy
|
|
@@ -269,12 +269,21 @@ class TasksDeliverableAdd extends base_command_1.BaseCommand {
|
|
|
269
269
|
this.handleApiError(err);
|
|
270
270
|
return false;
|
|
271
271
|
}
|
|
272
|
+
const { resourceReceipt, ...archived } = asset;
|
|
273
|
+
if (!resourceReceipt?.link.id) {
|
|
274
|
+
this.warn('The file was archived, but this server did not return its Deliverable link. ' +
|
|
275
|
+
`Run skrr tasks deliverable list ${opts.taskId} --json to find the exact version before submitting a Result.`);
|
|
276
|
+
}
|
|
272
277
|
if (opts.json) {
|
|
273
|
-
this.log(JSON.stringify({ archived
|
|
278
|
+
this.log(JSON.stringify({ ...resourceReceipt, archived, identity: opts.identity }, null, 2));
|
|
274
279
|
return true;
|
|
275
280
|
}
|
|
276
|
-
|
|
277
|
-
`
|
|
281
|
+
const recorded = resourceReceipt?.link.id
|
|
282
|
+
? `Recorded Deliverable ${resourceReceipt.link.id}: ${opts.identity}`
|
|
283
|
+
: `Archived ${opts.identity}`;
|
|
284
|
+
const version = resourceReceipt?.version.id ? `version ${resourceReceipt.version.id}; ` : '';
|
|
285
|
+
this.log(`${recorded} — archived copy ${asset.id} ` +
|
|
286
|
+
`(${version}sha256 pinned; observed available; self reported).`);
|
|
278
287
|
if (opts.requestedStatus && opts.requestedStatus !== 'available') {
|
|
279
288
|
// Not silent: the platform WATCHED these bytes land, which is a stronger
|
|
280
289
|
// 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;
|
|
@@ -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;
|
|
@@ -10,7 +10,7 @@ const base_command_1 = require("../../base-command");
|
|
|
10
10
|
* activity log shows who pulled the plug and why.
|
|
11
11
|
*/
|
|
12
12
|
class TasksInterrupt extends base_command_1.BaseCommand {
|
|
13
|
-
static description = '
|
|
13
|
+
static description = 'Request an interrupt for the current run; child runs, queued work and future schedules are unchanged';
|
|
14
14
|
static examples = [
|
|
15
15
|
'<%= config.bin %> tasks interrupt <task-id>',
|
|
16
16
|
'<%= config.bin %> tasks interrupt <task-id> --reason "wrong file"',
|
|
@@ -45,7 +45,7 @@ class TasksInterrupt extends base_command_1.BaseCommand {
|
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
const c = result;
|
|
48
|
-
this.log(`
|
|
48
|
+
this.log(`Stop requested for task ${taskRef} (comment ${c.id ?? c._id ?? '?'}). Child runs and schedules are unchanged; inspect run state to confirm it stopped.`);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
exports.default = TasksInterrupt;
|
|
@@ -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,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
5
5
|
const base_command_1 = require("../../base-command");
|
|
6
6
|
const web_url_1 = require("../../lib/web-url");
|
|
7
7
|
class TasksPauseSchedule extends base_command_1.BaseCommand {
|
|
8
|
-
static description = 'Pause
|
|
8
|
+
static description = 'Pause future recurring runs; current runs and already queued work are unchanged';
|
|
9
9
|
static examples = [
|
|
10
10
|
'<%= config.bin %> tasks pause-schedule <task-id>',
|
|
11
11
|
'<%= config.bin %> tasks pause-schedule <task-id> --json',
|
|
@@ -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
|
*
|