@skrr-ai/cli 0.1.59 → 0.1.60
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/followups/checkin.js +16 -3
- package/dist/lib/agentic-stream.d.ts +7 -0
- package/dist/lib/agentic-stream.js +38 -2
- package/dist/lib/followups.d.ts +7 -0
- package/dist/lib/followups.js +17 -4
- package/dist/node_modules/@skrr-ai/data-provider/index.js +6 -0
- package/oclif.manifest.json +24478 -24478
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@ class FollowupsCheckin extends base_command_1.BaseCommand {
|
|
|
20
20
|
'<%= config.bin %> followups checkin --subject task:OSK-42 --why "weekly touch-base" --frequency "0 9 * * MON" --timezone America/New_York',
|
|
21
21
|
];
|
|
22
22
|
static flags = {
|
|
23
|
-
subject: core_1.Flags.string({ description:
|
|
23
|
+
subject: core_1.Flags.string({ description: followups_1.FOLLOWUP_SUBJECT_FLAG_HELP, required: true }),
|
|
24
24
|
why: core_1.Flags.string({ description: 'Why this wake exists, in one line', required: true }),
|
|
25
25
|
in: core_1.Flags.string({
|
|
26
26
|
description: 'Duration from now (90m, 2h) — the once form',
|
|
@@ -41,8 +41,21 @@ class FollowupsCheckin extends base_command_1.BaseCommand {
|
|
|
41
41
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
42
42
|
};
|
|
43
43
|
async run() {
|
|
44
|
-
this.requireAuth();
|
|
45
44
|
const { flags } = await this.parse(FollowupsCheckin);
|
|
45
|
+
let subject;
|
|
46
|
+
try {
|
|
47
|
+
subject = (0, followups_1.parseSubjectRef)(flags.subject);
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
this.failWithCliError({
|
|
51
|
+
message: err instanceof Error ? err.message : String(err),
|
|
52
|
+
code: 'FOLLOWUP_SUBJECT_INVALID',
|
|
53
|
+
exit: 2,
|
|
54
|
+
retryable: false,
|
|
55
|
+
});
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
this.requireAuth();
|
|
46
59
|
if (!flags.in && !flags.frequency) {
|
|
47
60
|
this.failWithCliError({
|
|
48
61
|
message: 'Either --in <duration> or --frequency <cron> is required.',
|
|
@@ -71,7 +84,7 @@ class FollowupsCheckin extends base_command_1.BaseCommand {
|
|
|
71
84
|
kind: 'checkin',
|
|
72
85
|
producer: agent.boundToSession ? 'agent_in_turn' : 'user_explicit',
|
|
73
86
|
agentId: agent.id,
|
|
74
|
-
subject
|
|
87
|
+
subject,
|
|
75
88
|
why: flags.why,
|
|
76
89
|
...(flags.in ? { form: 'once', in: flags.in } : {}),
|
|
77
90
|
...(flags.frequency
|
|
@@ -201,6 +201,13 @@ export type ProjectedToolEvent = {
|
|
|
201
201
|
* of the run. The pairing is unambiguous within a turn.
|
|
202
202
|
*/
|
|
203
203
|
export declare function projectDaemonToolEvents(envelopes: unknown[], namesByCall: Map<string, string>): ProjectedToolEvent[];
|
|
204
|
+
/**
|
|
205
|
+
* The exact output the daemon's Codex backend writes on a tool item that an
|
|
206
|
+
* approval declined (`codexToolItemEndOutput` in daemon/src/backends/codex.ts).
|
|
207
|
+
* Pinned against that source by agentic-stream.spec.ts, so a rewording there
|
|
208
|
+
* fails here instead of silently reverting these calls to `[tool failed]`.
|
|
209
|
+
*/
|
|
210
|
+
export declare const CODEX_DECLINED_TOOL_OUTPUTS: readonly string[];
|
|
204
211
|
/**
|
|
205
212
|
* The line printed when a tool call ends, in the words its status earns.
|
|
206
213
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AgenticStreamClient = exports.USER_CONNECTION_CAP_CODE = exports.TYPE_AHEAD_DISCARD_MS = exports.NON_INTERACTIVE_QUESTION_DISMISSAL = void 0;
|
|
3
|
+
exports.AgenticStreamClient = exports.USER_CONNECTION_CAP_CODE = exports.CODEX_DECLINED_TOOL_OUTPUTS = exports.TYPE_AHEAD_DISCARD_MS = exports.NON_INTERACTIVE_QUESTION_DISMISSAL = void 0;
|
|
4
4
|
exports.writeJsonLine = writeJsonLine;
|
|
5
5
|
exports.discardTypeAhead = discardTypeAhead;
|
|
6
6
|
exports.describePermissionTarget = describePermissionTarget;
|
|
@@ -298,12 +298,48 @@ function projectDaemonToolEvents(envelopes, namesByCall) {
|
|
|
298
298
|
...(call ? { toolUseId: call } : {}),
|
|
299
299
|
...(name ? { toolName: name } : {}),
|
|
300
300
|
...(ev.output !== undefined ? { toolResponse: ev.output } : {}),
|
|
301
|
-
...(typeof ev.status === 'string' ? { status: ev
|
|
301
|
+
...(typeof ev.status === 'string' ? { status: daemonToolEndStatus(ev) } : {}),
|
|
302
302
|
});
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
return out;
|
|
306
306
|
}
|
|
307
|
+
/**
|
|
308
|
+
* The exact output the daemon's Codex backend writes on a tool item that an
|
|
309
|
+
* approval declined (`codexToolItemEndOutput` in daemon/src/backends/codex.ts).
|
|
310
|
+
* Pinned against that source by agentic-stream.spec.ts, so a rewording there
|
|
311
|
+
* fails here instead of silently reverting these calls to `[tool failed]`.
|
|
312
|
+
*/
|
|
313
|
+
exports.CODEX_DECLINED_TOOL_OUTPUTS = [
|
|
314
|
+
'Declined: the approval was refused, so the command did not run.',
|
|
315
|
+
'Declined: the approval was refused, so the edit was not applied.',
|
|
316
|
+
];
|
|
317
|
+
/**
|
|
318
|
+
* A daemon `tool-call-end` status, with a Codex decline read as `denied`.
|
|
319
|
+
*
|
|
320
|
+
* OSK-12480 — a Codex `exec_command` a person or a policy refused ends as an
|
|
321
|
+
* app-server item with status `declined`, which the daemon writes on the wire
|
|
322
|
+
* as `failed`: the envelope's status vocabulary (`ToolCallEndStatusSchema`,
|
|
323
|
+
* enforced at the server's persistence boundary) has no `denied`, so the
|
|
324
|
+
* daemon cannot say it there without breaking every server that predates it.
|
|
325
|
+
* What it does say is the output — a sentence it authors for exactly that
|
|
326
|
+
* case, and never for a call that ran. So the stream printed `[tool failed]`
|
|
327
|
+
* for a command that never started, where the daemon's Claude-style path
|
|
328
|
+
* (OSK-12469) prints `[tool denied] … (it did not run)`.
|
|
329
|
+
*
|
|
330
|
+
* Only that exact output upgrades a `failed`: a genuine failure keeps its
|
|
331
|
+
* status, and so does a decline Codex gave its own output (the status quo,
|
|
332
|
+
* never a misclassification).
|
|
333
|
+
*/
|
|
334
|
+
function daemonToolEndStatus(ev) {
|
|
335
|
+
const status = ev.status;
|
|
336
|
+
if (status === 'failed' &&
|
|
337
|
+
typeof ev.output === 'string' &&
|
|
338
|
+
exports.CODEX_DECLINED_TOOL_OUTPUTS.includes(ev.output)) {
|
|
339
|
+
return 'denied';
|
|
340
|
+
}
|
|
341
|
+
return status;
|
|
342
|
+
}
|
|
307
343
|
/**
|
|
308
344
|
* The line printed when a tool call ends, in the words its status earns.
|
|
309
345
|
*
|
package/dist/lib/followups.d.ts
CHANGED
|
@@ -120,6 +120,13 @@ export type ResolvedFollowUpAgent = {
|
|
|
120
120
|
*/
|
|
121
121
|
boundToSession: boolean;
|
|
122
122
|
};
|
|
123
|
+
/**
|
|
124
|
+
* A trigger subject becomes a durable concurrency key, so it cannot be prose.
|
|
125
|
+
* Keep this grammar aligned with TriggerEngine's subject validation and the
|
|
126
|
+
* FollowUpService storage limit.
|
|
127
|
+
*/
|
|
128
|
+
export declare const FOLLOWUP_SUBJECT_EXTERNAL_KEY_RE: RegExp;
|
|
129
|
+
export declare const FOLLOWUP_SUBJECT_FLAG_HELP = "Subject ref: type:externalKey (externalKey: letters, digits, _ - . : / # @ + ~; no spaces)";
|
|
123
130
|
/**
|
|
124
131
|
* Which agent a follow-up belongs to.
|
|
125
132
|
*
|
package/dist/lib/followups.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.followupsApi = exports.WATCH_WAIT_KINDS = exports.FOLLOWUP_RESOLVE_OUTCOMES = exports.FOLLOWUP_STATES = exports.FOLLOWUP_KINDS = exports.followUpIdArg = void 0;
|
|
3
|
+
exports.followupsApi = exports.FOLLOWUP_SUBJECT_FLAG_HELP = exports.FOLLOWUP_SUBJECT_EXTERNAL_KEY_RE = exports.WATCH_WAIT_KINDS = exports.FOLLOWUP_RESOLVE_OUTCOMES = exports.FOLLOWUP_STATES = exports.FOLLOWUP_KINDS = exports.followUpIdArg = void 0;
|
|
4
4
|
exports.settledLine = settledLine;
|
|
5
5
|
exports.recipeWatchBoundsRefusal = recipeWatchBoundsRefusal;
|
|
6
6
|
exports.resolveFollowUpAgent = resolveFollowUpAgent;
|
|
@@ -115,6 +115,13 @@ function recipeWatchBoundsRefusal(waitKind, passed) {
|
|
|
115
115
|
: 'A recipe watch ends through its --wait.',
|
|
116
116
|
].join(' ');
|
|
117
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* A trigger subject becomes a durable concurrency key, so it cannot be prose.
|
|
120
|
+
* Keep this grammar aligned with TriggerEngine's subject validation and the
|
|
121
|
+
* FollowUpService storage limit.
|
|
122
|
+
*/
|
|
123
|
+
exports.FOLLOWUP_SUBJECT_EXTERNAL_KEY_RE = /^[A-Za-z0-9_\-.:/#@+~]{1,300}$/;
|
|
124
|
+
exports.FOLLOWUP_SUBJECT_FLAG_HELP = 'Subject ref: type:externalKey (externalKey: letters, digits, _ - . : / # @ + ~; no spaces)';
|
|
118
125
|
/**
|
|
119
126
|
* Which agent a follow-up belongs to.
|
|
120
127
|
*
|
|
@@ -154,11 +161,17 @@ function resolveFollowUpAgent(explicitAgentId, env = process.env) {
|
|
|
154
161
|
}
|
|
155
162
|
/** A `type:externalKey` subject ref → the subject block the API wants. */
|
|
156
163
|
function parseSubjectRef(ref) {
|
|
157
|
-
const
|
|
158
|
-
|
|
164
|
+
const value = ref.trim();
|
|
165
|
+
const idx = value.indexOf(':');
|
|
166
|
+
if (idx <= 0 || idx === value.length - 1) {
|
|
159
167
|
throw new Error(`--subject must be "type:externalKey" (e.g. task:OSK-42, conversation:conv_123), got "${ref}"`);
|
|
160
168
|
}
|
|
161
|
-
|
|
169
|
+
const type = value.slice(0, idx);
|
|
170
|
+
const externalKey = value.slice(idx + 1);
|
|
171
|
+
if (!exports.FOLLOWUP_SUBJECT_EXTERNAL_KEY_RE.test(externalKey)) {
|
|
172
|
+
throw new Error('--subject has an invalid external key. Use type:externalKey; the key may contain only letters, digits, _ - . : / # @ + ~ (no spaces). Put descriptive text in --why.');
|
|
173
|
+
}
|
|
174
|
+
return { type, externalKey };
|
|
162
175
|
}
|
|
163
176
|
/* ------------------------------------------------------------------ *
|
|
164
177
|
* API *
|
|
@@ -43615,6 +43615,10 @@ var vA = Object.freeze({ __proto__: null, acceptAgentIntuition: function(e2, t2,
|
|
|
43615
43615
|
return cA.get($i(e2));
|
|
43616
43616
|
}, getGroupChatHistorySnapshot: function(e2, t2) {
|
|
43617
43617
|
return cA.get(oo(e2, t2));
|
|
43618
|
+
}, getGroupChatHistorySnapshotComposerState: function(e2) {
|
|
43619
|
+
return cA.get((function(e3) {
|
|
43620
|
+
return "".concat(no(e3), "/composer");
|
|
43621
|
+
})(e2));
|
|
43618
43622
|
}, getGroupChatInvitations: function(e2, t2) {
|
|
43619
43623
|
return cA.get(os(e2, t2));
|
|
43620
43624
|
}, getGroupChatMessages: function(e2, t2) {
|
|
@@ -44754,6 +44758,8 @@ var vA = Object.freeze({ __proto__: null, acceptAgentIntuition: function(e2, t2,
|
|
|
44754
44758
|
return cA.get(to(e2));
|
|
44755
44759
|
}, listGroupChatFolders: function(e2) {
|
|
44756
44760
|
return cA.get($n(e2));
|
|
44761
|
+
}, listGroupChatHistorySnapshots: function(e2) {
|
|
44762
|
+
return cA.get(no(e2));
|
|
44757
44763
|
}, listGroupChatSpaces: function(e2, t2) {
|
|
44758
44764
|
return cA.get(us(e2), { params: t2 });
|
|
44759
44765
|
}, listGroupChatWidgets: function(e2) {
|