@skrr-ai/cli 0.1.94 → 0.1.96
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 +175 -165
- package/bin/run.js +32 -0
- package/bin/update-npm-runner.cjs +33 -0
- package/bin/update-session.cjs +194 -0
- package/bin/update-worker.cjs +208 -0
- package/dist/base-command.js +0 -15
- package/dist/commands/agent/message/send.d.ts +2 -0
- package/dist/commands/agent/message/send.js +75 -5
- package/dist/commands/agents/chat.js +1 -1
- package/dist/commands/agents/create.d.ts +0 -3
- package/dist/commands/agents/create.js +0 -26
- package/dist/commands/agents/egress.d.ts +17 -0
- package/dist/commands/agents/egress.js +84 -0
- package/dist/commands/agents/mailbox/messages.d.ts +14 -0
- package/dist/commands/agents/mailbox/messages.js +52 -0
- package/dist/commands/agents/mailbox/show.d.ts +13 -0
- package/dist/commands/agents/mailbox/show.js +52 -0
- package/dist/commands/agents/operating-plan.js +8 -0
- package/dist/commands/agents/roles/capture.d.ts +16 -0
- package/dist/commands/agents/roles/capture.js +53 -0
- package/dist/commands/agents/roles/install.d.ts +1 -0
- package/dist/commands/agents/roles/install.js +8 -1
- package/dist/commands/agents/roles/preview.d.ts +2 -0
- package/dist/commands/agents/roles/preview.js +27 -3
- package/dist/commands/agents/update.d.ts +0 -3
- package/dist/commands/agents/update.js +1 -31
- package/dist/commands/agents/usage-cap.d.ts +4 -1
- package/dist/commands/agents/usage-cap.js +49 -10
- package/dist/commands/code/doctor.d.ts +1 -0
- package/dist/commands/code/doctor.js +6 -0
- package/dist/commands/code/index.js +4 -0
- package/dist/commands/code/install.d.ts +5 -62
- package/dist/commands/code/install.js +86 -279
- package/dist/commands/code/jobs/show.js +12 -0
- package/dist/commands/code/rollback.d.ts +8 -0
- package/dist/commands/code/rollback.js +20 -0
- package/dist/commands/code/update.d.ts +8 -37
- package/dist/commands/code/update.js +134 -213
- package/dist/commands/commitments/action-proposals/decide.d.ts +2 -0
- package/dist/commands/commitments/action-proposals/decide.js +12 -0
- package/dist/commands/commitments/action-proposals.js +7 -0
- package/dist/commands/commitments/create.d.ts +1 -0
- package/dist/commands/commitments/create.js +17 -1
- package/dist/commands/commitments/delivery.d.ts +1 -0
- package/dist/commands/commitments/delivery.js +11 -1
- package/dist/commands/commitments/doctor.js +4 -0
- package/dist/commands/commitments/effective-policy.js +26 -0
- package/dist/commands/commitments/endpoints/create.js +5 -2
- package/dist/commands/commitments/observations.d.ts +10 -0
- package/dist/commands/commitments/observations.js +88 -0
- package/dist/commands/commitments/pause.d.ts +1 -1
- package/dist/commands/commitments/pause.js +4 -3
- package/dist/commands/commitments/preflight.js +2 -1
- package/dist/commands/commitments/reports.d.ts +2 -0
- package/dist/commands/commitments/reports.js +22 -4
- package/dist/commands/commitments/update.d.ts +1 -0
- package/dist/commands/commitments/update.js +35 -5
- package/dist/commands/daemon/install.js +4 -0
- package/dist/commands/generate-recovery-code.d.ts +13 -1
- package/dist/commands/generate-recovery-code.js +146 -13
- package/dist/commands/grants/create.d.ts +1 -0
- package/dist/commands/grants/create.js +8 -0
- package/dist/commands/grants/rotate.d.ts +5 -0
- package/dist/commands/grants/rotate.js +13 -1
- package/dist/commands/grants/update.d.ts +12 -0
- package/dist/commands/grants/update.js +27 -0
- package/dist/commands/instructions/guide.d.ts +20 -0
- package/dist/commands/instructions/guide.js +84 -0
- package/dist/commands/instructions/install.js +57 -33
- package/dist/commands/instructions/setup.d.ts +14 -0
- package/dist/commands/instructions/setup.js +72 -0
- package/dist/commands/integrations/execute.js +1 -1
- package/dist/commands/login.d.ts +5 -6
- package/dist/commands/login.js +27 -11
- package/dist/commands/logout.js +7 -7
- package/dist/commands/machines/hosted/start.js +7 -1
- package/dist/commands/machines/list.js +4 -4
- package/dist/commands/measures/confirm.d.ts +1 -7
- package/dist/commands/measures/confirm.js +15 -14
- package/dist/commands/measures/list.d.ts +1 -7
- package/dist/commands/measures/list.js +1 -7
- package/dist/commands/measures/record.js +4 -4
- package/dist/commands/measures/show.d.ts +11 -0
- package/dist/commands/measures/show.js +26 -0
- package/dist/commands/northstars/governance/configure.d.ts +1 -0
- package/dist/commands/northstars/governance/configure.js +8 -1
- package/dist/commands/proposals/discard.d.ts +5 -0
- package/dist/commands/proposals/discard.js +8 -0
- package/dist/commands/proposals/keep.d.ts +5 -0
- package/dist/commands/proposals/keep.js +8 -0
- package/dist/commands/proposals/list.d.ts +15 -0
- package/dist/commands/proposals/list.js +74 -0
- package/dist/commands/proposals/show.d.ts +12 -0
- package/dist/commands/proposals/show.js +27 -0
- package/dist/commands/proposals/snooze.d.ts +5 -0
- package/dist/commands/proposals/snooze.js +8 -0
- package/dist/commands/security/overview.d.ts +11 -0
- package/dist/commands/security/overview.js +158 -0
- package/dist/commands/signals/monitors/create.d.ts +9 -0
- package/dist/commands/signals/monitors/create.js +29 -0
- package/dist/commands/signals/monitors/list.d.ts +8 -0
- package/dist/commands/signals/monitors/list.js +16 -0
- package/dist/commands/signals/monitors/pause.d.ts +11 -0
- package/dist/commands/signals/monitors/pause.js +17 -0
- package/dist/commands/signals/monitors/resume.d.ts +11 -0
- package/dist/commands/signals/monitors/resume.js +17 -0
- package/dist/commands/signals/monitors/revise.d.ts +12 -0
- package/dist/commands/signals/monitors/revise.js +25 -0
- package/dist/commands/signals/monitors/show.d.ts +11 -0
- package/dist/commands/signals/monitors/show.js +17 -0
- package/dist/commands/signals/monitors/test.d.ts +12 -0
- package/dist/commands/signals/monitors/test.js +25 -0
- package/dist/commands/signals/monitors/transitions.d.ts +11 -0
- package/dist/commands/signals/monitors/transitions.js +17 -0
- package/dist/commands/signals/monitors/validate.d.ts +9 -0
- package/dist/commands/signals/monitors/validate.js +24 -0
- package/dist/commands/signals/schemas/list.d.ts +8 -0
- package/dist/commands/signals/schemas/list.js +16 -0
- package/dist/commands/signals/schemas/show.d.ts +11 -0
- package/dist/commands/signals/schemas/show.js +17 -0
- package/dist/commands/signals/sources/list.d.ts +8 -0
- package/dist/commands/signals/sources/list.js +16 -0
- package/dist/commands/signals/sources/receipts.d.ts +11 -0
- package/dist/commands/signals/sources/receipts.js +17 -0
- package/dist/commands/signals/sources/show.d.ts +11 -0
- package/dist/commands/signals/sources/show.js +17 -0
- package/dist/commands/spaces/claim.d.ts +12 -0
- package/dist/commands/spaces/claim.js +42 -0
- package/dist/commands/spaces/ownership.d.ts +12 -0
- package/dist/commands/spaces/ownership.js +46 -0
- package/dist/commands/spaces/usage.d.ts +12 -0
- package/dist/commands/spaces/usage.js +28 -0
- package/dist/commands/spaces/workflows/run.js +3 -0
- package/dist/commands/spaces/workflows/runs.js +2 -1
- package/dist/commands/spaces/workflows/update.d.ts +6 -1
- package/dist/commands/spaces/workflows/update.js +34 -2
- package/dist/commands/tasks/cancel-cascade.js +1 -1
- package/dist/commands/tasks/cascade-status.d.ts +2 -0
- package/dist/commands/tasks/cascade-status.js +27 -1
- package/dist/commands/tasks/create-tree.d.ts +5 -1
- package/dist/commands/tasks/create-tree.js +35 -7
- package/dist/commands/tasks/create.d.ts +4 -0
- package/dist/commands/tasks/create.js +16 -0
- package/dist/commands/tasks/deliverable/add.js +12 -3
- package/dist/commands/tasks/economics-compare.d.ts +15 -0
- package/dist/commands/tasks/economics-compare.js +60 -0
- package/dist/commands/tasks/expectations/evaluate.d.ts +13 -0
- package/dist/commands/tasks/expectations/evaluate.js +43 -0
- package/dist/commands/tasks/interrupt.js +2 -2
- package/dist/commands/tasks/list.d.ts +1 -0
- package/dist/commands/tasks/list.js +44 -1
- package/dist/commands/tasks/pause-schedule.js +1 -1
- package/dist/commands/tasks/show.d.ts +5 -0
- package/dist/commands/tasks/show.js +17 -0
- package/dist/commands/tasks/update.d.ts +4 -0
- package/dist/commands/tasks/update.js +9 -0
- package/dist/commands/tasks/workflow-findings.js +2 -2
- package/dist/commands/token/list.d.ts +3 -5
- package/dist/commands/token/list.js +99 -57
- package/dist/commands/triggers/create.d.ts +2 -0
- package/dist/commands/triggers/create.js +15 -0
- package/dist/commands/update.d.ts +14 -0
- package/dist/commands/update.js +61 -0
- package/dist/commands/workspaces/grants.d.ts +12 -0
- package/dist/commands/workspaces/grants.js +31 -0
- package/dist/commands/workspaces/stewardship.d.ts +13 -0
- package/dist/commands/workspaces/stewardship.js +34 -0
- package/dist/generated/managed-instruction-guides.json +9 -0
- package/dist/hooks/init.d.ts +5 -0
- package/dist/hooks/init.js +27 -0
- package/dist/lib/agent-config.d.ts +0 -12
- package/dist/lib/agent-config.js +1 -27
- package/dist/lib/agent-mailbox.d.ts +35 -0
- package/dist/lib/agent-mailbox.js +55 -0
- package/dist/lib/commitment-endpoints.d.ts +2 -1
- package/dist/lib/commitment-endpoints.js +2 -5
- package/dist/lib/commitment-product.d.ts +3 -1
- package/dist/lib/commitment-product.js +10 -0
- package/dist/lib/commitment-terms.js +1 -1
- package/dist/lib/commitments.d.ts +17 -15
- package/dist/lib/commitments.js +173 -137
- package/dist/lib/compasses.d.ts +14 -0
- package/dist/lib/compasses.js +25 -11
- package/dist/lib/daemon-installer.d.ts +2 -0
- package/dist/lib/daemon-installer.js +100 -24
- package/dist/lib/first-party-harness-doctor.js +31 -1
- package/dist/lib/first-party-harness-remote-install.d.ts +71 -0
- package/dist/lib/first-party-harness-remote-install.js +310 -0
- package/dist/lib/first-party-harness-remote-update.d.ts +46 -0
- package/dist/lib/first-party-harness-remote-update.js +242 -0
- package/dist/lib/first-party-harness-startup-update.d.ts +26 -0
- package/dist/lib/first-party-harness-startup-update.js +166 -0
- package/dist/lib/first-party-harness-update.d.ts +46 -0
- package/dist/lib/first-party-harness-update.js +289 -0
- package/dist/lib/first-party-harness.js +7 -4
- package/dist/lib/grants.d.ts +5 -1
- package/dist/lib/grants.js +9 -1
- package/dist/lib/hosted-machines.d.ts +7 -0
- package/dist/lib/mailbox-human-command.d.ts +11 -0
- package/dist/lib/mailbox-human-command.js +41 -0
- package/dist/lib/managed-instruction-local.d.ts +12 -0
- package/dist/lib/managed-instruction-local.js +58 -0
- package/dist/lib/managed-instruction-setup.d.ts +35 -0
- package/dist/lib/managed-instruction-setup.js +306 -0
- package/dist/lib/measures.d.ts +28 -2
- package/dist/lib/measures.js +38 -14
- package/dist/lib/memory-sync.d.ts +1 -0
- package/dist/lib/memory-sync.js +279 -68
- package/dist/lib/message-intent.d.ts +6 -2
- package/dist/lib/message-intent.js +1 -0
- package/dist/lib/northstars.js +2 -1
- package/dist/lib/platform-update-local.d.ts +2 -0
- package/dist/lib/platform-update-local.js +113 -0
- package/dist/lib/platform-update.d.ts +39 -0
- package/dist/lib/platform-update.js +84 -0
- package/dist/lib/profile-machine-identity-guard.d.ts +2 -0
- package/dist/lib/profile-machine-identity-guard.js +13 -0
- package/dist/lib/prompt.d.ts +1 -0
- package/dist/lib/prompt.js +4 -3
- package/dist/lib/proposal-decision-command.d.ts +19 -0
- package/dist/lib/proposal-decision-command.js +64 -0
- package/dist/lib/proposals.d.ts +8 -0
- package/dist/lib/proposals.js +22 -0
- package/dist/lib/roles.d.ts +141 -6
- package/dist/lib/roles.js +8 -2
- package/dist/lib/signals.d.ts +20 -0
- package/dist/lib/signals.js +24 -0
- package/dist/lib/space-usage.d.ts +3 -0
- package/dist/lib/space-usage.js +17 -0
- package/dist/lib/stewardship-output.d.ts +4 -0
- package/dist/lib/stewardship-output.js +82 -0
- package/dist/lib/task-asset-upload.d.ts +3 -1
- package/dist/lib/task-asset-upload.js +1 -0
- package/dist/lib/task-batch.d.ts +9 -0
- package/dist/lib/task-batch.js +94 -17
- package/dist/lib/task-economics.d.ts +16 -0
- package/dist/lib/task-economics.js +22 -0
- package/dist/lib/task-instruction-offer.d.ts +1 -4
- package/dist/lib/task-instruction-offer.js +3 -129
- package/dist/lib/triggers.d.ts +11 -3
- package/dist/lib/triggers.js +58 -1
- package/dist/lib/update-check.d.ts +61 -53
- package/dist/lib/update-check.js +453 -314
- package/dist/lib/usage-discovery.d.ts +10 -0
- package/dist/lib/usage-discovery.js +24 -3
- package/dist/lib/workflow-run-budget.d.ts +12 -0
- package/dist/lib/workflow-run-budget.js +37 -0
- package/dist/lib/workspaces.d.ts +48 -0
- package/dist/lib/workspaces.js +8 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.d.ts +4 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.js +14 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.d.ts +3 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.js +3 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessReleaseKeys.d.ts +82 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessReleaseKeys.js +105 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessUpdater.d.ts +110 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessUpdater.js +945 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/githubPushRefusal.d.ts +9 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/githubPushRefusal.js +49 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessPermissionControls.d.ts +32 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessPermissionControls.js +62 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +4 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.js +35 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releasePolicy.d.ts +63 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releasePolicy.js +169 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseVersions.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseVersions.js +44 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.d.ts +4 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.js +12 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.d.ts +3 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.js +3 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessReleaseKeys.d.ts +82 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessReleaseKeys.js +102 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessUpdater.d.ts +110 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessUpdater.js +923 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/githubPushRefusal.d.ts +9 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/githubPushRefusal.js +44 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessPermissionControls.d.ts +32 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessPermissionControls.js +59 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.js +35 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releasePolicy.d.ts +63 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releasePolicy.js +163 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseVersions.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseVersions.js +41 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +41 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +8069 -7121
- package/docs/v1/README.md +28 -0
- package/docs/v1/api.md +55 -0
- package/docs/v1/changelog.md +16 -0
- package/docs/v1/check-examples.mjs +178 -0
- package/docs/v1/examples/api-readonly.mjs +144 -0
- package/docs/v1/operations.md +87 -0
- package/docs/v1/quickstart.md +71 -0
- package/oclif.manifest.json +49424 -46174
- package/package.json +34 -11
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
class AgentsEgress extends base_command_1.BaseCommand {
|
|
7
|
+
static description = 'Show or declare the exact hosts and repositories a hosted agent may use on its next start';
|
|
8
|
+
static args = { id: core_1.Args.string({ required: true, ignoreStdin: true }) };
|
|
9
|
+
static flags = {
|
|
10
|
+
allow: core_1.Flags.string({ multiple: true, exclusive: ['clear'] }),
|
|
11
|
+
remove: core_1.Flags.string({ multiple: true, exclusive: ['clear'] }),
|
|
12
|
+
repo: core_1.Flags.string({
|
|
13
|
+
multiple: true,
|
|
14
|
+
exclusive: ['clear'],
|
|
15
|
+
description: 'Allow a repository (owner/name) for Hosted Jobs',
|
|
16
|
+
}),
|
|
17
|
+
'remove-repo': core_1.Flags.string({ multiple: true, exclusive: ['clear'] }),
|
|
18
|
+
reason: core_1.Flags.string({ exclusive: ['clear'] }),
|
|
19
|
+
clear: core_1.Flags.boolean({
|
|
20
|
+
exclusive: ['allow', 'remove', 'repo', 'remove-repo', 'reason'],
|
|
21
|
+
description: 'Delete the whole declaration: hosts and repositories',
|
|
22
|
+
}),
|
|
23
|
+
json: core_1.Flags.boolean(),
|
|
24
|
+
};
|
|
25
|
+
async run() {
|
|
26
|
+
this.requireAuth();
|
|
27
|
+
const { args, flags } = await this.parse(AgentsEgress);
|
|
28
|
+
try {
|
|
29
|
+
let result = await data_provider_1.dataService.getAgentEgress(args.id);
|
|
30
|
+
if (flags.clear)
|
|
31
|
+
result = await data_provider_1.dataService.clearAgentEgress(args.id);
|
|
32
|
+
else if (flags.allow ||
|
|
33
|
+
flags.remove ||
|
|
34
|
+
flags.repo ||
|
|
35
|
+
flags['remove-repo'] ||
|
|
36
|
+
flags.reason !== undefined) {
|
|
37
|
+
const remove = new Set((0, data_provider_1.normalizeAgentEgressHosts)(flags.remove || []));
|
|
38
|
+
const hosts = (0, data_provider_1.normalizeAgentEgressHosts)([
|
|
39
|
+
...(result.declaration?.hosts || []),
|
|
40
|
+
...(flags.allow || []),
|
|
41
|
+
]).filter((host) => !remove.has(host));
|
|
42
|
+
// Repositories are sent only when this call changes them, so a hosts-only
|
|
43
|
+
// edit can never rewrite a list another surface set.
|
|
44
|
+
const touchesRepositories = Boolean(flags.repo || flags['remove-repo']);
|
|
45
|
+
const removeRepos = new Set((0, data_provider_1.normalizeAgentRepositories)(flags['remove-repo'] || []));
|
|
46
|
+
const repositories = touchesRepositories
|
|
47
|
+
? (0, data_provider_1.normalizeAgentRepositories)([
|
|
48
|
+
...(result.declaration?.repositories || []),
|
|
49
|
+
...(flags.repo || []),
|
|
50
|
+
]).filter((repository) => !removeRepos.has(repository))
|
|
51
|
+
: undefined;
|
|
52
|
+
result = await data_provider_1.dataService.setAgentEgress(args.id, {
|
|
53
|
+
hosts,
|
|
54
|
+
...(repositories ? { repositories } : {}),
|
|
55
|
+
...(flags.reason !== undefined ? { reason: flags.reason } : {}),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (flags.json) {
|
|
59
|
+
this.log(JSON.stringify(result, null, 2));
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const repositories = result.declaration?.repositories;
|
|
63
|
+
this.log(repositories?.length
|
|
64
|
+
? `Repositories: ${repositories.join(', ')} (Hosted Jobs and Commitment deliveries may use only these; git_commit push is not enabled in production turns and, when enabled, is bounded by them too; raw git in a shell is not limited by it)`
|
|
65
|
+
: 'Repositories: none declared (no restriction)');
|
|
66
|
+
if (!('policy' in result.effective)) {
|
|
67
|
+
this.log('Effective network unavailable: the workspace policy could not be read.');
|
|
68
|
+
this.log(data_provider_1.AGENT_EGRESS_EXPLANATION);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
this.log(`Network: ${result.effective.policy} (${result.effective.source}; ${result.effective.hosts.length} hosts)`);
|
|
72
|
+
this.log(result.effective.hosts.join(', '));
|
|
73
|
+
if (result.effective.droppedHosts.length)
|
|
74
|
+
this.log(`Workspace policy dropped: ${result.effective.droppedHosts.join(', ')}`);
|
|
75
|
+
if (result.effective.unreadable)
|
|
76
|
+
this.log('Declaration or ceiling unreadable: baseline only.');
|
|
77
|
+
this.log(data_provider_1.AGENT_EGRESS_EXPLANATION);
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
this.handleApiError(error);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.default = AgentsEgress;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MailboxHumanCommand } from '../../../lib/mailbox-human-command';
|
|
2
|
+
export default class AgentsMailboxMessages extends MailboxHumanCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
limit: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
cursor: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const mailbox_human_command_1 = require("../../../lib/mailbox-human-command");
|
|
5
|
+
const agent_mailbox_1 = require("../../../lib/agent-mailbox");
|
|
6
|
+
class AgentsMailboxMessages extends mailbox_human_command_1.MailboxHumanCommand {
|
|
7
|
+
static description = 'List received mailbox message metadata (human operator only; view content in agent settings)';
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> agents mailbox messages <agent-id> --json',
|
|
10
|
+
'<%= config.bin %> agents mailbox messages <agent-id> --limit 25 --cursor <cursor>',
|
|
11
|
+
];
|
|
12
|
+
static args = {
|
|
13
|
+
id: core_1.Args.string({ description: 'Agent ID', required: true, ignoreStdin: true }),
|
|
14
|
+
};
|
|
15
|
+
static flags = {
|
|
16
|
+
json: core_1.Flags.boolean({ description: 'Output message metadata and nextCursor as JSON' }),
|
|
17
|
+
limit: core_1.Flags.integer({
|
|
18
|
+
description: 'Messages per page (1–100)',
|
|
19
|
+
default: 25,
|
|
20
|
+
min: 1,
|
|
21
|
+
max: 100,
|
|
22
|
+
}),
|
|
23
|
+
cursor: core_1.Flags.string({ description: 'Opaque nextCursor from a previous page' }),
|
|
24
|
+
};
|
|
25
|
+
async run() {
|
|
26
|
+
this.requireHumanMailboxAuth();
|
|
27
|
+
const { args, flags } = await this.parse(AgentsMailboxMessages);
|
|
28
|
+
let result;
|
|
29
|
+
try {
|
|
30
|
+
result = await (0, agent_mailbox_1.getAgentMailboxMessageMetadata)(args.id, {
|
|
31
|
+
limit: flags.limit,
|
|
32
|
+
cursor: flags.cursor,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
this.handleApiError(error);
|
|
37
|
+
}
|
|
38
|
+
if (flags.json) {
|
|
39
|
+
this.log(JSON.stringify(result, null, 2));
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (result.data.length === 0)
|
|
43
|
+
this.log('No received messages on this page.');
|
|
44
|
+
for (const message of result.data) {
|
|
45
|
+
this.log(`${message.id} ${message.receivedAt} ${message.classification} ${message.status}`);
|
|
46
|
+
}
|
|
47
|
+
if (result.nextCursor)
|
|
48
|
+
this.log(`Next cursor: ${result.nextCursor}`);
|
|
49
|
+
this.log('Read mail content in the mailbox tab in agent settings.');
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.default = AgentsMailboxMessages;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MailboxHumanCommand } from '../../../lib/mailbox-human-command';
|
|
2
|
+
export default class AgentsMailboxShow extends MailboxHumanCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static aliases: string[];
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {
|
|
7
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const mailbox_human_command_1 = require("../../../lib/mailbox-human-command");
|
|
5
|
+
const agent_mailbox_1 = require("../../../lib/agent-mailbox");
|
|
6
|
+
class AgentsMailboxShow extends mailbox_human_command_1.MailboxHumanCommand {
|
|
7
|
+
static description = "Show an agent's mailbox status and address (human operator only)";
|
|
8
|
+
static aliases = ['agents:mailbox:status'];
|
|
9
|
+
static examples = [
|
|
10
|
+
'<%= config.bin %> agents mailbox show <agent-id>',
|
|
11
|
+
'<%= config.bin %> agents mailbox status <agent-id> --json',
|
|
12
|
+
];
|
|
13
|
+
static args = {
|
|
14
|
+
id: core_1.Args.string({ description: 'Agent ID', required: true, ignoreStdin: true }),
|
|
15
|
+
};
|
|
16
|
+
static flags = { json: core_1.Flags.boolean({ description: 'Output metadata as JSON' }) };
|
|
17
|
+
async run() {
|
|
18
|
+
this.requireHumanMailboxAuth();
|
|
19
|
+
const { args, flags } = await this.parse(AgentsMailboxShow);
|
|
20
|
+
let result;
|
|
21
|
+
try {
|
|
22
|
+
result = await (0, agent_mailbox_1.getAgentMailboxMetadata)(args.id);
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
this.handleApiError(error);
|
|
26
|
+
}
|
|
27
|
+
if (flags.json) {
|
|
28
|
+
this.log(JSON.stringify(result, null, 2));
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const receiving = result.receivingRuntime?.status;
|
|
32
|
+
this.log(receiving === 'running'
|
|
33
|
+
? 'Incoming processing: running (DNS and SMTP delivery are not verified by this command).'
|
|
34
|
+
: receiving === 'starting'
|
|
35
|
+
? 'Incoming processing: starting. Refresh before using a recovery address.'
|
|
36
|
+
: receiving === 'unavailable'
|
|
37
|
+
? 'Incoming processing: unavailable. Do not use this address for account recovery until receiving is restored.'
|
|
38
|
+
: 'Incoming processing: unverified. Refresh before using a recovery address.');
|
|
39
|
+
if (!result.mailbox) {
|
|
40
|
+
this.log('No mailbox provisioned. Configure the mailbox in the agent settings.');
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this.log(`Address: ${result.mailbox.address}`);
|
|
44
|
+
this.log(`Address lifecycle: ${result.mailbox.status}`);
|
|
45
|
+
this.log(`Sending: ${result.mailbox.sending}`);
|
|
46
|
+
if (result.mailbox.sendingPausedReason) {
|
|
47
|
+
this.log(`Sending paused: ${result.mailbox.sendingPausedReason}`);
|
|
48
|
+
}
|
|
49
|
+
this.log(`Version: ${result.mailbox.version}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.default = AgentsMailboxShow;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
3
4
|
const core_1 = require("@oclif/core");
|
|
4
5
|
const base_command_1 = require("../../base-command");
|
|
5
6
|
const roles_1 = require("../../lib/roles");
|
|
@@ -26,6 +27,13 @@ class AgentOperatingPlan extends base_command_1.BaseCommand {
|
|
|
26
27
|
this.log(` Responsibility: ${r.purpose}`);
|
|
27
28
|
this.log(` Evidence: ${r.evidence.status}${r.evidence.issues?.length ? ` (${r.evidence.issues.join(', ')})` : ''}`);
|
|
28
29
|
this.log(" Execution authority: tools, sandbox and approvals use the Agent's runtime permissions.");
|
|
30
|
+
for (const observation of r.evidenceAuthority?.observations || []) {
|
|
31
|
+
const comparison = (0, data_provider_1.describeObservationChange)({
|
|
32
|
+
...observation.serverComparison,
|
|
33
|
+
changeReason: observation.serverComparison.reason,
|
|
34
|
+
});
|
|
35
|
+
this.log(` Observation: ${observation.key} — ${comparison.reason}${comparison.progress ? ` ${comparison.progress}` : ''}${comparison.reference ? `; ${comparison.reference}` : ''} (AGENT-REPORTED)`);
|
|
36
|
+
}
|
|
29
37
|
for (const q of r.inquiries)
|
|
30
38
|
this.log(` Inquiry: ${q.question} [${q.status}] — ${q.decisionImpact}`);
|
|
31
39
|
for (const w of r.work)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class RolesCapture 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
|
+
key: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
title: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
commitment: import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
compass: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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 RolesCapture extends base_command_1.BaseCommand {
|
|
8
|
+
static description = 'Capture selected owner responsibilities as a portable role draft with explicit omissions';
|
|
9
|
+
static args = {
|
|
10
|
+
id: core_1.Args.string({ required: true, ignoreStdin: true, description: 'Agent ID' }),
|
|
11
|
+
};
|
|
12
|
+
static flags = {
|
|
13
|
+
key: core_1.Flags.string({ required: true, description: 'Portable role key' }),
|
|
14
|
+
title: core_1.Flags.string({ required: true, description: 'Role title' }),
|
|
15
|
+
commitment: core_1.Flags.string({
|
|
16
|
+
required: true,
|
|
17
|
+
multiple: true,
|
|
18
|
+
description: 'Responsibility ID (repeat for each)',
|
|
19
|
+
}),
|
|
20
|
+
compass: core_1.Flags.string({ description: 'Compass to capture' }),
|
|
21
|
+
output: core_1.Flags.string({ description: 'Save portable spec JSON for review' }),
|
|
22
|
+
json: core_1.Flags.boolean({ description: 'Output draft and omissions as JSON' }),
|
|
23
|
+
};
|
|
24
|
+
async run() {
|
|
25
|
+
this.requireAuth();
|
|
26
|
+
const { args, flags } = await this.parse(RolesCapture);
|
|
27
|
+
try {
|
|
28
|
+
const result = await roles_1.roleApi.capture(args.id, {
|
|
29
|
+
key: flags.key,
|
|
30
|
+
title: flags.title,
|
|
31
|
+
commitmentIds: flags.commitment,
|
|
32
|
+
...(flags.compass ? { compassId: flags.compass } : {}),
|
|
33
|
+
});
|
|
34
|
+
if (flags.output)
|
|
35
|
+
(0, node_fs_1.writeFileSync)(flags.output, `${JSON.stringify(result.spec, null, 2)}\n`, { mode: 0o600 });
|
|
36
|
+
if (flags.json) {
|
|
37
|
+
this.log(JSON.stringify(result, null, 2));
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
this.log(`Captured ${result.spec.title}; review before installation.`);
|
|
41
|
+
for (const omission of result.omitted)
|
|
42
|
+
this.log(`Omitted ${omission.responsibilityKey || 'role'}.${omission.field}: ${omission.reason}`);
|
|
43
|
+
for (const prerequisite of result.prerequisites)
|
|
44
|
+
this.log(prerequisite);
|
|
45
|
+
if (flags.output)
|
|
46
|
+
this.log(`Portable draft saved to ${flags.output}.`);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
this.handleApiError(error);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.default = RolesCapture;
|
|
@@ -6,6 +6,7 @@ export default class RolesInstall extends BaseCommand {
|
|
|
6
6
|
};
|
|
7
7
|
static flags: {
|
|
8
8
|
preview: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
'confirm-rule-conflict': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
10
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
};
|
|
11
12
|
run(): Promise<void>;
|
|
@@ -13,6 +13,10 @@ class RolesInstall extends base_command_1.BaseCommand {
|
|
|
13
13
|
required: true,
|
|
14
14
|
description: 'Server-generated preview JSON saved by agents roles preview',
|
|
15
15
|
}),
|
|
16
|
+
'confirm-rule-conflict': core_1.Flags.string({
|
|
17
|
+
multiple: true,
|
|
18
|
+
description: 'Rule id the role revision changed or removes and you also edited: overwrite or delete your edit (shown as conflicts_with_owner_edit or removed_owner_edited in the preview)',
|
|
19
|
+
}),
|
|
16
20
|
json: core_1.Flags.boolean({ description: 'Output the installation receipt as JSON' }),
|
|
17
21
|
};
|
|
18
22
|
async run() {
|
|
@@ -21,7 +25,10 @@ class RolesInstall extends base_command_1.BaseCommand {
|
|
|
21
25
|
try {
|
|
22
26
|
const preview = (0, roles_1.readRoleJson)(flags.preview);
|
|
23
27
|
(0, roles_1.assertRolePreview)(preview);
|
|
24
|
-
const
|
|
28
|
+
const confirmed = flags['confirm-rule-conflict'] ?? [];
|
|
29
|
+
const receipt = confirmed.length
|
|
30
|
+
? await roles_1.roleApi.install(args.id, preview, confirmed)
|
|
31
|
+
: await roles_1.roleApi.install(args.id, preview);
|
|
25
32
|
if (flags.json)
|
|
26
33
|
this.log(JSON.stringify(receipt, null, 2));
|
|
27
34
|
else {
|
|
@@ -6,6 +6,8 @@ export default class RolesPreview extends BaseCommand {
|
|
|
6
6
|
};
|
|
7
7
|
static flags: {
|
|
8
8
|
file: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
params: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
endpoints: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
11
|
bindings: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
12
|
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
13
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
@@ -11,7 +11,11 @@ class RolesPreview extends base_command_1.BaseCommand {
|
|
|
11
11
|
};
|
|
12
12
|
static flags = {
|
|
13
13
|
file: core_1.Flags.string({ required: true, description: 'Role operating spec JSON file' }),
|
|
14
|
-
|
|
14
|
+
params: core_1.Flags.string({ description: 'JSON file of typed parameter values' }),
|
|
15
|
+
endpoints: core_1.Flags.string({
|
|
16
|
+
description: 'JSON file of endpoint slot → owned endpoint ID bindings',
|
|
17
|
+
}),
|
|
18
|
+
bindings: core_1.Flags.string({ description: 'JSON file of context slot → accessible target ID bindings' }),
|
|
15
19
|
output: core_1.Flags.string({ description: 'Save the server preview for review and installation' }),
|
|
16
20
|
json: core_1.Flags.boolean({ description: 'Output the complete preview as JSON' }),
|
|
17
21
|
};
|
|
@@ -19,7 +23,7 @@ class RolesPreview extends base_command_1.BaseCommand {
|
|
|
19
23
|
this.requireAuth();
|
|
20
24
|
const { args, flags } = await this.parse(RolesPreview);
|
|
21
25
|
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) : {});
|
|
26
|
+
const result = await roles_1.roleApi.preview(args.id, (0, roles_1.readRoleJson)(flags.file), flags.bindings ? (0, roles_1.readRoleJson)(flags.bindings) : {}, flags.params ? (0, roles_1.readRoleJson)(flags.params) : {}, flags.endpoints ? (0, roles_1.readRoleJson)(flags.endpoints) : {});
|
|
23
27
|
if (flags.output)
|
|
24
28
|
(0, node_fs_1.writeFileSync)(flags.output, `${JSON.stringify(result, null, 2)}\n`, { mode: 0o600 });
|
|
25
29
|
if (flags.json) {
|
|
@@ -28,8 +32,28 @@ class RolesPreview extends base_command_1.BaseCommand {
|
|
|
28
32
|
}
|
|
29
33
|
this.log(`${result.spec.title} — revision ${result.spec.revision}`);
|
|
30
34
|
this.log(`Compass ${result.compass.id}: archived; expected version ${result.expectedCompassVersion}`);
|
|
31
|
-
for (const change of result.changes)
|
|
35
|
+
for (const change of result.changes) {
|
|
32
36
|
this.log(` ${change.title}: ${change.change}`);
|
|
37
|
+
// Governance is ratified by installing this reviewed preview, so each
|
|
38
|
+
// owned leaf is shown with what it replaces and whether it loosens.
|
|
39
|
+
for (const field of change.governance || [])
|
|
40
|
+
this.log(` ${field.path}: ${field.change}${field.ownerModified ? '; owner modified' : ''} — ${JSON.stringify(field.current)} → ${JSON.stringify(field.next)}`);
|
|
41
|
+
}
|
|
42
|
+
for (const responsibility of (result.resolvedSpec || result.spec).responsibilities)
|
|
43
|
+
this.log(` directive ${responsibility.key}: ${responsibility.directive || '(none)'}`);
|
|
44
|
+
for (const endpoint of result.endpoints || [])
|
|
45
|
+
this.log(` endpoint ${endpoint.label}: ${endpoint.status}`);
|
|
46
|
+
// Enforced rules the role owns: anything the owner has touched is called out.
|
|
47
|
+
const ruleAdvice = (rule) => {
|
|
48
|
+
if (rule.change === 'conflicts_with_owner_edit')
|
|
49
|
+
return ` — you edited it and this revision changes it; install with --confirm-rule-conflict ${rule.id} to overwrite your edit`;
|
|
50
|
+
if (rule.change === 'removed_owner_edited')
|
|
51
|
+
return ` — you edited it and this revision removes it; install with --confirm-rule-conflict ${rule.id} to delete it`;
|
|
52
|
+
return '';
|
|
53
|
+
};
|
|
54
|
+
for (const rule of result.ruleChanges || [])
|
|
55
|
+
if (rule.change !== 'unchanged')
|
|
56
|
+
this.log(` rule ${rule.id}: ${rule.change}${rule.ownerStatus ? ` (owner status: ${rule.ownerStatus})` : ''}${ruleAdvice(rule)}`);
|
|
33
57
|
for (const removed of result.removedResponsibilities)
|
|
34
58
|
this.log(` ${removed.key}: pause removed responsibility`);
|
|
35
59
|
for (const ctx of result.contexts)
|
|
@@ -45,9 +45,6 @@ export default class AgentsUpdate extends BaseCommand {
|
|
|
45
45
|
avatar: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
46
46
|
'conversation-starter': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
47
47
|
'todo-working-hours': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
48
|
-
'reasoning-tool-escape': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
49
|
-
'commitment-responsibility': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
50
|
-
'commitment-responsibility-ceiling': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
51
48
|
'max-turns': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
52
49
|
'tool-resources': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
53
50
|
'install-channel': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -116,32 +116,6 @@ class AgentsUpdate extends base_command_1.BaseCommand {
|
|
|
116
116
|
description: 'When this agent schedules its own work: HH:MM-HH:MM[@<IANA timezone>], e.g. ' +
|
|
117
117
|
'09:00-18:00@America/Los_Angeles',
|
|
118
118
|
}),
|
|
119
|
-
// Retired (OSK-11975): a Commitment turn works under the Agent's own
|
|
120
|
-
// permissions. Hidden, warned on use, and never sent (OSK-12068) — see
|
|
121
|
-
// `mergeAgentConfigFlags`. Kept parseable so an old script still runs.
|
|
122
|
-
'reasoning-tool-escape': core_1.Flags.string({
|
|
123
|
-
description: "Retired — has no effect and is not sent. Commitment runs use the agent's own permissions.",
|
|
124
|
-
options: [...agent_config_1.REASONING_TOOL_ESCAPES],
|
|
125
|
-
multiple: true,
|
|
126
|
-
deprecated: { message: (0, agent_config_1.retiredCommitmentPermissionFlagMessage)('reasoning-tool-escape') },
|
|
127
|
-
hidden: true,
|
|
128
|
-
}),
|
|
129
|
-
'commitment-responsibility': core_1.Flags.string({
|
|
130
|
-
description: "Retired — has no effect and is not sent. Commitment runs use the agent's own permissions.",
|
|
131
|
-
options: [...agent_config_1.COMMITMENT_RESPONSIBILITY_LEVELS],
|
|
132
|
-
deprecated: {
|
|
133
|
-
message: (0, agent_config_1.retiredCommitmentPermissionFlagMessage)('commitment-responsibility'),
|
|
134
|
-
},
|
|
135
|
-
hidden: true,
|
|
136
|
-
}),
|
|
137
|
-
'commitment-responsibility-ceiling': core_1.Flags.string({
|
|
138
|
-
description: "Retired — has no effect and is not sent. Commitment runs use the agent's own permissions.",
|
|
139
|
-
options: [...agent_config_1.COMMITMENT_RESPONSIBILITY_LEVELS],
|
|
140
|
-
deprecated: {
|
|
141
|
-
message: (0, agent_config_1.retiredCommitmentPermissionFlagMessage)('commitment-responsibility-ceiling'),
|
|
142
|
-
},
|
|
143
|
-
hidden: true,
|
|
144
|
-
}),
|
|
145
119
|
'max-turns': core_1.Flags.integer({ description: 'Maximum turns in one agent run (1-500)' }),
|
|
146
120
|
'tool-resources': core_1.Flags.string({
|
|
147
121
|
description: 'Tool resources JSON object (file_search / context / image_edit bindings)',
|
|
@@ -210,11 +184,7 @@ class AgentsUpdate extends base_command_1.BaseCommand {
|
|
|
210
184
|
this.error(err.message, { exit: 1 });
|
|
211
185
|
}
|
|
212
186
|
if (Object.keys(payload).length === 0) {
|
|
213
|
-
|
|
214
|
-
this.error(retired.length > 0
|
|
215
|
-
? `Nothing to update: ${retired.map((flag) => `--${flag}`).join(', ')} ` +
|
|
216
|
-
`${retired.length === 1 ? 'is' : 'are'} retired and not sent. ${agent_config_1.COMMITMENT_PERMISSION_FLAG_RETIRED}`
|
|
217
|
-
: 'Nothing to update. Pass at least one flag (e.g. --name) or --from-json.', { exit: 1 });
|
|
187
|
+
this.error('Nothing to update. Pass at least one flag (e.g. --name) or --from-json.', { exit: 1 });
|
|
218
188
|
}
|
|
219
189
|
let updated;
|
|
220
190
|
try {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from '../../base-command';
|
|
2
2
|
/**
|
|
3
|
-
* YOUR monthly cap on ONE agent's hosted spend (C11), enforced where each of
|
|
3
|
+
* YOUR daily and/or monthly cap on ONE agent's hosted spend (C11), enforced where each of
|
|
4
4
|
* your hosted Agent SDK runs of it starts. It counts and bounds only the runs
|
|
5
5
|
* billed to you. For a Store agent, pass your installed copy's id — the cap is
|
|
6
6
|
* on the agent that runs, not on the publisher's listing.
|
|
@@ -13,7 +13,10 @@ export default class AgentsUsageCap extends BaseCommand {
|
|
|
13
13
|
};
|
|
14
14
|
static flags: {
|
|
15
15
|
set: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
|
+
daily: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
17
|
clear: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
18
|
+
'clear-daily': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
19
|
+
'clear-monthly': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
20
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
18
21
|
};
|
|
19
22
|
run(): Promise<void>;
|
|
@@ -4,16 +4,18 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
5
|
const base_command_1 = require("../../base-command");
|
|
6
6
|
/**
|
|
7
|
-
* YOUR monthly cap on ONE agent's hosted spend (C11), enforced where each of
|
|
7
|
+
* YOUR daily and/or monthly cap on ONE agent's hosted spend (C11), enforced where each of
|
|
8
8
|
* your hosted Agent SDK runs of it starts. It counts and bounds only the runs
|
|
9
9
|
* billed to you. For a Store agent, pass your installed copy's id — the cap is
|
|
10
10
|
* on the agent that runs, not on the publisher's listing.
|
|
11
11
|
*/
|
|
12
12
|
class AgentsUsageCap extends base_command_1.BaseCommand {
|
|
13
|
-
static description = 'Show, set or remove your monthly hosted-spend cap on an agent';
|
|
13
|
+
static description = 'Show, set or remove your daily or monthly hosted-spend cap on an agent';
|
|
14
14
|
static examples = [
|
|
15
15
|
'<%= config.bin %> agents usage-cap <agent-id>',
|
|
16
16
|
'<%= config.bin %> agents usage-cap <agent-id> --set 20',
|
|
17
|
+
'<%= config.bin %> agents usage-cap <agent-id> --daily 2 --set 20',
|
|
18
|
+
'<%= config.bin %> agents usage-cap <agent-id> --clear-daily',
|
|
17
19
|
'<%= config.bin %> agents usage-cap <agent-id> --clear --json',
|
|
18
20
|
];
|
|
19
21
|
static args = {
|
|
@@ -26,9 +28,24 @@ class AgentsUsageCap extends base_command_1.BaseCommand {
|
|
|
26
28
|
static flags = {
|
|
27
29
|
set: core_1.Flags.string({
|
|
28
30
|
description: 'Monthly cap in dollars of usage, e.g. 20 or 12.50',
|
|
29
|
-
exclusive: ['clear'],
|
|
31
|
+
exclusive: ['clear', 'clear-monthly'],
|
|
32
|
+
}),
|
|
33
|
+
daily: core_1.Flags.string({
|
|
34
|
+
description: 'Daily hosted cap in dollars (UTC day)',
|
|
35
|
+
exclusive: ['clear', 'clear-daily'],
|
|
36
|
+
}),
|
|
37
|
+
clear: core_1.Flags.boolean({
|
|
38
|
+
description: 'Remove both caps',
|
|
39
|
+
exclusive: ['set', 'daily', 'clear-daily', 'clear-monthly'],
|
|
40
|
+
}),
|
|
41
|
+
'clear-daily': core_1.Flags.boolean({
|
|
42
|
+
description: 'Remove only the daily cap (the monthly cap is kept)',
|
|
43
|
+
exclusive: ['clear', 'daily'],
|
|
44
|
+
}),
|
|
45
|
+
'clear-monthly': core_1.Flags.boolean({
|
|
46
|
+
description: 'Remove only the monthly cap (the daily cap is kept)',
|
|
47
|
+
exclusive: ['clear', 'set'],
|
|
30
48
|
}),
|
|
31
|
-
clear: core_1.Flags.boolean({ description: 'Remove the cap', exclusive: ['set'] }),
|
|
32
49
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
33
50
|
};
|
|
34
51
|
async run() {
|
|
@@ -43,13 +60,30 @@ class AgentsUsageCap extends base_command_1.BaseCommand {
|
|
|
43
60
|
});
|
|
44
61
|
}
|
|
45
62
|
}
|
|
63
|
+
let dailyMicros = null;
|
|
64
|
+
if (flags.daily !== undefined) {
|
|
65
|
+
dailyMicros = (0, data_provider_1.parseAgentUsageCapDollars)(flags.daily);
|
|
66
|
+
if (dailyMicros === null)
|
|
67
|
+
this.error('--daily takes a positive amount in dollars, like 20 or 12.50', { exit: 2 });
|
|
68
|
+
}
|
|
46
69
|
let cap;
|
|
47
70
|
try {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
71
|
+
const clearDaily = flags['clear-daily'] === true;
|
|
72
|
+
const clearMonthly = flags['clear-monthly'] === true;
|
|
73
|
+
// `null` removes one window on the server; a window not named is untouched.
|
|
74
|
+
const windows = {
|
|
75
|
+
...(micros !== null ? { monthlyLimitMicros: micros } : {}),
|
|
76
|
+
...(clearMonthly ? { monthlyLimitMicros: null } : {}),
|
|
77
|
+
...(dailyMicros !== null ? { dailyLimitMicros: dailyMicros } : {}),
|
|
78
|
+
...(clearDaily ? { dailyLimitMicros: null } : {}),
|
|
79
|
+
};
|
|
80
|
+
if (flags.clear)
|
|
81
|
+
cap = await data_provider_1.dataService.clearAgentUsageCap(args.id);
|
|
82
|
+
else if (Object.keys(windows).length) {
|
|
83
|
+
cap = await data_provider_1.dataService.setAgentUsageCap(args.id, windows);
|
|
84
|
+
}
|
|
85
|
+
else
|
|
86
|
+
cap = await data_provider_1.dataService.getAgentUsageCap(args.id);
|
|
53
87
|
}
|
|
54
88
|
catch (err) {
|
|
55
89
|
this.handleApiError(err);
|
|
@@ -62,7 +96,10 @@ class AgentsUsageCap extends base_command_1.BaseCommand {
|
|
|
62
96
|
}
|
|
63
97
|
const resets = String(cap.periodEnd).slice(0, 10);
|
|
64
98
|
if (cap.monthlyLimitMicros === null) {
|
|
65
|
-
|
|
99
|
+
// "No cap set" is only true when NEITHER window has one; a daily-only cap
|
|
100
|
+
// is a cap, and the line below it must not contradict this one.
|
|
101
|
+
const dailyCapSet = cap.daily?.limitMicros != null;
|
|
102
|
+
this.log(`Agent ${args.id}: ${dailyCapSet ? 'no monthly cap' : 'no cap set'} · ${(0, data_provider_1.formatAgentUsageMicros)(cap.usedMicros)} used by you this month`);
|
|
66
103
|
}
|
|
67
104
|
else {
|
|
68
105
|
// Figures unclamped: usage past the cap is shown as it is. "Reached" is
|
|
@@ -70,6 +107,8 @@ class AgentsUsageCap extends base_command_1.BaseCommand {
|
|
|
70
107
|
// left can already be too little to start a run.
|
|
71
108
|
this.log(`Agent ${args.id}: ${(0, data_provider_1.formatAgentUsageMicros)(cap.usedMicros)} of ${(0, data_provider_1.formatAgentUsageMicros)(cap.monthlyLimitMicros)} used by you this month (resets ${resets})${cap.exhausted ? ' — cap reached, your new runs are refused' : ''}`);
|
|
72
109
|
}
|
|
110
|
+
if (cap.daily)
|
|
111
|
+
this.log(`Today (UTC): ${(0, data_provider_1.formatAgentUsageMicros)(cap.daily.usedMicros)}${cap.daily.limitMicros === null ? ' · no daily cap' : ` of ${(0, data_provider_1.formatAgentUsageMicros)(cap.daily.limitMicros)}`}${cap.daily.exhausted ? ' — daily cap reached, your new runs are refused' : ''} (resets ${cap.daily.periodEnd})`);
|
|
73
112
|
this.log(data_provider_1.AGENT_USAGE_CAP_EXPLANATION);
|
|
74
113
|
}
|
|
75
114
|
}
|
|
@@ -16,6 +16,7 @@ export default class CodeDoctor extends Command {
|
|
|
16
16
|
static examples: string[];
|
|
17
17
|
static flags: {
|
|
18
18
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
19
|
+
check: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
19
20
|
};
|
|
20
21
|
run(): Promise<void>;
|
|
21
22
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
4
|
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
5
5
|
const first_party_harness_doctor_1 = require("../../lib/first-party-harness-doctor");
|
|
6
|
+
const first_party_harness_update_1 = require("../../lib/first-party-harness-update");
|
|
6
7
|
/**
|
|
7
8
|
* `skrr code doctor` — diagnose the local first-party harness installation.
|
|
8
9
|
*
|
|
@@ -23,9 +24,14 @@ class CodeDoctor extends core_1.Command {
|
|
|
23
24
|
];
|
|
24
25
|
static flags = {
|
|
25
26
|
json: core_1.Flags.boolean({ description: 'Emit the report as JSON' }),
|
|
27
|
+
check: core_1.Flags.boolean({
|
|
28
|
+
description: 'Also check the signed release channel (the default diagnosis is offline)',
|
|
29
|
+
}),
|
|
26
30
|
};
|
|
27
31
|
async run() {
|
|
28
32
|
const { flags } = await this.parse(CodeDoctor);
|
|
33
|
+
if (flags.check)
|
|
34
|
+
await (0, first_party_harness_update_1.checkLocalCodeUpdate)({ force: true });
|
|
29
35
|
const report = (0, first_party_harness_doctor_1.runDoctor)();
|
|
30
36
|
if (flags.json) {
|
|
31
37
|
this.logJson(report);
|