@skrr-ai/cli 0.1.14 → 0.1.17
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/README.md +3 -0
- 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/commitments/autonomy.js +9 -1
- package/dist/commands/commitments/create.d.ts +8 -5
- package/dist/commands/commitments/create.js +38 -8
- package/dist/commands/commitments/doctor.d.ts +19 -0
- package/dist/commands/commitments/doctor.js +72 -0
- package/dist/commands/commitments/preflight.d.ts +3 -1
- package/dist/commands/commitments/preflight.js +25 -3
- package/dist/commands/commitments/reports.js +15 -2
- package/dist/commands/commitments/update.d.ts +9 -2
- package/dist/commands/commitments/update.js +36 -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 +107 -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 +27 -2
- package/dist/commands/tasks/deliverable/add.d.ts +23 -0
- package/dist/commands/tasks/deliverable/add.js +70 -0
- package/dist/commands/tasks/deliverable/confirm.d.ts +35 -0
- package/dist/commands/tasks/deliverable/confirm.js +77 -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 +111 -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 +27 -3
- package/dist/commands/tasks/trust.d.ts +35 -0
- package/dist/commands/tasks/trust.js +75 -0
- 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/commitments.d.ts +28 -3
- package/dist/lib/commitments.js +20 -11
- 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 +93 -2
- package/dist/node_modules/@skrr-ai/data-provider/index.js +2393 -2197
- package/dist/node_modules/@skrr-ai/inference-broker/package.json +1 -1
- package/oclif.manifest.json +17725 -15563
- 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' }),
|
|
@@ -29,6 +29,7 @@ class CommitmentsAutonomy extends base_command_1.BaseCommand {
|
|
|
29
29
|
static examples = [
|
|
30
30
|
'<%= config.bin %> commitments autonomy <commitment-id> --mode ask_first',
|
|
31
31
|
'<%= config.bin %> commitments autonomy <commitment-id> --mode auto_run_limited --reason "trusted after 2 weeks"',
|
|
32
|
+
'<%= config.bin %> commitments autonomy <commitment-id> --mode auto_run --reason "owns the pipeline end to end"',
|
|
32
33
|
];
|
|
33
34
|
static args = {
|
|
34
35
|
id: core_1.Args.string({ description: 'Commitment ID', required: true, ignoreStdin: true }),
|
|
@@ -36,7 +37,14 @@ class CommitmentsAutonomy extends base_command_1.BaseCommand {
|
|
|
36
37
|
static flags = {
|
|
37
38
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
38
39
|
mode: core_1.Flags.string({
|
|
39
|
-
|
|
40
|
+
// The web surface groups these into three choices; the CLI keeps the
|
|
41
|
+
// canonical five because an operator and a coding agent both need to name
|
|
42
|
+
// the stored value. What it must NOT keep is the silence: the two acting
|
|
43
|
+
// rungs were indistinguishable in the decision core until the authority
|
|
44
|
+
// rework, and this help text never said what separated them.
|
|
45
|
+
description: 'Autonomy mode: off (stop) | suggestions_only (propose only) | ask_first (prepare, wait for approval) | ' +
|
|
46
|
+
'auto_run_limited (act unattended on low/medium-risk work, bring high-risk to the owner) | ' +
|
|
47
|
+
'auto_run (act unattended, high-risk work included)',
|
|
40
48
|
options: [...commitments_1.COMMITMENT_AUTONOMY_MODES],
|
|
41
49
|
required: true,
|
|
42
50
|
}),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BaseCommand } from '../../base-command';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* mode
|
|
5
|
-
*
|
|
6
|
-
* boundary; otherwise a successful create response
|
|
7
|
-
* autonomy is live when
|
|
3
|
+
* Creation preserves the policy its author wrote, so the mode that comes back
|
|
4
|
+
* is normally the mode that was asked for. When it is not — normalization
|
|
5
|
+
* rejected the value, or a governance layer sits lower — the difference has to
|
|
6
|
+
* be said out loud at the CLI boundary; otherwise a successful create response
|
|
7
|
+
* reads like the requested autonomy is live when something else is running.
|
|
8
8
|
*/
|
|
9
9
|
export declare function autonomyStagingNotice({ payload, commitment, bin, }: {
|
|
10
10
|
payload: Record<string, unknown>;
|
|
@@ -32,6 +32,8 @@ export default class CommitmentsCreate extends BaseCommand {
|
|
|
32
32
|
title: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
33
33
|
outcome: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
34
34
|
description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
35
|
+
'agent-directive': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
36
|
+
'agent-directive-file': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
35
37
|
goal: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
36
38
|
status: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
37
39
|
deadline: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -47,6 +49,7 @@ export default class CommitmentsCreate extends BaseCommand {
|
|
|
47
49
|
'cadence-mode': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
48
50
|
timezone: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
49
51
|
autonomy: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
52
|
+
isolation: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
50
53
|
'max-nudges': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
51
54
|
};
|
|
52
55
|
run(): Promise<void>;
|