@skrr-ai/cli 0.1.95 → 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 +22 -0
- package/dist/commands/agent/message/send.d.ts +2 -0
- package/dist/commands/agent/message/send.js +75 -5
- package/dist/commands/agents/chat.js +1 -1
- package/dist/commands/agents/create.d.ts +0 -3
- package/dist/commands/agents/create.js +0 -26
- package/dist/commands/agents/egress.d.ts +17 -0
- package/dist/commands/agents/egress.js +84 -0
- package/dist/commands/agents/mailbox/messages.d.ts +14 -0
- package/dist/commands/agents/mailbox/messages.js +52 -0
- package/dist/commands/agents/mailbox/show.d.ts +13 -0
- package/dist/commands/agents/mailbox/show.js +52 -0
- package/dist/commands/agents/operating-plan.js +8 -0
- package/dist/commands/agents/roles/capture.d.ts +16 -0
- package/dist/commands/agents/roles/capture.js +53 -0
- package/dist/commands/agents/roles/install.d.ts +1 -0
- package/dist/commands/agents/roles/install.js +8 -1
- package/dist/commands/agents/roles/preview.d.ts +2 -0
- package/dist/commands/agents/roles/preview.js +27 -3
- package/dist/commands/agents/update.d.ts +0 -3
- package/dist/commands/agents/update.js +1 -31
- package/dist/commands/agents/usage-cap.d.ts +4 -1
- package/dist/commands/agents/usage-cap.js +49 -10
- package/dist/commands/code/jobs/show.js +12 -0
- package/dist/commands/commitments/action-proposals/decide.d.ts +2 -0
- package/dist/commands/commitments/action-proposals/decide.js +12 -0
- package/dist/commands/commitments/action-proposals.js +7 -0
- package/dist/commands/commitments/create.d.ts +1 -0
- package/dist/commands/commitments/create.js +17 -1
- package/dist/commands/commitments/delivery.d.ts +1 -0
- package/dist/commands/commitments/delivery.js +11 -1
- package/dist/commands/commitments/doctor.js +4 -0
- package/dist/commands/commitments/effective-policy.js +26 -0
- package/dist/commands/commitments/endpoints/create.js +5 -2
- package/dist/commands/commitments/observations.d.ts +10 -0
- package/dist/commands/commitments/observations.js +88 -0
- package/dist/commands/commitments/pause.d.ts +1 -1
- package/dist/commands/commitments/pause.js +4 -3
- package/dist/commands/commitments/preflight.js +2 -1
- package/dist/commands/commitments/reports.d.ts +2 -0
- package/dist/commands/commitments/reports.js +22 -4
- package/dist/commands/commitments/update.d.ts +1 -0
- package/dist/commands/commitments/update.js +35 -5
- package/dist/commands/grants/create.d.ts +1 -0
- package/dist/commands/grants/create.js +8 -0
- package/dist/commands/grants/rotate.d.ts +5 -0
- package/dist/commands/grants/rotate.js +13 -1
- package/dist/commands/grants/update.d.ts +12 -0
- package/dist/commands/grants/update.js +27 -0
- package/dist/commands/machines/hosted/start.js +7 -1
- package/dist/commands/machines/list.js +4 -4
- package/dist/commands/measures/confirm.d.ts +1 -7
- package/dist/commands/measures/confirm.js +15 -14
- package/dist/commands/measures/list.d.ts +1 -7
- package/dist/commands/measures/list.js +1 -7
- package/dist/commands/measures/record.js +4 -4
- package/dist/commands/measures/show.d.ts +11 -0
- package/dist/commands/measures/show.js +26 -0
- package/dist/commands/northstars/governance/configure.d.ts +1 -0
- package/dist/commands/northstars/governance/configure.js +8 -1
- package/dist/commands/proposals/discard.d.ts +5 -0
- package/dist/commands/proposals/discard.js +8 -0
- package/dist/commands/proposals/keep.d.ts +5 -0
- package/dist/commands/proposals/keep.js +8 -0
- package/dist/commands/proposals/list.d.ts +15 -0
- package/dist/commands/proposals/list.js +74 -0
- package/dist/commands/proposals/show.d.ts +12 -0
- package/dist/commands/proposals/show.js +27 -0
- package/dist/commands/proposals/snooze.d.ts +5 -0
- package/dist/commands/proposals/snooze.js +8 -0
- package/dist/commands/signals/monitors/create.d.ts +9 -0
- package/dist/commands/signals/monitors/create.js +29 -0
- package/dist/commands/signals/monitors/list.d.ts +8 -0
- package/dist/commands/signals/monitors/list.js +16 -0
- package/dist/commands/signals/monitors/pause.d.ts +11 -0
- package/dist/commands/signals/monitors/pause.js +17 -0
- package/dist/commands/signals/monitors/resume.d.ts +11 -0
- package/dist/commands/signals/monitors/resume.js +17 -0
- package/dist/commands/signals/monitors/revise.d.ts +12 -0
- package/dist/commands/signals/monitors/revise.js +25 -0
- package/dist/commands/signals/monitors/show.d.ts +11 -0
- package/dist/commands/signals/monitors/show.js +17 -0
- package/dist/commands/signals/monitors/test.d.ts +12 -0
- package/dist/commands/signals/monitors/test.js +25 -0
- package/dist/commands/signals/monitors/transitions.d.ts +11 -0
- package/dist/commands/signals/monitors/transitions.js +17 -0
- package/dist/commands/signals/monitors/validate.d.ts +9 -0
- package/dist/commands/signals/monitors/validate.js +24 -0
- package/dist/commands/signals/schemas/list.d.ts +8 -0
- package/dist/commands/signals/schemas/list.js +16 -0
- package/dist/commands/signals/schemas/show.d.ts +11 -0
- package/dist/commands/signals/schemas/show.js +17 -0
- package/dist/commands/signals/sources/list.d.ts +8 -0
- package/dist/commands/signals/sources/list.js +16 -0
- package/dist/commands/signals/sources/receipts.d.ts +11 -0
- package/dist/commands/signals/sources/receipts.js +17 -0
- package/dist/commands/signals/sources/show.d.ts +11 -0
- package/dist/commands/signals/sources/show.js +17 -0
- package/dist/commands/spaces/usage.d.ts +12 -0
- package/dist/commands/spaces/usage.js +28 -0
- package/dist/commands/spaces/workflows/run.js +3 -0
- package/dist/commands/spaces/workflows/runs.js +2 -1
- package/dist/commands/spaces/workflows/update.d.ts +6 -1
- package/dist/commands/spaces/workflows/update.js +34 -2
- package/dist/commands/tasks/cascade-status.d.ts +2 -0
- package/dist/commands/tasks/cascade-status.js +27 -1
- package/dist/commands/tasks/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/list.d.ts +1 -0
- package/dist/commands/tasks/list.js +44 -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/triggers/create.d.ts +2 -0
- package/dist/commands/triggers/create.js +15 -0
- package/dist/commands/workspaces/grants.d.ts +12 -0
- package/dist/commands/workspaces/grants.js +31 -0
- package/dist/commands/workspaces/stewardship.d.ts +13 -0
- package/dist/commands/workspaces/stewardship.js +34 -0
- package/dist/lib/agent-config.d.ts +0 -12
- package/dist/lib/agent-config.js +1 -27
- package/dist/lib/agent-mailbox.d.ts +35 -0
- package/dist/lib/agent-mailbox.js +55 -0
- package/dist/lib/commitment-endpoints.d.ts +2 -1
- package/dist/lib/commitment-endpoints.js +2 -5
- package/dist/lib/commitment-product.d.ts +3 -1
- package/dist/lib/commitment-product.js +10 -0
- package/dist/lib/commitment-terms.js +1 -1
- package/dist/lib/commitments.d.ts +17 -7
- package/dist/lib/commitments.js +173 -85
- package/dist/lib/compasses.d.ts +14 -0
- package/dist/lib/compasses.js +25 -11
- package/dist/lib/grants.d.ts +5 -1
- package/dist/lib/grants.js +9 -1
- package/dist/lib/hosted-machines.d.ts +7 -0
- package/dist/lib/mailbox-human-command.d.ts +11 -0
- package/dist/lib/mailbox-human-command.js +41 -0
- package/dist/lib/measures.d.ts +28 -2
- package/dist/lib/measures.js +38 -14
- package/dist/lib/message-intent.d.ts +6 -2
- package/dist/lib/message-intent.js +1 -0
- package/dist/lib/northstars.js +2 -1
- package/dist/lib/proposal-decision-command.d.ts +19 -0
- package/dist/lib/proposal-decision-command.js +64 -0
- package/dist/lib/proposals.d.ts +8 -0
- package/dist/lib/proposals.js +22 -0
- package/dist/lib/roles.d.ts +141 -6
- package/dist/lib/roles.js +8 -2
- package/dist/lib/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-economics.d.ts +16 -0
- package/dist/lib/task-economics.js +22 -0
- package/dist/lib/triggers.d.ts +11 -3
- package/dist/lib/triggers.js +58 -1
- package/dist/lib/usage-discovery.d.ts +10 -0
- package/dist/lib/usage-discovery.js +24 -3
- package/dist/lib/workflow-run-budget.d.ts +12 -0
- package/dist/lib/workflow-run-budget.js +37 -0
- package/dist/lib/workspaces.d.ts +48 -0
- package/dist/lib/workspaces.js +8 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.d.ts +4 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.js +14 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/githubPushRefusal.d.ts +9 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/githubPushRefusal.js +49 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.d.ts +4 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.js +12 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/githubPushRefusal.d.ts +9 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/githubPushRefusal.js +44 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +10 -0
- package/dist/node_modules/@skrr-ai/data-provider/index.js +8017 -7086
- package/oclif.manifest.json +3872 -1167
- package/package.json +22 -1
|
@@ -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}`);
|
|
@@ -63,6 +63,11 @@ export declare function labelsLine(labelIds?: string[], nameById?: Map<string, s
|
|
|
63
63
|
* reassigning the task changes only the implied kind.
|
|
64
64
|
*/
|
|
65
65
|
export declare function taskExecutorLabel(t: Record<string, unknown>, bin?: string): string;
|
|
66
|
+
/**
|
|
67
|
+
* The `Recurrence:` line for a series whose next occurrence was never armed.
|
|
68
|
+
* Silent otherwise: a healthy series has nothing to say here.
|
|
69
|
+
*/
|
|
70
|
+
export declare function recurrenceArmFailureLines(t: Record<string, unknown>, bin?: string): string[];
|
|
66
71
|
/**
|
|
67
72
|
* The failure rows of `tasks show`, when there are any. (S3 dogfood finding)
|
|
68
73
|
*
|
|
@@ -5,6 +5,7 @@ exports.blockerDetailLines = blockerDetailLines;
|
|
|
5
5
|
exports.completionLines = completionLines;
|
|
6
6
|
exports.labelsLine = labelsLine;
|
|
7
7
|
exports.taskExecutorLabel = taskExecutorLabel;
|
|
8
|
+
exports.recurrenceArmFailureLines = recurrenceArmFailureLines;
|
|
8
9
|
exports.taskFailureLines = taskFailureLines;
|
|
9
10
|
const core_1 = require("@oclif/core");
|
|
10
11
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
@@ -137,6 +138,20 @@ function taskExecutorLabel(t, bin = 'skrr') {
|
|
|
137
138
|
return '-';
|
|
138
139
|
}
|
|
139
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* The `Recurrence:` line for a series whose next occurrence was never armed.
|
|
143
|
+
* Silent otherwise: a healthy series has nothing to say here.
|
|
144
|
+
*/
|
|
145
|
+
function recurrenceArmFailureLines(t, bin = 'skrr') {
|
|
146
|
+
const recurrence = t.recurrence;
|
|
147
|
+
const code = recurrence?.armFailure?.code;
|
|
148
|
+
if (typeof code !== 'string' || !code)
|
|
149
|
+
return [];
|
|
150
|
+
return [
|
|
151
|
+
`Recurrence: ${(0, data_provider_1.describeRecurrenceArmFailure)(code)} (${code})`,
|
|
152
|
+
` Reschedule with \`${bin} tasks schedule\` to start the series again.`,
|
|
153
|
+
];
|
|
154
|
+
}
|
|
140
155
|
/**
|
|
141
156
|
* The failure rows of `tasks show`, when there are any. (S3 dogfood finding)
|
|
142
157
|
*
|
|
@@ -321,6 +336,8 @@ class TasksShow extends base_command_1.BaseCommand {
|
|
|
321
336
|
// question and this is the answer to it.
|
|
322
337
|
for (const line of taskFailureLines(t, this.config.bin))
|
|
323
338
|
this.log(line);
|
|
339
|
+
for (const line of recurrenceArmFailureLines(t, this.config.bin))
|
|
340
|
+
this.log(line);
|
|
324
341
|
/*
|
|
325
342
|
* Closing is the actor's call — a Task may be `done` with work still
|
|
326
343
|
* outstanding, and `resolution.closure` is where the server recorded what
|
|
@@ -17,6 +17,10 @@ export default class TasksUpdate extends BaseCommand {
|
|
|
17
17
|
priority: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
18
18
|
'start-date': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
19
19
|
'due-date': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
|
+
savings: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
21
|
+
per: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
22
|
+
effort: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
23
|
+
risk: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
24
|
estimate: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
21
25
|
/**
|
|
22
26
|
* Declared, hidden, and refused — on purpose. (S4 dogfood finding)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
|
+
const task_economics_1 = require("../../lib/task-economics");
|
|
4
5
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
6
|
const base_command_1 = require("../../base-command");
|
|
6
7
|
const web_url_1 = require("../../lib/web-url");
|
|
@@ -62,6 +63,13 @@ class TasksUpdate extends base_command_1.BaseCommand {
|
|
|
62
63
|
}),
|
|
63
64
|
'start-date': core_1.Flags.string({ description: 'New planned start date (ISO string)' }),
|
|
64
65
|
'due-date': core_1.Flags.string({ description: 'New due date (ISO string)' }),
|
|
66
|
+
savings: core_1.Flags.string({ description: 'Expected USD savings (requires --per)' }),
|
|
67
|
+
per: core_1.Flags.string({
|
|
68
|
+
options: ['month', 'year', 'once'],
|
|
69
|
+
description: 'Savings period (requires --savings)',
|
|
70
|
+
}),
|
|
71
|
+
effort: core_1.Flags.string({ description: 'Expected effort in hours, nonnegative' }),
|
|
72
|
+
risk: core_1.Flags.string({ options: ['low', 'medium', 'high'], description: 'Expected risk' }),
|
|
65
73
|
estimate: core_1.Flags.integer({
|
|
66
74
|
description: 'New estimate value from the Space estimate scale. Requires a scale on the Space (or an ' +
|
|
67
75
|
'ancestor it inherits from); with none set, the server drops the value. Set the scale ' +
|
|
@@ -356,6 +364,7 @@ class TasksUpdate extends base_command_1.BaseCommand {
|
|
|
356
364
|
startDate: flags['start-date'],
|
|
357
365
|
dueDate: flags['due-date'],
|
|
358
366
|
estimate: flags.estimate,
|
|
367
|
+
economics: (0, task_economics_1.economicsFromFlags)(flags, body.economics),
|
|
359
368
|
// Never sent: `taskUpdateMutationGuard` refuses any payload carrying
|
|
360
369
|
// `status` before the request is built. It is merged in only so the guard
|
|
361
370
|
// sees it and answers with the sentence that names `tasks move`.
|
|
@@ -88,8 +88,8 @@ class TasksWorkflowFindings extends base_command_1.BaseCommand {
|
|
|
88
88
|
}
|
|
89
89
|
this.log(`Reported ${response.reported} finding(s) on ${response.nodeKey}.`);
|
|
90
90
|
this.log(`Open blocking: ${response.openBlocking} of ${response.total} total.`);
|
|
91
|
-
this.log(response.
|
|
92
|
-
? 'No blocking findings
|
|
91
|
+
this.log(response.openBlocking === 0
|
|
92
|
+
? 'No blocking findings are currently open. Panel availability is evaluated by the Workflow engine.'
|
|
93
93
|
: 'Each open blocking finding must be fixed, or rebutted with evidence, before this converges.');
|
|
94
94
|
}
|
|
95
95
|
}
|
|
@@ -21,6 +21,8 @@ export default class TriggersCreate extends BaseCommand {
|
|
|
21
21
|
'effect-contract': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
22
22
|
'effect-write-mode': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
23
23
|
'effect-options': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
24
|
+
'workflow-event-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
25
|
+
'workflow-outcome': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
24
26
|
dispatch: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
25
27
|
reference: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
26
28
|
references: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -61,6 +61,14 @@ class TriggersCreate extends base_command_1.BaseCommand {
|
|
|
61
61
|
dependsOn: ['effect-contract'],
|
|
62
62
|
}),
|
|
63
63
|
'effect-options': core_1.Flags.string({ description: 'Effect policy options JSON object' }),
|
|
64
|
+
'workflow-event-key': core_1.Flags.string({
|
|
65
|
+
description: 'Exact event key the parked workflow step waits on (required for mode=workflow_signal). Resolves steps in the scope Space; the trigger owner must hold Space edit access at every fire',
|
|
66
|
+
}),
|
|
67
|
+
'workflow-outcome': core_1.Flags.string({
|
|
68
|
+
description: 'How the resolved step settles (default success)',
|
|
69
|
+
options: ['success', 'failure'],
|
|
70
|
+
dependsOn: ['workflow-event-key'],
|
|
71
|
+
}),
|
|
64
72
|
dispatch: core_1.Flags.string({
|
|
65
73
|
description: 'auto_start fires the work immediately; manual parks it as todo',
|
|
66
74
|
options: ['auto_start', 'manual'],
|
|
@@ -218,6 +226,13 @@ class TriggersCreate extends base_command_1.BaseCommand {
|
|
|
218
226
|
builtinAction,
|
|
219
227
|
conversationId: flags.conversation,
|
|
220
228
|
effectPolicy,
|
|
229
|
+
// Built only when a key is named, for the same reason as effectPolicy.
|
|
230
|
+
workflowSignal: flags['workflow-event-key']
|
|
231
|
+
? {
|
|
232
|
+
eventKey: flags['workflow-event-key'],
|
|
233
|
+
...(flags['workflow-outcome'] ? { outcome: flags['workflow-outcome'] } : {}),
|
|
234
|
+
}
|
|
235
|
+
: undefined,
|
|
221
236
|
dispatch: flags.dispatch,
|
|
222
237
|
references: (0, triggers_1.parseExecutionReferences)(flags.reference, flags.references),
|
|
223
238
|
workingHours: (0, triggers_1.parseJsonObject)(flags['working-hours'], '--working-hours'),
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
export default class WorkspacesGrants extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
workspaceId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../base-command");
|
|
5
|
+
const workspaces_1 = require("../../lib/workspaces");
|
|
6
|
+
const stewardship_output_1 = require("../../lib/stewardship-output");
|
|
7
|
+
class WorkspacesGrants extends base_command_1.BaseCommand {
|
|
8
|
+
static description = 'Read workspace Grant metadata and impact (person owner/admin only)';
|
|
9
|
+
static examples = ['<%= config.bin %> workspaces grants <workspace-id> --json'];
|
|
10
|
+
static args = {
|
|
11
|
+
workspaceId: core_1.Args.string({ required: true, ignoreStdin: true, description: 'Workspace ID' }),
|
|
12
|
+
};
|
|
13
|
+
static flags = {
|
|
14
|
+
json: core_1.Flags.boolean({ description: 'Output metadata and coverage as JSON' }),
|
|
15
|
+
};
|
|
16
|
+
async run() {
|
|
17
|
+
this.requireAuth();
|
|
18
|
+
const { args, flags } = await this.parse(WorkspacesGrants);
|
|
19
|
+
try {
|
|
20
|
+
const report = await (0, workspaces_1.listWorkspaceGrants)(args.workspaceId);
|
|
21
|
+
if (flags.json)
|
|
22
|
+
this.log(JSON.stringify(report, null, 2));
|
|
23
|
+
else
|
|
24
|
+
(0, stewardship_output_1.printWorkspaceGrants)(report, (line) => this.log(line));
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
this.handleApiError(error);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.default = WorkspacesGrants;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
export default class WorkspacesStewardship extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
workspaceId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
userId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../base-command");
|
|
5
|
+
const workspaces_1 = require("../../lib/workspaces");
|
|
6
|
+
const stewardship_output_1 = require("../../lib/stewardship-output");
|
|
7
|
+
class WorkspacesStewardship extends base_command_1.BaseCommand {
|
|
8
|
+
static description = 'Read a member’s workspace stewardship metadata (person owner/admin only)';
|
|
9
|
+
static examples = [
|
|
10
|
+
'<%= config.bin %> workspaces stewardship <workspace-id> <user-id> --json',
|
|
11
|
+
];
|
|
12
|
+
static args = {
|
|
13
|
+
workspaceId: core_1.Args.string({ required: true, ignoreStdin: true, description: 'Workspace ID' }),
|
|
14
|
+
userId: core_1.Args.string({ required: true, ignoreStdin: true, description: 'Member user ID' }),
|
|
15
|
+
};
|
|
16
|
+
static flags = {
|
|
17
|
+
json: core_1.Flags.boolean({ description: 'Output metadata and coverage as JSON' }),
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
this.requireAuth();
|
|
21
|
+
const { args, flags } = await this.parse(WorkspacesStewardship);
|
|
22
|
+
try {
|
|
23
|
+
const report = await (0, workspaces_1.getWorkspaceStewardship)(args.workspaceId, args.userId);
|
|
24
|
+
if (flags.json)
|
|
25
|
+
this.log(JSON.stringify(report, null, 2));
|
|
26
|
+
else
|
|
27
|
+
(0, stewardship_output_1.printWorkspaceStewardship)(report, (line) => this.log(line));
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
this.handleApiError(error);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.default = WorkspacesStewardship;
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
export declare const COMMITMENT_RESPONSIBILITY_LEVELS: readonly ["reasoning_only", "full_ownership"];
|
|
2
|
-
export declare const REASONING_TOOL_ESCAPES: readonly ["bash", "browser"];
|
|
3
|
-
/** Warning printed by the three retired Commitment permission flags (OSK-11975). */
|
|
4
|
-
export declare const COMMITMENT_PERMISSION_FLAG_RETIRED = "This setting no longer has any effect: Commitment runs use the agent's own permissions.";
|
|
5
|
-
/** The three retired flags themselves: accepted at parse, warned on, never sent. */
|
|
6
|
-
export declare const RETIRED_COMMITMENT_PERMISSION_FLAGS: readonly ["reasoning-tool-escape", "commitment-responsibility", "commitment-responsibility-ceiling"];
|
|
7
|
-
/**
|
|
8
|
-
* The deprecation warning ONE retired flag prints. oclif prints a
|
|
9
|
-
* `deprecated.message` verbatim, so a shared message printed the same line
|
|
10
|
-
* once per flag with nothing saying which flag each one was about (OSK-12068).
|
|
11
|
-
*/
|
|
12
|
-
export declare function retiredCommitmentPermissionFlagMessage(flag: (typeof RETIRED_COMMITMENT_PERMISSION_FLAGS)[number]): string;
|
|
13
1
|
/**
|
|
14
2
|
* The fields the server ignored and why, from a write's `deprecatedFields`
|
|
15
3
|
* notice, one line each. Empty when the response carries none.
|
package/dist/lib/agent-config.js
CHANGED
|
@@ -1,31 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RELEASE_INSTALL_CHANNELS =
|
|
4
|
-
exports.retiredCommitmentPermissionFlagMessage = retiredCommitmentPermissionFlagMessage;
|
|
3
|
+
exports.RELEASE_INSTALL_CHANNELS = void 0;
|
|
5
4
|
exports.deprecatedFieldsWarnings = deprecatedFieldsWarnings;
|
|
6
5
|
exports.deprecatedFieldNames = deprecatedFieldNames;
|
|
7
6
|
exports.parseWorkingHoursFlag = parseWorkingHoursFlag;
|
|
8
7
|
exports.mergeAgentConfigFlags = mergeAgentConfigFlags;
|
|
9
8
|
const prompt_1 = require("./prompt");
|
|
10
9
|
const agent_visual_refs_1 = require("./agent-visual-refs");
|
|
11
|
-
exports.COMMITMENT_RESPONSIBILITY_LEVELS = ['reasoning_only', 'full_ownership'];
|
|
12
|
-
exports.REASONING_TOOL_ESCAPES = ['bash', 'browser'];
|
|
13
|
-
/** Warning printed by the three retired Commitment permission flags (OSK-11975). */
|
|
14
|
-
exports.COMMITMENT_PERMISSION_FLAG_RETIRED = "This setting no longer has any effect: Commitment runs use the agent's own permissions.";
|
|
15
|
-
/** The three retired flags themselves: accepted at parse, warned on, never sent. */
|
|
16
|
-
exports.RETIRED_COMMITMENT_PERMISSION_FLAGS = [
|
|
17
|
-
'reasoning-tool-escape',
|
|
18
|
-
'commitment-responsibility',
|
|
19
|
-
'commitment-responsibility-ceiling',
|
|
20
|
-
];
|
|
21
|
-
/**
|
|
22
|
-
* The deprecation warning ONE retired flag prints. oclif prints a
|
|
23
|
-
* `deprecated.message` verbatim, so a shared message printed the same line
|
|
24
|
-
* once per flag with nothing saying which flag each one was about (OSK-12068).
|
|
25
|
-
*/
|
|
26
|
-
function retiredCommitmentPermissionFlagMessage(flag) {
|
|
27
|
-
return `--${flag} is retired and was not sent. ${exports.COMMITMENT_PERMISSION_FLAG_RETIRED}`;
|
|
28
|
-
}
|
|
29
10
|
/**
|
|
30
11
|
* The fields the server ignored and why, from a write's `deprecatedFields`
|
|
31
12
|
* notice, one line each. Empty when the response carries none.
|
|
@@ -141,13 +122,6 @@ function mergeAgentConfigFlags(body, flags) {
|
|
|
141
122
|
if (flags['todo-working-hours'] !== undefined) {
|
|
142
123
|
parsed.todoWorkingHours = parseWorkingHoursFlag(String(flags['todo-working-hours']));
|
|
143
124
|
}
|
|
144
|
-
// `--reasoning-tool-escape`, `--commitment-responsibility` and
|
|
145
|
-
// `--commitment-responsibility-ceiling` are retired (OSK-11975) and are
|
|
146
|
-
// deliberately NOT forwarded. The server still accepts and echoes the stored
|
|
147
|
-
// fields, so sending them wrote a value nothing reads and handed it back as
|
|
148
|
-
// if it were live — and "a ceiling a commitment may not exceed" is a safety
|
|
149
|
-
// claim a person then believes (OSK-12068). The flags stay parseable so old
|
|
150
|
-
// scripts do not break; oclif prints COMMITMENT_PERMISSION_FLAG_RETIRED.
|
|
151
125
|
if (flags['tool-resources'] !== undefined) {
|
|
152
126
|
parsed.tool_resources = JSON.parse(String(flags['tool-resources']));
|
|
153
127
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Human operator projections; never expose mail content or provider/storage identifiers. */
|
|
2
|
+
export interface AgentMailboxMetadata {
|
|
3
|
+
id: string;
|
|
4
|
+
agentId: string;
|
|
5
|
+
workspaceId: string;
|
|
6
|
+
handle: string;
|
|
7
|
+
address: string;
|
|
8
|
+
status: string;
|
|
9
|
+
sending: string;
|
|
10
|
+
sendingPausedReason?: string | null;
|
|
11
|
+
version: number;
|
|
12
|
+
}
|
|
13
|
+
export interface AgentMailMessageMetadata {
|
|
14
|
+
id: string;
|
|
15
|
+
messageId: string;
|
|
16
|
+
receivedAt: string;
|
|
17
|
+
classification: string;
|
|
18
|
+
status: string;
|
|
19
|
+
expiresAt?: string | null;
|
|
20
|
+
}
|
|
21
|
+
export interface AgentMailboxStatus {
|
|
22
|
+
mailbox: AgentMailboxMetadata | null;
|
|
23
|
+
receivingRuntime?: {
|
|
24
|
+
status: 'running' | 'starting' | 'unavailable';
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface AgentMailboxMessages {
|
|
28
|
+
data: AgentMailMessageMetadata[];
|
|
29
|
+
nextCursor: string | null;
|
|
30
|
+
}
|
|
31
|
+
export declare function getAgentMailboxMetadata(agentId: string): Promise<AgentMailboxStatus>;
|
|
32
|
+
export declare function getAgentMailboxMessageMetadata(agentId: string, options?: {
|
|
33
|
+
limit?: number;
|
|
34
|
+
cursor?: string;
|
|
35
|
+
}): Promise<AgentMailboxMessages>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAgentMailboxMetadata = getAgentMailboxMetadata;
|
|
4
|
+
exports.getAgentMailboxMessageMetadata = getAgentMailboxMessageMetadata;
|
|
5
|
+
const api_fetch_1 = require("./api-fetch");
|
|
6
|
+
function withMailboxQuery(path, query) {
|
|
7
|
+
return query.size ? `${path}?${query.toString()}` : path;
|
|
8
|
+
}
|
|
9
|
+
async function getAgentMailboxMetadata(agentId) {
|
|
10
|
+
const result = await (0, api_fetch_1.apiFetch)(`/api/agents/${encodeURIComponent(agentId)}/mailbox/metadata`);
|
|
11
|
+
const mailbox = result.mailbox;
|
|
12
|
+
// Also project at the output boundary. A future server field must not
|
|
13
|
+
// accidentally turn the CLI's JSON into a content or credential export.
|
|
14
|
+
return {
|
|
15
|
+
...(['running', 'starting', 'unavailable'].includes(result.receivingRuntime?.status || '')
|
|
16
|
+
? { receivingRuntime: { status: result.receivingRuntime.status } }
|
|
17
|
+
: {}),
|
|
18
|
+
mailbox: mailbox
|
|
19
|
+
? {
|
|
20
|
+
id: mailbox.id,
|
|
21
|
+
agentId: mailbox.agentId,
|
|
22
|
+
workspaceId: mailbox.workspaceId,
|
|
23
|
+
handle: mailbox.handle,
|
|
24
|
+
address: mailbox.address,
|
|
25
|
+
status: mailbox.status,
|
|
26
|
+
sending: mailbox.sending,
|
|
27
|
+
sendingPausedReason: mailbox.sendingPausedReason,
|
|
28
|
+
version: mailbox.version,
|
|
29
|
+
}
|
|
30
|
+
: null,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
async function getAgentMailboxMessageMetadata(agentId, options = {}) {
|
|
34
|
+
if (options.limit !== undefined &&
|
|
35
|
+
(!Number.isInteger(options.limit) || options.limit < 1 || options.limit > 100)) {
|
|
36
|
+
throw new Error('Mailbox message limit must be an integer from 1 to 100.');
|
|
37
|
+
}
|
|
38
|
+
const query = new URLSearchParams();
|
|
39
|
+
if (options.limit !== undefined)
|
|
40
|
+
query.set('limit', String(options.limit));
|
|
41
|
+
if (options.cursor)
|
|
42
|
+
query.set('cursor', options.cursor);
|
|
43
|
+
const result = await (0, api_fetch_1.apiFetch)(withMailboxQuery(`/api/agents/${encodeURIComponent(agentId)}/mailbox/messages/metadata`, query));
|
|
44
|
+
return {
|
|
45
|
+
data: result.data.map((message) => ({
|
|
46
|
+
id: message.id,
|
|
47
|
+
messageId: message.messageId,
|
|
48
|
+
receivedAt: message.receivedAt,
|
|
49
|
+
classification: message.classification,
|
|
50
|
+
status: message.status,
|
|
51
|
+
expiresAt: message.expiresAt,
|
|
52
|
+
})),
|
|
53
|
+
nextCursor: result.nextCursor,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { withQuery } from './triggers';
|
|
2
2
|
export declare const ENDPOINT_CAPABILITIES: readonly ["push", "reply", "structuredAsk"];
|
|
3
|
-
|
|
3
|
+
/** Derived from the one destination registry; never a second list. */
|
|
4
|
+
export declare const COMMITMENT_ENDPOINT_DESTINATIONS: ("email" | "pinned" | "app_owner_dm" | "slack_owner_dm" | "slack_channel" | "main" | "discord_owner_dm" | "user_notify")[];
|
|
4
5
|
export type EndpointCapability = (typeof ENDPOINT_CAPABILITIES)[number];
|
|
5
6
|
export interface CommitmentEndpoint {
|
|
6
7
|
id: string;
|
|
@@ -21,11 +21,8 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
21
21
|
const format_1 = require("./format");
|
|
22
22
|
const triggers_1 = require("./triggers");
|
|
23
23
|
exports.ENDPOINT_CAPABILITIES = ['push', 'reply', 'structuredAsk'];
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
'slack_owner_dm',
|
|
27
|
-
'app_owner_dm',
|
|
28
|
-
];
|
|
24
|
+
/** Derived from the one destination registry; never a second list. */
|
|
25
|
+
exports.COMMITMENT_ENDPOINT_DESTINATIONS = data_provider_1.COMMITMENT_REGISTRABLE_REPORT_DESTINATIONS;
|
|
29
26
|
const MOUNT = '/api/commitment-endpoints';
|
|
30
27
|
const base = (id) => `${MOUNT}/${encodeURIComponent(id)}`;
|
|
31
28
|
exports.commitmentEndpointApi = {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type { CommitmentDeliveryIntent, CommitmentExecutionReceipt, CommitmentExecutionReceiptQuarterlyMetricsResponse } from '@skrr-ai/data-provider';
|
|
1
|
+
import type { CommitmentDeliveryIntent, TaskReviewPolicy, CommitmentExecutionReceipt, CommitmentExecutionReceiptQuarterlyMetricsResponse } from '@skrr-ai/data-provider';
|
|
2
2
|
export declare const COMMITMENT_DELIVERY_CHOICES: readonly ["report-only", "local-patch", "draft-pr", "push-branch", "direct-branch"];
|
|
3
3
|
export declare function deliveryLabel(mode?: string): string;
|
|
4
|
+
export declare function normalizeTaskReviewPolicy(value: unknown): TaskReviewPolicy;
|
|
4
5
|
export declare function deliveryInput(mode: string, options?: {
|
|
5
6
|
repo?: string;
|
|
6
7
|
base?: string;
|
|
8
|
+
taskReviewPolicy?: TaskReviewPolicy;
|
|
7
9
|
}): CommitmentDeliveryIntent;
|
|
8
10
|
export declare function renderExecutionReceipt(receipt: CommitmentExecutionReceipt, log: (line: string) => void, verbose?: boolean): void;
|
|
9
11
|
/**
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.COMMITMENT_DELIVERY_CHOICES = void 0;
|
|
4
4
|
exports.deliveryLabel = deliveryLabel;
|
|
5
|
+
exports.normalizeTaskReviewPolicy = normalizeTaskReviewPolicy;
|
|
5
6
|
exports.deliveryInput = deliveryInput;
|
|
6
7
|
exports.renderExecutionReceipt = renderExecutionReceipt;
|
|
7
8
|
exports.renderExecutionReceiptQuarterlyMetrics = renderExecutionReceiptQuarterlyMetrics;
|
|
9
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
8
10
|
exports.COMMITMENT_DELIVERY_CHOICES = [
|
|
9
11
|
'report-only',
|
|
10
12
|
'local-patch',
|
|
@@ -21,6 +23,11 @@ function deliveryLabel(mode) {
|
|
|
21
23
|
direct_branch: 'Direct branch',
|
|
22
24
|
}[mode || ''] || 'Not declared');
|
|
23
25
|
}
|
|
26
|
+
function normalizeTaskReviewPolicy(value) {
|
|
27
|
+
if (typeof value !== 'string' || !data_provider_1.TASK_REVIEW_POLICIES.includes(value))
|
|
28
|
+
throw new Error('Task review policy must be none or required.');
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
24
31
|
function deliveryInput(mode, options = {}) {
|
|
25
32
|
const normalized = mode.replace(/-/g, '_');
|
|
26
33
|
if (!exports.COMMITMENT_DELIVERY_CHOICES.some((choice) => choice.replace(/-/g, '_') === normalized)) {
|
|
@@ -31,6 +38,9 @@ function deliveryInput(mode, options = {}) {
|
|
|
31
38
|
mode: normalized,
|
|
32
39
|
...(options.repo ? { repo: options.repo } : {}),
|
|
33
40
|
...(options.base ? { baseBranch: options.base } : {}),
|
|
41
|
+
...(options.taskReviewPolicy !== undefined
|
|
42
|
+
? { reviewPolicy: normalizeTaskReviewPolicy(options.taskReviewPolicy) }
|
|
43
|
+
: {}),
|
|
34
44
|
};
|
|
35
45
|
}
|
|
36
46
|
function renderExecutionReceipt(receipt, log, verbose = false) {
|
|
@@ -94,7 +94,7 @@ function renderCommitmentTerms(commitment, log) {
|
|
|
94
94
|
const reports = commitment.reports ?? [];
|
|
95
95
|
log(`Reports: ${reports.length
|
|
96
96
|
? reports
|
|
97
|
-
.map((r) => `${r.destination}${r.destinationTarget ? `:${r.destinationTarget}` : ''} on ${r.on ?? 'material_change'}`)
|
|
97
|
+
.map((r) => `${r.destination}${r.destinationTarget ? `:${r.destinationTarget}` : ''} on ${r.on ?? 'material_change'}${r.format ? ` format ${r.format}` : ''}${r.review ? ` · reviewed by ${r.review}` : ''}`)
|
|
98
98
|
.join(', ')
|
|
99
99
|
: 'default surface only'}`);
|
|
100
100
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CommitmentObservationsQuery, type CommitmentObservationsResponse } from '@skrr-ai/data-provider';
|
|
1
2
|
/**
|
|
2
3
|
* commitments.ts — request-based client for the Commitments subsystem
|
|
3
4
|
* (`/api/commitments/*`).
|
|
@@ -79,6 +80,8 @@ export type CommitmentPreflightReport = {
|
|
|
79
80
|
label?: string;
|
|
80
81
|
available: boolean;
|
|
81
82
|
reason?: string;
|
|
83
|
+
/** Why a destination cannot deliver, in words (e.g. a stored-only destination). */
|
|
84
|
+
detail?: string;
|
|
82
85
|
capabilities: string[];
|
|
83
86
|
}>;
|
|
84
87
|
attention: {
|
|
@@ -201,6 +204,12 @@ export declare const commitmentPackApi: {
|
|
|
201
204
|
preflight: (id: string, nextRunCount?: number) => Promise<CommitmentPackPreflightResponse>;
|
|
202
205
|
activate: (id: string) => Promise<CommitmentPackLifecycleResponse>;
|
|
203
206
|
};
|
|
207
|
+
export type ObservationWindowQuery = {
|
|
208
|
+
key: string;
|
|
209
|
+
from: string;
|
|
210
|
+
to: string;
|
|
211
|
+
limit?: number;
|
|
212
|
+
};
|
|
204
213
|
export declare const commitmentApi: {
|
|
205
214
|
/**
|
|
206
215
|
* The lib owns every URL in this domain, and the parity spec depends on that:
|
|
@@ -287,6 +296,8 @@ export declare const commitmentApi: {
|
|
|
287
296
|
decideActionProposal: (id: string, proposalId: string, decision: "approve" | "reject", snapshot?: {
|
|
288
297
|
snapshotDigest?: string;
|
|
289
298
|
bundleVersion?: number;
|
|
299
|
+
reason?: string;
|
|
300
|
+
reasonCode?: import("@skrr-ai/data-provider").ProposalDiscardReasonCode;
|
|
290
301
|
}) => Promise<Record<string, unknown>>;
|
|
291
302
|
executeActionProposal: (id: string, proposalId: string) => Promise<Record<string, unknown>>;
|
|
292
303
|
preflight: (id: string, nextRunCount?: number) => Promise<CommitmentPreflightReport>;
|
|
@@ -434,13 +445,12 @@ export declare const commitmentApi: {
|
|
|
434
445
|
}) => Promise<CommitmentListPage>;
|
|
435
446
|
createEvaluation: (id: string, body: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
436
447
|
retryEvaluationLearning: (id: string, scheduleId: string) => Promise<Record<string, unknown>>;
|
|
437
|
-
observations: (id: string, query?:
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
}) => Promise<CommitmentListPage>;
|
|
448
|
+
observations: (id: string, query?: CommitmentObservationsQuery) => Promise<CommitmentObservationsResponse>;
|
|
449
|
+
observationSeries: (id: string, query: ObservationWindowQuery) => Promise<Record<string, unknown>>;
|
|
450
|
+
observationCompare: (id: string, query: ObservationWindowQuery & {
|
|
451
|
+
baselineFrom: string;
|
|
452
|
+
baselineTo: string;
|
|
453
|
+
}) => Promise<Record<string, unknown>>;
|
|
444
454
|
/** One-tap feedback on a check — the signal Reflection retunes cadence from. */
|
|
445
455
|
checkFeedback: (id: string, checkId: string, body: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
446
456
|
/** Bounded, named corrections — never a free-form contract edit. */
|