@skrr-ai/cli 0.1.113 → 0.1.115
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/bin/update-npm-runner.cjs +4 -1
- package/bin/update-worker.cjs +6 -3
- package/dist/commands/agents/chat.js +10 -1
- package/dist/commands/computer-use/audio.d.ts +6 -0
- package/dist/commands/computer-use/audio.js +9 -0
- package/dist/commands/computer-use/browser.d.ts +7 -0
- package/dist/commands/computer-use/browser.js +16 -0
- package/dist/commands/computer-use/disable.d.ts +6 -0
- package/dist/commands/computer-use/disable.js +9 -0
- package/dist/commands/computer-use/enable.d.ts +6 -0
- package/dist/commands/computer-use/enable.js +9 -0
- package/dist/commands/computer-use/index.d.ts +6 -0
- package/dist/commands/computer-use/index.js +9 -0
- package/dist/commands/computer-use/install.d.ts +6 -0
- package/dist/commands/computer-use/install.js +9 -0
- package/dist/commands/computer-use/recover.d.ts +6 -0
- package/dist/commands/computer-use/recover.js +9 -0
- package/dist/commands/computer-use/status.d.ts +6 -0
- package/dist/commands/computer-use/status.js +9 -0
- package/dist/commands/computer-use/stop.d.ts +6 -0
- package/dist/commands/computer-use/stop.js +9 -0
- package/dist/commands/daemon/login.js +1 -1
- package/dist/commands/followups/plans/cancel.js +10 -3
- package/dist/commands/followups/plans/capacity.d.ts +9 -0
- package/dist/commands/followups/plans/capacity.js +42 -0
- package/dist/commands/followups/plans/create.js +3 -0
- package/dist/commands/followups/plans/revise.js +13 -6
- package/dist/commands/followups/remind.js +13 -5
- package/dist/commands/followups/watch.js +2 -2
- package/dist/lib/agentic-stream.d.ts +5 -1
- package/dist/lib/agentic-stream.js +25 -9
- package/dist/lib/computer-use.d.ts +9 -0
- package/dist/lib/computer-use.js +41 -0
- package/dist/lib/lookbackPlans.d.ts +20 -6
- package/dist/lib/lookbackPlans.js +19 -5
- package/dist/lib/update-check.d.ts +11 -10
- package/dist/lib/update-check.js +41 -23
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerUse.d.ts +228 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerUse.js +375 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonScopes.d.ts +4 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonScopes.js +6 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.js +40 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/desktopWire.d.ts +140 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/desktopWire.js +46 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.d.ts +4 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.js +2 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +3 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +8 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerUse.d.ts +228 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerUse.js +358 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonScopes.d.ts +4 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonScopes.js +5 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.js +40 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/desktopWire.d.ts +140 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/desktopWire.js +42 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.d.ts +4 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.js +2 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +3 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +3 -1
- package/dist/node_modules/@skrr-ai/auth-core/package.json +21 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +23687 -23456
- package/oclif.manifest.json +306 -26
- package/package.json +2 -2
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
// Park before npm executes. The parent publishes this process group's durable
|
|
4
4
|
// mutation ownership before authorizing execution, closing its crash window.
|
|
5
5
|
const fs = require('node:fs');
|
|
6
|
+
const path = require('node:path');
|
|
6
7
|
const { spawn } = require('node:child_process');
|
|
7
8
|
const requestFile = process.argv[2];
|
|
8
9
|
const request = JSON.parse(fs.readFileSync(requestFile, 'utf8'));
|
|
10
|
+
if (request.npmPrefix != null && !path.isAbsolute(request.npmPrefix)) throw new Error('Invalid npm prefix');
|
|
9
11
|
const deadline = Date.now() + 30000;
|
|
10
12
|
const timer = setInterval(() => {
|
|
11
13
|
let authorization;
|
|
@@ -16,7 +18,8 @@ const timer = setInterval(() => {
|
|
|
16
18
|
}
|
|
17
19
|
if (authorization?.pid === process.pid && authorization?.token === request.token) {
|
|
18
20
|
clearInterval(timer);
|
|
19
|
-
const
|
|
21
|
+
const prefixArgs = request.npmPrefix ? ['--prefix', request.npmPrefix] : [];
|
|
22
|
+
const child = spawn(request.npmPath, ['install', '-g', ...prefixArgs, `@skrr-ai/cli@${request.version}`], {
|
|
20
23
|
stdio: 'inherit',
|
|
21
24
|
shell: process.platform === 'win32',
|
|
22
25
|
});
|
package/bin/update-worker.cjs
CHANGED
|
@@ -41,7 +41,8 @@ async function run(directory, options = {}) {
|
|
|
41
41
|
if (
|
|
42
42
|
!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(attempt.version) ||
|
|
43
43
|
!path.isAbsolute(attempt.packageRoot) ||
|
|
44
|
-
!path.isAbsolute(attempt.npmPath)
|
|
44
|
+
!path.isAbsolute(attempt.npmPath) ||
|
|
45
|
+
(attempt.npmPrefix != null && !path.isAbsolute(attempt.npmPrefix))
|
|
45
46
|
) {
|
|
46
47
|
throw new Error('Invalid persisted CLI update request');
|
|
47
48
|
}
|
|
@@ -86,7 +87,8 @@ async function run(directory, options = {}) {
|
|
|
86
87
|
});
|
|
87
88
|
return;
|
|
88
89
|
}
|
|
89
|
-
const
|
|
90
|
+
const prefixArgs = attempt.npmPrefix ? ['--prefix', attempt.npmPrefix] : [];
|
|
91
|
+
const rootResult = await execFileAsync(attempt.npmPath, ['root', '-g', ...prefixArgs], {
|
|
90
92
|
timeout: 1500,
|
|
91
93
|
maxBuffer: 64 * 1024,
|
|
92
94
|
shell: process.platform === 'win32',
|
|
@@ -117,7 +119,8 @@ async function run(directory, options = {}) {
|
|
|
117
119
|
await new Promise((resolve, reject) => {
|
|
118
120
|
const requestFile = path.join(directory, `runner-${crypto.randomUUID()}.json`);
|
|
119
121
|
const token = crypto.randomUUID();
|
|
120
|
-
runtime.writeJson(requestFile, { token, npmPath: attempt.npmPath, version: attempt.version
|
|
122
|
+
runtime.writeJson(requestFile, { token, npmPath: attempt.npmPath, version: attempt.version,
|
|
123
|
+
...(attempt.npmPrefix ? { npmPrefix: attempt.npmPrefix } : {}) });
|
|
121
124
|
const child = spawn(
|
|
122
125
|
process.execPath,
|
|
123
126
|
[path.join(__dirname, 'update-npm-runner.cjs'), requestFile],
|
|
@@ -105,10 +105,14 @@ function reconcileTerminalFromMessages(messages, responseMessageId) {
|
|
|
105
105
|
[...messages].reverse().find((m) => m && m.isCreatedByUser === false);
|
|
106
106
|
if (!row)
|
|
107
107
|
return null;
|
|
108
|
+
const projection = row.metadata && typeof row.metadata === 'object'
|
|
109
|
+
? row.metadata.publicProjection : undefined;
|
|
110
|
+
const publicProjection = (0, data_provider_1.isDecodedPublicProjection)(projection) ? { publicProjection: projection } : {};
|
|
108
111
|
const failure = (0, data_provider_1.resolveMessageFailure)(row);
|
|
109
112
|
if (failure) {
|
|
110
113
|
return {
|
|
111
114
|
status: 'failed',
|
|
115
|
+
...publicProjection,
|
|
112
116
|
...(failure.answer ? { text: failure.answer } : {}),
|
|
113
117
|
// The reason exists on the row; it simply never reached the surface. Say
|
|
114
118
|
// it, rather than the transport error that masked it (OSK-7595).
|
|
@@ -123,7 +127,7 @@ function reconcileTerminalFromMessages(messages, responseMessageId) {
|
|
|
123
127
|
// it set is a turn that ended having produced nothing, which is still
|
|
124
128
|
// terminal and still better reported than waited on.
|
|
125
129
|
if (row.unfinished === false)
|
|
126
|
-
return { status: 'completed', text };
|
|
130
|
+
return { status: 'completed', text, ...publicProjection };
|
|
127
131
|
return null;
|
|
128
132
|
}
|
|
129
133
|
function agenticRecord(row) {
|
|
@@ -161,12 +165,16 @@ function handoverStateFromMessages(messages, responseMessageId) {
|
|
|
161
165
|
(!responseMessageId && [...messages].reverse().find((m) => m && m.isCreatedByUser === false));
|
|
162
166
|
if (!row)
|
|
163
167
|
return { state: 'pending' };
|
|
168
|
+
const projection = row.metadata && typeof row.metadata === 'object'
|
|
169
|
+
? row.metadata.publicProjection : undefined;
|
|
170
|
+
const publicProjection = (0, data_provider_1.isDecodedPublicProjection)(projection) ? { publicProjection: projection } : {};
|
|
164
171
|
const failure = (0, data_provider_1.resolveMessageFailure)(row);
|
|
165
172
|
if (failure) {
|
|
166
173
|
if (agenticErrorSubtype(row) === agentic_stream_1.DAEMON_HANDOVER_REASON)
|
|
167
174
|
return { state: 'pending' };
|
|
168
175
|
return {
|
|
169
176
|
state: 'failed',
|
|
177
|
+
...publicProjection,
|
|
170
178
|
error: failure.reason ?? 'The run failed. No reason was recorded on the message.',
|
|
171
179
|
...(failure.answer ? { text: failure.answer } : {}),
|
|
172
180
|
};
|
|
@@ -178,6 +186,7 @@ function handoverStateFromMessages(messages, responseMessageId) {
|
|
|
178
186
|
const repairedAt = typeof repair.repairedAt === 'string' ? repair.repairedAt : undefined;
|
|
179
187
|
return {
|
|
180
188
|
state: 'repaired',
|
|
189
|
+
...publicProjection,
|
|
181
190
|
text: typeof row.text === 'string' ? row.text : '',
|
|
182
191
|
...(repairedAt ? { repairedAt } : {}),
|
|
183
192
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const computer_use_1 = require("../../lib/computer-use");
|
|
4
|
+
class ComputerUseAudio extends computer_use_1.ComputerUseCommand {
|
|
5
|
+
static summary = 'Configure optional computer audio with status, enable or disable';
|
|
6
|
+
static description = 'Flags are forwarded unchanged. Run `skrrd computer-use audio --help` for options; --profile selects the local daemon profile and --json emits one stable document.';
|
|
7
|
+
action = 'audio';
|
|
8
|
+
}
|
|
9
|
+
exports.default = ComputerUseAudio;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const computer_use_1 = require("../../lib/computer-use");
|
|
4
|
+
class ComputerUseBrowser extends computer_use_1.ComputerUseCommand {
|
|
5
|
+
static summary = 'Configure original Chrome, inspect its extension, and manage its native host';
|
|
6
|
+
static description = 'Actions: status, enable, disable, setup, update, verify. Setup uses the original LCU installer: private relay files belong to the selected skrr profile, while native-host registration is shared by the desktop account and supported Chromium browsers. Verify initializes the original MCP schema without browser actions. Flags are forwarded unchanged; run `skrrd computer-use browser --help` for all options.';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> computer-use browser enable',
|
|
9
|
+
'<%= config.bin %> computer-use browser setup --profile work',
|
|
10
|
+
'<%= config.bin %> computer-use browser status --profile work --json',
|
|
11
|
+
'<%= config.bin %> computer-use browser update --profile work',
|
|
12
|
+
'<%= config.bin %> computer-use browser verify --profile work --json',
|
|
13
|
+
];
|
|
14
|
+
action = 'browser';
|
|
15
|
+
}
|
|
16
|
+
exports.default = ComputerUseBrowser;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const computer_use_1 = require("../../lib/computer-use");
|
|
4
|
+
class ComputerUseDisable extends computer_use_1.ComputerUseCommand {
|
|
5
|
+
static summary = 'Revoke Computer Use consent and stop the active controller';
|
|
6
|
+
static description = 'Flags are forwarded unchanged. Run `skrrd computer-use disable --help` for options; --profile selects the local daemon profile and --json emits one stable document.';
|
|
7
|
+
action = 'disable';
|
|
8
|
+
}
|
|
9
|
+
exports.default = ComputerUseDisable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const computer_use_1 = require("../../lib/computer-use");
|
|
4
|
+
class ComputerUseEnable extends computer_use_1.ComputerUseCommand {
|
|
5
|
+
static summary = 'Enable Computer Use locally; --cloud-agents separately grants cloud Agent access';
|
|
6
|
+
static description = 'Flags are forwarded unchanged. Run `skrrd computer-use enable --help` for options; --profile selects the local daemon profile and --json emits one stable document.';
|
|
7
|
+
action = 'enable';
|
|
8
|
+
}
|
|
9
|
+
exports.default = ComputerUseEnable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const computer_use_1 = require("../../lib/computer-use");
|
|
4
|
+
class ComputerUse extends computer_use_1.ComputerUseCommand {
|
|
5
|
+
static summary = 'Install and control optional Computer Use on this machine';
|
|
6
|
+
static description = 'Computer Use uses your installed official app runtime. Run `skrr computer-use status`; use `skrrd computer-use --help` for all options, including --profile and --json.';
|
|
7
|
+
action = undefined;
|
|
8
|
+
}
|
|
9
|
+
exports.default = ComputerUse;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const computer_use_1 = require("../../lib/computer-use");
|
|
4
|
+
class ComputerUseInstall extends computer_use_1.ComputerUseCommand {
|
|
5
|
+
static summary = 'Install a pinned thin release from an explicit local archive and trusted SHA-256';
|
|
6
|
+
static description = 'Flags are forwarded unchanged. Run `skrrd computer-use install --help` for options; --profile selects the local daemon profile and --json emits one stable document.';
|
|
7
|
+
action = 'install';
|
|
8
|
+
}
|
|
9
|
+
exports.default = ComputerUseInstall;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const computer_use_1 = require("../../lib/computer-use");
|
|
4
|
+
class ComputerUseRecover extends computer_use_1.ComputerUseCommand {
|
|
5
|
+
static summary = 'Retry runtime recovery only after confirmed execution cleanup';
|
|
6
|
+
static description = 'Flags are forwarded unchanged. Run `skrrd computer-use recover --help` for options; --profile selects the local daemon profile and --json emits one stable document.';
|
|
7
|
+
action = 'recover';
|
|
8
|
+
}
|
|
9
|
+
exports.default = ComputerUseRecover;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const computer_use_1 = require("../../lib/computer-use");
|
|
4
|
+
class ComputerUseStatus extends computer_use_1.ComputerUseCommand {
|
|
5
|
+
static summary = 'Show configuration and live Computer Use availability without desktop interaction';
|
|
6
|
+
static description = 'Flags are forwarded unchanged. Run `skrrd computer-use status --help` for options; --profile selects the local daemon profile and --json emits one stable document.';
|
|
7
|
+
action = 'status';
|
|
8
|
+
}
|
|
9
|
+
exports.default = ComputerUseStatus;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const computer_use_1 = require("../../lib/computer-use");
|
|
4
|
+
class ComputerUseStop extends computer_use_1.ComputerUseCommand {
|
|
5
|
+
static summary = 'Stop the running Computer Use controller and confirm cleanup';
|
|
6
|
+
static description = 'Flags are forwarded unchanged. Run `skrrd computer-use stop --help` for options; --profile selects the local daemon profile and --json emits one stable document.';
|
|
7
|
+
action = 'stop';
|
|
8
|
+
}
|
|
9
|
+
exports.default = ComputerUseStop;
|
|
@@ -32,7 +32,7 @@ const daemon_machine_identity_copy_1 = require("../../lib/daemon-machine-identit
|
|
|
32
32
|
class DaemonLogin extends core_1.Command {
|
|
33
33
|
static aliases = ['daemons:login'];
|
|
34
34
|
static summary = 'Authenticate the skrr background service on this computer (separate from `skrr login`)';
|
|
35
|
-
static description = (0, exec_runtime_binary_1.forwardedFlagsNote)('login', { binds: true });
|
|
35
|
+
static description = (0, exec_runtime_binary_1.forwardedFlagsNote)('login', { binds: true }) + '\nUse --computer-use to request explicit Computer Use permission in browser consent. This does not enable the runtime or grant machine access.';
|
|
36
36
|
static strict = false; // forward all args verbatim — see run()
|
|
37
37
|
async run() {
|
|
38
38
|
// `this.argv`, NOT `this.parse()` — `strict = false` relaxes POSITIONAL
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lookbackPlans_1 = require("../../../lib/lookbackPlans");
|
|
3
4
|
const core_1 = require("@oclif/core");
|
|
4
5
|
const base_command_1 = require("../../../base-command");
|
|
5
|
-
const
|
|
6
|
+
const lookbackPlans_2 = require("../../../lib/lookbackPlans");
|
|
6
7
|
class LookbackPlansCancel extends base_command_1.BaseCommand {
|
|
7
8
|
static description = 'Cancel the remaining lookbacks of a plan';
|
|
8
|
-
static args = { id:
|
|
9
|
+
static args = { id: lookbackPlans_2.lookbackPlanIdArg };
|
|
9
10
|
static flags = {
|
|
10
11
|
revision: core_1.Flags.integer({ description: 'Expected current revision; stale edits are refused', min: 1 }),
|
|
11
12
|
reason: core_1.Flags.string({ description: 'Why the remaining lookbacks are no longer needed' }),
|
|
@@ -15,10 +16,16 @@ class LookbackPlansCancel extends base_command_1.BaseCommand {
|
|
|
15
16
|
this.requireAuth();
|
|
16
17
|
const { args, flags } = await this.parse(LookbackPlansCancel);
|
|
17
18
|
try {
|
|
18
|
-
const result = await
|
|
19
|
+
const result = await lookbackPlans_2.lookbackPlansApi.cancel(args.id, { expectedRevision: flags.revision, reason: flags.reason });
|
|
19
20
|
this.log(flags.json ? JSON.stringify(result, null, 2) : `Lookback plan ${result.plan.id}: ${result.plan.state} (r${result.plan.revision}).`);
|
|
20
21
|
}
|
|
21
22
|
catch (err) {
|
|
23
|
+
if ((0, lookbackPlans_1.isLookbackMutationOutcomeUnknown)(err)) {
|
|
24
|
+
const readback = await lookbackPlans_2.lookbackPlansApi.show(args.id).catch(() => null);
|
|
25
|
+
this.failWithCliError((0, lookbackPlans_1.lookbackUnconfirmedFailure)({ operation: 'cancel', planId: args.id,
|
|
26
|
+
...(readback?.plan ? { currentPlan: readback.plan } : {}),
|
|
27
|
+
readback: readback?.plan ? 'observed' : 'unavailable' }));
|
|
28
|
+
}
|
|
22
29
|
this.handleApiError(err);
|
|
23
30
|
}
|
|
24
31
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class LookbackPlansCapacity extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
agent: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../../base-command");
|
|
5
|
+
const lookbackPlans_1 = require("../../../lib/lookbackPlans");
|
|
6
|
+
const followups_1 = require("../../../lib/followups");
|
|
7
|
+
class LookbackPlansCapacity extends base_command_1.BaseCommand {
|
|
8
|
+
static description = 'Read one agent’s actual UTC-day lookback plan allowance; reserves nothing';
|
|
9
|
+
static flags = {
|
|
10
|
+
agent: core_1.Flags.string({ description: 'Agent ID (default: bound session agent)' }),
|
|
11
|
+
json: core_1.Flags.boolean({ description: 'Output authoritative capacity facts as JSON' }),
|
|
12
|
+
};
|
|
13
|
+
async run() {
|
|
14
|
+
this.requireAuth();
|
|
15
|
+
const { flags } = await this.parse(LookbackPlansCapacity);
|
|
16
|
+
let agentId;
|
|
17
|
+
try {
|
|
18
|
+
agentId = (0, followups_1.resolveFollowUpAgent)(flags.agent).id;
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
this.failWithCliError({ message: err instanceof Error ? err.message : String(err),
|
|
22
|
+
code: 'AGENT_CONTEXT_AMBIGUOUS', exit: 2, retryable: false });
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
const result = await lookbackPlans_1.lookbackPlansApi.capacity({ agentId });
|
|
27
|
+
if (flags.json) {
|
|
28
|
+
this.log(JSON.stringify(result, null, 2));
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
this.log(`${result.scope.agentId}: ${result.remaining}/${result.limit} plans remaining (${result.used} admitted this UTC day).`);
|
|
32
|
+
this.log(result.admission === 'policy_blocked'
|
|
33
|
+
? 'New plans are blocked by a zero agent allowance. The daily reset does not change that policy.'
|
|
34
|
+
: `UTC-day reset: ${new Date(result.period.resetAt).toLocaleString()} (${result.period.resetAt}). Recheck capacity then.`);
|
|
35
|
+
this.log(`Observed: ${result.observedAt}. This read reserves nothing; source, execution and delivery are checked separately.`);
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
this.handleApiError(err);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.default = LookbackPlansCapacity;
|
|
@@ -30,6 +30,9 @@ class LookbackPlansCreate extends base_command_1.BaseCommand {
|
|
|
30
30
|
this.log(flags.json ? JSON.stringify(result, null, 2) : (0, lookbackPlans_1.lookbackArmingLine)(result));
|
|
31
31
|
}
|
|
32
32
|
catch (err) {
|
|
33
|
+
if ((0, lookbackPlans_1.isLookbackMutationOutcomeUnknown)(err)) {
|
|
34
|
+
this.failWithCliError((0, lookbackPlans_1.lookbackUnconfirmedFailure)({ operation: 'create', source: body.plan.source, agentId: body.agentId }));
|
|
35
|
+
}
|
|
33
36
|
this.handleApiError(err);
|
|
34
37
|
}
|
|
35
38
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lookbackPlans_1 = require("../../../lib/lookbackPlans");
|
|
3
4
|
const core_1 = require("@oclif/core");
|
|
4
5
|
const base_command_1 = require("../../../base-command");
|
|
5
6
|
const prompt_1 = require("../../../lib/prompt");
|
|
6
|
-
const
|
|
7
|
+
const lookbackPlans_2 = require("../../../lib/lookbackPlans");
|
|
7
8
|
const lookbackPlanHelp_1 = require("../../../lib/lookbackPlanHelp");
|
|
8
9
|
class LookbackPlansRevise extends base_command_1.BaseCommand {
|
|
9
10
|
static description = 'Revise pending lookbacks using the original source and step IDs\n\n' + lookbackPlanHelp_1.LOOKBACK_PLAN_INPUT_HELP +
|
|
10
11
|
'\n\nRevise accepts the plan itself, not a create envelope. Use the current --revision from show; a stale revision returns LOOKBACK_CONFLICT (409).';
|
|
11
12
|
static examples = ['<%= config.bin %> followups plans revise PLAN_ID --revision 1 --from-json revised-plan.json --json'];
|
|
12
|
-
static args = { id:
|
|
13
|
+
static args = { id: lookbackPlans_2.lookbackPlanIdArg };
|
|
13
14
|
static flags = {
|
|
14
15
|
revision: core_1.Flags.integer({ description: 'Expected current revision; stale edits are refused', min: 1, required: true }),
|
|
15
16
|
'from-json': core_1.Flags.string({ description: 'Full PlanInput JSON file; - reads stdin', required: true }),
|
|
@@ -20,17 +21,23 @@ class LookbackPlansRevise extends base_command_1.BaseCommand {
|
|
|
20
21
|
const { args, flags } = await this.parse(LookbackPlansRevise);
|
|
21
22
|
let plan;
|
|
22
23
|
try {
|
|
23
|
-
plan = (0,
|
|
24
|
+
plan = (0, lookbackPlans_2.lookbackInput)(await (0, prompt_1.readJsonBody)(flags['from-json']), true);
|
|
24
25
|
}
|
|
25
26
|
catch (err) {
|
|
26
|
-
this.failWithCliError((0,
|
|
27
|
+
this.failWithCliError((0, lookbackPlans_2.lookbackInputFailure)(err));
|
|
27
28
|
return;
|
|
28
29
|
}
|
|
29
30
|
try {
|
|
30
|
-
const result = await
|
|
31
|
-
this.log(flags.json ? JSON.stringify(result, null, 2) : (0,
|
|
31
|
+
const result = await lookbackPlans_2.lookbackPlansApi.revise(args.id, { expectedRevision: flags.revision, plan });
|
|
32
|
+
this.log(flags.json ? JSON.stringify(result, null, 2) : (0, lookbackPlans_2.lookbackArmingLine)(result));
|
|
32
33
|
}
|
|
33
34
|
catch (err) {
|
|
35
|
+
if ((0, lookbackPlans_1.isLookbackMutationOutcomeUnknown)(err)) {
|
|
36
|
+
const readback = await lookbackPlans_2.lookbackPlansApi.show(args.id).catch(() => null);
|
|
37
|
+
this.failWithCliError((0, lookbackPlans_1.lookbackUnconfirmedFailure)({ operation: 'revise', planId: args.id,
|
|
38
|
+
...(readback?.plan ? { currentPlan: readback.plan } : {}),
|
|
39
|
+
readback: readback?.plan ? 'observed' : 'unavailable' }));
|
|
40
|
+
}
|
|
34
41
|
this.handleApiError(err);
|
|
35
42
|
}
|
|
36
43
|
}
|
|
@@ -12,7 +12,7 @@ const agent_resolver_1 = require("../../lib/agent-resolver");
|
|
|
12
12
|
* needs an agent context the passive form does not.
|
|
13
13
|
*/
|
|
14
14
|
class FollowupsRemind extends base_command_1.BaseCommand {
|
|
15
|
-
static description = 'Remind the owner at a time
|
|
15
|
+
static description = 'Remind the owner at a time. By default, deliver the literal content through owner notifications without an agent turn. Use --active for agent-written delivery.';
|
|
16
16
|
static examples = [
|
|
17
17
|
'<%= config.bin %> followups remind --subject task:OSK-42 --content "pick the deploy up" --in 2h',
|
|
18
18
|
'<%= config.bin %> followups remind --subject conversation:conv_9 --content "ask how the move went" --at 2026-09-20T09:00:00Z --active --agent agent_1',
|
|
@@ -34,15 +34,23 @@ class FollowupsRemind extends base_command_1.BaseCommand {
|
|
|
34
34
|
description: 'Wake the agent to word the reminder (needs an agent context)',
|
|
35
35
|
default: false,
|
|
36
36
|
}),
|
|
37
|
-
agent: core_1.Flags.string({ description: 'Agent ID (default: bound session agent)' }),
|
|
38
|
-
endpoint: core_1.Flags.string({ description: '
|
|
39
|
-
'endpoint-target': core_1.Flags.string({ description: '
|
|
40
|
-
pin: core_1.Flags.string({ description: '
|
|
37
|
+
agent: core_1.Flags.string({ description: 'Agent ID (default: bound session agent). Attribution only unless --active is set' }),
|
|
38
|
+
endpoint: core_1.Flags.string({ description: 'Active only: delivery endpoint id; requires --active' }),
|
|
39
|
+
'endpoint-target': core_1.Flags.string({ description: 'Active only: channel target for a channel endpoint; requires --active' }),
|
|
40
|
+
pin: core_1.Flags.string({ description: 'Active only: deliver into this conversation; requires --active. Do not combine with --endpoint other than pinned' }),
|
|
41
41
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
42
42
|
};
|
|
43
43
|
async run() {
|
|
44
44
|
this.requireAuth();
|
|
45
45
|
const { flags } = await this.parse(FollowupsRemind);
|
|
46
|
+
if (!flags.active && (flags.endpoint || flags['endpoint-target'] || flags.pin)) {
|
|
47
|
+
this.failWithCliError({
|
|
48
|
+
message: '--endpoint, --endpoint-target and --pin require --active. For a passive reminder, remove these flags; the literal content is delivered through owner notifications without an agent turn. --agent alone records attribution.',
|
|
49
|
+
code: 'FOLLOWUP_INVALID_ENDPOINT',
|
|
50
|
+
exit: 2,
|
|
51
|
+
retryable: false,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
46
54
|
const at = flags.at ?? flags.in;
|
|
47
55
|
if (!at) {
|
|
48
56
|
this.failWithCliError({
|
|
@@ -83,9 +83,9 @@ class FollowupsWatch extends base_command_1.BaseCommand {
|
|
|
83
83
|
description: 'SLA backstop — required for --wait event (an event may never arrive), optional for poll_until',
|
|
84
84
|
}),
|
|
85
85
|
// delivery
|
|
86
|
-
endpoint: core_1.Flags.string({ description: 'Delivery endpoint id (
|
|
86
|
+
endpoint: core_1.Flags.string({ description: 'Delivery endpoint id (defaults to main). Use --pin to deliver into a specific conversation' }),
|
|
87
87
|
'endpoint-target': core_1.Flags.string({ description: 'Channel target for channel endpoints' }),
|
|
88
|
-
pin: core_1.Flags.string({ description: '
|
|
88
|
+
pin: core_1.Flags.string({ description: 'Deliver into this conversation. Do not combine with --endpoint other than pinned' }),
|
|
89
89
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
90
90
|
};
|
|
91
91
|
async run() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AssistantTextJoiner } from '@skrr-ai/data-provider';
|
|
1
|
+
import { type PublicProjection, type AssistantTextJoiner } from '@skrr-ai/data-provider';
|
|
2
2
|
/**
|
|
3
3
|
* Why a question was dismissed when no terminal exists to ask it on. It is the
|
|
4
4
|
* REASON for a dismissal, never an answer: it travels as the value of the
|
|
@@ -48,6 +48,7 @@ export type AgenticStreamResult = {
|
|
|
48
48
|
*/
|
|
49
49
|
export type ReconciledTerminal = {
|
|
50
50
|
status: 'completed' | 'failed';
|
|
51
|
+
publicProjection?: PublicProjection;
|
|
51
52
|
/** The answer as persisted, when there is one. */
|
|
52
53
|
text?: string;
|
|
53
54
|
/** The recorded failure reason — `metadata.agentic.error` on the message. */
|
|
@@ -100,6 +101,7 @@ export type HandoverReading =
|
|
|
100
101
|
| {
|
|
101
102
|
state: 'repaired';
|
|
102
103
|
text: string;
|
|
104
|
+
publicProjection?: PublicProjection;
|
|
103
105
|
repairedAt?: string;
|
|
104
106
|
}
|
|
105
107
|
/** The machine's turn ended without finishing, and the server settled it so. */
|
|
@@ -107,6 +109,7 @@ export type HandoverReading =
|
|
|
107
109
|
state: 'failed';
|
|
108
110
|
error: string;
|
|
109
111
|
text?: string;
|
|
112
|
+
publicProjection?: PublicProjection;
|
|
110
113
|
};
|
|
111
114
|
export type HandoverWaitOptions = {
|
|
112
115
|
/** Read the persisted response message. A throw or null is "no evidence". */
|
|
@@ -512,6 +515,7 @@ export declare class AgenticStreamClient {
|
|
|
512
515
|
private readonly textJoiner;
|
|
513
516
|
/** Highest envelope `__seq` folded into `accumulated`, for gap detection. */
|
|
514
517
|
private highestSeq;
|
|
518
|
+
private publicProjection;
|
|
515
519
|
private readonly pendingEnvelopes;
|
|
516
520
|
private replayTimer;
|
|
517
521
|
private replayFlight;
|