@skrr-ai/cli 0.1.14 → 0.1.17
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 +3 -0
- package/dist/base-command.d.ts +14 -0
- package/dist/base-command.js +60 -1
- package/dist/commands/agents/create.d.ts +1 -0
- package/dist/commands/agents/create.js +6 -1
- package/dist/commands/agents/instructions/add.d.ts +21 -0
- package/dist/commands/agents/instructions/add.js +115 -0
- package/dist/commands/agents/instructions/disable.d.ts +13 -0
- package/dist/commands/agents/instructions/disable.js +50 -0
- package/dist/commands/agents/instructions/edit.d.ts +16 -0
- package/dist/commands/agents/instructions/edit.js +79 -0
- package/dist/commands/agents/instructions/enable.d.ts +13 -0
- package/dist/commands/agents/instructions/enable.js +50 -0
- package/dist/commands/agents/instructions/move.d.ts +15 -0
- package/dist/commands/agents/instructions/move.js +61 -0
- package/dist/commands/agents/instructions/preview.d.ts +13 -0
- package/dist/commands/agents/instructions/preview.js +59 -0
- package/dist/commands/agents/instructions/remove.d.ts +13 -0
- package/dist/commands/agents/instructions/remove.js +49 -0
- package/dist/commands/agents/instructions/set.d.ts +17 -0
- package/dist/commands/agents/instructions/set.js +79 -0
- package/dist/commands/agents/instructions/show.d.ts +15 -0
- package/dist/commands/agents/instructions/show.js +76 -0
- package/dist/commands/agents/instructions/upgrade.d.ts +16 -0
- package/dist/commands/agents/instructions/upgrade.js +77 -0
- package/dist/commands/agents/show.js +5 -0
- package/dist/commands/agents/triggers/policy.js +8 -2
- package/dist/commands/agents/update.d.ts +1 -0
- package/dist/commands/agents/update.js +8 -2
- package/dist/commands/commitments/autonomy.js +9 -1
- package/dist/commands/commitments/create.d.ts +8 -5
- package/dist/commands/commitments/create.js +38 -8
- package/dist/commands/commitments/doctor.d.ts +19 -0
- package/dist/commands/commitments/doctor.js +72 -0
- package/dist/commands/commitments/preflight.d.ts +3 -1
- package/dist/commands/commitments/preflight.js +25 -3
- package/dist/commands/commitments/reports.js +15 -2
- package/dist/commands/commitments/update.d.ts +9 -2
- package/dist/commands/commitments/update.js +36 -2
- package/dist/commands/daemon/index.js +2 -0
- package/dist/commands/daemon/recover-offline-queue.d.ts +9 -0
- package/dist/commands/daemon/recover-offline-queue.js +24 -0
- package/dist/commands/daemon/start.js +29 -1
- package/dist/commands/instruction-blocks/create.d.ts +19 -0
- package/dist/commands/instruction-blocks/create.js +94 -0
- package/dist/commands/instruction-blocks/delete.d.ts +13 -0
- package/dist/commands/instruction-blocks/delete.js +35 -0
- package/dist/commands/instruction-blocks/list.d.ts +13 -0
- package/dist/commands/instruction-blocks/list.js +71 -0
- package/dist/commands/instruction-blocks/show.d.ts +12 -0
- package/dist/commands/instruction-blocks/show.js +35 -0
- package/dist/commands/instruction-blocks/update.d.ts +23 -0
- package/dist/commands/instruction-blocks/update.js +94 -0
- package/dist/commands/spaces/auto-executor/preview.d.ts +1 -0
- package/dist/commands/spaces/auto-executor/preview.js +62 -3
- package/dist/commands/spaces/auto-executor/update.d.ts +4 -0
- package/dist/commands/spaces/auto-executor/update.js +78 -7
- package/dist/commands/spaces/capacity.js +14 -2
- package/dist/commands/spaces/update.d.ts +4 -0
- package/dist/commands/spaces/update.js +49 -2
- package/dist/commands/tasks/complete.d.ts +12 -5
- package/dist/commands/tasks/complete.js +107 -28
- package/dist/commands/tasks/continue-ready.js +9 -1
- package/dist/commands/tasks/create.d.ts +1 -0
- package/dist/commands/tasks/create.js +27 -2
- package/dist/commands/tasks/deliverable/add.d.ts +23 -0
- package/dist/commands/tasks/deliverable/add.js +70 -0
- package/dist/commands/tasks/deliverable/confirm.d.ts +35 -0
- package/dist/commands/tasks/deliverable/confirm.js +77 -0
- package/dist/commands/tasks/events/append.d.ts +1 -1
- package/dist/commands/tasks/events/append.js +4 -4
- package/dist/commands/tasks/expectations.d.ts +12 -0
- package/dist/commands/tasks/expectations.js +111 -0
- package/dist/commands/tasks/judge.d.ts +29 -0
- package/dist/commands/tasks/judge.js +68 -0
- package/dist/commands/tasks/report.d.ts +1 -1
- package/dist/commands/tasks/report.js +27 -3
- package/dist/commands/tasks/trust.d.ts +35 -0
- package/dist/commands/tasks/trust.js +75 -0
- package/dist/commands/tasks/update.d.ts +1 -0
- package/dist/commands/tasks/update.js +34 -4
- package/dist/commands/tasks/waive.d.ts +25 -0
- package/dist/commands/tasks/waive.js +58 -0
- package/dist/lib/agent-config.js +5 -0
- package/dist/lib/agent-instructions.d.ts +15 -0
- package/dist/lib/agent-instructions.js +55 -0
- package/dist/lib/command-hygiene.d.ts +6 -1
- package/dist/lib/command-hygiene.js +49 -29
- package/dist/lib/commitments.d.ts +28 -3
- package/dist/lib/commitments.js +20 -11
- package/dist/lib/exec-runtime-binary.d.ts +13 -0
- package/dist/lib/exec-runtime-binary.js +45 -0
- package/dist/lib/git-task.d.ts +37 -0
- package/dist/lib/git-task.js +151 -0
- package/dist/lib/instruction-blocks.d.ts +29 -0
- package/dist/lib/instruction-blocks.js +159 -0
- package/dist/lib/runtime-start-verification.d.ts +49 -0
- package/dist/lib/runtime-start-verification.js +108 -0
- package/dist/lib/task-execution.d.ts +18 -2
- package/dist/lib/task-execution.js +19 -14
- package/dist/lib/task-transcript.js +1 -1
- package/dist/lib/tasks.d.ts +50 -0
- package/dist/lib/tasks.js +93 -2
- package/dist/node_modules/@skrr-ai/data-provider/index.js +2393 -2197
- package/dist/node_modules/@skrr-ai/inference-broker/package.json +1 -1
- package/oclif.manifest.json +17725 -15563
- package/package.json +4 -1
package/dist/lib/tasks.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RECOGNIZED_TASK_VERDICTS = exports.TASK_WORK_EVENT_KINDS = exports.TASK_PRIORITIES = void 0;
|
|
3
|
+
exports.RECOGNIZED_TASK_VERDICTS = exports.DELIVERABLE_LIFECYCLE_VALUES = exports.EXPECT_FLAG_HELP = exports.TASK_WORK_EVENT_KINDS = exports.TASK_PRIORITIES = void 0;
|
|
4
4
|
exports.releasePinRepairGuard = releasePinRepairGuard;
|
|
5
5
|
exports.taskUpdateMutationGuard = taskUpdateMutationGuard;
|
|
6
6
|
exports.executionIsolationFromWorktreeFlag = executionIsolationFromWorktreeFlag;
|
|
7
|
+
exports.parseExpectation = parseExpectation;
|
|
8
|
+
exports.parseExpectations = parseExpectations;
|
|
9
|
+
exports.parseDeliverableCoordinate = parseDeliverableCoordinate;
|
|
7
10
|
exports.buildTaskCreatePayload = buildTaskCreatePayload;
|
|
8
11
|
exports.boundSessionAgentId = boundSessionAgentId;
|
|
9
12
|
exports.applyDaemonSessionDefaults = applyDaemonSessionDefaults;
|
|
@@ -106,8 +109,95 @@ function executionIsolationFromWorktreeFlag(worktree) {
|
|
|
106
109
|
return undefined;
|
|
107
110
|
return worktree ? 'ephemeral' : 'shared';
|
|
108
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Parse an expectation spec.
|
|
114
|
+
*
|
|
115
|
+
* DELEGATES to `@skrr-ai/data-provider`, which owns the grammar and is read by
|
|
116
|
+
* the API and the web client too. The copy this replaces validated correctly
|
|
117
|
+
* and then described a syntax it refused — its messages named three different
|
|
118
|
+
* flags (`--requires`, `--output`, `--accept`) and used `git_ref:origin/main`
|
|
119
|
+
* as the example, a value the same function rejects. For an agent the refusal
|
|
120
|
+
* IS the documentation: it hits the error and corrects, so an error naming a
|
|
121
|
+
* rejected example costs a whole turn and can loop.
|
|
122
|
+
*/
|
|
123
|
+
function parseExpectation(spec) {
|
|
124
|
+
return (0, data_provider_1.parseExpectationSpec)(spec);
|
|
125
|
+
}
|
|
126
|
+
/** Parse several, failing on the first that cannot be read. */
|
|
127
|
+
function parseExpectations(specs) {
|
|
128
|
+
if (!specs || specs.length === 0) {
|
|
129
|
+
return { ok: true, value: [] };
|
|
130
|
+
}
|
|
131
|
+
const out = [];
|
|
132
|
+
for (const spec of specs) {
|
|
133
|
+
const parsed = (0, data_provider_1.parseExpectationSpec)(spec);
|
|
134
|
+
if (!parsed.ok) {
|
|
135
|
+
return parsed;
|
|
136
|
+
}
|
|
137
|
+
out.push(parsed.value);
|
|
138
|
+
}
|
|
139
|
+
return { ok: true, value: out };
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* The one-line help every expectation flag shares, so they cannot disagree.
|
|
143
|
+
*
|
|
144
|
+
* The vocabulary is read from the owning package, but DEFENSIVELY: oclif
|
|
145
|
+
* evaluates a flag `description` when the command class body runs, i.e. at
|
|
146
|
+
* module load, and several suites mock `@skrr-ai/data-provider` with an
|
|
147
|
+
* explicit allow-list that predates these exports. Under such a mock the arrays
|
|
148
|
+
* are `undefined`, and a HELP STRING is never worth failing a module load for —
|
|
149
|
+
* the fallbacks below are a test-environment courtesy, never the vocabulary
|
|
150
|
+
* anything is validated against. `parseExpectationSpec` runs at call time
|
|
151
|
+
* against the real module and remains the only authority.
|
|
152
|
+
*/
|
|
153
|
+
const kindsForHelp = Array.isArray(data_provider_1.TASK_OUTCOME_KINDS)
|
|
154
|
+
? data_provider_1.TASK_OUTCOME_KINDS.join(', ')
|
|
155
|
+
: 'code, page, url, file, message, dataset';
|
|
156
|
+
const presetsForHelp = Array.isArray(data_provider_1.EXPECTATION_PRESETS)
|
|
157
|
+
? data_provider_1.EXPECTATION_PRESETS.map((preset) => `@${preset.key}`).join(', ')
|
|
158
|
+
: '@merged-to-main, @pdf-delivered';
|
|
159
|
+
exports.EXPECT_FLAG_HELP = 'What this task must produce, as <kind>[/<format>][:<target>] or @<preset> — ' +
|
|
160
|
+
`e.g. 'code:origin/main', 'file/pdf:Drive/Reports', '@merged-to-main'. ` +
|
|
161
|
+
`Kinds: ${kindsForHelp}. Presets: ${presetsForHelp}. ` +
|
|
162
|
+
'Anything else is stored as a plain-language expectation a person settles. Repeatable.';
|
|
163
|
+
/**
|
|
164
|
+
* Parse a deliverable coordinate. Also delegated — `:` and `@` and now `/` all
|
|
165
|
+
* mean different things, and a second implementation of that grammar is how the
|
|
166
|
+
* declaring side and the recording side stop agreeing.
|
|
167
|
+
*/
|
|
168
|
+
function parseDeliverableCoordinate(spec) {
|
|
169
|
+
return (0, data_provider_1.parseDeliverableCoordinate)(spec);
|
|
170
|
+
}
|
|
171
|
+
/** Lifecycle values a caller may assert, for flag validation. */
|
|
172
|
+
exports.DELIVERABLE_LIFECYCLE_VALUES = data_provider_1.DELIVERABLE_LIFECYCLES;
|
|
173
|
+
/**
|
|
174
|
+
* `--from-json` takes stored API field names, while the interactive flags use
|
|
175
|
+
* shorter names such as `--project` and `--spawned-by`. Normalize the obvious
|
|
176
|
+
* camel-case forms before a permissive API route can silently drop them.
|
|
177
|
+
*/
|
|
178
|
+
function normalizeTaskCreateJsonAliases(body) {
|
|
179
|
+
const normalized = { ...body };
|
|
180
|
+
const aliases = [
|
|
181
|
+
['parent', 'parentId'],
|
|
182
|
+
['space', 'spaceId'],
|
|
183
|
+
['goal', 'goalId'],
|
|
184
|
+
['commitment', 'commitmentId'],
|
|
185
|
+
['project', 'projectId'],
|
|
186
|
+
['cycle', 'cycleId'],
|
|
187
|
+
['spawnedBy', 'spawnedByTaskId'],
|
|
188
|
+
];
|
|
189
|
+
for (const [alias, canonical] of aliases) {
|
|
190
|
+
if (Object.prototype.hasOwnProperty.call(normalized, canonical))
|
|
191
|
+
continue;
|
|
192
|
+
if (!Object.prototype.hasOwnProperty.call(normalized, alias))
|
|
193
|
+
continue;
|
|
194
|
+
normalized[canonical] = normalized[alias];
|
|
195
|
+
delete normalized[alias];
|
|
196
|
+
}
|
|
197
|
+
return normalized;
|
|
198
|
+
}
|
|
109
199
|
function buildTaskCreatePayload(body, flags = {}) {
|
|
110
|
-
const payload = (0, prompt_1.mergeDefined)(body, {
|
|
200
|
+
const payload = (0, prompt_1.mergeDefined)(normalizeTaskCreateJsonAliases(body), {
|
|
111
201
|
templateId: flags.template,
|
|
112
202
|
title: flags.title,
|
|
113
203
|
description: flags.description,
|
|
@@ -123,6 +213,7 @@ function buildTaskCreatePayload(body, flags = {}) {
|
|
|
123
213
|
assigneeAgentIds: flags['assignee-agent'],
|
|
124
214
|
assigneeUserIds: flags['assignee-user'],
|
|
125
215
|
executionMode: flags['execution-mode'],
|
|
216
|
+
expectations: flags.expectations,
|
|
126
217
|
startDate: flags['start-date'],
|
|
127
218
|
dueDate: flags['due-date'],
|
|
128
219
|
estimate: flags.estimate,
|