@skrr-ai/cli 0.1.154 → 0.1.155
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/daemon/index.js +2 -0
- package/dist/commands/daemon/workspace-locks.d.ts +9 -0
- package/dist/commands/daemon/workspace-locks.js +59 -0
- package/dist/commands/spaces/members/add.js +6 -6
- package/dist/commands/spaces/members/remove.js +6 -6
- package/dist/node_modules/@skrr-ai/data-provider/index.js +8411 -8373
- package/oclif.manifest.json +33 -1
- package/package.json +2 -2
|
@@ -30,6 +30,7 @@ class Daemon extends core_1.Command {
|
|
|
30
30
|
'<%= config.bin %> daemon logs',
|
|
31
31
|
'<%= config.bin %> daemon diagnostics',
|
|
32
32
|
'<%= config.bin %> daemon recover-offline-queue --apply',
|
|
33
|
+
'<%= config.bin %> daemon workspace-locks',
|
|
33
34
|
'<%= config.bin %> daemon usage --refresh',
|
|
34
35
|
'<%= config.bin %> daemon byok status',
|
|
35
36
|
];
|
|
@@ -52,6 +53,7 @@ class Daemon extends core_1.Command {
|
|
|
52
53
|
this.log(' skrr daemon logs — tail recent daemon logs');
|
|
53
54
|
this.log(' skrr daemon diagnostics — write a support bundle (status, logs) to send with a bug report');
|
|
54
55
|
this.log(' skrr daemon recover-offline-queue — restore recoverable offline WALs');
|
|
56
|
+
this.log(' skrr daemon workspace-locks — list workspace locks, clear a stranded one');
|
|
55
57
|
this.log(' skrr daemon usage — show local Claude Code and Codex usage limits');
|
|
56
58
|
this.log(' skrr daemon byok — manage local BYOK Keychain credentials');
|
|
57
59
|
this.log(' skrr daemon profile — list, select, clean up, remove and restore profiles');
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class DaemonWorkspaceLocks extends Command {
|
|
3
|
+
static aliases: string[];
|
|
4
|
+
static summary: string;
|
|
5
|
+
static description: string;
|
|
6
|
+
static strict: boolean;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const exec_runtime_binary_1 = require("../../lib/exec-runtime-binary");
|
|
5
|
+
/**
|
|
6
|
+
* `skrrd workspace-locks` exits 2 for "refused, nothing changed", 64 for a bad key and 78 for an untrusted state
|
|
7
|
+
* directory, and this wrapper forwards those verbatim. "The installed runtime has no such command" must not
|
|
8
|
+
* collide with any of them, so it is sysexits' EX_UNAVAILABLE.
|
|
9
|
+
*/
|
|
10
|
+
const RUNTIME_TOO_OLD_EXIT = 69;
|
|
11
|
+
class DaemonWorkspaceLocks extends core_1.Command {
|
|
12
|
+
// `skrr daemons <sub>` — the plural is advertised as an alias for the
|
|
13
|
+
// whole topic, and without a per-command alias only the bare topic
|
|
14
|
+
// resolved: every subcommand under it failed.
|
|
15
|
+
static aliases = ['daemons:workspace-locks'];
|
|
16
|
+
static summary = 'List the workspace locks on this computer, or clear one left by a launch that never recorded its outcome';
|
|
17
|
+
static description = (0, exec_runtime_binary_1.forwardedFlagsNote)('workspace-locks');
|
|
18
|
+
static strict = false; // forward all args verbatim — see run()
|
|
19
|
+
static examples = [
|
|
20
|
+
'<%= config.bin %> daemon workspace-locks',
|
|
21
|
+
'<%= config.bin %> daemon workspace-locks --json',
|
|
22
|
+
'<%= config.bin %> daemon workspace-locks clear <key> --acknowledge launch_outcome_unknown',
|
|
23
|
+
];
|
|
24
|
+
async run() {
|
|
25
|
+
// The refusal "Task workspace launch outcome is unknown; explicit recovery is
|
|
26
|
+
// required" repeats on every later start until this runs, so it must be
|
|
27
|
+
// reachable from the wrapper like `unlock`, not only from a second binary.
|
|
28
|
+
//
|
|
29
|
+
// It is reached for on a machine that is already wedged, which is often a
|
|
30
|
+
// machine whose runtime predates the verb. A stale runtime treats a
|
|
31
|
+
// subcommand it does not know as `start`, which collides with the healthy
|
|
32
|
+
// daemon's singleton lock, so the runtime's top-level help is read first
|
|
33
|
+
// (it starts nothing). Only a runtime that positively lacks the verb is
|
|
34
|
+
// refused; one whose help cannot be read is forwarded to, as every other
|
|
35
|
+
// wrapper does.
|
|
36
|
+
//
|
|
37
|
+
// `this.argv`, NOT `this.parse()`: `strict = false` relaxes POSITIONAL arity
|
|
38
|
+
// and oclif still rejects any flag this command has not declared, which
|
|
39
|
+
// would make `--acknowledge` and `--json` unreachable (OSK-296).
|
|
40
|
+
const argv = this.argv;
|
|
41
|
+
try {
|
|
42
|
+
if ((await (0, exec_runtime_binary_1.runtimeBinarySupportsSubcommand)('workspace-locks')) === false) {
|
|
43
|
+
this.error('The installed skrr background service is older than this skrr CLI and has no ' +
|
|
44
|
+
'`workspace-locks` command. Update it with `skrr daemon update`, then rerun ' +
|
|
45
|
+
'`skrr daemon workspace-locks`; do not stop a healthy running daemon to work around this.', { exit: RUNTIME_TOO_OLD_EXIT });
|
|
46
|
+
}
|
|
47
|
+
const code = await (0, exec_runtime_binary_1.execRuntimeBinary)(['workspace-locks', ...argv]);
|
|
48
|
+
this.exit(code);
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
if (err.message === 'runtime-binary-not-installed') {
|
|
52
|
+
this.log((0, exec_runtime_binary_1.notInstalledMessage)());
|
|
53
|
+
this.exit(127);
|
|
54
|
+
}
|
|
55
|
+
throw err;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.default = DaemonWorkspaceLocks;
|
|
@@ -104,16 +104,16 @@ class SpacesMembersAdd extends base_command_1.BaseCommand {
|
|
|
104
104
|
accessRoleId,
|
|
105
105
|
})),
|
|
106
106
|
];
|
|
107
|
-
let current;
|
|
108
107
|
let result;
|
|
109
108
|
try {
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
// `public` is left out on purpose: the server reads a missing or false one as
|
|
110
|
+
// "revoke the PUBLIC grant", so it is read from the space right before the
|
|
111
|
+
// write and carried through. If it cannot be read, nothing is written.
|
|
112
|
+
const request = await (0, data_provider_1.resolvePermissionsUpdate)({
|
|
112
113
|
updated: updated,
|
|
113
114
|
removed: [],
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
});
|
|
115
|
+
}, () => data_provider_1.dataService.getResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef));
|
|
116
|
+
result = await data_provider_1.dataService.updateResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef, request);
|
|
117
117
|
const expertise = flags.expertise;
|
|
118
118
|
if ((brief && brief.trim().length > 0) || (expertise && expertise.length > 0)) {
|
|
119
119
|
const saves = [
|
|
@@ -42,16 +42,16 @@ class SpacesMembersRemove extends base_command_1.BaseCommand {
|
|
|
42
42
|
...userIds.map((id) => ({ type: (0, space_members_1.principalType)('user'), id })),
|
|
43
43
|
...agentIds.map((id) => ({ type: (0, space_members_1.principalType)('agent'), id })),
|
|
44
44
|
];
|
|
45
|
-
let current;
|
|
46
45
|
let result;
|
|
47
46
|
try {
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
// `public` is left out on purpose: the server reads a missing or false one as
|
|
48
|
+
// "revoke the PUBLIC grant", so it is read from the space right before the
|
|
49
|
+
// write and carried through. If it cannot be read, nothing is written.
|
|
50
|
+
const request = await (0, data_provider_1.resolvePermissionsUpdate)({
|
|
50
51
|
updated: [],
|
|
51
52
|
removed: removed,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
});
|
|
53
|
+
}, () => data_provider_1.dataService.getResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef));
|
|
54
|
+
result = await data_provider_1.dataService.updateResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef, request);
|
|
55
55
|
if (!flags['keep-brief']) {
|
|
56
56
|
const deletes = [
|
|
57
57
|
...userIds.map((principalId) => data_provider_1.dataService.deleteSpaceBrief(spaceRef, 'user', principalId).catch(() => undefined)),
|