@skrr-ai/cli 0.1.199 → 0.1.202
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/dist/commands/agents/always-on/recovery-close.d.ts +3 -4
- package/dist/commands/agents/always-on/recovery-close.js +5 -5
- package/dist/commands/agents/always-on/recovery-review.d.ts +1 -1
- package/dist/commands/agents/always-on/recovery-review.js +4 -3
- package/dist/commands/agents/create.d.ts +4 -2
- package/dist/commands/agents/create.js +29 -4
- package/dist/commands/duties/check-now.d.ts +1 -0
- package/dist/commands/duties/check-now.js +17 -1
- package/dist/commands/duties/create.js +95 -9
- package/dist/commands/duties/observations.d.ts +1 -0
- package/dist/commands/duties/observations.js +12 -3
- package/dist/commands/duties/operating-review.js +34 -2
- package/dist/commands/duties/pack/plan.d.ts +1 -0
- package/dist/commands/duties/pack/plan.js +30 -0
- package/dist/commands/duties/plan.d.ts +1 -0
- package/dist/commands/duties/plan.js +24 -0
- package/dist/commands/duties/preflight.d.ts +3 -3
- package/dist/commands/duties/preflight.js +36 -12
- package/dist/commands/duties/receipt.d.ts +1 -0
- package/dist/commands/duties/receipt.js +35 -11
- package/dist/commands/duties/roster.js +29 -6
- package/dist/commands/duties/status.js +19 -11
- package/dist/commands/duties/update.js +1 -1
- package/dist/commands/goals/create.js +1 -1
- package/dist/commands/goals/key-results/create.js +1 -1
- package/dist/commands/machines/computer-adoption.js +1 -1
- package/dist/commands/machines/dedicated/audit.js +1 -1
- package/dist/commands/machines/dedicated/catalog.js +1 -1
- package/dist/commands/machines/dedicated/current.js +1 -1
- package/dist/commands/machines/dedicated/git-status.js +1 -1
- package/dist/commands/machines/dedicated/health-check.js +1 -1
- package/dist/commands/machines/dedicated/logs.js +1 -1
- package/dist/commands/machines/dedicated/price-book.js +1 -1
- package/dist/commands/machines/dedicated/sign-in-status.js +1 -1
- package/dist/commands/machines/dedicated/stat.js +1 -1
- package/dist/commands/machines/services/ls.js +1 -1
- package/dist/commands/machines/shared.js +1 -1
- package/dist/commands/machines/shares.js +1 -1
- package/dist/commands/tasks/result/show.d.ts +1 -0
- package/dist/commands/tasks/result/show.js +19 -1
- package/dist/commands/triggers/capabilities.js +11 -2
- package/dist/commands/triggers/create.d.ts +1 -1
- package/dist/commands/triggers/create.js +15 -6
- package/dist/commands/triggers/fire-detail.js +7 -0
- package/dist/generated/agent-guides.json +36 -36
- package/dist/lib/daemon-setup.js +1 -1
- package/dist/lib/duties.d.ts +7 -5
- package/dist/lib/duties.js +32 -19
- package/dist/lib/duty-loop-status.d.ts +2 -0
- package/dist/lib/duty-loop-status.js +26 -1
- package/dist/lib/duty-product.js +52 -3
- package/dist/lib/task-runtime-headers.d.ts +2 -0
- package/dist/lib/task-runtime-headers.js +26 -9
- package/dist/lib/tasks.js +11 -3
- package/dist/lib/usage-discovery.js +2 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/dutyExecutionContract.d.ts +3 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/dutyExecutionContract.js +6 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/dutyExecutionContract.d.ts +3 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/dutyExecutionContract.js +6 -4
- package/dist/node_modules/@skrr-ai/data-provider/index.js +10384 -10375
- package/oclif.manifest.json +54 -11
- package/package.json +5 -2
package/dist/lib/duty-product.js
CHANGED
|
@@ -7,8 +7,28 @@ exports.deliveryInput = deliveryInput;
|
|
|
7
7
|
exports.renderExecutionReceipt = renderExecutionReceipt;
|
|
8
8
|
exports.renderExecutionReceiptQuarterlyMetrics = renderExecutionReceiptQuarterlyMetrics;
|
|
9
9
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
10
|
+
const search_display_1 = require("./search-display");
|
|
10
11
|
const DELIVERY_INPUT_RE = /-/g;
|
|
11
12
|
const RENDER_EXECUTION_RECEIPT_RE = /^[A-Za-z0-9_.:-]+$/;
|
|
13
|
+
const RECEIPT_PHASE_MARKS = {
|
|
14
|
+
done: '✓',
|
|
15
|
+
working: '→',
|
|
16
|
+
waiting: '…',
|
|
17
|
+
blocked: '!',
|
|
18
|
+
failed: '×',
|
|
19
|
+
skipped: '–',
|
|
20
|
+
};
|
|
21
|
+
const PEER_VERIFICATION_LABELS = {
|
|
22
|
+
applied: 'Peer Duty changed · waiting for evidence',
|
|
23
|
+
verified: 'Peer Duty change verified',
|
|
24
|
+
acceptance_not_met: 'Peer Duty acceptance not met',
|
|
25
|
+
blocked: 'Peer Duty verification blocked',
|
|
26
|
+
};
|
|
27
|
+
const PEER_VERIFICATION_BLOCKERS = new Map([
|
|
28
|
+
['peer_change_not_current', 'The target Duty is already on another revision.'],
|
|
29
|
+
['peer_evidence_unproven', 'This revision still needs qualifying evidence from a target Run.'],
|
|
30
|
+
['target_or_observation_unavailable', 'The target Duty or its declared observation is unavailable.'],
|
|
31
|
+
]);
|
|
12
32
|
exports.DUTY_DELIVERY_CHOICES = [
|
|
13
33
|
'report-only',
|
|
14
34
|
'local-patch',
|
|
@@ -47,6 +67,34 @@ function deliveryInput(mode, options = {}) {
|
|
|
47
67
|
}
|
|
48
68
|
function renderExecutionReceipt(receipt, log, verbose = false) {
|
|
49
69
|
log(receipt.summary);
|
|
70
|
+
if (receipt.scope === 'exact_run')
|
|
71
|
+
log('This receipt covers the selected Run.');
|
|
72
|
+
if (receipt.decisionEvidence?.length) {
|
|
73
|
+
log('Agent-reported observations');
|
|
74
|
+
for (const observation of receipt.decisionEvidence) {
|
|
75
|
+
log(` ${(0, search_display_1.searchDisplayText)(observation.label)}: ${(0, search_display_1.searchDisplayText)(observation.state)}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (receipt.peerVerification) {
|
|
79
|
+
const { status, reason, receipt: change } = receipt.peerVerification;
|
|
80
|
+
log(PEER_VERIFICATION_LABELS[status]);
|
|
81
|
+
const blocker = reason && PEER_VERIFICATION_BLOCKERS.get(reason);
|
|
82
|
+
if (status === 'blocked' && blocker)
|
|
83
|
+
log(` ${blocker}`);
|
|
84
|
+
if (change) {
|
|
85
|
+
const { targetDutyId, previousVersion, version, verification } = change;
|
|
86
|
+
const query = new URLSearchParams({ view: 'activity' });
|
|
87
|
+
if (verification) {
|
|
88
|
+
query.set('checkId', verification.targetCheckId);
|
|
89
|
+
query.set('runId', verification.targetRunId);
|
|
90
|
+
query.set('observationId', verification.observationId);
|
|
91
|
+
}
|
|
92
|
+
const path = `/duties/${encodeURIComponent(targetDutyId)}?${query}`;
|
|
93
|
+
log(` Target Duty v${previousVersion} → v${version}: ${path}`);
|
|
94
|
+
if (verification)
|
|
95
|
+
log(` Observation: ${verification.observationId}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
50
98
|
if (receipt.runtime) {
|
|
51
99
|
const identity = receipt.runtime.name || receipt.runtime.id || 'the selected runtime';
|
|
52
100
|
log(`Runtime: ${identity}${receipt.runtime.kind ? ` · ${receipt.runtime.kind}` : ''}${receipt.runtime.provider ? ` · ${receipt.runtime.provider}` : ''}`);
|
|
@@ -57,10 +105,11 @@ function renderExecutionReceipt(receipt, log, verbose = false) {
|
|
|
57
105
|
// open it; different evidence stays on the phase it belongs to. The web receipt does the same.
|
|
58
106
|
const printedEvidence = new Set();
|
|
59
107
|
for (const phase of receipt.phases) {
|
|
60
|
-
const mark =
|
|
61
|
-
const
|
|
108
|
+
const mark = RECEIPT_PHASE_MARKS[phase.status];
|
|
109
|
+
const title = phase.phase === 'delivered' && phase.status === 'blocked' ? 'delivery' : phase.phase;
|
|
110
|
+
const label = title === 'observed' && receipt.checkKind === 'follow_through'
|
|
62
111
|
? 'Check'
|
|
63
|
-
:
|
|
112
|
+
: title[0].toUpperCase() + title.slice(1);
|
|
64
113
|
log(` ${mark} ${label}: ${phase.summary}${phase.at ? ` · ${phase.at}` : ''}`);
|
|
65
114
|
for (const evidence of phase.evidence) {
|
|
66
115
|
const location = evidence.url || evidence.path;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export declare const SPACE_REVIEW_WORK_RUNTIME_PROOF_VERSION = 1;
|
|
2
|
+
export declare const SPACE_REVIEW_RESULT_RUNTIME_PROOF_VERSION = 1;
|
|
1
3
|
/**
|
|
2
4
|
* Account Authorization decides access; a separate server-issued session
|
|
3
5
|
* credential proves Agent authorship. Environment ids are selectors only.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SPACE_REVIEW_RESULT_RUNTIME_PROOF_VERSION = exports.SPACE_REVIEW_WORK_RUNTIME_PROOF_VERSION = void 0;
|
|
3
4
|
exports.withTaskRuntimeHeaders = withTaskRuntimeHeaders;
|
|
4
5
|
exports.taskRuntimeRedirectOptions = taskRuntimeRedirectOptions;
|
|
5
6
|
const WITH_TASK_RUNTIME_HEADERS_RE = /^\/api\/tasks(?:\/|$)/;
|
|
@@ -7,6 +8,11 @@ const WITH_TASK_RUNTIME_HEADERS_RE_2 = /^\/api\/agents\/[^/]+\/agent-actions\/[^
|
|
|
7
8
|
const WITH_TASK_RUNTIME_HEADERS_RE_3 = /^\/api\/(?:shortcuts|task-templates)\/[^/]+\/(?:instantiate|trigger)\/?$/;
|
|
8
9
|
const WITH_TASK_RUNTIME_HEADERS_RE_4 = /^\/api\/templates\/[^/]+\/(?:instantiate|fork)\/?$/;
|
|
9
10
|
const WITH_TASK_RUNTIME_HEADERS_RE_5 = /^\/api\/store\/services\/[^/]+\/install\/?$/;
|
|
11
|
+
const KEY_RESULT_LIST = /^\/api\/goals\/[^/]+\/key-results\/?$/;
|
|
12
|
+
const KEY_RESULT_ASSESS = /^\/api\/goals\/[^/]+\/key-results\/[^/]+\/assessments\/?$/;
|
|
13
|
+
const EXACT_TASK_RESULT = /^\/api\/tasks\/[^/]+\/results\/[^/]+\/?$/;
|
|
14
|
+
exports.SPACE_REVIEW_WORK_RUNTIME_PROOF_VERSION = 1;
|
|
15
|
+
exports.SPACE_REVIEW_RESULT_RUNTIME_PROOF_VERSION = 1;
|
|
10
16
|
/**
|
|
11
17
|
* Account Authorization decides access; a separate server-issued session
|
|
12
18
|
* credential proves Agent authorship. Environment ids are selectors only.
|
|
@@ -15,14 +21,16 @@ const WITH_TASK_RUNTIME_HEADERS_RE_5 = /^\/api\/store\/services\/[^/]+\/install\
|
|
|
15
21
|
*/
|
|
16
22
|
function withTaskRuntimeHeaders(headers, requestUrl, method, env = process.env) {
|
|
17
23
|
const sent = { ...headers };
|
|
18
|
-
// A companion credential
|
|
19
|
-
//
|
|
20
|
-
// hints outside Task authorship mutations for other APIs' provenance checks.
|
|
24
|
+
// A companion credential travels only on the exact managed operations below.
|
|
25
|
+
// Preserve nonsecret correlation hints for other APIs' provenance checks.
|
|
21
26
|
for (const key of Object.keys(sent)) {
|
|
22
27
|
if (key.toLowerCase() === 'x-oversky-session-authorization')
|
|
23
28
|
delete sent[key];
|
|
24
29
|
}
|
|
25
|
-
|
|
30
|
+
const verb = method.toUpperCase();
|
|
31
|
+
const mutation = ['POST', 'PUT', 'PATCH', 'DELETE'].includes(verb);
|
|
32
|
+
const reviewSpace = env.OVERSKY_SPACE_REVIEW_WORK === '1' ? env.OVERSKY_SESSION_SPACE_ID : undefined;
|
|
33
|
+
if (!mutation && !(reviewSpace && verb === 'GET'))
|
|
26
34
|
return sent;
|
|
27
35
|
const refuseOrigin = () => Object.assign(new Error('Managed Task requests require their bound server origin; refusing account-attributed fallback.'), {
|
|
28
36
|
code: 'SESSION_TASK_ORIGIN_MISMATCH',
|
|
@@ -39,14 +47,23 @@ function withTaskRuntimeHeaders(headers, requestUrl, method, env = process.env)
|
|
|
39
47
|
// Some platform operations materialize Tasks outside the Task router. Keep
|
|
40
48
|
// their exact POST routes here; action/library edits, picker reads and other
|
|
41
49
|
// integration routes must never receive the companion credential.
|
|
42
|
-
const
|
|
43
|
-
const
|
|
50
|
+
const { pathname } = target;
|
|
51
|
+
const taskMutation = mutation && WITH_TASK_RUNTIME_HEADERS_RE.test(pathname);
|
|
52
|
+
const attributedWrite = verb === 'POST' && [
|
|
44
53
|
WITH_TASK_RUNTIME_HEADERS_RE_2,
|
|
45
54
|
WITH_TASK_RUNTIME_HEADERS_RE_3,
|
|
46
55
|
WITH_TASK_RUNTIME_HEADERS_RE_4,
|
|
47
56
|
WITH_TASK_RUNTIME_HEADERS_RE_5,
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
KEY_RESULT_ASSESS,
|
|
58
|
+
].some((route) => route.test(pathname));
|
|
59
|
+
const spacePath = reviewSpace ? `/api/spaces/${encodeURIComponent(reviewSpace)}` : undefined;
|
|
60
|
+
const reviewProof = spacePath && ((verb === 'GET' && (KEY_RESULT_LIST.test(pathname) || pathname === `${spacePath}/goals` ||
|
|
61
|
+
(EXACT_TASK_RESULT.test(pathname) && target.searchParams.getAll('reviewSpaceId').length === 1 &&
|
|
62
|
+
target.searchParams.get('reviewSpaceId') === reviewSpace) ||
|
|
63
|
+
(pathname === '/api/tasks' && target.searchParams.getAll('spaceId').length === 1 &&
|
|
64
|
+
target.searchParams.get('spaceId') === reviewSpace))) ||
|
|
65
|
+
(verb === 'POST' && pathname === `${spacePath}/wiki/pages`));
|
|
66
|
+
if (!taskMutation && !attributedWrite && !reviewProof)
|
|
50
67
|
return sent;
|
|
51
68
|
const names = new Set(['x-oversky-agent-id', 'x-oversky-session-id', 'x-oversky-autonomous-run-id']);
|
|
52
69
|
for (const key of Object.keys(sent))
|
|
@@ -65,7 +82,7 @@ function withTaskRuntimeHeaders(headers, requestUrl, method, env = process.env)
|
|
|
65
82
|
throw refuseOrigin();
|
|
66
83
|
}
|
|
67
84
|
// The companion credential only travels to the managed runtime's server
|
|
68
|
-
// and only to
|
|
85
|
+
// and only to the attributed operations and scoped Review receipts above.
|
|
69
86
|
if (target.origin !== trusted.origin)
|
|
70
87
|
throw refuseOrigin();
|
|
71
88
|
if (!sessionId || !token) {
|
package/dist/lib/tasks.js
CHANGED
|
@@ -1106,11 +1106,19 @@ function projectMatchesId(project, ref) {
|
|
|
1106
1106
|
}
|
|
1107
1107
|
async function getCachedProject(projectId, cache) {
|
|
1108
1108
|
const load = async () => {
|
|
1109
|
+
if ((0, projects_1.looksLikeCanonicalProjectId)(projectId) && !looksLikeStorageId(projectId)) {
|
|
1110
|
+
try {
|
|
1111
|
+
return await projects_1.projectApi.get(projectId);
|
|
1112
|
+
}
|
|
1113
|
+
catch (error) {
|
|
1114
|
+
if (error?.code !== 'PROJECT_LOOKUP_UNSUPPORTED') {
|
|
1115
|
+
throw error;
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1109
1119
|
const filtered = await projects_1.projectApi.search({ q: projectId, limit: 20 });
|
|
1110
1120
|
let exact = (0, projects_1.projectsFrom)(filtered).filter((project) => projectMatchesId(project, projectId));
|
|
1111
|
-
//
|
|
1112
|
-
// not UUID. Fall back to the bounded visible project catalog so canonical
|
|
1113
|
-
// IDs still resolve without inventing a second project read endpoint.
|
|
1121
|
+
// Older servers and pasted Mongo storage ids still use the visible catalog.
|
|
1114
1122
|
if (exact.length === 0) {
|
|
1115
1123
|
const catalog = await projects_1.projectApi.search({ limit: 200 });
|
|
1116
1124
|
exact = (0, projects_1.projectsFrom)(catalog).filter((project) => projectMatchesId(project, projectId));
|
|
@@ -140,8 +140,8 @@ function buildUsageReference(manifest, domainInput, options = {}) {
|
|
|
140
140
|
}
|
|
141
141
|
function renderUsageOverview(overview) {
|
|
142
142
|
const lines = [
|
|
143
|
-
`skrr command domains (${overview.domains.length}
|
|
144
|
-
'Read
|
|
143
|
+
`skrr command domains (${overview.domains.length}).`,
|
|
144
|
+
'Read a domain with skrr usage <domain>.',
|
|
145
145
|
...overview.domains.map(({ domain }) => domain),
|
|
146
146
|
];
|
|
147
147
|
return lines.join('\n');
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export declare const DUTY_EXECUTION_CONTRACT_VERSION: 3;
|
|
3
3
|
export declare const DUTY_EXECUTION_CONTRACT_CAPABILITY = "duty_execution_contract_v3";
|
|
4
4
|
export declare const PLATFORM_DUTY_SCRATCH_CAPABILITY = "platform_duty_scratch_v1";
|
|
5
|
+
export declare const REPORT_ONLY_DUTY_SCRATCH_CAPABILITY = "report_only_duty_scratch_v1";
|
|
5
6
|
export interface DutyExecutionContract {
|
|
6
7
|
version: 3;
|
|
7
8
|
kind: 'duty' | 'task_delivery';
|
|
@@ -42,12 +43,13 @@ export interface DutyExecutionContract {
|
|
|
42
43
|
return: 'duty_result_v1' | 'task_output';
|
|
43
44
|
}
|
|
44
45
|
export declare function eventRepository(event: Record<string, unknown> | null | undefined): string;
|
|
45
|
-
/**
|
|
46
|
+
/** Relationship Duties and unrooted reports without repository inputs can use empty scratch. */
|
|
46
47
|
export declare function usesPlatformDutyScratch(input: {
|
|
47
48
|
dutyId?: string;
|
|
48
49
|
delivery?: DutyExecutionContract['delivery'];
|
|
49
50
|
workspace?: DutyExecutionContract['workspace'];
|
|
50
51
|
event?: DutyExecutionContract['event'];
|
|
52
|
+
unrootedReport?: boolean;
|
|
51
53
|
}): boolean;
|
|
52
54
|
/** One strict parser used at storage admission and at runtime admission. */
|
|
53
55
|
export declare function normalizeDutyExecutionContract(value: unknown): DutyExecutionContract | null;
|
|
@@ -21,6 +21,7 @@ __export(dutyExecutionContract_exports, {
|
|
|
21
21
|
DUTY_EXECUTION_CONTRACT_CAPABILITY: () => DUTY_EXECUTION_CONTRACT_CAPABILITY,
|
|
22
22
|
DUTY_EXECUTION_CONTRACT_VERSION: () => DUTY_EXECUTION_CONTRACT_VERSION,
|
|
23
23
|
PLATFORM_DUTY_SCRATCH_CAPABILITY: () => PLATFORM_DUTY_SCRATCH_CAPABILITY,
|
|
24
|
+
REPORT_ONLY_DUTY_SCRATCH_CAPABILITY: () => REPORT_ONLY_DUTY_SCRATCH_CAPABILITY,
|
|
24
25
|
eventRepository: () => eventRepository,
|
|
25
26
|
normalizeDutyExecutionContract: () => normalizeDutyExecutionContract,
|
|
26
27
|
usesPlatformDutyScratch: () => usesPlatformDutyScratch
|
|
@@ -41,6 +42,7 @@ const VALID_DELIVERY_SOURCE_RE_2 = /^[a-f0-9]{40,64}$/i;
|
|
|
41
42
|
const DUTY_EXECUTION_CONTRACT_VERSION = 3;
|
|
42
43
|
const DUTY_EXECUTION_CONTRACT_CAPABILITY = "duty_execution_contract_v3";
|
|
43
44
|
const PLATFORM_DUTY_SCRATCH_CAPABILITY = "platform_duty_scratch_v1";
|
|
45
|
+
const REPORT_ONLY_DUTY_SCRATCH_CAPABILITY = "report_only_duty_scratch_v1";
|
|
44
46
|
const DELIVERY_MODES = /* @__PURE__ */ new Set([
|
|
45
47
|
"report_only",
|
|
46
48
|
"local_patch",
|
|
@@ -405,8 +407,9 @@ function eventRepository(event) {
|
|
|
405
407
|
return VALID_DELIVERY_RE.test(String(value || "")) ? String(value).toLowerCase() : "";
|
|
406
408
|
}
|
|
407
409
|
function usesPlatformDutyScratch(input) {
|
|
408
|
-
const { dutyId, delivery, workspace, event } = input;
|
|
409
|
-
|
|
410
|
+
const { dutyId, delivery, workspace, event, unrootedReport } = input;
|
|
411
|
+
const relationshipDuty = typeof dutyId === "string" && /^obj_system_(conversation_continuity|relationship_pulse|duty_incubator|open_loop_closer)_[a-f0-9]{24}$/.test(dutyId);
|
|
412
|
+
return (relationshipDuty || unrootedReport === true) && delivery?.mode === "report_only" && !delivery.repo && !delivery.baseBranch && workspace?.kind === "ephemeral" && workspace.base === "agent_working_directory" && !workspace.fetchBase && !event?.repo && !event?.repository && !eventRepository(event);
|
|
410
413
|
}
|
|
411
414
|
function failedGitHubCheck(event) {
|
|
412
415
|
const eventType = String(event?.eventType || event?.type || "").toLowerCase();
|
|
@@ -447,6 +450,7 @@ function normalizeDutyExecutionContract(value) {
|
|
|
447
450
|
DUTY_EXECUTION_CONTRACT_CAPABILITY,
|
|
448
451
|
DUTY_EXECUTION_CONTRACT_VERSION,
|
|
449
452
|
PLATFORM_DUTY_SCRATCH_CAPABILITY,
|
|
453
|
+
REPORT_ONLY_DUTY_SCRATCH_CAPABILITY,
|
|
450
454
|
eventRepository,
|
|
451
455
|
normalizeDutyExecutionContract,
|
|
452
456
|
usesPlatformDutyScratch
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export declare const DUTY_EXECUTION_CONTRACT_VERSION: 3;
|
|
3
3
|
export declare const DUTY_EXECUTION_CONTRACT_CAPABILITY = "duty_execution_contract_v3";
|
|
4
4
|
export declare const PLATFORM_DUTY_SCRATCH_CAPABILITY = "platform_duty_scratch_v1";
|
|
5
|
+
export declare const REPORT_ONLY_DUTY_SCRATCH_CAPABILITY = "report_only_duty_scratch_v1";
|
|
5
6
|
export interface DutyExecutionContract {
|
|
6
7
|
version: 3;
|
|
7
8
|
kind: 'duty' | 'task_delivery';
|
|
@@ -42,12 +43,13 @@ export interface DutyExecutionContract {
|
|
|
42
43
|
return: 'duty_result_v1' | 'task_output';
|
|
43
44
|
}
|
|
44
45
|
export declare function eventRepository(event: Record<string, unknown> | null | undefined): string;
|
|
45
|
-
/**
|
|
46
|
+
/** Relationship Duties and unrooted reports without repository inputs can use empty scratch. */
|
|
46
47
|
export declare function usesPlatformDutyScratch(input: {
|
|
47
48
|
dutyId?: string;
|
|
48
49
|
delivery?: DutyExecutionContract['delivery'];
|
|
49
50
|
workspace?: DutyExecutionContract['workspace'];
|
|
50
51
|
event?: DutyExecutionContract['event'];
|
|
52
|
+
unrootedReport?: boolean;
|
|
51
53
|
}): boolean;
|
|
52
54
|
/** One strict parser used at storage admission and at runtime admission. */
|
|
53
55
|
export declare function normalizeDutyExecutionContract(value: unknown): DutyExecutionContract | null;
|
|
@@ -15,6 +15,7 @@ const VALID_DELIVERY_SOURCE_RE_2 = /^[a-f0-9]{40,64}$/i;
|
|
|
15
15
|
export const DUTY_EXECUTION_CONTRACT_VERSION = 3;
|
|
16
16
|
export const DUTY_EXECUTION_CONTRACT_CAPABILITY = 'duty_execution_contract_v3';
|
|
17
17
|
export const PLATFORM_DUTY_SCRATCH_CAPABILITY = 'platform_duty_scratch_v1';
|
|
18
|
+
export const REPORT_ONLY_DUTY_SCRATCH_CAPABILITY = 'report_only_duty_scratch_v1';
|
|
18
19
|
const DELIVERY_MODES = new Set([
|
|
19
20
|
'report_only',
|
|
20
21
|
'local_patch',
|
|
@@ -477,11 +478,12 @@ export function eventRepository(event) {
|
|
|
477
478
|
const value = event.repoFullName || repository?.full_name || repository?.fullName;
|
|
478
479
|
return VALID_DELIVERY_RE.test(String(value || '')) ? String(value).toLowerCase() : '';
|
|
479
480
|
}
|
|
480
|
-
/**
|
|
481
|
+
/** Relationship Duties and unrooted reports without repository inputs can use empty scratch. */
|
|
481
482
|
export function usesPlatformDutyScratch(input) {
|
|
482
|
-
const { dutyId, delivery, workspace, event } = input;
|
|
483
|
-
|
|
484
|
-
/^obj_system_(conversation_continuity|relationship_pulse|duty_incubator|open_loop_closer)_[a-f0-9]{24}$/.test(dutyId)
|
|
483
|
+
const { dutyId, delivery, workspace, event, unrootedReport } = input;
|
|
484
|
+
const relationshipDuty = typeof dutyId === 'string' &&
|
|
485
|
+
/^obj_system_(conversation_continuity|relationship_pulse|duty_incubator|open_loop_closer)_[a-f0-9]{24}$/.test(dutyId);
|
|
486
|
+
return ((relationshipDuty || unrootedReport === true) &&
|
|
485
487
|
delivery?.mode === 'report_only' &&
|
|
486
488
|
!delivery.repo &&
|
|
487
489
|
!delivery.baseBranch &&
|