@skrr-ai/cli 0.1.14 → 0.1.15
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 +14 -0
- package/dist/base-command.js +60 -1
- package/dist/commands/agents/create.d.ts +1 -0
- package/dist/commands/agents/create.js +6 -1
- package/dist/commands/agents/instructions/add.d.ts +21 -0
- package/dist/commands/agents/instructions/add.js +115 -0
- package/dist/commands/agents/instructions/disable.d.ts +13 -0
- package/dist/commands/agents/instructions/disable.js +50 -0
- package/dist/commands/agents/instructions/edit.d.ts +16 -0
- package/dist/commands/agents/instructions/edit.js +79 -0
- package/dist/commands/agents/instructions/enable.d.ts +13 -0
- package/dist/commands/agents/instructions/enable.js +50 -0
- package/dist/commands/agents/instructions/move.d.ts +15 -0
- package/dist/commands/agents/instructions/move.js +61 -0
- package/dist/commands/agents/instructions/preview.d.ts +13 -0
- package/dist/commands/agents/instructions/preview.js +59 -0
- package/dist/commands/agents/instructions/remove.d.ts +13 -0
- package/dist/commands/agents/instructions/remove.js +49 -0
- package/dist/commands/agents/instructions/set.d.ts +17 -0
- package/dist/commands/agents/instructions/set.js +79 -0
- package/dist/commands/agents/instructions/show.d.ts +15 -0
- package/dist/commands/agents/instructions/show.js +76 -0
- package/dist/commands/agents/instructions/upgrade.d.ts +16 -0
- package/dist/commands/agents/instructions/upgrade.js +77 -0
- package/dist/commands/agents/show.js +5 -0
- package/dist/commands/agents/triggers/policy.js +8 -2
- package/dist/commands/agents/update.d.ts +1 -0
- package/dist/commands/agents/update.js +8 -2
- package/dist/commands/daemon/index.js +2 -0
- package/dist/commands/daemon/recover-offline-queue.d.ts +9 -0
- package/dist/commands/daemon/recover-offline-queue.js +24 -0
- package/dist/commands/daemon/start.js +29 -1
- package/dist/commands/instruction-blocks/create.d.ts +19 -0
- package/dist/commands/instruction-blocks/create.js +94 -0
- package/dist/commands/instruction-blocks/delete.d.ts +13 -0
- package/dist/commands/instruction-blocks/delete.js +35 -0
- package/dist/commands/instruction-blocks/list.d.ts +13 -0
- package/dist/commands/instruction-blocks/list.js +71 -0
- package/dist/commands/instruction-blocks/show.d.ts +12 -0
- package/dist/commands/instruction-blocks/show.js +35 -0
- package/dist/commands/instruction-blocks/update.d.ts +23 -0
- package/dist/commands/instruction-blocks/update.js +94 -0
- package/dist/commands/spaces/auto-executor/preview.d.ts +1 -0
- package/dist/commands/spaces/auto-executor/preview.js +62 -3
- package/dist/commands/spaces/auto-executor/update.d.ts +4 -0
- package/dist/commands/spaces/auto-executor/update.js +78 -7
- package/dist/commands/spaces/capacity.js +14 -2
- package/dist/commands/spaces/update.d.ts +4 -0
- package/dist/commands/spaces/update.js +49 -2
- package/dist/commands/tasks/complete.d.ts +12 -5
- package/dist/commands/tasks/complete.js +50 -28
- package/dist/commands/tasks/continue-ready.js +9 -1
- package/dist/commands/tasks/create.d.ts +1 -0
- package/dist/commands/tasks/create.js +25 -1
- package/dist/commands/tasks/deliverable/add.d.ts +23 -0
- package/dist/commands/tasks/deliverable/add.js +70 -0
- package/dist/commands/tasks/events/append.d.ts +1 -1
- package/dist/commands/tasks/events/append.js +4 -4
- package/dist/commands/tasks/expectations.d.ts +12 -0
- package/dist/commands/tasks/expectations.js +92 -0
- package/dist/commands/tasks/judge.d.ts +29 -0
- package/dist/commands/tasks/judge.js +68 -0
- package/dist/commands/tasks/report.d.ts +1 -1
- package/dist/commands/tasks/report.js +3 -3
- package/dist/commands/tasks/update.d.ts +1 -0
- package/dist/commands/tasks/update.js +34 -4
- package/dist/commands/tasks/waive.d.ts +25 -0
- package/dist/commands/tasks/waive.js +58 -0
- package/dist/lib/agent-config.js +5 -0
- package/dist/lib/agent-instructions.d.ts +15 -0
- package/dist/lib/agent-instructions.js +55 -0
- package/dist/lib/command-hygiene.d.ts +6 -1
- package/dist/lib/command-hygiene.js +49 -29
- package/dist/lib/exec-runtime-binary.d.ts +13 -0
- package/dist/lib/exec-runtime-binary.js +45 -0
- package/dist/lib/git-task.d.ts +37 -0
- package/dist/lib/git-task.js +151 -0
- package/dist/lib/instruction-blocks.d.ts +29 -0
- package/dist/lib/instruction-blocks.js +159 -0
- package/dist/lib/runtime-start-verification.d.ts +49 -0
- package/dist/lib/runtime-start-verification.js +108 -0
- package/dist/lib/task-execution.d.ts +18 -2
- package/dist/lib/task-execution.js +19 -14
- package/dist/lib/task-transcript.js +1 -1
- package/dist/lib/tasks.d.ts +50 -0
- package/dist/lib/tasks.js +66 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +2027 -1904
- package/dist/node_modules/@skrr-ai/inference-broker/package.json +1 -1
- package/oclif.manifest.json +13706 -11858
- package/package.json +4 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
|
+
const base_command_1 = require("../../../base-command");
|
|
6
|
+
const agent_resolver_1 = require("../../../lib/agent-resolver");
|
|
7
|
+
const agent_instructions_1 = require("../../../lib/agent-instructions");
|
|
8
|
+
class AgentsInstructionsPreview extends base_command_1.BaseCommand {
|
|
9
|
+
static description = 'Revalidate and preview the exact custom instructions an Agent composition renders';
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> agents instructions preview <agent-id>',
|
|
12
|
+
'<%= config.bin %> agents instructions preview --json',
|
|
13
|
+
];
|
|
14
|
+
static args = {
|
|
15
|
+
id: core_1.Args.string({
|
|
16
|
+
description: 'Agent ID. Omit to use OVERSKY_SESSION_AGENT_ID.',
|
|
17
|
+
required: false,
|
|
18
|
+
ignoreStdin: true,
|
|
19
|
+
}),
|
|
20
|
+
};
|
|
21
|
+
static flags = {
|
|
22
|
+
json: core_1.Flags.boolean({ description: 'Output preview metadata and text as JSON' }),
|
|
23
|
+
agent: core_1.Flags.string({ description: 'Agent ID (alias for the positional argument)' }),
|
|
24
|
+
};
|
|
25
|
+
async run() {
|
|
26
|
+
this.requireAuth();
|
|
27
|
+
const { args, flags } = await this.parse(AgentsInstructionsPreview);
|
|
28
|
+
let agentId;
|
|
29
|
+
try {
|
|
30
|
+
agentId = await (0, agent_instructions_1.resolveInstructionAgentId)(args.id, flags.agent);
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
const failure = (0, agent_resolver_1.agentResolutionFailure)(error);
|
|
34
|
+
this.failWithCliError({
|
|
35
|
+
message: failure.message,
|
|
36
|
+
code: failure.code,
|
|
37
|
+
exit: 2,
|
|
38
|
+
retryable: false,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
let preview;
|
|
42
|
+
try {
|
|
43
|
+
const { composition } = await (0, agent_instructions_1.loadAgentInstructions)(agentId);
|
|
44
|
+
preview = await data_provider_1.dataService.previewInstructionComposition(composition);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
this.handleApiError(error);
|
|
48
|
+
}
|
|
49
|
+
if (flags.json)
|
|
50
|
+
return this.log(JSON.stringify({ agentId, ...preview }, null, 2));
|
|
51
|
+
this.log(`Agent: ${agentId}`);
|
|
52
|
+
this.log(`Compiled: ${preview.bytes} bytes · ~${preview.estimatedTokens} tokens · ${preview.composition.entries.length} block(s)`);
|
|
53
|
+
this.log('');
|
|
54
|
+
this.log(preview.instructions || '(No enabled custom instruction blocks.)');
|
|
55
|
+
this.log('');
|
|
56
|
+
this.log('This is behavior guidance only; it does not grant tools, integrations, scope, or approval authority.');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.default = AgentsInstructionsPreview;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class AgentsInstructionsRemove extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
instance: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
agent: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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 agent_resolver_1 = require("../../../lib/agent-resolver");
|
|
6
|
+
const agent_instructions_1 = require("../../../lib/agent-instructions");
|
|
7
|
+
const instruction_blocks_1 = require("../../../lib/instruction-blocks");
|
|
8
|
+
class AgentsInstructionsRemove extends base_command_1.BaseCommand {
|
|
9
|
+
static description = 'Remove one instruction block from an Agent (the library source remains intact)';
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> agents instructions remove library_… --agent <agent-id>',
|
|
12
|
+
];
|
|
13
|
+
static args = {
|
|
14
|
+
instance: core_1.Args.string({ description: 'Block instance ID', required: true, ignoreStdin: true }),
|
|
15
|
+
};
|
|
16
|
+
static flags = {
|
|
17
|
+
json: core_1.Flags.boolean({ description: 'Output the updated Agent as JSON' }),
|
|
18
|
+
agent: core_1.Flags.string({ description: 'Agent ID (alias for the positional argument)' }),
|
|
19
|
+
};
|
|
20
|
+
async run() {
|
|
21
|
+
this.requireAuth();
|
|
22
|
+
const { args, flags } = await this.parse(AgentsInstructionsRemove);
|
|
23
|
+
let agentId;
|
|
24
|
+
try {
|
|
25
|
+
agentId = await (0, agent_instructions_1.resolveInstructionAgentId)(undefined, flags.agent);
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
const failure = (0, agent_resolver_1.agentResolutionFailure)(error);
|
|
29
|
+
this.failWithCliError({
|
|
30
|
+
message: failure.message,
|
|
31
|
+
code: failure.code,
|
|
32
|
+
exit: 2,
|
|
33
|
+
retryable: false,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
let updated;
|
|
37
|
+
try {
|
|
38
|
+
const { composition } = await (0, agent_instructions_1.loadAgentInstructions)(agentId);
|
|
39
|
+
updated = await (0, agent_instructions_1.saveAgentInstructions)(agentId, (0, instruction_blocks_1.removeEntry)(composition, args.instance));
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
this.handleApiError(error);
|
|
43
|
+
}
|
|
44
|
+
if (flags.json)
|
|
45
|
+
return this.log(JSON.stringify(updated, null, 2));
|
|
46
|
+
this.log(`Removed ${args.instance} from ${agentId}. The reusable library block, if any, was not changed.`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.default = AgentsInstructionsRemove;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/** Replace a composition atomically — the automation-friendly escape hatch. */
|
|
3
|
+
export default class AgentsInstructionsSet extends BaseCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {
|
|
7
|
+
id: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
agent: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
empty: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
yes: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
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 agent_resolver_1 = require("../../../lib/agent-resolver");
|
|
6
|
+
const agent_instructions_1 = require("../../../lib/agent-instructions");
|
|
7
|
+
const prompt_1 = require("../../../lib/prompt");
|
|
8
|
+
/** Replace a composition atomically — the automation-friendly escape hatch. */
|
|
9
|
+
class AgentsInstructionsSet extends base_command_1.BaseCommand {
|
|
10
|
+
static description = 'Replace an Agent’s instruction composition from JSON (the server validates and compiles it atomically)';
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> agents instructions set <agent-id> --file composition.json',
|
|
13
|
+
'cat composition.json | <%= config.bin %> agents instructions set --file -',
|
|
14
|
+
'<%= config.bin %> agents instructions set <agent-id> --empty --yes',
|
|
15
|
+
];
|
|
16
|
+
static args = {
|
|
17
|
+
id: core_1.Args.string({
|
|
18
|
+
description: 'Agent ID. Omit to use OVERSKY_SESSION_AGENT_ID.',
|
|
19
|
+
required: false,
|
|
20
|
+
ignoreStdin: true,
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
23
|
+
static flags = {
|
|
24
|
+
json: core_1.Flags.boolean({ description: 'Output the updated Agent as JSON' }),
|
|
25
|
+
agent: core_1.Flags.string({ description: 'Agent ID (alias for the positional argument)' }),
|
|
26
|
+
file: core_1.Flags.string({ description: 'Composition JSON file, or - for stdin' }),
|
|
27
|
+
empty: core_1.Flags.boolean({ description: 'Remove every custom instruction block' }),
|
|
28
|
+
yes: core_1.Flags.boolean({ char: 'y', description: 'Required with --empty' }),
|
|
29
|
+
};
|
|
30
|
+
async run() {
|
|
31
|
+
this.requireAuth();
|
|
32
|
+
const { args, flags } = await this.parse(AgentsInstructionsSet);
|
|
33
|
+
if (Boolean(flags.file) === Boolean(flags.empty)) {
|
|
34
|
+
this.error('Provide exactly one of --file or --empty.', { exit: 2 });
|
|
35
|
+
}
|
|
36
|
+
if (flags.empty && !flags.yes) {
|
|
37
|
+
this.error('Refusing to remove all custom instructions without --yes.', { exit: 2 });
|
|
38
|
+
}
|
|
39
|
+
let agentId;
|
|
40
|
+
try {
|
|
41
|
+
agentId = await (0, agent_instructions_1.resolveInstructionAgentId)(args.id, flags.agent);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
const failure = (0, agent_resolver_1.agentResolutionFailure)(error);
|
|
45
|
+
this.failWithCliError({
|
|
46
|
+
message: failure.message,
|
|
47
|
+
code: failure.code,
|
|
48
|
+
exit: 2,
|
|
49
|
+
retryable: false,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
let composition;
|
|
53
|
+
try {
|
|
54
|
+
composition = flags.empty
|
|
55
|
+
? { schemaVersion: 1, entries: [] }
|
|
56
|
+
: (await (0, prompt_1.readJsonBody)(flags.file));
|
|
57
|
+
if (!composition ||
|
|
58
|
+
typeof composition !== 'object' ||
|
|
59
|
+
composition.schemaVersion !== 1 ||
|
|
60
|
+
!Array.isArray(composition.entries)) {
|
|
61
|
+
throw new Error('Composition JSON must contain { "schemaVersion": 1, "entries": [...] }.');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
this.error(error.message, { exit: 2 });
|
|
66
|
+
}
|
|
67
|
+
let updated;
|
|
68
|
+
try {
|
|
69
|
+
updated = await (0, agent_instructions_1.saveAgentInstructions)(agentId, composition);
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
this.handleApiError(error);
|
|
73
|
+
}
|
|
74
|
+
if (flags.json)
|
|
75
|
+
return this.log(JSON.stringify(updated, null, 2));
|
|
76
|
+
this.log(`Replaced custom instructions for ${agentId}; the server compiled and saved the new composition.`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.default = AgentsInstructionsSet;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/** Inspect the editable composition, not merely its legacy rendered string. */
|
|
3
|
+
export default class AgentsInstructionsShow extends BaseCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {
|
|
7
|
+
id: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
agent: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
rendered: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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 agent_resolver_1 = require("../../../lib/agent-resolver");
|
|
6
|
+
const agent_instructions_1 = require("../../../lib/agent-instructions");
|
|
7
|
+
/** Inspect the editable composition, not merely its legacy rendered string. */
|
|
8
|
+
class AgentsInstructionsShow extends base_command_1.BaseCommand {
|
|
9
|
+
static description = 'Show an Agent’s custom-instruction composition, ordering, versions, and instance IDs';
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> agents instructions show <agent-id>',
|
|
12
|
+
'<%= config.bin %> agents instructions show --rendered',
|
|
13
|
+
'<%= config.bin %> agents instructions show <agent-id> --json',
|
|
14
|
+
];
|
|
15
|
+
static args = {
|
|
16
|
+
id: core_1.Args.string({
|
|
17
|
+
description: 'Agent ID. Omit to use OVERSKY_SESSION_AGENT_ID.',
|
|
18
|
+
required: false,
|
|
19
|
+
ignoreStdin: true,
|
|
20
|
+
}),
|
|
21
|
+
};
|
|
22
|
+
static flags = {
|
|
23
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
24
|
+
agent: core_1.Flags.string({ description: 'Agent ID (alias for the positional argument)' }),
|
|
25
|
+
rendered: core_1.Flags.boolean({ description: 'Also print the exact compiled custom instructions' }),
|
|
26
|
+
};
|
|
27
|
+
async run() {
|
|
28
|
+
this.requireAuth();
|
|
29
|
+
const { args, flags } = await this.parse(AgentsInstructionsShow);
|
|
30
|
+
let agentId;
|
|
31
|
+
try {
|
|
32
|
+
agentId = await (0, agent_instructions_1.resolveInstructionAgentId)(args.id, flags.agent);
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
const failure = (0, agent_resolver_1.agentResolutionFailure)(error);
|
|
36
|
+
this.failWithCliError({
|
|
37
|
+
message: failure.message,
|
|
38
|
+
code: failure.code,
|
|
39
|
+
exit: 2,
|
|
40
|
+
retryable: false,
|
|
41
|
+
details: { suggestion: failure.suggestion, context: failure.details },
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
let loaded;
|
|
45
|
+
try {
|
|
46
|
+
loaded = await (0, agent_instructions_1.loadAgentInstructions)(agentId);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
this.handleApiError(error);
|
|
50
|
+
}
|
|
51
|
+
const { agent, composition } = loaded;
|
|
52
|
+
if (flags.json) {
|
|
53
|
+
this.log(JSON.stringify({
|
|
54
|
+
agentId,
|
|
55
|
+
composition,
|
|
56
|
+
instructions: agent.instructions ?? '',
|
|
57
|
+
}, null, 2));
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this.log(`Agent: ${agent.name ?? agentId} (${agentId})`);
|
|
61
|
+
this.log(`Revision: ${composition.revisionId ?? 'legacy/unsaved'} · ${composition.entries.length} block(s)`);
|
|
62
|
+
this.log('');
|
|
63
|
+
for (const line of (0, agent_instructions_1.renderCompositionLines)(composition))
|
|
64
|
+
this.log(line);
|
|
65
|
+
if (flags.rendered) {
|
|
66
|
+
this.log('');
|
|
67
|
+
this.log('Compiled instructions:');
|
|
68
|
+
this.log(agent.instructions || '(No enabled custom instruction blocks.)');
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
this.log('');
|
|
72
|
+
this.log('Use --rendered to inspect the exact compiled text, or `preview` to revalidate it.');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.default = AgentsInstructionsShow;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/** Explicit is intentional: no library editor can silently change a live Agent. */
|
|
3
|
+
export default class AgentsInstructionsUpgrade extends BaseCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {
|
|
7
|
+
instance: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
agent: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
version: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
latest: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
|
+
const base_command_1 = require("../../../base-command");
|
|
6
|
+
const agent_resolver_1 = require("../../../lib/agent-resolver");
|
|
7
|
+
const agent_instructions_1 = require("../../../lib/agent-instructions");
|
|
8
|
+
const instruction_blocks_1 = require("../../../lib/instruction-blocks");
|
|
9
|
+
/** Explicit is intentional: no library editor can silently change a live Agent. */
|
|
10
|
+
class AgentsInstructionsUpgrade extends base_command_1.BaseCommand {
|
|
11
|
+
static description = 'Move one attached library block to a reviewed version explicitly';
|
|
12
|
+
static examples = [
|
|
13
|
+
'<%= config.bin %> agents instructions upgrade library_… --agent <agent-id> --version 2',
|
|
14
|
+
'<%= config.bin %> agents instructions upgrade library_… --agent <agent-id> --latest',
|
|
15
|
+
];
|
|
16
|
+
static args = {
|
|
17
|
+
instance: core_1.Args.string({
|
|
18
|
+
description: 'Library block instance ID',
|
|
19
|
+
required: true,
|
|
20
|
+
ignoreStdin: true,
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
23
|
+
static flags = {
|
|
24
|
+
json: core_1.Flags.boolean({ description: 'Output the updated Agent as JSON' }),
|
|
25
|
+
agent: core_1.Flags.string({ description: 'Agent ID (alias for the positional argument)' }),
|
|
26
|
+
version: core_1.Flags.integer({ description: 'Exact version to pin' }),
|
|
27
|
+
latest: core_1.Flags.boolean({ description: 'Pin the source’s current version' }),
|
|
28
|
+
};
|
|
29
|
+
async run() {
|
|
30
|
+
this.requireAuth();
|
|
31
|
+
const { args, flags } = await this.parse(AgentsInstructionsUpgrade);
|
|
32
|
+
if (Boolean(flags.version) === Boolean(flags.latest)) {
|
|
33
|
+
this.error('Choose exactly one of --version <n> or --latest.', { exit: 2 });
|
|
34
|
+
}
|
|
35
|
+
let agentId;
|
|
36
|
+
try {
|
|
37
|
+
agentId = await (0, agent_instructions_1.resolveInstructionAgentId)(undefined, flags.agent);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
const failure = (0, agent_resolver_1.agentResolutionFailure)(error);
|
|
41
|
+
this.failWithCliError({
|
|
42
|
+
message: failure.message,
|
|
43
|
+
code: failure.code,
|
|
44
|
+
exit: 2,
|
|
45
|
+
retryable: false,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
let updated;
|
|
49
|
+
let selectedVersion;
|
|
50
|
+
try {
|
|
51
|
+
const { composition } = await (0, agent_instructions_1.loadAgentInstructions)(agentId);
|
|
52
|
+
const entry = (0, instruction_blocks_1.entryByInstance)(composition, args.instance);
|
|
53
|
+
if (entry.source.kind !== 'library') {
|
|
54
|
+
throw new Error(`${args.instance} is an inline block and has no library version to upgrade.`);
|
|
55
|
+
}
|
|
56
|
+
const block = await data_provider_1.dataService.getInstructionBlock(entry.source.blockId);
|
|
57
|
+
selectedVersion = flags.latest ? block.currentVersion : flags.version;
|
|
58
|
+
if (!block.versions.some((candidate) => candidate.version === selectedVersion)) {
|
|
59
|
+
throw new Error(`${block.id} has no v${selectedVersion}. Run \`skrr instruction-blocks show ${block.id}\`.`);
|
|
60
|
+
}
|
|
61
|
+
updated = await (0, agent_instructions_1.saveAgentInstructions)(agentId, (0, instruction_blocks_1.replaceEntry)(composition, args.instance, {
|
|
62
|
+
...entry,
|
|
63
|
+
source: { kind: 'library', blockId: entry.source.blockId, version: selectedVersion },
|
|
64
|
+
// The controller resolves the selected source server-side and writes
|
|
65
|
+
// a new immutable snapshot. Never carry the old snapshot forward.
|
|
66
|
+
resolved: undefined,
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
this.handleApiError(error);
|
|
71
|
+
}
|
|
72
|
+
if (flags.json)
|
|
73
|
+
return this.log(JSON.stringify(updated, null, 2));
|
|
74
|
+
this.log(`Upgraded ${args.instance} on ${agentId} to v${selectedVersion}.`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.default = AgentsInstructionsUpgrade;
|
|
@@ -112,6 +112,11 @@ class AgentsShow extends base_command_1.BaseCommand {
|
|
|
112
112
|
this.log(`Tone: ${agentToneLine(a)}`);
|
|
113
113
|
this.log(`Category: ${a.category ?? '-'}`);
|
|
114
114
|
this.log(`Author: ${a.author ?? '-'}`);
|
|
115
|
+
// A cap the user cannot see is a cap they cannot diagnose: a saturated
|
|
116
|
+
// agent makes its assigned tasks wait, which reads as "the board is stuck".
|
|
117
|
+
this.log(`Task limit: ${typeof a.maxConcurrentTaskExecutions === 'number' && a.maxConcurrentTaskExecutions > 0
|
|
118
|
+
? `${a.maxConcurrentTaskExecutions} concurrent across all spaces`
|
|
119
|
+
: 'unlimited'}`);
|
|
115
120
|
for (const line of agentExecutionOrderLines(a))
|
|
116
121
|
this.log(line);
|
|
117
122
|
if (a.harnessName || a.harnessProvider || a.harnessStatus) {
|
|
@@ -4,7 +4,10 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
const base_command_1 = require("../../../base-command");
|
|
5
5
|
const prompt_1 = require("../../../lib/prompt");
|
|
6
6
|
const triggers_1 = require("../../../lib/triggers");
|
|
7
|
-
|
|
7
|
+
// The server validates `mode` against the full autonomy ladder. This command
|
|
8
|
+
// used to carry its own copy that stopped one rung short, so `auto_run` was
|
|
9
|
+
// accepted by the API and unreachable from the CLI.
|
|
10
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
8
11
|
class AgentsTriggersPolicy extends base_command_1.BaseCommand {
|
|
9
12
|
static description = "Show or update an agent's initiative policy for agent-scoped triggers";
|
|
10
13
|
static examples = [
|
|
@@ -23,7 +26,10 @@ class AgentsTriggersPolicy extends base_command_1.BaseCommand {
|
|
|
23
26
|
'audit-limit': core_1.Flags.integer({
|
|
24
27
|
description: 'Recent fire rows to include when showing policy',
|
|
25
28
|
}),
|
|
26
|
-
mode: core_1.Flags.string({
|
|
29
|
+
mode: core_1.Flags.string({
|
|
30
|
+
description: 'Initiative policy mode',
|
|
31
|
+
options: [...data_provider_1.AGENT_INITIATIVE_POLICY_MODES],
|
|
32
|
+
}),
|
|
27
33
|
'allowed-kind': core_1.Flags.string({
|
|
28
34
|
description: 'Allowed trigger kind under auto_run_limited (repeatable or comma-separated)',
|
|
29
35
|
multiple: true,
|
|
@@ -29,6 +29,7 @@ export default class AgentsUpdate extends BaseCommand {
|
|
|
29
29
|
'tone-mode': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
30
30
|
'tone-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
31
31
|
'tone-notes': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
32
|
+
'max-concurrent-task-executions': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
32
33
|
skills: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
33
34
|
'agent-actions': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
34
35
|
'tool-policy': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -11,7 +11,7 @@ class AgentsUpdate extends base_command_1.BaseCommand {
|
|
|
11
11
|
static description = 'Update an existing agent (partial patch)';
|
|
12
12
|
static examples = [
|
|
13
13
|
'<%= config.bin %> agents update <agent-id> --name "New name"',
|
|
14
|
-
'<%= config.bin %> agents
|
|
14
|
+
'<%= config.bin %> agents instructions add <agent-id> --inline --title "Working preferences" --body "Lead with the answer."',
|
|
15
15
|
'<%= config.bin %> agents update <agent-id> --model claude-sonnet-5',
|
|
16
16
|
'<%= config.bin %> agents update <agent-id> --target sbs_123',
|
|
17
17
|
'<%= config.bin %> agents update <agent-id> --target rt_local --next-target hosted-machine',
|
|
@@ -27,7 +27,9 @@ class AgentsUpdate extends base_command_1.BaseCommand {
|
|
|
27
27
|
}),
|
|
28
28
|
name: core_1.Flags.string({ description: 'New name' }),
|
|
29
29
|
description: core_1.Flags.string({ description: 'New description' }),
|
|
30
|
-
instructions: core_1.Flags.string({
|
|
30
|
+
instructions: core_1.Flags.string({
|
|
31
|
+
description: 'Replace all custom instructions with one raw legacy block. For block-aware edits use `agents instructions`.',
|
|
32
|
+
}),
|
|
31
33
|
provider: core_1.Flags.string({ description: 'New provider' }),
|
|
32
34
|
model: core_1.Flags.string({ description: 'New model' }),
|
|
33
35
|
category: core_1.Flags.string({ description: 'New category' }),
|
|
@@ -56,6 +58,10 @@ class AgentsUpdate extends base_command_1.BaseCommand {
|
|
|
56
58
|
'tone-mode': core_1.Flags.string({ description: 'Tone mode' }),
|
|
57
59
|
'tone-id': core_1.Flags.string({ description: 'Tone ID' }),
|
|
58
60
|
'tone-notes': core_1.Flags.string({ description: 'Per-agent tone notes' }),
|
|
61
|
+
'max-concurrent-task-executions': core_1.Flags.integer({
|
|
62
|
+
description: 'Max Task executions this agent may run at once ACROSS every space (0 = unlimited). ' +
|
|
63
|
+
'Ready tasks assigned to a saturated agent wait instead of starting.',
|
|
64
|
+
}),
|
|
59
65
|
skills: core_1.Flags.string({ description: 'Skills JSON array' }),
|
|
60
66
|
'agent-actions': core_1.Flags.string({ description: 'Embedded actions JSON array' }),
|
|
61
67
|
'tool-policy': core_1.Flags.string({ description: 'Tool policy JSON object' }),
|
|
@@ -20,6 +20,7 @@ class Daemon extends core_1.Command {
|
|
|
20
20
|
'<%= config.bin %> daemon start',
|
|
21
21
|
'<%= config.bin %> daemon stop',
|
|
22
22
|
'<%= config.bin %> daemon logs',
|
|
23
|
+
'<%= config.bin %> daemon recover-offline-queue --apply',
|
|
23
24
|
'<%= config.bin %> daemon usage --refresh',
|
|
24
25
|
'<%= config.bin %> daemon byok status',
|
|
25
26
|
];
|
|
@@ -38,6 +39,7 @@ class Daemon extends core_1.Command {
|
|
|
38
39
|
this.log(' skrr daemon stop — stop the daemon');
|
|
39
40
|
this.log(' skrr daemon status — show running state and config');
|
|
40
41
|
this.log(' skrr daemon logs — tail recent daemon logs');
|
|
42
|
+
this.log(' skrr daemon recover-offline-queue — restore recoverable offline WALs');
|
|
41
43
|
this.log(' skrr daemon usage — show local Claude Code and Codex usage limits');
|
|
42
44
|
this.log(' skrr daemon byok — manage local BYOK Keychain credentials');
|
|
43
45
|
this.log('');
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/** Restore explicitly selected offline-queue forensic WALs through the runtime. */
|
|
3
|
+
export default class DaemonRecoverOfflineQueue extends Command {
|
|
4
|
+
static aliases: string[];
|
|
5
|
+
static summary: string;
|
|
6
|
+
static description: string;
|
|
7
|
+
static strict: boolean;
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
/** Restore explicitly selected offline-queue forensic WALs through the runtime. */
|
|
6
|
+
class DaemonRecoverOfflineQueue extends core_1.Command {
|
|
7
|
+
static aliases = ['daemons:recover-offline-queue'];
|
|
8
|
+
static summary = 'Restore recoverable offline-queue dead letters after a replay fix';
|
|
9
|
+
static description = (0, exec_runtime_binary_1.forwardedFlagsNote)('recover-offline-queue');
|
|
10
|
+
static strict = false;
|
|
11
|
+
async run() {
|
|
12
|
+
try {
|
|
13
|
+
this.exit(await (0, exec_runtime_binary_1.execRuntimeBinary)(['recover-offline-queue', ...this.argv]));
|
|
14
|
+
}
|
|
15
|
+
catch (err) {
|
|
16
|
+
if (err.message === 'runtime-binary-not-installed') {
|
|
17
|
+
this.log((0, exec_runtime_binary_1.notInstalledMessage)());
|
|
18
|
+
this.exit(127);
|
|
19
|
+
}
|
|
20
|
+
throw err;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = DaemonRecoverOfflineQueue;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
4
|
const exec_runtime_binary_1 = require("../../lib/exec-runtime-binary");
|
|
5
|
+
const runtime_start_verification_1 = require("../../lib/runtime-start-verification");
|
|
5
6
|
class DaemonStart extends core_1.Command {
|
|
6
7
|
// `skrr daemons <sub>` — the plural is advertised as an alias for the
|
|
7
8
|
// whole topic, and without a per-command alias only the bare topic
|
|
@@ -23,7 +24,34 @@ class DaemonStart extends core_1.Command {
|
|
|
23
24
|
const argv = this.argv;
|
|
24
25
|
try {
|
|
25
26
|
const code = await (0, exec_runtime_binary_1.execRuntimeBinary)(['start', ...argv]);
|
|
26
|
-
|
|
27
|
+
if (code !== 0)
|
|
28
|
+
this.exit(code);
|
|
29
|
+
// A supervisor's successful `kickstart` means only that it accepted the
|
|
30
|
+
// request. Older installed skrrd builds then write TOKEN_MISSING and exit
|
|
31
|
+
// cleanly, leaving the CLI that invoked them to report success. Query the
|
|
32
|
+
// same profile after every zero exit so the public command never claims a
|
|
33
|
+
// stopped service is running while users move through a staggered release.
|
|
34
|
+
const status = await (0, exec_runtime_binary_1.execRuntimeBinaryCapture)((0, runtime_start_verification_1.statusArgsForStart)(argv));
|
|
35
|
+
const verification = (0, runtime_start_verification_1.verifyRuntimeStart)(status.stdout, status.code, argv);
|
|
36
|
+
if (verification.status === 'reauth_required') {
|
|
37
|
+
this.logToStderr(`Local runtime did not start: profile '${verification.profile}' requires ` +
|
|
38
|
+
`re-authentication (reason: ${verification.reason ?? 'UNKNOWN'}). Run ` +
|
|
39
|
+
`\`${verification.recoveryCommand}\`, then retry \`skrr daemon start\`.`);
|
|
40
|
+
this.exit(runtime_start_verification_1.DAEMON_START_REAUTH_EXIT);
|
|
41
|
+
}
|
|
42
|
+
if (verification.status === 'not_running') {
|
|
43
|
+
this.logToStderr(`Local runtime did not remain running after skrrd exited successfully ` +
|
|
44
|
+
`(profile '${verification.profile}', service status: ` +
|
|
45
|
+
`${verification.runtimeStatus ?? 'unknown'}). Run \`skrr daemon logs\` for the reason.`);
|
|
46
|
+
this.exit(runtime_start_verification_1.DAEMON_START_UNVERIFIED_EXIT);
|
|
47
|
+
}
|
|
48
|
+
if (verification.status === 'unreadable_status') {
|
|
49
|
+
this.logToStderr(`skrrd start exited successfully, but skrr could not verify a running local runtime ` +
|
|
50
|
+
`for profile '${verification.profile}'; refusing to report success. ` +
|
|
51
|
+
'Run `skrr daemon status` and `skrr daemon logs` for the reason.');
|
|
52
|
+
this.exit(runtime_start_verification_1.DAEMON_START_UNVERIFIED_EXIT);
|
|
53
|
+
}
|
|
54
|
+
this.exit(0);
|
|
27
55
|
}
|
|
28
56
|
catch (err) {
|
|
29
57
|
if (err.message === 'runtime-binary-not-installed') {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
export default class InstructionBlocksCreate extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
name: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
summary: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
body: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
category: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
tag: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
visibility: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
'parameter-schema': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
requirements: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
|
+
changelog: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
|
+
};
|
|
18
|
+
run(): Promise<void>;
|
|
19
|
+
}
|