@skrr-ai/cli 0.1.22 → 0.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -73
- package/bin/dev-fallback.js +221 -0
- package/bin/run.js +96 -0
- package/dist/base-command.d.ts +15 -0
- package/dist/base-command.js +145 -11
- package/dist/commands/agents/attach-harness.d.ts +37 -0
- package/dist/commands/agents/attach-harness.js +102 -3
- package/dist/commands/agents/chat.d.ts +69 -1
- package/dist/commands/agents/chat.js +202 -22
- package/dist/commands/agents/create.d.ts +38 -0
- package/dist/commands/agents/create.js +95 -2
- package/dist/commands/agents/schedule-trace.js +11 -0
- package/dist/commands/agents/show.js +29 -1
- package/dist/commands/api-keys/create.d.ts +24 -0
- package/dist/commands/api-keys/create.js +80 -0
- package/dist/commands/api-keys/list.d.ts +11 -0
- package/dist/commands/api-keys/list.js +42 -0
- package/dist/commands/api-keys/revoke.d.ts +14 -0
- package/dist/commands/api-keys/revoke.js +33 -0
- package/dist/commands/api-keys/rotate.d.ts +19 -0
- package/dist/commands/api-keys/rotate.js +42 -0
- package/dist/commands/balance/index.d.ts +18 -0
- package/dist/commands/balance/index.js +29 -0
- package/dist/commands/balance/show.d.ts +25 -0
- package/dist/commands/balance/show.js +60 -0
- package/dist/commands/balance/statement.d.ts +19 -0
- package/dist/commands/balance/statement.js +52 -0
- package/dist/commands/browser/doctor.d.ts +11 -0
- package/dist/commands/browser/doctor.js +11 -0
- package/dist/commands/code/jobs/approve.d.ts +25 -0
- package/dist/commands/code/jobs/approve.js +52 -0
- package/dist/commands/code/jobs/cancel.d.ts +12 -0
- package/dist/commands/code/jobs/cancel.js +39 -0
- package/dist/commands/code/jobs/index.d.ts +19 -0
- package/dist/commands/code/jobs/index.js +38 -0
- package/dist/commands/code/jobs/list.d.ts +12 -0
- package/dist/commands/code/jobs/list.js +87 -0
- package/dist/commands/code/jobs/run.d.ts +32 -0
- package/dist/commands/code/jobs/run.js +151 -0
- package/dist/commands/code/jobs/show.d.ts +12 -0
- package/dist/commands/code/jobs/show.js +86 -0
- package/dist/commands/commitments/preflight.js +18 -4
- package/dist/commands/commitments/receipt-metrics.d.ts +39 -0
- package/dist/commands/commitments/receipt-metrics.js +78 -0
- package/dist/commands/convos/search.js +5 -5
- package/dist/commands/harnesses/leases/list.d.ts +3 -0
- package/dist/commands/harnesses/leases/list.js +59 -12
- package/dist/commands/harnesses/leases/show.js +36 -0
- package/dist/commands/harnesses/list.d.ts +18 -0
- package/dist/commands/harnesses/list.js +30 -0
- package/dist/commands/harnesses/products.js +49 -3
- package/dist/commands/harnesses/quota.d.ts +16 -0
- package/dist/commands/harnesses/quota.js +26 -1
- package/dist/commands/harnesses/usage.js +17 -0
- package/dist/commands/inbox/index.d.ts +2 -1
- package/dist/commands/inbox/index.js +27 -4
- package/dist/commands/login.js +4 -1
- package/dist/commands/machines/dedicated/create.d.ts +18 -0
- package/dist/commands/machines/dedicated/create.js +90 -0
- package/dist/commands/machines/dedicated/destroy.d.ts +14 -0
- package/dist/commands/machines/dedicated/destroy.js +56 -0
- package/dist/commands/machines/dedicated/grow.d.ts +13 -0
- package/dist/commands/machines/dedicated/grow.js +46 -0
- package/dist/commands/machines/dedicated/health-check.d.ts +12 -0
- package/dist/commands/machines/dedicated/health-check.js +42 -0
- package/dist/commands/machines/dedicated/incident-close.d.ts +12 -0
- package/dist/commands/machines/dedicated/incident-close.js +42 -0
- package/dist/commands/machines/dedicated/index.d.ts +6 -0
- package/dist/commands/machines/dedicated/index.js +39 -0
- package/dist/commands/machines/dedicated/list.d.ts +11 -0
- package/dist/commands/machines/dedicated/list.js +58 -0
- package/dist/commands/machines/dedicated/restart.d.ts +12 -0
- package/dist/commands/machines/dedicated/restart.js +42 -0
- package/dist/commands/machines/dedicated/show.d.ts +12 -0
- package/dist/commands/machines/dedicated/show.js +58 -0
- package/dist/commands/machines/dedicated/snapshot.d.ts +12 -0
- package/dist/commands/machines/dedicated/snapshot.js +42 -0
- package/dist/commands/machines/dedicated/start.d.ts +12 -0
- package/dist/commands/machines/dedicated/start.js +42 -0
- package/dist/commands/machines/dedicated/stop.d.ts +12 -0
- package/dist/commands/machines/dedicated/stop.js +42 -0
- package/dist/commands/machines/hosted/index.js +4 -1
- package/dist/commands/machines/list.d.ts +1 -0
- package/dist/commands/machines/list.js +33 -5
- package/dist/commands/memory/approvals/issue.d.ts +18 -0
- package/dist/commands/memory/approvals/issue.js +63 -0
- package/dist/commands/memory/commit.js +5 -2
- package/dist/commands/memory/context.d.ts +3 -2
- package/dist/commands/memory/context.js +9 -11
- package/dist/commands/memory/delete.d.ts +1 -1
- package/dist/commands/memory/list.d.ts +1 -1
- package/dist/commands/memory/list.js +1 -1
- package/dist/commands/memory/mounts/resolve.d.ts +10 -0
- package/dist/commands/memory/mounts/resolve.js +27 -0
- package/dist/commands/memory/proposals/commit.d.ts +18 -0
- package/dist/commands/memory/proposals/commit.js +32 -0
- package/dist/commands/memory/proposals/create.d.ts +18 -0
- package/dist/commands/memory/proposals/create.js +56 -0
- package/dist/commands/memory/proposals/list.d.ts +13 -0
- package/dist/commands/memory/proposals/list.js +31 -0
- package/dist/commands/memory/proposals/promote.d.ts +22 -0
- package/dist/commands/memory/proposals/promote.js +33 -0
- package/dist/commands/memory/proposals/reject.d.ts +16 -0
- package/dist/commands/memory/proposals/reject.js +28 -0
- package/dist/commands/memory/rebuild-index.d.ts +20 -0
- package/dist/commands/memory/rebuild-index.js +25 -0
- package/dist/commands/memory/save.d.ts +1 -1
- package/dist/commands/memory/save.js +1 -1
- package/dist/commands/memory/search.d.ts +6 -3
- package/dist/commands/memory/search.js +27 -3
- package/dist/commands/memory/show.d.ts +1 -1
- package/dist/commands/memory/stores/archive.d.ts +14 -0
- package/dist/commands/memory/stores/archive.js +31 -0
- package/dist/commands/memory/stores/create.d.ts +12 -0
- package/dist/commands/memory/stores/create.js +30 -0
- package/dist/commands/memory/stores/delete.d.ts +15 -0
- package/dist/commands/memory/stores/delete.js +38 -0
- package/dist/commands/memory/stores/list.d.ts +10 -0
- package/dist/commands/memory/stores/list.js +29 -0
- package/dist/commands/memory/stores/show.d.ts +12 -0
- package/dist/commands/memory/stores/show.js +14 -0
- package/dist/commands/memory/stores/update.d.ts +15 -0
- package/dist/commands/memory/stores/update.js +39 -0
- package/dist/commands/memory/sync/delete.d.ts +13 -0
- package/dist/commands/memory/sync/delete.js +35 -0
- package/dist/commands/memory/sync/pull.d.ts +19 -0
- package/dist/commands/memory/sync/pull.js +52 -0
- package/dist/commands/memory/sync/push.d.ts +18 -0
- package/dist/commands/memory/sync/push.js +115 -0
- package/dist/commands/memory/sync/resolve.d.ts +23 -0
- package/dist/commands/memory/sync/resolve.js +27 -0
- package/dist/commands/memory/sync/status.d.ts +9 -0
- package/dist/commands/memory/sync/status.js +22 -0
- package/dist/commands/memory/topics/archive.d.ts +20 -0
- package/dist/commands/memory/topics/archive.js +29 -0
- package/dist/commands/memory/topics/create.d.ts +23 -0
- package/dist/commands/memory/topics/create.js +46 -0
- package/dist/commands/memory/topics/delete.d.ts +22 -0
- package/dist/commands/memory/topics/delete.js +30 -0
- package/dist/commands/memory/topics/forget.d.ts +22 -0
- package/dist/commands/memory/topics/forget.js +29 -0
- package/dist/commands/memory/topics/list.d.ts +13 -0
- package/dist/commands/memory/topics/list.js +22 -0
- package/dist/commands/memory/topics/move.d.ts +22 -0
- package/dist/commands/memory/topics/move.js +26 -0
- package/dist/commands/memory/topics/show.d.ts +17 -0
- package/dist/commands/memory/topics/show.js +21 -0
- package/dist/commands/memory/topics/update.d.ts +23 -0
- package/dist/commands/memory/topics/update.js +27 -0
- package/dist/commands/memory/tree.d.ts +5 -2
- package/dist/commands/memory/tree.js +20 -2
- package/dist/commands/memory/update.d.ts +1 -1
- package/dist/commands/memory/versions/list.d.ts +16 -0
- package/dist/commands/memory/versions/list.js +22 -0
- package/dist/commands/memory/versions/redact.d.ts +21 -0
- package/dist/commands/memory/versions/redact.js +22 -0
- package/dist/commands/memory/versions/restore.d.ts +20 -0
- package/dist/commands/memory/versions/restore.js +16 -0
- package/dist/commands/memory/versions/show.d.ts +15 -0
- package/dist/commands/memory/versions/show.js +17 -0
- package/dist/commands/messages/list.js +25 -8
- package/dist/commands/messages/show.js +10 -0
- package/dist/commands/spaces/update.js +16 -12
- package/dist/commands/spaces/work-sync/reconcile.d.ts +38 -0
- package/dist/commands/spaces/work-sync/reconcile.js +90 -0
- package/dist/commands/spaces/work-sync/telemetry.d.ts +29 -0
- package/dist/commands/spaces/work-sync/telemetry.js +96 -0
- package/dist/commands/store/install.js +5 -1
- package/dist/commands/store/releases.js +1 -1
- package/dist/commands/store/update.js +5 -1
- package/dist/commands/subscriptions/cancel.js +5 -1
- package/dist/commands/subscriptions/health.js +5 -1
- package/dist/commands/subscriptions/status.js +5 -1
- package/dist/commands/subscriptions/subscribe.js +5 -1
- package/dist/commands/tasks/activity.d.ts +2 -3
- package/dist/commands/tasks/activity.js +20 -6
- package/dist/commands/tasks/complete.d.ts +22 -150
- package/dist/commands/tasks/complete.js +174 -599
- package/dist/commands/tasks/create.d.ts +6 -0
- package/dist/commands/tasks/create.js +114 -4
- package/dist/commands/tasks/deliverable/add.d.ts +8 -0
- package/dist/commands/tasks/deliverable/add.js +62 -11
- package/dist/commands/tasks/deliverable/confirm.d.ts +5 -5
- package/dist/commands/tasks/deliverable/confirm.js +9 -18
- package/dist/commands/tasks/deliverable/list.d.ts +12 -0
- package/dist/commands/tasks/deliverable/list.js +58 -0
- package/dist/commands/tasks/events/append.d.ts +2 -0
- package/dist/commands/tasks/events/append.js +41 -6
- package/dist/commands/tasks/events/list.d.ts +1 -0
- package/dist/commands/tasks/events/list.js +1 -0
- package/dist/commands/tasks/events/tail.d.ts +1 -0
- package/dist/commands/tasks/events/tail.js +1 -0
- package/dist/commands/tasks/expectations/assess.d.ts +21 -0
- package/dist/commands/tasks/expectations/assess.js +103 -0
- package/dist/commands/tasks/expectations.js +121 -25
- package/dist/commands/tasks/judge.d.ts +1 -0
- package/dist/commands/tasks/judge.js +2 -1
- package/dist/commands/tasks/output.d.ts +1 -11
- package/dist/commands/tasks/output.js +80 -141
- package/dist/commands/tasks/report.d.ts +3 -3
- package/dist/commands/tasks/report.js +66 -41
- package/dist/commands/tasks/resource/add.d.ts +23 -0
- package/dist/commands/tasks/resource/add.js +76 -0
- package/dist/commands/tasks/resource/list.d.ts +13 -0
- package/dist/commands/tasks/resource/list.js +41 -0
- package/dist/commands/tasks/result/show.d.ts +13 -0
- package/dist/commands/tasks/result/show.js +64 -0
- package/dist/commands/tasks/result/submit.d.ts +26 -0
- package/dist/commands/tasks/result/submit.js +134 -0
- package/dist/commands/tasks/resume/save.d.ts +16 -0
- package/dist/commands/tasks/resume/save.js +69 -0
- package/dist/commands/tasks/resume/show.d.ts +13 -0
- package/dist/commands/tasks/resume/show.js +35 -0
- package/dist/commands/tasks/review.d.ts +17 -0
- package/dist/commands/tasks/review.js +54 -0
- package/dist/commands/tasks/runs.js +5 -0
- package/dist/commands/tasks/self-schedule.js +7 -4
- package/dist/commands/tasks/show.js +19 -0
- package/dist/commands/tasks/timeline.d.ts +2 -2
- package/dist/commands/tasks/timeline.js +19 -24
- package/dist/commands/tasks/updates/add.d.ts +22 -0
- package/dist/commands/tasks/updates/add.js +122 -0
- package/dist/commands/tasks/updates/list.d.ts +15 -0
- package/dist/commands/tasks/updates/list.js +57 -0
- package/dist/commands/tasks/waive.d.ts +1 -0
- package/dist/commands/tasks/waive.js +2 -1
- package/dist/lib/agentic-stream.d.ts +257 -0
- package/dist/lib/agentic-stream.js +490 -33
- package/dist/lib/balance.d.ts +8 -0
- package/dist/lib/commitment-product.d.ts +10 -1
- package/dist/lib/commitment-product.js +66 -2
- package/dist/lib/commitments.d.ts +2 -1
- package/dist/lib/commitments.js +1 -0
- package/dist/lib/conversation-search.d.ts +3 -0
- package/dist/lib/conversation-search.js +75 -0
- package/dist/lib/dedicated-machines.d.ts +66 -0
- package/dist/lib/dedicated-machines.js +161 -0
- package/dist/lib/execution-target.d.ts +21 -0
- package/dist/lib/execution-target.js +22 -6
- package/dist/lib/harnesses.d.ts +87 -6
- package/dist/lib/harnesses.js +32 -1
- package/dist/lib/hosted-machines.js +9 -0
- package/dist/lib/inbox.d.ts +2 -1
- package/dist/lib/machines.d.ts +17 -0
- package/dist/lib/machines.js +29 -0
- package/dist/lib/managed-agent-keys.d.ts +104 -0
- package/dist/lib/managed-agent-keys.js +50 -0
- package/dist/lib/memory-scope.d.ts +4 -3
- package/dist/lib/memory-scope.js +9 -9
- package/dist/lib/memory-sync.d.ts +114 -0
- package/dist/lib/memory-sync.js +730 -0
- package/dist/lib/message-provenance.d.ts +42 -0
- package/dist/lib/message-provenance.js +89 -0
- package/dist/lib/scoped-memory-command.d.ts +68 -0
- package/dist/lib/scoped-memory-command.js +183 -0
- package/dist/lib/session-task-endpoints.d.ts +1 -1
- package/dist/lib/session-task-endpoints.js +7 -0
- package/dist/lib/sky-code-broker.d.ts +47 -0
- package/dist/lib/sky-code-broker.js +50 -0
- package/dist/lib/sky-code-doctor.js +10 -1
- package/dist/lib/task-artifact-flags.d.ts +2 -0
- package/dist/lib/task-artifact-flags.js +7 -0
- package/dist/lib/task-execution.d.ts +4 -5
- package/dist/lib/task-execution.js +4 -5
- package/dist/lib/task-extras.d.ts +1 -5
- package/dist/lib/task-extras.js +1 -5
- package/dist/lib/task-legacy.d.ts +24 -0
- package/dist/lib/task-legacy.js +48 -0
- package/dist/lib/task-transcript.d.ts +5 -7
- package/dist/lib/task-transcript.js +8 -16
- package/dist/lib/tasks.d.ts +39 -21
- package/dist/lib/tasks.js +64 -21
- package/dist/lib/triggers.d.ts +39 -1
- package/dist/lib/triggers.js +70 -2
- package/dist/lib/usage-discovery.d.ts +17 -1
- package/dist/lib/usage-discovery.js +17 -1
- package/dist/lib/work-sync.d.ts +70 -0
- package/dist/lib/work-sync.js +29 -0
- package/dist/node_modules/@skrr-ai/data-provider/index.js +3760 -3621
- package/oclif.manifest.json +14653 -7813
- package/package.json +26 -5
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseCommand } from '../../base-command';
|
|
2
|
+
import { type TaskRecord } from '../../lib/tasks';
|
|
2
3
|
/**
|
|
3
4
|
* Whether the estimate we asked for survived the write. (S3 dogfood finding)
|
|
4
5
|
*
|
|
@@ -25,6 +26,9 @@ import { BaseCommand } from '../../base-command';
|
|
|
25
26
|
* silently-dropped assignee (OSK-4857).
|
|
26
27
|
*/
|
|
27
28
|
export declare function droppedEstimateWarning(requested: number | undefined, written: Record<string, unknown> | null | undefined, spaceId?: string | null): string | null;
|
|
29
|
+
/** A create may have committed before any of these response failures surfaced. */
|
|
30
|
+
export declare function taskCreateMayHaveCommitted(error: unknown): boolean;
|
|
31
|
+
export declare function taskMatchesCreateIdentity(task: TaskRecord, payload: TaskRecord): boolean;
|
|
28
32
|
export default class TasksCreate extends BaseCommand {
|
|
29
33
|
static description: string;
|
|
30
34
|
static examples: string[];
|
|
@@ -54,6 +58,7 @@ export default class TasksCreate extends BaseCommand {
|
|
|
54
58
|
'dri-agent': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
55
59
|
'dri-user': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
56
60
|
expect: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
61
|
+
'review-policy': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
57
62
|
'execution-mode': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
58
63
|
'start-date': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
59
64
|
'due-date': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -63,6 +68,7 @@ export default class TasksCreate extends BaseCommand {
|
|
|
63
68
|
worktree: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
64
69
|
};
|
|
65
70
|
run(): Promise<void>;
|
|
71
|
+
private createTaskOrRecover;
|
|
66
72
|
/**
|
|
67
73
|
* Predict the create route's `ASSIGNEE_NOT_IN_SPACE` degradation for a
|
|
68
74
|
* DEFAULTED assignee, so `--dry-run` does not report a payload the real
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.droppedEstimateWarning = droppedEstimateWarning;
|
|
4
|
+
exports.taskCreateMayHaveCommitted = taskCreateMayHaveCommitted;
|
|
5
|
+
exports.taskMatchesCreateIdentity = taskMatchesCreateIdentity;
|
|
4
6
|
const core_1 = require("@oclif/core");
|
|
5
7
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
8
|
const base_command_1 = require("../../base-command");
|
|
@@ -51,6 +53,53 @@ function droppedEstimateWarning(requested, written, spaceId) {
|
|
|
51
53
|
'estimate scale, so the value is discarded rather than rejected. ' +
|
|
52
54
|
'Set one with `spaces update <space> --estimate-scale <scale> --estimate-migration <clear|migrate>`.');
|
|
53
55
|
}
|
|
56
|
+
function taskCreateFailureCode(error) {
|
|
57
|
+
const failure = error;
|
|
58
|
+
if (typeof failure?.body === 'string') {
|
|
59
|
+
try {
|
|
60
|
+
const parsed = JSON.parse(failure.body);
|
|
61
|
+
if (typeof parsed.code === 'string')
|
|
62
|
+
return parsed.code;
|
|
63
|
+
if (typeof parsed.errorType === 'string')
|
|
64
|
+
return parsed.errorType;
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
// Non-JSON response bodies carry no typed code.
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return typeof failure?.code === 'string' ? failure.code : undefined;
|
|
71
|
+
}
|
|
72
|
+
/** A create may have committed before any of these response failures surfaced. */
|
|
73
|
+
function taskCreateMayHaveCommitted(error) {
|
|
74
|
+
const failure = error;
|
|
75
|
+
const status = failure?.status ?? failure?.response?.status;
|
|
76
|
+
if (typeof status === 'number' && status >= 500)
|
|
77
|
+
return true;
|
|
78
|
+
if (taskCreateFailureCode(error) === 'TASK_EXTERNAL_KEY_CONFLICT')
|
|
79
|
+
return true;
|
|
80
|
+
const code = failure?.code || '';
|
|
81
|
+
if (['ECONNRESET', 'ETIMEDOUT', 'EAI_AGAIN', 'ENOTFOUND'].includes(code))
|
|
82
|
+
return true;
|
|
83
|
+
return /fetch failed|socket hang up|timed? ?out/i.test(failure?.message || '');
|
|
84
|
+
}
|
|
85
|
+
function taskMatchesCreateIdentity(task, payload) {
|
|
86
|
+
for (const field of [
|
|
87
|
+
'externalKey',
|
|
88
|
+
'title',
|
|
89
|
+
'spaceId',
|
|
90
|
+
'goalId',
|
|
91
|
+
'projectId',
|
|
92
|
+
'parentId',
|
|
93
|
+
'commitmentId',
|
|
94
|
+
]) {
|
|
95
|
+
const requested = payload[field];
|
|
96
|
+
if (requested === undefined || requested === null || requested === '')
|
|
97
|
+
continue;
|
|
98
|
+
if (String(task[field] ?? '') !== String(requested))
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
54
103
|
class TasksCreate extends base_command_1.BaseCommand {
|
|
55
104
|
static description = 'Create a new task';
|
|
56
105
|
static examples = [
|
|
@@ -143,6 +192,13 @@ class TasksCreate extends base_command_1.BaseCommand {
|
|
|
143
192
|
" Injected into the agent's instructions and checked against what the run produced. " +
|
|
144
193
|
'Omit to inherit the space default.',
|
|
145
194
|
}),
|
|
195
|
+
'review-policy': core_1.Flags.string({
|
|
196
|
+
options: ['none', 'required'],
|
|
197
|
+
description: 'Whether closing this Task needs someone other than the Result author to accept it. ' +
|
|
198
|
+
"Default 'none': the Expectations you declare are already your definition of done. " +
|
|
199
|
+
"Use 'required' when the work warrants a second pair of eyes — it applies to every " +
|
|
200
|
+
'executor, human or agent.',
|
|
201
|
+
}),
|
|
146
202
|
'execution-mode': core_1.Flags.string({
|
|
147
203
|
description: 'Who executes the task: agent or human. Required when both Humans and Agents are ' +
|
|
148
204
|
'assigned. Passing "human" with no assignee flags files the task against you, ' +
|
|
@@ -357,8 +413,11 @@ class TasksCreate extends base_command_1.BaseCommand {
|
|
|
357
413
|
});
|
|
358
414
|
}
|
|
359
415
|
let created;
|
|
416
|
+
let createRecovery;
|
|
360
417
|
try {
|
|
361
|
-
|
|
418
|
+
const result = await this.createTaskOrRecover(payload);
|
|
419
|
+
created = result.task;
|
|
420
|
+
createRecovery = result.recovery;
|
|
362
421
|
}
|
|
363
422
|
catch (err) {
|
|
364
423
|
// The CLI resolves the assignee default BEFORE sending, so by the time
|
|
@@ -405,7 +464,9 @@ class TasksCreate extends base_command_1.BaseCommand {
|
|
|
405
464
|
'Add it to the space, or pass an assignee explicitly.',
|
|
406
465
|
};
|
|
407
466
|
try {
|
|
408
|
-
|
|
467
|
+
const result = await this.createTaskOrRecover(payload);
|
|
468
|
+
created = result.task;
|
|
469
|
+
createRecovery = result.recovery;
|
|
409
470
|
}
|
|
410
471
|
catch (retryErr) {
|
|
411
472
|
this.handleApiError(retryErr);
|
|
@@ -423,10 +484,18 @@ class TasksCreate extends base_command_1.BaseCommand {
|
|
|
423
484
|
// bound". Surface the same decision plain mode prints under `assignment`
|
|
424
485
|
// — a scripted caller is exactly the audience that never sees the note.
|
|
425
486
|
// (OSK-4856)
|
|
426
|
-
this.log(JSON.stringify({
|
|
487
|
+
this.log(JSON.stringify({
|
|
488
|
+
...created,
|
|
489
|
+
url,
|
|
490
|
+
assignment: defaultAgentResolution,
|
|
491
|
+
...(createRecovery ? { recovery: createRecovery } : {}),
|
|
492
|
+
}, null, 2));
|
|
427
493
|
return;
|
|
428
494
|
}
|
|
429
|
-
this.log(
|
|
495
|
+
this.log(`${createRecovery ? 'Recovered' : 'Created'} task ${(0, tasks_1.formatTaskLabel)(created)}`);
|
|
496
|
+
if (createRecovery) {
|
|
497
|
+
this.log('The create response was uncertain, so skrr resolved the external key and returned the existing task instead of creating a duplicate.');
|
|
498
|
+
}
|
|
430
499
|
// Say so when nobody was assigned. The task exists either way — this is the
|
|
431
500
|
// line that stops "unassigned" from being a silent outcome.
|
|
432
501
|
if (defaultAgentResolution.note)
|
|
@@ -435,6 +504,47 @@ class TasksCreate extends base_command_1.BaseCommand {
|
|
|
435
504
|
this.log(`View it at ${url}`);
|
|
436
505
|
await (0, task_instruction_offer_1.maybeOfferTaskManagementInstructions)((message) => this.log(message));
|
|
437
506
|
}
|
|
507
|
+
async createTaskOrRecover(payload) {
|
|
508
|
+
try {
|
|
509
|
+
return {
|
|
510
|
+
task: await data_provider_1.dataService.createTask(payload),
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
catch (error) {
|
|
514
|
+
const externalKey = typeof payload.externalKey === 'string' ? payload.externalKey.trim() : '';
|
|
515
|
+
if (!externalKey || !taskCreateMayHaveCommitted(error))
|
|
516
|
+
throw error;
|
|
517
|
+
try {
|
|
518
|
+
const existing = await (0, tasks_1.findTaskByExternalKey)({
|
|
519
|
+
externalKey,
|
|
520
|
+
spaceId: payload.spaceId,
|
|
521
|
+
goalId: payload.goalId,
|
|
522
|
+
parentId: payload.parentId,
|
|
523
|
+
});
|
|
524
|
+
if (existing.task &&
|
|
525
|
+
existing.duplicates.length === 0 &&
|
|
526
|
+
taskMatchesCreateIdentity(existing.task, payload)) {
|
|
527
|
+
return {
|
|
528
|
+
task: existing.task,
|
|
529
|
+
recovery: {
|
|
530
|
+
kind: 'external_key_reconciliation',
|
|
531
|
+
externalKey,
|
|
532
|
+
originalFailureCode: taskCreateFailureCode(error) ?? null,
|
|
533
|
+
originalStatus: error?.status ??
|
|
534
|
+
error?.response?.status ??
|
|
535
|
+
null,
|
|
536
|
+
note: 'The original create response was uncertain; the existing matching task is the canonical result.',
|
|
537
|
+
},
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
catch {
|
|
542
|
+
// Preserve the original failure. A failed reconciliation is not proof
|
|
543
|
+
// that the write did or did not commit.
|
|
544
|
+
}
|
|
545
|
+
throw error;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
438
548
|
/**
|
|
439
549
|
* Predict the create route's `ASSIGNEE_NOT_IN_SPACE` degradation for a
|
|
440
550
|
* DEFAULTED assignee, so `--dry-run` does not report a payload the real
|
|
@@ -16,7 +16,15 @@ export default class TasksDeliverableAdd extends BaseCommand {
|
|
|
16
16
|
coordinate: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
17
17
|
};
|
|
18
18
|
static flags: {
|
|
19
|
+
status: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
19
20
|
lifecycle: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
21
|
+
title: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
22
|
+
provider: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
23
|
+
version: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
24
|
+
'content-digest': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
25
|
+
expectation: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
26
|
+
'run-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
27
|
+
'idempotency-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
28
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
21
29
|
};
|
|
22
30
|
run(): Promise<void>;
|
|
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
4
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
5
|
const base_command_1 = require("../../../base-command");
|
|
6
|
+
const outbox_1 = require("../../../lib/outbox");
|
|
7
|
+
const api_fetch_1 = require("../../../lib/api-fetch");
|
|
8
|
+
const session_task_endpoints_1 = require("../../../lib/session-task-endpoints");
|
|
6
9
|
const tasks_1 = require("../../../lib/tasks");
|
|
7
10
|
/**
|
|
8
11
|
* `skrr tasks deliverable add <task> <kind>:<identity>[@<location>]`
|
|
@@ -14,28 +17,57 @@ const tasks_1 = require("../../../lib/tasks");
|
|
|
14
17
|
* optional structured one.
|
|
15
18
|
*/
|
|
16
19
|
class TasksDeliverableAdd extends base_command_1.BaseCommand {
|
|
17
|
-
static description = 'Record something this task produced (a commit, a page, a URL, a file, a message, a dataset)'
|
|
20
|
+
static description = 'Record something this task produced (a commit, a page, a URL, a file, a message, a dataset).\n' +
|
|
21
|
+
'\n' +
|
|
22
|
+
'IDENTITY is the part before @; LOCATION is the part after it. They are not the same ' +
|
|
23
|
+
'grammar as `--expect`, where the same-looking `code:origin/main` names a DESTINATION ' +
|
|
24
|
+
'rather than a thing that exists. Here `origin/main` is where the commit landed, and ' +
|
|
25
|
+
'the commit SHA is what is identified.\n' +
|
|
26
|
+
'\n' +
|
|
27
|
+
'Two Deliverables share one Resource when their identity matches, scoped to the ' +
|
|
28
|
+
'workspace. A bare relative path has no global meaning, so `docs/report.md` from two ' +
|
|
29
|
+
'different repositories in one workspace IS the same Resource — pass --provider and a ' +
|
|
30
|
+
"provider id when you mean a specific system's object, which moves the identity into " +
|
|
31
|
+
"that provider's namespace. Without --version or a content digest the version is " +
|
|
32
|
+
'`locator_only`: nothing pins which revision it is, and a later sighting of the same ' +
|
|
33
|
+
'coordinate may be different bytes.';
|
|
18
34
|
static examples = [
|
|
19
35
|
'<%= config.bin %> tasks deliverable add <task-id> code:a1b2c3d@origin/main',
|
|
20
36
|
'<%= config.bin %> tasks deliverable add <task-id> page:d_92@Engineering/deploy',
|
|
21
37
|
'<%= config.bin %> tasks deliverable add <task-id> file/pdf:f_71@Drive/Reports',
|
|
22
|
-
'<%= config.bin %> tasks deliverable add <task-id> code:a1b2c3d --
|
|
38
|
+
'<%= config.bin %> tasks deliverable add <task-id> code:a1b2c3d --status in_review',
|
|
23
39
|
];
|
|
24
40
|
static args = {
|
|
25
41
|
task: core_1.Args.string({ description: 'Task id or ref', required: true, ignoreStdin: true }),
|
|
26
42
|
coordinate: core_1.Args.string({
|
|
27
|
-
description: '<kind>[/<format>]:<identity>[@<location>] —
|
|
28
|
-
'file/pdf:report_92@Drive/Reports'
|
|
43
|
+
description: '<kind>[/<format>]:<identity>[@<location>] — identity before @, location after. ' +
|
|
44
|
+
'e.g. code:a1b2c3d@origin/main, file/pdf:report_92@Drive/Reports. ' +
|
|
45
|
+
'Kinds: code, file, page, url, message, dataset',
|
|
29
46
|
required: true,
|
|
30
47
|
ignoreStdin: true,
|
|
31
48
|
}),
|
|
32
49
|
};
|
|
33
50
|
static flags = {
|
|
51
|
+
status: core_1.Flags.string({
|
|
52
|
+
options: ['local', 'in_review', 'available', 'unavailable', 'superseded'],
|
|
53
|
+
description: 'Observed availability. Defaults to `local`; evidence strength is recorded separately.',
|
|
54
|
+
}),
|
|
34
55
|
lifecycle: core_1.Flags.string({
|
|
35
|
-
options: ['local', 'in_review', '
|
|
36
|
-
description: '
|
|
37
|
-
|
|
56
|
+
options: ['local', 'in_review', 'available', 'unavailable', 'superseded'],
|
|
57
|
+
description: 'Deprecated compatibility alias for --status',
|
|
58
|
+
hidden: true,
|
|
59
|
+
}),
|
|
60
|
+
title: core_1.Flags.string({ description: 'Human-readable Deliverable name' }),
|
|
61
|
+
provider: core_1.Flags.string({
|
|
62
|
+
description: 'Provider, such as github or drive. This CHANGES the Resource identity: it moves the ' +
|
|
63
|
+
"key from the locator namespace into the provider's, so the same coordinate with and " +
|
|
64
|
+
'without --provider are two different Resources',
|
|
38
65
|
}),
|
|
66
|
+
version: core_1.Flags.string({ description: 'Exact provider version, such as a full commit SHA' }),
|
|
67
|
+
'content-digest': core_1.Flags.string({ description: 'Integrity digest for this exact version' }),
|
|
68
|
+
expectation: core_1.Flags.string({ multiple: true, description: 'Expectation id this satisfies' }),
|
|
69
|
+
'run-id': core_1.Flags.string({ description: 'Run that produced it' }),
|
|
70
|
+
'idempotency-key': core_1.Flags.string({ description: 'Stable retry key' }),
|
|
39
71
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
40
72
|
};
|
|
41
73
|
async run() {
|
|
@@ -48,12 +80,31 @@ class TasksDeliverableAdd extends base_command_1.BaseCommand {
|
|
|
48
80
|
this.error(parsed.error, { exit: 1 });
|
|
49
81
|
return;
|
|
50
82
|
}
|
|
83
|
+
if (flags.status && flags.lifecycle && flags.status !== flags.lifecycle) {
|
|
84
|
+
this.error('--status and deprecated --lifecycle cannot disagree', { exit: 1 });
|
|
85
|
+
}
|
|
86
|
+
const status = flags.status || flags.lifecycle;
|
|
51
87
|
let result;
|
|
52
88
|
try {
|
|
53
|
-
|
|
89
|
+
const payload = {
|
|
54
90
|
...parsed.value,
|
|
55
|
-
...(
|
|
56
|
-
|
|
91
|
+
...(status ? { status } : {}),
|
|
92
|
+
title: flags.title,
|
|
93
|
+
provider: flags.provider,
|
|
94
|
+
version: flags.version,
|
|
95
|
+
contentDigest: flags['content-digest'],
|
|
96
|
+
expectationIds: flags.expectation,
|
|
97
|
+
runId: flags['run-id'],
|
|
98
|
+
idempotencyKey: flags['idempotency-key'] ||
|
|
99
|
+
(0, outbox_1.idempotencyKeyFor)('task-deliverable', args.task, JSON.stringify({ coordinate: parsed.value, status })),
|
|
100
|
+
};
|
|
101
|
+
const sessionPath = await (0, session_task_endpoints_1.sessionScopedTaskPath)('deliverable');
|
|
102
|
+
result = sessionPath
|
|
103
|
+
? await (0, api_fetch_1.apiFetch)(sessionPath, {
|
|
104
|
+
method: 'POST',
|
|
105
|
+
body: payload,
|
|
106
|
+
})
|
|
107
|
+
: await data_provider_1.dataService.addTaskDeliverable(args.task, payload);
|
|
57
108
|
}
|
|
58
109
|
catch (err) {
|
|
59
110
|
this.handleApiError(err);
|
|
@@ -64,7 +115,7 @@ class TasksDeliverableAdd extends base_command_1.BaseCommand {
|
|
|
64
115
|
return;
|
|
65
116
|
}
|
|
66
117
|
const where = parsed.value.location ? ` at ${parsed.value.location}` : '';
|
|
67
|
-
this.log(`Recorded ${parsed.value.kind}:${parsed.value.identity}${where} (${
|
|
118
|
+
this.log(`Recorded Deliverable ${result.link.id}: ${parsed.value.kind}:${parsed.value.identity}${where} (${status || 'local'}; self reported).`);
|
|
68
119
|
}
|
|
69
120
|
}
|
|
70
121
|
exports.default = TasksDeliverableAdd;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from '../../../base-command';
|
|
2
2
|
/**
|
|
3
|
-
* `skrr tasks deliverable confirm <task> <
|
|
3
|
+
* `skrr tasks deliverable confirm <task> <resource-link-id> --reason "<what you checked>"`
|
|
4
4
|
*
|
|
5
5
|
* Somebody looked, and it is there.
|
|
6
6
|
*
|
|
@@ -16,16 +16,16 @@ import { BaseCommand } from '../../../base-command';
|
|
|
16
16
|
* are: the entire value of a confirmation is that a person actually looked, and
|
|
17
17
|
* a confirmation with nothing written down is indistinguishable from a click.
|
|
18
18
|
*
|
|
19
|
-
* It
|
|
20
|
-
*
|
|
21
|
-
*
|
|
19
|
+
* It confirms an exact linked Resource Version. A person never retypes identity
|
|
20
|
+
* or location during confirmation, because either may now name a different
|
|
21
|
+
* version than the one the Task actually delivered.
|
|
22
22
|
*/
|
|
23
23
|
export default class TasksDeliverableConfirm extends BaseCommand {
|
|
24
24
|
static description: string;
|
|
25
25
|
static examples: string[];
|
|
26
26
|
static args: {
|
|
27
27
|
task: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
28
|
-
|
|
28
|
+
link: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
29
29
|
};
|
|
30
30
|
static flags: {
|
|
31
31
|
reason: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -3,9 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
4
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
5
|
const base_command_1 = require("../../../base-command");
|
|
6
|
-
const tasks_1 = require("../../../lib/tasks");
|
|
7
6
|
/**
|
|
8
|
-
* `skrr tasks deliverable confirm <task> <
|
|
7
|
+
* `skrr tasks deliverable confirm <task> <resource-link-id> --reason "<what you checked>"`
|
|
9
8
|
*
|
|
10
9
|
* Somebody looked, and it is there.
|
|
11
10
|
*
|
|
@@ -21,20 +20,19 @@ const tasks_1 = require("../../../lib/tasks");
|
|
|
21
20
|
* are: the entire value of a confirmation is that a person actually looked, and
|
|
22
21
|
* a confirmation with nothing written down is indistinguishable from a click.
|
|
23
22
|
*
|
|
24
|
-
* It
|
|
25
|
-
*
|
|
26
|
-
*
|
|
23
|
+
* It confirms an exact linked Resource Version. A person never retypes identity
|
|
24
|
+
* or location during confirmation, because either may now name a different
|
|
25
|
+
* version than the one the Task actually delivered.
|
|
27
26
|
*/
|
|
28
27
|
class TasksDeliverableConfirm extends base_command_1.BaseCommand {
|
|
29
28
|
static description = 'Confirm you checked a deliverable and it is there — the evidence an expectation needs when nothing observes it automatically';
|
|
30
29
|
static examples = [
|
|
31
|
-
'<%= config.bin %> tasks deliverable confirm <task-id>
|
|
32
|
-
'<%= config.bin %> tasks deliverable confirm <task-id> message:m_51@#general --reason "Read the thread; it went out at 09:04."',
|
|
30
|
+
'<%= config.bin %> tasks deliverable confirm <task-id> <resource-link-id> --reason "Opened the exact version; all four sections are there."',
|
|
33
31
|
];
|
|
34
32
|
static args = {
|
|
35
33
|
task: core_1.Args.string({ description: 'Task id or ref', required: true, ignoreStdin: true }),
|
|
36
|
-
|
|
37
|
-
description: '
|
|
34
|
+
link: core_1.Args.string({
|
|
35
|
+
description: 'Task Resource link id for the exact version you checked',
|
|
38
36
|
required: true,
|
|
39
37
|
ignoreStdin: true,
|
|
40
38
|
}),
|
|
@@ -49,17 +47,10 @@ class TasksDeliverableConfirm extends base_command_1.BaseCommand {
|
|
|
49
47
|
async run() {
|
|
50
48
|
this.requireAuth();
|
|
51
49
|
const { args, flags } = await this.parse(TasksDeliverableConfirm);
|
|
52
|
-
const parsed = (0, tasks_1.parseDeliverableCoordinate)(args.coordinate);
|
|
53
|
-
if (!parsed.ok) {
|
|
54
|
-
// For an agent the refusal IS the documentation — it hits the error and
|
|
55
|
-
// corrects — so it carries the whole form and vocabulary.
|
|
56
|
-
this.error(parsed.error, { exit: 1 });
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
50
|
let result;
|
|
60
51
|
try {
|
|
61
52
|
result = await data_provider_1.dataService.confirmTaskDeliverable(args.task, {
|
|
62
|
-
|
|
53
|
+
linkId: args.link,
|
|
63
54
|
reason: flags.reason,
|
|
64
55
|
});
|
|
65
56
|
}
|
|
@@ -71,7 +62,7 @@ class TasksDeliverableConfirm extends base_command_1.BaseCommand {
|
|
|
71
62
|
this.log(JSON.stringify(result, null, 2));
|
|
72
63
|
return;
|
|
73
64
|
}
|
|
74
|
-
this.log(`Confirmed ${
|
|
65
|
+
this.log(`Confirmed Deliverable link ${args.link}: ${flags.reason}`);
|
|
75
66
|
}
|
|
76
67
|
}
|
|
77
68
|
exports.default = TasksDeliverableConfirm;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class TasksDeliverableList 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
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
/**
|
|
8
|
+
* `locator_only` is the storage word, and it appeared on nearly every row with
|
|
9
|
+
* nothing saying what it meant. It is not a defect — it is the honest statement
|
|
10
|
+
* that nothing pins WHICH revision this is — so the label says that.
|
|
11
|
+
*/
|
|
12
|
+
function fidelityLabel(value) {
|
|
13
|
+
switch (value) {
|
|
14
|
+
case 'managed_copy':
|
|
15
|
+
return 'exact version archived';
|
|
16
|
+
case 'content_digest':
|
|
17
|
+
return 'exact version (content verified)';
|
|
18
|
+
case 'provider_version':
|
|
19
|
+
return 'exact version (provider revision)';
|
|
20
|
+
case 'locator_only':
|
|
21
|
+
return 'version not pinned — the coordinate may change under you';
|
|
22
|
+
default:
|
|
23
|
+
return value || 'unknown fidelity';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
class TasksDeliverableList extends base_command_1.BaseCommand {
|
|
27
|
+
static description = 'List Deliverables with exact version, location, and evidence state';
|
|
28
|
+
static args = {
|
|
29
|
+
task: core_1.Args.string({ required: false, ignoreStdin: true, description: 'Task id or ref' }),
|
|
30
|
+
};
|
|
31
|
+
static flags = {
|
|
32
|
+
task: core_1.Flags.string({ description: 'Task id; overrides runtime context' }),
|
|
33
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
34
|
+
};
|
|
35
|
+
async run() {
|
|
36
|
+
this.requireAuth();
|
|
37
|
+
const { args, flags } = await this.parse(TasksDeliverableList);
|
|
38
|
+
const task = (0, task_resolver_1.resolveTaskIdentity)({ positionalId: args.task, flagTask: flags.task });
|
|
39
|
+
let result;
|
|
40
|
+
try {
|
|
41
|
+
result = await data_provider_1.dataService.listTaskDeliverables(task.id);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
this.handleApiError(error);
|
|
45
|
+
}
|
|
46
|
+
if (flags.json)
|
|
47
|
+
return this.log(JSON.stringify(result, null, 2));
|
|
48
|
+
if (!result.data.length)
|
|
49
|
+
return this.log('No Deliverables recorded.');
|
|
50
|
+
for (const item of result.data) {
|
|
51
|
+
this.log(`${item.linkId} · ${item.kind}${item.format ? `/${item.format}` : ''} · ` +
|
|
52
|
+
`${item.title || item.identity || '(untitled)'}\n` +
|
|
53
|
+
` ${item.location || 'no locator'} · ${fidelityLabel(item.versionFidelity)} · ` +
|
|
54
|
+
`${item.status} · ${item.evidenceLevel}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.default = TasksDeliverableList;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from '../../../base-command';
|
|
2
2
|
export default class TasksEventsAppend extends BaseCommand {
|
|
3
|
+
static hidden: boolean;
|
|
3
4
|
static summary: string;
|
|
4
5
|
static description: string;
|
|
5
6
|
static examples: string[];
|
|
@@ -16,6 +17,7 @@ export default class TasksEventsAppend extends BaseCommand {
|
|
|
16
17
|
next: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
18
|
evidence: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
18
19
|
deliverable: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
|
+
artifact: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
19
21
|
};
|
|
20
22
|
run(): Promise<void>;
|
|
21
23
|
}
|
|
@@ -6,12 +6,20 @@ 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
8
|
const session_task_endpoints_1 = require("../../../lib/session-task-endpoints");
|
|
9
|
+
const task_artifact_flags_1 = require("../../../lib/task-artifact-flags");
|
|
9
10
|
const tasks_1 = require("../../../lib/tasks");
|
|
10
11
|
class TasksEventsAppend extends base_command_1.BaseCommand {
|
|
11
|
-
static
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
static hidden = true;
|
|
13
|
+
// The SUMMARY is what `tasks --help` and the first line of `--help` show, and
|
|
14
|
+
// it is the only line most readers see. Saying only "Append a typed, durable
|
|
15
|
+
// task event" there while the deprecation lived in the long DESCRIPTION meant
|
|
16
|
+
// the retired vocabulary read as the intended path — which is how it kept
|
|
17
|
+
// getting exercised.
|
|
18
|
+
static summary = 'DEPRECATED compatibility spelling for `tasks updates add` — append a legacy task event';
|
|
19
|
+
static description = 'DEPRECATED compatibility adapter for the historical Event vocabulary. Every kind is ' +
|
|
20
|
+
'stored as a canonical Update, so `--kind handoff` and `--kind checkpoint` both become ' +
|
|
21
|
+
'`progress`, and `--kind started|lifecycle` writes only to the Activity ledger and will ' +
|
|
22
|
+
'NOT appear in `tasks updates list`. Use `tasks updates add` instead.';
|
|
15
23
|
static examples = [
|
|
16
24
|
'<%= config.bin %> tasks events append <task-id> --kind checkpoint --idempotency-key "<task-id>:first-pass" --summary "Parser handles nested fences"',
|
|
17
25
|
'<%= config.bin %> tasks events append <task-id> --kind decision --idempotency-key "<task-id>:storage-choice" --summary "Chose the CRDT path" --evidence "A direct contentHtml write is reverted by the next render tick"',
|
|
@@ -58,11 +66,16 @@ class TasksEventsAppend extends base_command_1.BaseCommand {
|
|
|
58
66
|
multiple: true,
|
|
59
67
|
description: 'Durable reference: a file path, commit sha, or URL. Repeatable. "in the conversation" is not a deliverable',
|
|
60
68
|
}),
|
|
69
|
+
artifact: core_1.Flags.string({
|
|
70
|
+
multiple: true,
|
|
71
|
+
description: 'Compatibility alias for --deliverable used by older managed instruction blocks',
|
|
72
|
+
}),
|
|
61
73
|
};
|
|
62
74
|
async run() {
|
|
63
75
|
this.requireAuth();
|
|
64
76
|
const { args, flags } = await this.parse(TasksEventsAppend);
|
|
65
77
|
const task = (0, task_resolver_1.resolveTaskIdentity)({ positionalId: args.id, flagTask: flags.task });
|
|
78
|
+
const deliverables = (0, task_artifact_flags_1.mergeTaskArtifactFlags)(flags.deliverable, flags.artifact);
|
|
66
79
|
const data = {
|
|
67
80
|
idempotencyKey: flags['idempotency-key'],
|
|
68
81
|
kind: flags.kind,
|
|
@@ -70,7 +83,9 @@ class TasksEventsAppend extends base_command_1.BaseCommand {
|
|
|
70
83
|
changed: flags.changed,
|
|
71
84
|
next: flags.next,
|
|
72
85
|
evidence: flags.evidence,
|
|
73
|
-
artifacts:
|
|
86
|
+
artifacts: deliverables.length
|
|
87
|
+
? deliverables.map((ref) => ({ label: 'deliverable', ref }))
|
|
88
|
+
: undefined,
|
|
74
89
|
};
|
|
75
90
|
const path = await (0, session_task_endpoints_1.sessionScopedTaskPath)('event');
|
|
76
91
|
let result;
|
|
@@ -84,7 +99,27 @@ class TasksEventsAppend extends base_command_1.BaseCommand {
|
|
|
84
99
|
}
|
|
85
100
|
if (path && result && typeof result === 'object' && 'entry' in result)
|
|
86
101
|
result = result.entry;
|
|
87
|
-
|
|
102
|
+
if (flags.json)
|
|
103
|
+
return this.log(JSON.stringify(result, null, 2));
|
|
104
|
+
// The old receipt named neither what was written nor where to find it, so a
|
|
105
|
+
// caller could not tell a successful compatibility write from a no-op — and
|
|
106
|
+
// this command silently becomes a canonical Update of a DIFFERENT type.
|
|
107
|
+
const written = result || {};
|
|
108
|
+
if (written.canonicalType) {
|
|
109
|
+
this.log(`Recorded on ${task.id} as a ${written.canonicalType} Update` +
|
|
110
|
+
`${written.id ? ` (${written.id})` : ''}.`);
|
|
111
|
+
this.log(`\`tasks events append\` is a compatibility spelling; \`${this.config.bin} tasks updates add\` ` +
|
|
112
|
+
`is the canonical command, and \`${this.config.bin} tasks updates list\` reads them back.`);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
// `--kind started|lifecycle` produces no Update at all: it writes a
|
|
116
|
+
// `task.lifecycle.changed` row to the Activity ledger. The old receipt was
|
|
117
|
+
// byte-identical to the Update case, so a caller was told "appended" and
|
|
118
|
+
// then could not find it in the surface the deprecation notice points at.
|
|
119
|
+
this.log(`Recorded on ${task.id} in the Activity ledger` +
|
|
120
|
+
`${written.id ? ` (${written.id})` : ''} — NOT as a Task Update.`);
|
|
121
|
+
this.log(`Read it with \`${this.config.bin} tasks activity ${task.id}\`; it will not appear in ` +
|
|
122
|
+
`\`${this.config.bin} tasks updates list\`.`);
|
|
88
123
|
}
|
|
89
124
|
}
|
|
90
125
|
exports.default = TasksEventsAppend;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from '../../../base-command';
|
|
2
2
|
export default class TasksEventsList extends BaseCommand {
|
|
3
|
+
static hidden: boolean;
|
|
3
4
|
static description: string;
|
|
4
5
|
static args: {
|
|
5
6
|
id: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
@@ -7,6 +7,7 @@ const task_resolver_1 = require("../../../lib/task-resolver");
|
|
|
7
7
|
const format_1 = require("../../../lib/format");
|
|
8
8
|
const tasks_1 = require("../../../lib/tasks");
|
|
9
9
|
class TasksEventsList extends base_command_1.BaseCommand {
|
|
10
|
+
static hidden = true;
|
|
10
11
|
static description = 'List durable task events';
|
|
11
12
|
static args = {
|
|
12
13
|
id: core_1.Args.string({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from '../../../base-command';
|
|
2
2
|
export default class TasksEventsTail extends BaseCommand {
|
|
3
|
+
static hidden: boolean;
|
|
3
4
|
static description: string;
|
|
4
5
|
static args: {
|
|
5
6
|
id: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
@@ -5,6 +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
|
class TasksEventsTail extends base_command_1.BaseCommand {
|
|
8
|
+
static hidden = true;
|
|
8
9
|
static description = 'Follow new task events';
|
|
9
10
|
static args = { id: core_1.Args.string({ required: false, ignoreStdin: true }) };
|
|
10
11
|
static flags = {
|