@skrr-ai/cli 0.1.93 → 0.1.94
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/agents/operating-plan.d.ts +11 -0
- package/dist/commands/agents/operating-plan.js +54 -0
- package/dist/commands/agents/roles/example.d.ts +11 -0
- package/dist/commands/agents/roles/example.js +30 -0
- package/dist/commands/{commitments/mode.d.ts → agents/roles/export.d.ts} +5 -5
- package/dist/commands/agents/roles/export.js +81 -0
- package/dist/commands/agents/roles/install.d.ts +12 -0
- package/dist/commands/agents/roles/install.js +48 -0
- package/dist/commands/agents/roles/list.d.ts +11 -0
- package/dist/commands/agents/roles/list.js +36 -0
- package/dist/commands/agents/roles/preview.d.ts +14 -0
- package/dist/commands/agents/roles/preview.js +49 -0
- package/dist/commands/agents/roles/withdraw.d.ts +13 -0
- package/dist/commands/agents/roles/withdraw.js +43 -0
- package/dist/commands/commitments/{autonomy-requests → cadence-requests}/decide.d.ts +5 -7
- package/dist/commands/commitments/{autonomy-requests → cadence-requests}/decide.js +13 -15
- package/dist/commands/commitments/cost.d.ts +1 -1
- package/dist/commands/commitments/cost.js +1 -1
- package/dist/commands/commitments/create.d.ts +0 -7
- package/dist/commands/commitments/create.js +9 -98
- package/dist/commands/commitments/delivery.js +3 -21
- package/dist/commands/commitments/doctor.js +28 -27
- package/dist/commands/commitments/effective-policy.js +5 -36
- package/dist/commands/commitments/evaluations.d.ts +15 -0
- package/dist/commands/commitments/evaluations.js +54 -0
- package/dist/commands/commitments/pack/activate.d.ts +11 -0
- package/dist/commands/commitments/pack/activate.js +22 -0
- package/dist/commands/commitments/pack/bind.js +1 -1
- package/dist/commands/commitments/remediate.js +2 -5
- package/dist/commands/commitments/show.js +1 -1
- package/dist/commands/commitments/update.js +9 -9
- package/dist/commands/commitments/wake-capabilities.d.ts +1 -3
- package/dist/commands/commitments/wake-capabilities.js +5 -21
- package/dist/lib/commitment-product.d.ts +0 -6
- package/dist/lib/commitment-product.js +1 -30
- package/dist/lib/commitments.d.ts +9 -45
- package/dist/lib/commitments.js +24 -95
- package/dist/lib/northstars.js +1 -1
- package/dist/lib/roles.d.ts +98 -0
- package/dist/lib/roles.js +45 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.d.ts +45 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.js +550 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.d.ts +7 -44
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.js +8 -47
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.d.ts +45 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.js +545 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.d.ts +7 -44
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.js +8 -47
- package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +7316 -7203
- package/dist/node_modules/@skrr-ai/data-provider/package.json +2 -2
- package/oclif.manifest.json +22528 -22170
- package/package.json +5 -2
- package/dist/commands/commitments/autonomy.d.ts +0 -30
- package/dist/commands/commitments/autonomy.js +0 -67
- package/dist/commands/commitments/mode.js +0 -58
- package/dist/commands/commitments/pack/promote.d.ts +0 -19
- package/dist/commands/commitments/pack/promote.js +0 -46
- package/dist/commands/commitments/pack/shadow.d.ts +0 -20
- package/dist/commands/commitments/pack/shadow.js +0 -42
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
export default class AgentOperatingPlan extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static flags: {
|
|
8
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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 roles_1 = require("../../lib/roles");
|
|
6
|
+
class AgentOperatingPlan extends base_command_1.BaseCommand {
|
|
7
|
+
static description = 'Read responsibilities, evidence, inquiries, work, delayed evaluation and existing planning loops without scheduling work';
|
|
8
|
+
static args = {
|
|
9
|
+
id: core_1.Args.string({ required: true, description: 'Agent ID', ignoreStdin: true }),
|
|
10
|
+
};
|
|
11
|
+
static flags = {
|
|
12
|
+
json: core_1.Flags.boolean({ description: 'Output full joined state and source coverage as JSON' }),
|
|
13
|
+
};
|
|
14
|
+
async run() {
|
|
15
|
+
this.requireAuth();
|
|
16
|
+
const { args, flags } = await this.parse(AgentOperatingPlan);
|
|
17
|
+
try {
|
|
18
|
+
const plan = await roles_1.roleApi.plan(args.id);
|
|
19
|
+
if (flags.json) {
|
|
20
|
+
this.log(JSON.stringify(plan, null, 2));
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
this.log(`Operating plan — ${args.id} (${plan.generatedAt})`);
|
|
24
|
+
for (const r of plan.responsibilities) {
|
|
25
|
+
this.log(`\n${r.title} · ${r.status} · ${r.kind} v${r.version}`);
|
|
26
|
+
this.log(` Responsibility: ${r.purpose}`);
|
|
27
|
+
this.log(` Evidence: ${r.evidence.status}${r.evidence.issues?.length ? ` (${r.evidence.issues.join(', ')})` : ''}`);
|
|
28
|
+
this.log(" Execution authority: tools, sandbox and approvals use the Agent's runtime permissions.");
|
|
29
|
+
for (const q of r.inquiries)
|
|
30
|
+
this.log(` Inquiry: ${q.question} [${q.status}] — ${q.decisionImpact}`);
|
|
31
|
+
for (const w of r.work)
|
|
32
|
+
this.log(` Work: ${w.title} [${w.status}]`);
|
|
33
|
+
for (const w of r.waiting)
|
|
34
|
+
this.log(` Evaluation: ${w.status} — ${w.reason}${w.nextAt ? `; next ${w.nextAt}` : ''}`);
|
|
35
|
+
this.log(` Next intervention: ${r.lifecycle !== 'active' ? 'inactive; requires activation' : r.nextIntervention?.nextAt || r.nextIntervention?.status || 'not recorded'}`);
|
|
36
|
+
if (r.blocker)
|
|
37
|
+
this.log(` Blocker: ${r.blocker.code} — ${r.blocker.remediation || ''}`);
|
|
38
|
+
}
|
|
39
|
+
this.log(`\n${plan.planning.loops.length} existing planning/reflection loops; ${plan.planning.todos.length} scheduled work blocks.`);
|
|
40
|
+
if (plan.learning?.skillValidation)
|
|
41
|
+
this.log(`Skill validation: ${plan.learning.skillValidation.enabled ? 'enabled' : 'disabled'} (${plan.learning.skillValidation.scope}); external effects validated: ${plan.learning.skillValidation.externalEffectsValidated}.`);
|
|
42
|
+
if (!plan.coverage.complete) {
|
|
43
|
+
this.log(`Incomplete coverage${plan.coverage.truncated ? '; view limits reached' : ''}.`);
|
|
44
|
+
for (const s of plan.coverage.sources.filter((s) => s.status !== 'available'))
|
|
45
|
+
this.log(` ${s.name}: ${s.status} (${s.code || 'unknown'})`);
|
|
46
|
+
}
|
|
47
|
+
this.log('Task or Run completion does not establish a verified outcome.');
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
this.handleApiError(error);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.default = AgentOperatingPlan;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class RolesExample extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
role: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static flags: {
|
|
8
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
|
+
const base_command_1 = require("../../../base-command");
|
|
7
|
+
class RolesExample extends base_command_1.BaseCommand {
|
|
8
|
+
static description = 'Start a portable DevOps, Financial Tech or Research Operations role using one generic schema';
|
|
9
|
+
static args = {
|
|
10
|
+
role: core_1.Args.string({
|
|
11
|
+
required: true,
|
|
12
|
+
options: ['devops', 'financial', 'research'],
|
|
13
|
+
description: 'Example role',
|
|
14
|
+
ignoreStdin: true,
|
|
15
|
+
}),
|
|
16
|
+
};
|
|
17
|
+
static flags = {
|
|
18
|
+
output: core_1.Flags.string({ description: 'Save the example JSON to a file; otherwise print JSON' }),
|
|
19
|
+
};
|
|
20
|
+
async run() {
|
|
21
|
+
const { args, flags } = await this.parse(RolesExample);
|
|
22
|
+
const example = data_provider_1.ROLE_OPERATING_SPEC_EXAMPLES[args.role];
|
|
23
|
+
const json = `${JSON.stringify(example, null, 2)}\n`;
|
|
24
|
+
if (flags.output)
|
|
25
|
+
(0, node_fs_1.writeFileSync)(flags.output, json, { mode: 0o600 });
|
|
26
|
+
else
|
|
27
|
+
this.log(json.trimEnd());
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.default = RolesExample;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { BaseCommand } from '
|
|
2
|
-
export default class
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class RolesExport extends BaseCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static args: {
|
|
6
6
|
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
-
|
|
7
|
+
key: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
8
|
};
|
|
9
9
|
static flags: {
|
|
10
|
+
summary: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
12
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
-
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
-
reason: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
13
|
};
|
|
14
14
|
run(): Promise<void>;
|
|
15
15
|
}
|
|
@@ -0,0 +1,81 @@
|
|
|
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 roles_1 = require("../../../lib/roles");
|
|
6
|
+
const artifact_export_1 = require("../../../lib/artifact-export");
|
|
7
|
+
/** Shape version of the portable role spec this command writes. */
|
|
8
|
+
const ROLE_EXPORT_VERSION = 1;
|
|
9
|
+
class RolesExport extends base_command_1.BaseCommand {
|
|
10
|
+
static description = 'Export portable role authoring intent; credentials, installation IDs and runtime state are excluded';
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> agents roles export <agent> <key> --summary',
|
|
13
|
+
'<%= config.bin %> agents roles export <agent> <key> --output role.json',
|
|
14
|
+
'<%= config.bin %> agents roles export <agent> <key> --output - | jq .',
|
|
15
|
+
];
|
|
16
|
+
static args = {
|
|
17
|
+
id: core_1.Args.string({ required: true, description: 'Agent ID', ignoreStdin: true }),
|
|
18
|
+
key: core_1.Args.string({ required: true, description: 'Role key', ignoreStdin: true }),
|
|
19
|
+
};
|
|
20
|
+
static flags = {
|
|
21
|
+
...(0, artifact_export_1.standardExportFlags)(),
|
|
22
|
+
};
|
|
23
|
+
async run() {
|
|
24
|
+
this.requireAuth();
|
|
25
|
+
const { args, flags } = await this.parse(RolesExport);
|
|
26
|
+
let selection;
|
|
27
|
+
try {
|
|
28
|
+
selection = (0, artifact_export_1.resolveExportSelection)(flags);
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
if (err instanceof artifact_export_1.ExportContractError) {
|
|
32
|
+
this.failWithCliError({ message: err.message, code: err.code, exit: 2, retryable: false });
|
|
33
|
+
}
|
|
34
|
+
throw err;
|
|
35
|
+
}
|
|
36
|
+
let spec;
|
|
37
|
+
try {
|
|
38
|
+
spec = await roles_1.roleApi.export(args.id, args.key);
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
this.handleApiError(error);
|
|
42
|
+
}
|
|
43
|
+
if (selection.summary) {
|
|
44
|
+
const summary = (0, artifact_export_1.contentFreeSummary)({
|
|
45
|
+
command: 'agents roles export',
|
|
46
|
+
artifactSchemaVersion: ROLE_EXPORT_VERSION,
|
|
47
|
+
itemCount: 1,
|
|
48
|
+
counts: {},
|
|
49
|
+
});
|
|
50
|
+
this.log(selection.json ? JSON.stringify(summary, null, 2) : (0, artifact_export_1.humanExportSummary)(summary));
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const serialized = (0, artifact_export_1.serializedArtifact)(spec);
|
|
54
|
+
if (selection.output === '-') {
|
|
55
|
+
this.log(serialized.trimEnd());
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
let receipt;
|
|
59
|
+
try {
|
|
60
|
+
receipt = await (0, artifact_export_1.writeExportArtifact)({
|
|
61
|
+
command: 'agents roles export',
|
|
62
|
+
artifactSchemaVersion: ROLE_EXPORT_VERSION,
|
|
63
|
+
format: 'json',
|
|
64
|
+
output: selection.output,
|
|
65
|
+
content: serialized,
|
|
66
|
+
itemCount: 1,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
this.failWithCliError({
|
|
71
|
+
message: `Could not write ${selection.output}: ${err.message}`,
|
|
72
|
+
code: 'ROLE_EXPORT_WRITE_FAILED',
|
|
73
|
+
exit: 1,
|
|
74
|
+
retryable: false,
|
|
75
|
+
details: { path: selection.output },
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
this.log(selection.json ? JSON.stringify(receipt, null, 2) : (0, artifact_export_1.humanExportReceipt)(receipt));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.default = RolesExport;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class RolesInstall extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static flags: {
|
|
8
|
+
preview: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 roles_1 = require("../../../lib/roles");
|
|
6
|
+
class RolesInstall extends base_command_1.BaseCommand {
|
|
7
|
+
static description = 'Install or reconcile a reviewed role preview as inactive existing objects; never attach credentials or activate work';
|
|
8
|
+
static args = {
|
|
9
|
+
id: core_1.Args.string({ required: true, description: 'Agent ID', ignoreStdin: true }),
|
|
10
|
+
};
|
|
11
|
+
static flags = {
|
|
12
|
+
preview: core_1.Flags.string({
|
|
13
|
+
required: true,
|
|
14
|
+
description: 'Server-generated preview JSON saved by agents roles preview',
|
|
15
|
+
}),
|
|
16
|
+
json: core_1.Flags.boolean({ description: 'Output the installation receipt as JSON' }),
|
|
17
|
+
};
|
|
18
|
+
async run() {
|
|
19
|
+
this.requireAuth();
|
|
20
|
+
const { args, flags } = await this.parse(RolesInstall);
|
|
21
|
+
try {
|
|
22
|
+
const preview = (0, roles_1.readRoleJson)(flags.preview);
|
|
23
|
+
(0, roles_1.assertRolePreview)(preview);
|
|
24
|
+
const receipt = await roles_1.roleApi.install(args.id, preview);
|
|
25
|
+
if (flags.json)
|
|
26
|
+
this.log(JSON.stringify(receipt, null, 2));
|
|
27
|
+
else {
|
|
28
|
+
this.log(receipt.complete ? 'Role installed inactive.' : 'Role installation partially saved.');
|
|
29
|
+
for (const item of receipt.results)
|
|
30
|
+
this.log(` ${item.key || item.id || 'receipt'}: ${item.status}${item.code ? ` (${item.code})` : ''}`);
|
|
31
|
+
this.log('Review and activate the Compass, attach required skills and evidence sources, then activate responsibilities through commitments resume.');
|
|
32
|
+
this.log(`Inspect the joined state: agents operating-plan ${args.id}`);
|
|
33
|
+
}
|
|
34
|
+
if (!receipt.complete)
|
|
35
|
+
this.failWithCliError({
|
|
36
|
+
code: 'ROLE_INSTALL_INCOMPLETE',
|
|
37
|
+
message: 'Some role objects were saved but installation is incomplete. Refresh the preview and reconcile the same revision.',
|
|
38
|
+
retryable: true,
|
|
39
|
+
exit: 1,
|
|
40
|
+
details: receipt,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
this.handleApiError(error);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.default = RolesInstall;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class RolesList extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static flags: {
|
|
8
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 roles_1 = require("../../../lib/roles");
|
|
6
|
+
class RolesList extends base_command_1.BaseCommand {
|
|
7
|
+
static description = 'List installed role specifications and their Compass lifecycle';
|
|
8
|
+
static args = {
|
|
9
|
+
id: core_1.Args.string({ required: true, description: 'Agent ID', ignoreStdin: true }),
|
|
10
|
+
};
|
|
11
|
+
static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
|
|
12
|
+
async run() {
|
|
13
|
+
this.requireAuth();
|
|
14
|
+
const { args, flags } = await this.parse(RolesList);
|
|
15
|
+
try {
|
|
16
|
+
const result = await roles_1.roleApi.list(args.id);
|
|
17
|
+
if (flags.json) {
|
|
18
|
+
this.log(JSON.stringify(result, null, 2));
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
for (const role of result.roles)
|
|
22
|
+
this.log(`${role.spec.key}: ${role.spec.title} · revision ${role.spec.revision} · ${role.status} · Compass ${role.compassStatus} v${role.compassVersion}`);
|
|
23
|
+
if (!result.roles.length)
|
|
24
|
+
this.log('No roles installed. Use agents roles example to start a portable configuration.');
|
|
25
|
+
if (result.skillInventory) {
|
|
26
|
+
this.log(`Attached Skill inventory: ${result.skillInventory.status}`);
|
|
27
|
+
for (const skill of result.skillInventory.skills)
|
|
28
|
+
this.log(` ${skill.name}: ${skill.id} · ${skill.versions.join(', ')}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
this.handleApiError(error);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.default = RolesList;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class RolesPreview extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static flags: {
|
|
8
|
+
file: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
bindings: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const base_command_1 = require("../../../base-command");
|
|
6
|
+
const roles_1 = require("../../../lib/roles");
|
|
7
|
+
class RolesPreview extends base_command_1.BaseCommand {
|
|
8
|
+
static description = 'Validate a portable role spec and preview its Compass, responsibilities, scope, budgets and requirements';
|
|
9
|
+
static args = {
|
|
10
|
+
id: core_1.Args.string({ required: true, description: 'Agent ID', ignoreStdin: true }),
|
|
11
|
+
};
|
|
12
|
+
static flags = {
|
|
13
|
+
file: core_1.Flags.string({ required: true, description: 'Role operating spec JSON file' }),
|
|
14
|
+
bindings: core_1.Flags.string({ description: 'JSON context slot → accessible target ID map' }),
|
|
15
|
+
output: core_1.Flags.string({ description: 'Save the server preview for review and installation' }),
|
|
16
|
+
json: core_1.Flags.boolean({ description: 'Output the complete preview as JSON' }),
|
|
17
|
+
};
|
|
18
|
+
async run() {
|
|
19
|
+
this.requireAuth();
|
|
20
|
+
const { args, flags } = await this.parse(RolesPreview);
|
|
21
|
+
try {
|
|
22
|
+
const result = await roles_1.roleApi.preview(args.id, (0, roles_1.readRoleJson)(flags.file), flags.bindings ? (0, roles_1.readRoleJson)(flags.bindings) : {});
|
|
23
|
+
if (flags.output)
|
|
24
|
+
(0, node_fs_1.writeFileSync)(flags.output, `${JSON.stringify(result, null, 2)}\n`, { mode: 0o600 });
|
|
25
|
+
if (flags.json) {
|
|
26
|
+
this.log(JSON.stringify(result, null, 2));
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
this.log(`${result.spec.title} — revision ${result.spec.revision}`);
|
|
30
|
+
this.log(`Compass ${result.compass.id}: archived; expected version ${result.expectedCompassVersion}`);
|
|
31
|
+
for (const change of result.changes)
|
|
32
|
+
this.log(` ${change.title}: ${change.change}`);
|
|
33
|
+
for (const removed of result.removedResponsibilities)
|
|
34
|
+
this.log(` ${removed.key}: pause removed responsibility`);
|
|
35
|
+
for (const ctx of result.contexts)
|
|
36
|
+
this.log(` context ${ctx.label}: ${ctx.status}${ctx.title ? ` (${ctx.title})` : ''}`);
|
|
37
|
+
for (const requirement of result.pending.skills)
|
|
38
|
+
this.log(` skill requirement: ${requirement.id}@${requirement.version}`);
|
|
39
|
+
for (const warning of result.warnings)
|
|
40
|
+
this.log(warning);
|
|
41
|
+
if (flags.output)
|
|
42
|
+
this.log(`Reviewed preview saved to ${flags.output}. Install with agents roles install ${args.id} --preview ${flags.output}.`);
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
this.handleApiError(error);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.default = RolesPreview;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class RolesWithdraw extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
key: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
'expected-version': import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 roles_1 = require("../../../lib/roles");
|
|
6
|
+
class RolesWithdraw extends base_command_1.BaseCommand {
|
|
7
|
+
static description = 'Pause installed responsibilities and archive their Compass, preserving work and history';
|
|
8
|
+
static args = {
|
|
9
|
+
id: core_1.Args.string({ required: true, description: 'Agent ID', ignoreStdin: true }),
|
|
10
|
+
key: core_1.Args.string({ required: true, description: 'Role key', ignoreStdin: true }),
|
|
11
|
+
};
|
|
12
|
+
static flags = {
|
|
13
|
+
'expected-version': core_1.Flags.integer({
|
|
14
|
+
required: true,
|
|
15
|
+
description: 'Compass version from agents roles list',
|
|
16
|
+
}),
|
|
17
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
this.requireAuth();
|
|
21
|
+
const { args, flags } = await this.parse(RolesWithdraw);
|
|
22
|
+
try {
|
|
23
|
+
const receipt = await roles_1.roleApi.withdraw(args.id, args.key, flags['expected-version']);
|
|
24
|
+
this.log(flags.json
|
|
25
|
+
? JSON.stringify(receipt, null, 2)
|
|
26
|
+
: receipt.complete
|
|
27
|
+
? 'Role paused; Compass archived. Existing work and memory retained.'
|
|
28
|
+
: 'Role partially paused. Refresh and retry to reconcile remaining responsibilities.');
|
|
29
|
+
if (!receipt.complete)
|
|
30
|
+
this.failWithCliError({
|
|
31
|
+
code: 'ROLE_WITHDRAW_INCOMPLETE',
|
|
32
|
+
message: 'Withdrawal is incomplete; inspect and retry.',
|
|
33
|
+
retryable: true,
|
|
34
|
+
exit: 1,
|
|
35
|
+
details: receipt,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
this.handleApiError(error);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.default = RolesWithdraw;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { BaseCommand } from '../../../base-command';
|
|
2
2
|
/**
|
|
3
|
-
* `skrr commitments
|
|
3
|
+
* `skrr commitments cadence-requests decide <id> <request-id> --approve`
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* wake through the same resolver a bypass-mode agent would have used; rejecting
|
|
9
|
-
* records the no and leaves the cadence alone.
|
|
5
|
+
* The server records concrete cadence proposals requiring an owner decision.
|
|
6
|
+
* Approval changes only the check schedule; it grants no execution permissions.
|
|
7
|
+
* Rejection records the decision and leaves the schedule unchanged.
|
|
10
8
|
*
|
|
11
9
|
* List the pending ones with `skrr commitments show <id>`.
|
|
12
10
|
*/
|
|
13
|
-
export default class
|
|
11
|
+
export default class CommitmentsCadenceRequestsDecide extends BaseCommand {
|
|
14
12
|
static description: string;
|
|
15
13
|
static examples: string[];
|
|
16
14
|
static args: {
|
|
@@ -4,44 +4,42 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
const base_command_1 = require("../../../base-command");
|
|
5
5
|
const commitments_1 = require("../../../lib/commitments");
|
|
6
6
|
/**
|
|
7
|
-
* `skrr commitments
|
|
7
|
+
* `skrr commitments cadence-requests decide <id> <request-id> --approve`
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* wake through the same resolver a bypass-mode agent would have used; rejecting
|
|
13
|
-
* records the no and leaves the cadence alone.
|
|
9
|
+
* The server records concrete cadence proposals requiring an owner decision.
|
|
10
|
+
* Approval changes only the check schedule; it grants no execution permissions.
|
|
11
|
+
* Rejection records the decision and leaves the schedule unchanged.
|
|
14
12
|
*
|
|
15
13
|
* List the pending ones with `skrr commitments show <id>`.
|
|
16
14
|
*/
|
|
17
|
-
class
|
|
15
|
+
class CommitmentsCadenceRequestsDecide extends base_command_1.BaseCommand {
|
|
18
16
|
static description = 'Approve or reject an agent-proposed commitment cadence change';
|
|
19
17
|
static examples = [
|
|
20
|
-
'<%= config.bin %> commitments
|
|
21
|
-
'<%= config.bin %> commitments
|
|
18
|
+
'<%= config.bin %> commitments cadence-requests decide obj_abc123 req_xyz --approve',
|
|
19
|
+
'<%= config.bin %> commitments cadence-requests decide obj_abc123 req_xyz --reject',
|
|
22
20
|
];
|
|
23
21
|
static args = {
|
|
24
22
|
commitmentId: core_1.Args.string({ ignoreStdin: true, description: 'Commitment ID', required: true }),
|
|
25
23
|
requestId: core_1.Args.string({
|
|
26
24
|
ignoreStdin: true,
|
|
27
|
-
description: 'Pending
|
|
25
|
+
description: 'Pending cadence request ID',
|
|
28
26
|
required: true,
|
|
29
27
|
}),
|
|
30
28
|
};
|
|
31
29
|
static flags = {
|
|
32
30
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
33
|
-
approve: core_1.Flags.boolean({ description: 'Approve
|
|
31
|
+
approve: core_1.Flags.boolean({ description: 'Approve the cadence change', exclusive: ['reject'] }),
|
|
34
32
|
reject: core_1.Flags.boolean({ description: 'Reject the proposal', exclusive: ['approve'] }),
|
|
35
33
|
};
|
|
36
34
|
async run() {
|
|
37
35
|
this.requireAuth();
|
|
38
|
-
const { args, flags } = await this.parse(
|
|
36
|
+
const { args, flags } = await this.parse(CommitmentsCadenceRequestsDecide);
|
|
39
37
|
if (!flags.approve && !flags.reject) {
|
|
40
38
|
this.error('Pass --approve or --reject.');
|
|
41
39
|
}
|
|
42
40
|
let result;
|
|
43
41
|
try {
|
|
44
|
-
result = await commitments_1.commitmentApi.
|
|
42
|
+
result = await commitments_1.commitmentApi.decideCadenceRequest(args.commitmentId, args.requestId, Boolean(flags.approve));
|
|
45
43
|
}
|
|
46
44
|
catch (err) {
|
|
47
45
|
this.handleApiError(err);
|
|
@@ -51,8 +49,8 @@ class CommitmentsAutonomyRequestsDecide extends base_command_1.BaseCommand {
|
|
|
51
49
|
return;
|
|
52
50
|
}
|
|
53
51
|
this.log(flags.approve
|
|
54
|
-
? `Approved ${args.requestId} — the proposed
|
|
52
|
+
? `Approved ${args.requestId} — the proposed cadence was applied.`
|
|
55
53
|
: `Rejected ${args.requestId} — the cadence is unchanged.`);
|
|
56
54
|
}
|
|
57
55
|
}
|
|
58
|
-
exports.default =
|
|
56
|
+
exports.default = CommitmentsCadenceRequestsDecide;
|
|
@@ -32,7 +32,7 @@ export declare function resolveCostWindow(input?: {
|
|
|
32
32
|
* Money on this path has no other bound the operator can read: a Commitment's
|
|
33
33
|
* agent turns are `AgentOutcome` rows carrying no cost fields, so
|
|
34
34
|
* `spendLimitDailyUsd` cannot see them and `maxRunsPerDay` IS the spend control
|
|
35
|
-
* (see `
|
|
35
|
+
* (see `executionBudget.maxRunsPerDay` in the API's own schema note). This is
|
|
36
36
|
* the read that says what those runs actually cost.
|
|
37
37
|
*
|
|
38
38
|
* `metrics` shows the daily rows; this sums the closed ones over a window and,
|
|
@@ -50,7 +50,7 @@ function resolveCostWindow(input = {}, now = new Date()) {
|
|
|
50
50
|
* Money on this path has no other bound the operator can read: a Commitment's
|
|
51
51
|
* agent turns are `AgentOutcome` rows carrying no cost fields, so
|
|
52
52
|
* `spendLimitDailyUsd` cannot see them and `maxRunsPerDay` IS the spend control
|
|
53
|
-
* (see `
|
|
53
|
+
* (see `executionBudget.maxRunsPerDay` in the API's own schema note). This is
|
|
54
54
|
* the read that says what those runs actually cost.
|
|
55
55
|
*
|
|
56
56
|
* `metrics` shows the daily rows; this sums the closed ones over a window and,
|
|
@@ -26,11 +26,6 @@ export declare function createCadenceFromFlags({ eventDriven, cadence: cadenceIn
|
|
|
26
26
|
* be said out loud at the CLI boundary; otherwise a successful create response
|
|
27
27
|
* reads like the requested autonomy is live when something else is running.
|
|
28
28
|
*/
|
|
29
|
-
export declare function autonomyStagingNotice({ payload, commitment, bin, }: {
|
|
30
|
-
payload: Record<string, unknown>;
|
|
31
|
-
commitment: Record<string, unknown>;
|
|
32
|
-
bin: string;
|
|
33
|
-
}): string | undefined;
|
|
34
29
|
/**
|
|
35
30
|
* `skrr commitments create` — author a durable commitment contract.
|
|
36
31
|
*
|
|
@@ -70,11 +65,9 @@ export default class CommitmentsCreate extends BaseCommand {
|
|
|
70
65
|
'event-driven': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
71
66
|
'cadence-mode': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
72
67
|
timezone: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
73
|
-
mode: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
74
68
|
delivery: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
75
69
|
repo: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
76
70
|
base: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
77
|
-
autonomy: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
78
71
|
isolation: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
79
72
|
'max-nudges': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
80
73
|
'max-concurrent-runs': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|