@skrr-ai/cli 0.1.215 → 0.1.216
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/agent/message/no-reply.d.ts +4 -0
- package/dist/commands/agent/message/no-reply.js +5 -1
- package/dist/commands/agents/always-on/recovery-review.d.ts +12 -0
- package/dist/commands/agents/always-on/recovery-review.js +52 -2
- package/dist/commands/agents/permissions/list.d.ts +12 -0
- package/dist/commands/agents/permissions/list.js +42 -0
- package/dist/commands/agents/permissions/remove.d.ts +15 -0
- package/dist/commands/agents/permissions/remove.js +68 -0
- package/dist/commands/dm/work.js +2 -0
- package/dist/commands/duties/action-proposal.js +7 -1
- package/dist/commands/duties/action-proposals.d.ts +9 -0
- package/dist/commands/duties/action-proposals.js +30 -12
- package/dist/commands/duties/pause.js +20 -2
- package/dist/commands/duties/trigger-status.js +6 -1
- package/dist/commands/duties/update.js +22 -7
- package/dist/commands/tasks/chat/index.d.ts +11 -0
- package/dist/commands/tasks/chat/index.js +27 -0
- package/dist/commands/tasks/input/answer.d.ts +12 -0
- package/dist/commands/tasks/input/answer.js +59 -5
- package/dist/commands/tasks/operations/show.js +5 -6
- package/dist/commands/tasks/result/show.js +2 -4
- package/dist/commands/tasks/retry-receipt.js +1 -3
- package/dist/generated/agent-guides.json +24 -24
- package/dist/lib/compasses.d.ts +5 -0
- package/dist/lib/compasses.js +6 -1
- package/dist/lib/duties.d.ts +27 -0
- package/dist/lib/duties.js +81 -14
- package/dist/lib/permission-rules.d.ts +18 -0
- package/dist/lib/permission-rules.js +62 -0
- package/dist/lib/task-extras.d.ts +19 -0
- package/dist/lib/task-extras.js +13 -0
- package/dist/node_modules/@skrr-ai/data-provider/index.js +12676 -12061
- package/oclif.manifest.json +200 -3
- package/package.json +5 -2
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ruleCovers = ruleCovers;
|
|
4
|
+
exports.ruleWhere = ruleWhere;
|
|
5
|
+
exports.ruleGranted = ruleGranted;
|
|
6
|
+
exports.ruleUse = ruleUse;
|
|
7
|
+
exports.ruleLines = ruleLines;
|
|
8
|
+
exports.ruleOutcomeLine = ruleOutcomeLine;
|
|
9
|
+
/** What a rule covers. "any command" is worded here, never read from a stored label. */
|
|
10
|
+
function ruleCovers(rule) {
|
|
11
|
+
return rule.match?.kind === 'any' ? 'any command' : rule.label;
|
|
12
|
+
}
|
|
13
|
+
function ruleWhere(rule) {
|
|
14
|
+
if (rule.where?.kind === 'machine') {
|
|
15
|
+
return rule.where.harnessId ? `on machine ${rule.where.harnessId}` : 'on a machine';
|
|
16
|
+
}
|
|
17
|
+
return 'in the cloud';
|
|
18
|
+
}
|
|
19
|
+
function ruleGranted(rule) {
|
|
20
|
+
const at = rule.createdAt ? `granted ${rule.createdAt}` : 'granted';
|
|
21
|
+
if (rule.source?.taskId)
|
|
22
|
+
return `${at} from Task ${rule.source.taskId}`;
|
|
23
|
+
if (rule.source?.conversationId)
|
|
24
|
+
return `${at} from chat ${rule.source.conversationId}`;
|
|
25
|
+
return at;
|
|
26
|
+
}
|
|
27
|
+
function ruleUse(rule) {
|
|
28
|
+
const count = rule.useCount ?? 0;
|
|
29
|
+
if (count === 0)
|
|
30
|
+
return 'not used yet';
|
|
31
|
+
const times = count === 1 ? 'used once' : `used ${count} times`;
|
|
32
|
+
return rule.lastUsedAt ? `${times}, last ${rule.lastUsedAt}` : times;
|
|
33
|
+
}
|
|
34
|
+
/** One rule as a short block: what it covers, then its id and details. */
|
|
35
|
+
function ruleLines(rule) {
|
|
36
|
+
return [
|
|
37
|
+
`${ruleCovers(rule)} (${rule.tool})`,
|
|
38
|
+
` id: ${rule.id}`,
|
|
39
|
+
` ${ruleWhere(rule)}; ${ruleGranted(rule)}`,
|
|
40
|
+
` ${ruleUse(rule)}`,
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
/** Why an "Always allow" saved no rule. Every one says the call itself was still allowed. */
|
|
44
|
+
const REFUSAL_LINES = {
|
|
45
|
+
invalid_context: 'Allowed this once. The rule could not be saved, so the Agent asks again next time.',
|
|
46
|
+
unavailable: 'Allowed this once. The rule could not be saved, so the Agent asks again next time.',
|
|
47
|
+
unsupported_place: 'Allowed this once. Rules are not available where this Agent runs yet, so it asks again next time.',
|
|
48
|
+
not_owner: "Allowed this once. Only the Agent's owner can save a rule, so it asks again next time.",
|
|
49
|
+
option_unavailable: 'Allowed this once. That rule no longer fits this call, so the Agent asks again next time.',
|
|
50
|
+
too_many_rules: 'Allowed this once. This Agent already holds as many rules as it can: remove one with `skrr agents permissions remove`.',
|
|
51
|
+
not_interactive: 'Allowed this once. A rule is saved only when you choose it on the card in the app, so the Agent asks again next time.',
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* What came of "Always allow …" chosen on a parked Task approval, as one line. The web card says
|
|
55
|
+
* the same through its toast.
|
|
56
|
+
*/
|
|
57
|
+
function ruleOutcomeLine(outcome) {
|
|
58
|
+
if (!outcome.granted)
|
|
59
|
+
return REFUSAL_LINES[outcome.reason];
|
|
60
|
+
const covers = outcome.breadth === 'any' ? 'any command' : outcome.label;
|
|
61
|
+
return `Saved a rule for ${covers}: the Agent runs calls it covers without asking you. See or remove it with \`skrr agents permissions list <agent>\`.`;
|
|
62
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TaskResultRecord } from '@skrr-ai/data-provider';
|
|
1
2
|
import { withQuery } from './triggers';
|
|
2
3
|
type Query = Parameters<typeof withQuery>[1];
|
|
3
4
|
type Json = Record<string, unknown>;
|
|
@@ -161,4 +162,22 @@ export interface TaskLabelSuggestionResponse {
|
|
|
161
162
|
suggestions?: TaskLabelSuggestion[];
|
|
162
163
|
}
|
|
163
164
|
export declare function taskLabelSuggestion(taskId: string): Promise<TaskLabelSuggestionResponse>;
|
|
165
|
+
/**
|
|
166
|
+
* The one Space evidence scope an exact Result read may name. The route refuses
|
|
167
|
+
* both at once, and a bound Space review or Notebook session must name its own.
|
|
168
|
+
*/
|
|
169
|
+
export type ExactTaskResultScope = {
|
|
170
|
+
reviewSpaceId?: string;
|
|
171
|
+
notebookSpaceId?: string;
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* `GET /api/tasks/:taskId/results/:resultId` — one immutable Result version, read
|
|
175
|
+
* by id (`skrr tasks result show --result <id>`, OSK-32828).
|
|
176
|
+
*
|
|
177
|
+
* Through the shared fetch rather than `request.get`: a native Space review
|
|
178
|
+
* session proves itself with the runtime headers that fetch attaches, and only
|
|
179
|
+
* for this exact path and its single `reviewSpaceId` (lib/task-runtime-headers.ts).
|
|
180
|
+
* Kept in the lib so `domain-api-parity` sees the endpoint.
|
|
181
|
+
*/
|
|
182
|
+
export declare function readExactTaskResult(taskId: string, resultId: string, scope?: ExactTaskResultScope): Promise<TaskResultRecord>;
|
|
164
183
|
export {};
|
package/dist/lib/task-extras.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.taskRunFork = taskRunFork;
|
|
|
7
7
|
exports.taskRunPromote = taskRunPromote;
|
|
8
8
|
exports.parseExecutionTargetRef = parseExecutionTargetRef;
|
|
9
9
|
exports.taskLabelSuggestion = taskLabelSuggestion;
|
|
10
|
+
exports.readExactTaskResult = readExactTaskResult;
|
|
10
11
|
/**
|
|
11
12
|
* task-extras.ts — the `/api/tasks` endpoints that have no `dataService.*`
|
|
12
13
|
* wrapper, gathered so every one of them is reachable from `skrr`.
|
|
@@ -198,3 +199,15 @@ function taskLabelSuggestion(taskId) {
|
|
|
198
199
|
method: 'POST',
|
|
199
200
|
});
|
|
200
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* `GET /api/tasks/:taskId/results/:resultId` — one immutable Result version, read
|
|
204
|
+
* by id (`skrr tasks result show --result <id>`, OSK-32828).
|
|
205
|
+
*
|
|
206
|
+
* Through the shared fetch rather than `request.get`: a native Space review
|
|
207
|
+
* session proves itself with the runtime headers that fetch attaches, and only
|
|
208
|
+
* for this exact path and its single `reviewSpaceId` (lib/task-runtime-headers.ts).
|
|
209
|
+
* Kept in the lib so `domain-api-parity` sees the endpoint.
|
|
210
|
+
*/
|
|
211
|
+
function readExactTaskResult(taskId, resultId, scope = {}) {
|
|
212
|
+
return (0, api_fetch_1.apiFetch)((0, triggers_1.withQuery)(`${base(taskId)}/results/${encodeURIComponent(resultId)}`, scope));
|
|
213
|
+
}
|