@skrr-ai/cli 0.1.116 → 0.1.117
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/base-command.d.ts +21 -0
- package/dist/base-command.js +95 -8
- package/dist/commands/actions/install.d.ts +1 -0
- package/dist/commands/actions/install.js +46 -1
- package/dist/commands/commitments/create.d.ts +21 -2
- package/dist/commands/commitments/create.js +74 -4
- package/dist/commands/convos/recovery.js +12 -4
- package/dist/commands/followups/plans/list.js +1 -1
- package/dist/commands/guide.d.ts +21 -0
- package/dist/commands/guide.js +46 -0
- package/dist/commands/instructions/guide.js +34 -52
- package/dist/commands/memory/maintain.js +1 -1
- package/dist/commands/skills/install.d.ts +1 -0
- package/dist/commands/skills/install.js +41 -2
- package/dist/commands/slack/send-as-agent.js +3 -3
- package/dist/commands/spaces/create.js +8 -2
- package/dist/commands/spaces/guide.d.ts +21 -0
- package/dist/commands/spaces/guide.js +40 -0
- package/dist/commands/spaces/index.d.ts +0 -1
- package/dist/commands/spaces/index.js +1 -6
- package/dist/commands/tasks/checkout.js +2 -3
- package/dist/commands/tasks/comments/add.js +3 -5
- package/dist/commands/tasks/complete.js +2 -3
- package/dist/commands/tasks/deliverable/add.d.ts +1 -1
- package/dist/commands/tasks/deliverable/add.js +4 -7
- package/dist/commands/tasks/expectations/assess.js +2 -2
- package/dist/commands/tasks/guide.d.ts +8 -0
- package/dist/commands/tasks/guide.js +23 -10
- package/dist/commands/tasks/report.js +9 -5
- package/dist/commands/tasks/resource/add.js +2 -3
- package/dist/commands/tasks/result/submit.js +2 -3
- package/dist/commands/tasks/resume/save.js +2 -3
- package/dist/commands/tasks/review.js +2 -3
- package/dist/commands/tasks/triage.js +2 -1
- package/dist/commands/tasks/updates/add.js +2 -3
- package/dist/generated/agent-guides.json +8290 -0
- package/dist/generated/managed-instruction-guides.json +1 -1
- package/dist/help.js +4 -3
- package/dist/hooks/command-not-found.js +1 -1
- package/dist/lib/agent-guide-reference-gate.d.ts +28 -0
- package/dist/lib/agent-guide-reference-gate.js +186 -0
- package/dist/lib/agent-guides.d.ts +51 -0
- package/dist/lib/agent-guides.js +170 -0
- package/dist/lib/command-miss.d.ts +13 -2
- package/dist/lib/command-miss.js +134 -8
- package/dist/lib/guide-pointer.d.ts +15 -0
- package/dist/lib/guide-pointer.js +51 -0
- package/dist/lib/lookbackPlans.d.ts +3 -1
- package/dist/lib/lookbackPlans.js +9 -0
- package/dist/lib/outbox.d.ts +0 -14
- package/dist/lib/outbox.js +0 -21
- package/dist/lib/roles.d.ts +1 -1
- package/dist/lib/task-batch.d.ts +10 -7
- package/dist/lib/task-batch.js +5 -20
- package/dist/lib/task-operations.d.ts +8 -20
- package/dist/lib/task-operations.js +9 -94
- package/dist/lib/task-preflight.js +70 -33
- package/dist/lib/usage-discovery.d.ts +4 -0
- package/dist/lib/usage-discovery.js +5 -0
- package/dist/lib/voice-call-intent.js +3 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +6593 -6383
- package/oclif.manifest.json +228 -13
- package/package.json +4 -2
|
@@ -22,7 +22,9 @@ function unavailable(error, label) {
|
|
|
22
22
|
if (typeof body?.code === 'string' && /^[A-Z][A-Z0-9_]{0,100}$/.test(body.code))
|
|
23
23
|
code = body.code;
|
|
24
24
|
}
|
|
25
|
-
catch {
|
|
25
|
+
catch {
|
|
26
|
+
/* non-JSON server refusal */
|
|
27
|
+
}
|
|
26
28
|
}
|
|
27
29
|
const remedy = status === 401
|
|
28
30
|
? 'Restore the current CLI sign-in or delegated runtime credential, then repeat this read-only check.'
|
|
@@ -32,9 +34,12 @@ function unavailable(error, label) {
|
|
|
32
34
|
? 'Check the Task reference and server support for this diagnostic. No start fallback was attempted.'
|
|
33
35
|
: 'Read tasks actionability and tasks start --dry-run separately for the native refusal, then repeat preflight after resolving it.';
|
|
34
36
|
return {
|
|
35
|
-
status: 'unavailable',
|
|
37
|
+
status: 'unavailable',
|
|
38
|
+
certainty: 'unknown',
|
|
39
|
+
code: code || 'TASK_PREFLIGHT_UNAVAILABLE',
|
|
36
40
|
...(status ? { httpStatus: status } : {}),
|
|
37
|
-
message: `${label} could not be confirmed${status ? ` (HTTP ${status})` : ''}.`,
|
|
41
|
+
message: `${label} could not be confirmed${status ? ` (HTTP ${status})` : ''}.`,
|
|
42
|
+
remedy,
|
|
38
43
|
};
|
|
39
44
|
}
|
|
40
45
|
function isWorkflow(value, taskId) {
|
|
@@ -42,60 +47,92 @@ function isWorkflow(value, taskId) {
|
|
|
42
47
|
return false;
|
|
43
48
|
const row = value;
|
|
44
49
|
const a = row.actionability;
|
|
45
|
-
return row.taskId === taskId &&
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
return (row.taskId === taskId &&
|
|
51
|
+
Boolean(a &&
|
|
52
|
+
['ready', 'running', 'waiting', 'terminal'].includes(a.state) &&
|
|
53
|
+
['agent', 'human', 'system', 'external', 'none'].includes(a.nextActor) &&
|
|
54
|
+
typeof a.reasonCode === 'string' &&
|
|
55
|
+
typeof a.reason === 'string' &&
|
|
56
|
+
(a.actorRefs === undefined ||
|
|
57
|
+
(Array.isArray(a.actorRefs) &&
|
|
58
|
+
a.actorRefs.every((ref) => ref && ['user', 'agent'].includes(ref.kind) && typeof ref.id === 'string'))) &&
|
|
59
|
+
Array.isArray(a.allowedActions) &&
|
|
60
|
+
a.allowedActions.every((action) => action &&
|
|
61
|
+
typeof action.action === 'string' &&
|
|
62
|
+
(action.targetId === undefined || typeof action.targetId === 'string'))));
|
|
52
63
|
}
|
|
53
64
|
function isPreview(value, taskId) {
|
|
54
65
|
if (!(0, task_admission_1.isAdmissionPreview)(value) || value.taskId !== taskId)
|
|
55
66
|
return false;
|
|
56
67
|
const a = value.executionAdmission;
|
|
57
|
-
return Boolean(typeof a.unattended === 'boolean' &&
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
(a.
|
|
65
|
-
(a.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
return Boolean(typeof a.unattended === 'boolean' &&
|
|
69
|
+
typeof a.approverAvailable === 'boolean' &&
|
|
70
|
+
(a.constraints === undefined ||
|
|
71
|
+
(Array.isArray(a.constraints) &&
|
|
72
|
+
a.constraints.every((c) => c &&
|
|
73
|
+
(c.message === undefined || typeof c.message === 'string') &&
|
|
74
|
+
(c.requiredAction === undefined || typeof c.requiredAction === 'string')))) &&
|
|
75
|
+
(a.permission === undefined ||
|
|
76
|
+
(a.permission &&
|
|
77
|
+
typeof a.permission === 'object' &&
|
|
78
|
+
(a.permission.mode == null || typeof a.permission.mode === 'string') &&
|
|
79
|
+
(a.permission.source === undefined || typeof a.permission.source === 'string'))) &&
|
|
80
|
+
(a.shell === undefined ||
|
|
81
|
+
(a.shell &&
|
|
82
|
+
typeof a.shell === 'object' &&
|
|
83
|
+
(a.shell.state === undefined || typeof a.shell.state === 'string'))) &&
|
|
84
|
+
(a.workingDirectory === undefined ||
|
|
85
|
+
(a.workingDirectory &&
|
|
86
|
+
(a.workingDirectory.path === null || typeof a.workingDirectory.path === 'string') &&
|
|
87
|
+
typeof a.workingDirectory.source === 'string')));
|
|
69
88
|
}
|
|
70
89
|
/** Compose native reads. This module cannot dispatch execution or infer grants. */
|
|
71
90
|
async function readTaskPreflight(taskId, reads) {
|
|
72
91
|
const [workflowResult, executionResult] = await Promise.allSettled([
|
|
73
|
-
Promise.resolve().then(reads.workflow),
|
|
92
|
+
Promise.resolve().then(reads.workflow),
|
|
93
|
+
Promise.resolve().then(reads.execution),
|
|
74
94
|
]);
|
|
75
95
|
const workflow = workflowResult.status === 'fulfilled' && isWorkflow(workflowResult.value, taskId)
|
|
76
96
|
? { status: 'observed', certainty: 'server_projection', value: workflowResult.value }
|
|
77
|
-
: unavailable(workflowResult.status === 'rejected'
|
|
97
|
+
: unavailable(workflowResult.status === 'rejected'
|
|
98
|
+
? workflowResult.reason
|
|
99
|
+
: { code: 'TASK_ACTIONABILITY_UNSUPPORTED' }, 'Workflow actionability');
|
|
78
100
|
const execution = executionResult.status === 'fulfilled' && isPreview(executionResult.value, taskId)
|
|
79
101
|
? { status: 'observed', certainty: 'server_projection', value: executionResult.value }
|
|
80
|
-
: unavailable(executionResult.status === 'rejected'
|
|
102
|
+
: unavailable(executionResult.status === 'rejected'
|
|
103
|
+
? executionResult.reason
|
|
104
|
+
: { code: 'TASK_START_PREVIEW_UNSUPPORTED' }, 'Execution preview');
|
|
81
105
|
// actionability.revision is the attention revision, not Task.version from
|
|
82
106
|
// start-preview. Equal numbers would not prove the reads shared a snapshot.
|
|
83
107
|
const workflowBlocked = workflow.status === 'observed' &&
|
|
84
|
-
!workflow.value.actionability.allowedActions.some(action => action.action === 'start_task');
|
|
108
|
+
!workflow.value.actionability.allowedActions.some((action) => action.action === 'start_task');
|
|
85
109
|
const executionBlocked = execution.status === 'observed' && execution.value.executionAdmission.state === 'blocked';
|
|
86
|
-
const summary = workflowBlocked || executionBlocked
|
|
87
|
-
|
|
88
|
-
|
|
110
|
+
const summary = workflowBlocked || executionBlocked
|
|
111
|
+
? 'blocked'
|
|
112
|
+
: workflow.status === 'unavailable' ||
|
|
113
|
+
execution.status === 'unavailable' ||
|
|
114
|
+
execution.value.executionAdmission.state !== 'ready'
|
|
115
|
+
? 'unknown'
|
|
89
116
|
: 'eligible_to_attempt';
|
|
90
|
-
return {
|
|
117
|
+
return {
|
|
118
|
+
taskId,
|
|
119
|
+
summary,
|
|
120
|
+
workflow,
|
|
121
|
+
execution,
|
|
122
|
+
consistency: 'independent_observations',
|
|
123
|
+
limits: [...LIMITS],
|
|
124
|
+
};
|
|
91
125
|
}
|
|
92
126
|
function taskPreflightLines(report, bin = 'skrr') {
|
|
93
|
-
const lines = [
|
|
127
|
+
const lines = [
|
|
128
|
+
`Task preflight: ${report.taskId}`,
|
|
129
|
+
`Start eligibility: ${report.summary.replaceAll('_', ' ')} (current server projections)`,
|
|
130
|
+
];
|
|
94
131
|
if (report.workflow.status === 'observed') {
|
|
95
132
|
const a = report.workflow.value.actionability;
|
|
96
133
|
lines.push('', `Workflow: ${a.state} (server projection)`, `Next actor: ${a.nextActor}`, `Why: ${a.reason} [${a.reasonCode}]`);
|
|
97
134
|
if (a.actorRefs?.length)
|
|
98
|
-
lines.push(`Eligible actors: ${a.actorRefs.map(ref => `${ref.kind}:${ref.id}`).join(', ')}`);
|
|
135
|
+
lines.push(`Eligible actors: ${a.actorRefs.map((ref) => `${ref.kind}:${ref.id}`).join(', ')}`);
|
|
99
136
|
for (const action of a.allowedActions) {
|
|
100
137
|
const command = (0, task_operations_1.taskActionCommand)(action.action, report.taskId, action.targetId, bin, {
|
|
101
138
|
allowedActions: a.allowedActions,
|
|
@@ -116,6 +153,6 @@ function taskPreflightLines(report, bin = 'skrr') {
|
|
|
116
153
|
}
|
|
117
154
|
else
|
|
118
155
|
lines.push('', `Execution: unknown. ${report.execution.message} [${report.execution.code}]`, `Next step: ${report.execution.remedy}`);
|
|
119
|
-
lines.push('', ...report.limits, `More operations: ${bin} tasks
|
|
156
|
+
lines.push('', ...report.limits, `More operations: ${bin} guide tasks commands`);
|
|
120
157
|
return lines;
|
|
121
158
|
}
|
|
@@ -33,6 +33,10 @@ export declare const USAGE_OVERVIEW_TOKEN_BUDGET = 240;
|
|
|
33
33
|
* `skrr widgets check`, and the app runs in the same frame. Its own overview line took the first read from 240 to 241
|
|
34
34
|
* tokens, and this file's rule for that is to fold into a domain that already has the concept, not to raise the bound.
|
|
35
35
|
* `skrr usage apps` still resolves, to the `widgets` pages, which name it in `Includes:`.
|
|
36
|
+
* `instruction-blocks` (version-pinned instruction blocks for cloud Agents) is the same concept as
|
|
37
|
+
* `instructions` (version-pinned blocks for local CLAUDE.md / AGENTS.md), aimed at another target. The overview
|
|
38
|
+
* read 245 once `skrr guide` joined it, and `guide` stays a line of its own because it is where every operation
|
|
39
|
+
* guide is read.
|
|
36
40
|
*/
|
|
37
41
|
export declare const USAGE_DOMAIN_FOLDS: Readonly<Record<string, string>>;
|
|
38
42
|
export declare const USAGE_DOMAIN_TOKEN_BUDGET = 500;
|
|
@@ -44,10 +44,15 @@ exports.USAGE_OVERVIEW_TOKEN_BUDGET = 240;
|
|
|
44
44
|
* `skrr widgets check`, and the app runs in the same frame. Its own overview line took the first read from 240 to 241
|
|
45
45
|
* tokens, and this file's rule for that is to fold into a domain that already has the concept, not to raise the bound.
|
|
46
46
|
* `skrr usage apps` still resolves, to the `widgets` pages, which name it in `Includes:`.
|
|
47
|
+
* `instruction-blocks` (version-pinned instruction blocks for cloud Agents) is the same concept as
|
|
48
|
+
* `instructions` (version-pinned blocks for local CLAUDE.md / AGENTS.md), aimed at another target. The overview
|
|
49
|
+
* read 245 once `skrr guide` joined it, and `guide` stays a line of its own because it is where every operation
|
|
50
|
+
* guide is read.
|
|
47
51
|
*/
|
|
48
52
|
exports.USAGE_DOMAIN_FOLDS = {
|
|
49
53
|
proposals: 'inbox',
|
|
50
54
|
apps: 'widgets',
|
|
55
|
+
'instruction-blocks': 'instructions',
|
|
51
56
|
};
|
|
52
57
|
exports.USAGE_DOMAIN_TOKEN_BUDGET = 500;
|
|
53
58
|
const GENERIC_FLAGS = new Set(['bare', 'help', 'json', 'token', 'workspace']);
|
|
@@ -74,9 +74,11 @@ function readVoiceCallSessionContext(env = process.env) {
|
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
function generatedVoiceCallIdempotencyKey({ context, reason, conversationId, expiresInSeconds, }) {
|
|
77
|
+
if (!context.requestId)
|
|
78
|
+
return `voice-call:${crypto.randomUUID()}`;
|
|
77
79
|
const input = [
|
|
78
80
|
context.sessionId,
|
|
79
|
-
context.requestId
|
|
81
|
+
context.requestId,
|
|
80
82
|
context.agentId,
|
|
81
83
|
reason,
|
|
82
84
|
conversationId || '',
|