@skrr-ai/cli 0.1.47 → 0.1.48
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 +1 -1
- package/dist/base-command.d.ts +18 -0
- package/dist/base-command.js +61 -1
- package/dist/commands/agents/chat.d.ts +21 -0
- package/dist/commands/agents/chat.js +26 -9
- package/dist/commands/balance/usage/breakdown.d.ts +14 -0
- package/dist/commands/balance/usage/breakdown.js +68 -0
- package/dist/commands/balance/usage.js +24 -0
- package/dist/commands/commerce/entitlements/explain.d.ts +22 -0
- package/dist/commands/commerce/entitlements/explain.js +40 -0
- package/dist/commands/commerce/incidents/audit.d.ts +20 -0
- package/dist/commands/commerce/incidents/audit.js +37 -0
- package/dist/commands/commerce/incidents/list.d.ts +22 -0
- package/dist/commands/commerce/incidents/list.js +49 -0
- package/dist/commands/commerce/incidents/resolve.d.ts +23 -0
- package/dist/commands/commerce/incidents/resolve.js +45 -0
- package/dist/commands/commerce/incidents/retry.d.ts +22 -0
- package/dist/commands/commerce/incidents/retry.js +45 -0
- package/dist/commands/commerce/incidents/show.d.ts +13 -0
- package/dist/commands/commerce/incidents/show.js +30 -0
- package/dist/commands/commerce/offers/approve.d.ts +17 -0
- package/dist/commands/commerce/offers/approve.js +33 -0
- package/dist/commands/commerce/offers/create.d.ts +18 -0
- package/dist/commands/commerce/offers/create.js +34 -0
- package/dist/commands/commerce/offers/publish.d.ts +13 -0
- package/dist/commands/commerce/offers/publish.js +28 -0
- package/dist/commands/commerce/offers/retire.d.ts +17 -0
- package/dist/commands/commerce/offers/retire.js +32 -0
- package/dist/commands/commerce/offers/validate.d.ts +18 -0
- package/dist/commands/commerce/offers/validate.js +33 -0
- package/dist/commands/commerce/products/create.d.ts +10 -0
- package/dist/commands/commerce/products/create.js +25 -0
- package/dist/commands/commerce/promotions/redeem.d.ts +13 -0
- package/dist/commands/commerce/promotions/redeem.js +32 -0
- package/dist/commands/commerce/terms/accept.d.ts +18 -0
- package/dist/commands/commerce/terms/accept.js +39 -0
- package/dist/commands/commerce/terms/show.d.ts +10 -0
- package/dist/commands/commerce/terms/show.js +34 -0
- package/dist/commands/commerce/trials/conversion-preview.d.ts +18 -0
- package/dist/commands/commerce/trials/conversion-preview.js +39 -0
- package/dist/commands/commerce/trials/start.d.ts +23 -0
- package/dist/commands/commerce/trials/start.js +58 -0
- package/dist/commands/commitments/accounting.d.ts +39 -0
- package/dist/commands/commitments/accounting.js +116 -0
- package/dist/commands/commitments/action-history.d.ts +1 -0
- package/dist/commands/commitments/action-history.js +8 -1
- package/dist/commands/commitments/case.d.ts +1 -0
- package/dist/commands/commitments/case.js +19 -3
- package/dist/commands/commitments/cases.d.ts +1 -0
- package/dist/commands/commitments/cases.js +11 -1
- package/dist/commands/commitments/checks.d.ts +1 -0
- package/dist/commands/commitments/checks.js +5 -1
- package/dist/commands/commitments/cost.d.ts +62 -0
- package/dist/commands/commitments/cost.js +130 -0
- package/dist/commands/commitments/create.js +1 -1
- package/dist/commands/commitments/delete.d.ts +1 -0
- package/dist/commands/commitments/delete.js +56 -6
- package/dist/commands/commitments/feedback.js +9 -1
- package/dist/commands/commitments/handover.js +16 -0
- package/dist/commands/commitments/hypotheses.d.ts +1 -0
- package/dist/commands/commitments/hypotheses.js +17 -2
- package/dist/commands/commitments/links/list.js +4 -1
- package/dist/commands/commitments/liveness.d.ts +18 -0
- package/dist/commands/commitments/liveness.js +80 -0
- package/dist/commands/commitments/metrics.d.ts +1 -0
- package/dist/commands/commitments/metrics.js +8 -1
- package/dist/commands/commitments/next-tick.d.ts +39 -0
- package/dist/commands/commitments/next-tick.js +122 -0
- package/dist/commands/commitments/observations.d.ts +1 -0
- package/dist/commands/commitments/observations.js +19 -2
- package/dist/commands/commitments/pause.js +12 -0
- package/dist/commands/commitments/receipt.d.ts +2 -0
- package/dist/commands/commitments/receipt.js +16 -2
- package/dist/commands/commitments/remediation-proposal.js +6 -2
- package/dist/commands/commitments/remediation-proposals.js +5 -1
- package/dist/commands/commitments/restore.d.ts +25 -0
- package/dist/commands/commitments/restore.js +46 -0
- package/dist/commands/commitments/show.js +32 -0
- package/dist/commands/commitments/trigger-status.js +33 -0
- package/dist/commands/commitments/update.d.ts +1 -0
- package/dist/commands/commitments/update.js +31 -5
- package/dist/commands/commitments/wake-capabilities.d.ts +0 -1
- package/dist/commands/commitments/wake-capabilities.js +8 -4
- package/dist/commands/enterprise/budgets/create.d.ts +11 -0
- package/dist/commands/enterprise/budgets/create.js +27 -0
- package/dist/commands/enterprise/budgets/evaluate.d.ts +17 -0
- package/dist/commands/enterprise/budgets/evaluate.js +32 -0
- package/dist/commands/enterprise/budgets/publish.d.ts +14 -0
- package/dist/commands/enterprise/budgets/publish.js +30 -0
- package/dist/commands/enterprise/contracts/activate.d.ts +14 -0
- package/dist/commands/enterprise/contracts/activate.js +30 -0
- package/dist/commands/enterprise/contracts/create.d.ts +14 -0
- package/dist/commands/enterprise/contracts/create.js +32 -0
- package/dist/commands/enterprise/contracts/issue.d.ts +18 -0
- package/dist/commands/enterprise/contracts/issue.js +34 -0
- package/dist/commands/enterprise/domains/begin.d.ts +20 -0
- package/dist/commands/enterprise/domains/begin.js +39 -0
- package/dist/commands/enterprise/domains/verify.d.ts +14 -0
- package/dist/commands/enterprise/domains/verify.js +32 -0
- package/dist/commands/enterprise/external-config/activate.d.ts +22 -0
- package/dist/commands/enterprise/external-config/activate.js +49 -0
- package/dist/commands/enterprise/external-config/set.d.ts +25 -0
- package/dist/commands/enterprise/external-config/set.js +123 -0
- package/dist/commands/enterprise/external-config/show.d.ts +12 -0
- package/dist/commands/enterprise/external-config/show.js +39 -0
- package/dist/commands/enterprise/external-config/suspend.d.ts +13 -0
- package/dist/commands/enterprise/external-config/suspend.js +41 -0
- package/dist/commands/enterprise/finance/close-snapshot.d.ts +11 -0
- package/dist/commands/enterprise/finance/close-snapshot.js +28 -0
- package/dist/commands/enterprise/finance/record-document.d.ts +18 -0
- package/dist/commands/enterprise/finance/record-document.js +35 -0
- package/dist/commands/enterprise/profile.d.ts +20 -0
- package/dist/commands/enterprise/profile.js +38 -0
- package/dist/commands/login.d.ts +13 -0
- package/dist/commands/login.js +77 -0
- package/dist/commands/machines/dedicated/index.js +3 -0
- package/dist/commands/machines/dedicated/service/apply.d.ts +23 -0
- package/dist/commands/machines/dedicated/service/apply.js +99 -0
- package/dist/commands/machines/dedicated/service/approve.d.ts +23 -0
- package/dist/commands/machines/dedicated/service/approve.js +52 -0
- package/dist/commands/machines/dedicated/service/create.d.ts +55 -0
- package/dist/commands/machines/dedicated/service/create.js +222 -0
- package/dist/commands/machines/dedicated/service/edit.d.ts +30 -0
- package/dist/commands/machines/dedicated/service/edit.js +146 -0
- package/dist/commands/machines/dedicated/service/exec.d.ts +26 -0
- package/dist/commands/machines/dedicated/service/exec.js +92 -0
- package/dist/commands/machines/dedicated/service/export.d.ts +29 -0
- package/dist/commands/machines/dedicated/service/export.js +106 -0
- package/dist/commands/machines/dedicated/service/index.d.ts +14 -0
- package/dist/commands/machines/dedicated/service/index.js +49 -0
- package/dist/commands/machines/dedicated/service/logs.d.ts +33 -0
- package/dist/commands/machines/dedicated/service/logs.js +148 -0
- package/dist/commands/machines/dedicated/service/ls.d.ts +20 -0
- package/dist/commands/machines/dedicated/service/ls.js +80 -0
- package/dist/commands/machines/dedicated/service/restart.d.ts +14 -0
- package/dist/commands/machines/dedicated/service/restart.js +29 -0
- package/dist/commands/machines/dedicated/service/rm.d.ts +20 -0
- package/dist/commands/machines/dedicated/service/rm.js +33 -0
- package/dist/commands/machines/dedicated/service/secret/index.d.ts +14 -0
- package/dist/commands/machines/dedicated/service/secret/index.js +25 -0
- package/dist/commands/machines/dedicated/service/secret/rm.d.ts +22 -0
- package/dist/commands/machines/dedicated/service/secret/rm.js +54 -0
- package/dist/commands/machines/dedicated/service/secret/set.d.ts +22 -0
- package/dist/commands/machines/dedicated/service/secret/set.js +93 -0
- package/dist/commands/machines/dedicated/service/start.d.ts +14 -0
- package/dist/commands/machines/dedicated/service/start.js +29 -0
- package/dist/commands/machines/dedicated/service/status.d.ts +21 -0
- package/dist/commands/machines/dedicated/service/status.js +85 -0
- package/dist/commands/machines/dedicated/service/stop.d.ts +20 -0
- package/dist/commands/machines/dedicated/service/stop.js +35 -0
- package/dist/commands/machines/dedicated/service/top.d.ts +22 -0
- package/dist/commands/machines/dedicated/service/top.js +120 -0
- package/dist/commands/machines/dedicated/sign-in-status.d.ts +22 -0
- package/dist/commands/machines/dedicated/sign-in-status.js +79 -0
- package/dist/commands/machines/dedicated/ssh-config.d.ts +28 -0
- package/dist/commands/machines/dedicated/ssh-config.js +66 -0
- package/dist/commands/machines/dedicated/ssh-proxy.d.ts +22 -0
- package/dist/commands/machines/dedicated/ssh-proxy.js +62 -0
- package/dist/commands/machines/dedicated/ssh.d.ts +29 -0
- package/dist/commands/machines/dedicated/ssh.js +121 -0
- package/dist/commands/native/allow-all.d.ts +14 -0
- package/dist/commands/native/allow-all.js +25 -0
- package/dist/commands/native/allow.d.ts +24 -0
- package/dist/commands/native/allow.js +45 -0
- package/dist/commands/native/deny.d.ts +24 -0
- package/dist/commands/native/deny.js +43 -0
- package/dist/commands/native/disable.d.ts +17 -0
- package/dist/commands/native/disable.js +28 -0
- package/dist/commands/native/enable.d.ts +12 -0
- package/dist/commands/native/enable.js +29 -0
- package/dist/commands/native/list-apps.d.ts +19 -0
- package/dist/commands/native/list-apps.js +30 -0
- package/dist/commands/native/restrict-to.d.ts +22 -0
- package/dist/commands/native/restrict-to.js +41 -0
- package/dist/commands/native/status.d.ts +19 -0
- package/dist/commands/native/status.js +33 -0
- package/dist/commands/native.d.ts +39 -0
- package/dist/commands/native.js +76 -0
- package/dist/commands/service/index.d.ts +14 -0
- package/dist/commands/service/index.js +31 -0
- package/dist/commands/service/logs.d.ts +18 -0
- package/dist/commands/service/logs.js +53 -0
- package/dist/commands/service/ls.d.ts +13 -0
- package/dist/commands/service/ls.js +48 -0
- package/dist/commands/service/propose.d.ts +34 -0
- package/dist/commands/service/propose.js +113 -0
- package/dist/commands/service/status.d.ts +17 -0
- package/dist/commands/service/status.js +56 -0
- package/dist/commands/spaces/auto-executor/runs.d.ts +13 -0
- package/dist/commands/spaces/auto-executor/runs.js +56 -0
- package/dist/commands/store/governance/artifacts.d.ts +25 -0
- package/dist/commands/store/governance/artifacts.js +55 -0
- package/dist/commands/store/governance/assign.d.ts +16 -0
- package/dist/commands/store/governance/assign.js +54 -0
- package/dist/commands/store/governance/create-license.d.ts +18 -0
- package/dist/commands/store/governance/create-license.js +35 -0
- package/dist/commands/store/governance/install-plan.d.ts +25 -0
- package/dist/commands/store/governance/install-plan.js +56 -0
- package/dist/commands/store/governance/license-policy.d.ts +30 -0
- package/dist/commands/store/governance/license-policy.js +69 -0
- package/dist/commands/store/governance/policy.d.ts +25 -0
- package/dist/commands/store/governance/policy.js +65 -0
- package/dist/commands/store/governance/publish-release.d.ts +17 -0
- package/dist/commands/store/governance/publish-release.js +34 -0
- package/dist/commands/tasks/deliverable/add.d.ts +15 -0
- package/dist/commands/tasks/deliverable/add.js +174 -0
- package/dist/commands/tasks/deliverable/archive.d.ts +35 -0
- package/dist/commands/tasks/deliverable/archive.js +205 -0
- package/dist/commands/tasks/labels/detach.js +3 -0
- package/dist/commands/tasks/labels/suggest.d.ts +24 -0
- package/dist/commands/tasks/labels/suggest.js +69 -0
- package/dist/commands/tasks/list.d.ts +16 -2
- package/dist/commands/tasks/list.js +100 -24
- package/dist/commands/tasks/show.d.ts +23 -0
- package/dist/commands/tasks/show.js +51 -1
- package/dist/commands/wiki/rm.d.ts +22 -1
- package/dist/commands/wiki/rm.js +52 -3
- package/dist/lib/agentic-stream.js +10 -2
- package/dist/lib/balance.d.ts +6 -1
- package/dist/lib/balance.js +15 -0
- package/dist/lib/commerce-command.d.ts +48 -0
- package/dist/lib/commerce-command.js +70 -0
- package/dist/lib/commerce.d.ts +93 -0
- package/dist/lib/commerce.js +129 -0
- package/dist/lib/commitment-product.js +1 -1
- package/dist/lib/commitments.d.ts +202 -29
- package/dist/lib/commitments.js +300 -33
- package/dist/lib/dedicated-lease-command.js +10 -0
- package/dist/lib/dedicated-machines.d.ts +37 -0
- package/dist/lib/dedicated-machines.js +47 -0
- package/dist/lib/dedicated-service-command.d.ts +60 -0
- package/dist/lib/dedicated-service-command.js +182 -0
- package/dist/lib/dedicated-service.d.ts +342 -0
- package/dist/lib/dedicated-service.js +741 -0
- package/dist/lib/dedicated-ssh.d.ts +136 -0
- package/dist/lib/dedicated-ssh.js +387 -0
- package/dist/lib/delegated-cli.js +51 -13
- package/dist/lib/enterprise-commerce.d.ts +67 -0
- package/dist/lib/enterprise-commerce.js +112 -0
- package/dist/lib/enterprise-external-configuration.d.ts +60 -0
- package/dist/lib/enterprise-external-configuration.js +58 -0
- package/dist/lib/first-party-harness.js +17 -3
- package/dist/lib/governed-store.d.ts +110 -0
- package/dist/lib/governed-store.js +79 -0
- package/dist/lib/guest-service-command.d.ts +16 -0
- package/dist/lib/guest-service-command.js +32 -0
- package/dist/lib/guest-service.d.ts +67 -0
- package/dist/lib/guest-service.js +112 -0
- package/dist/lib/prompt.d.ts +1 -0
- package/dist/lib/prompt.js +1 -0
- package/dist/lib/task-asset-upload.d.ts +20 -0
- package/dist/lib/task-asset-upload.js +30 -8
- package/dist/lib/task-extras.d.ts +23 -0
- package/dist/lib/task-extras.js +6 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonScopes.d.ts +9 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonScopes.js +10 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +6 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/messages.d.ts +16 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/messages.js +21 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.js +24 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonScopes.d.ts +9 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonScopes.js +10 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/messages.d.ts +16 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/messages.js +20 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.js +24 -2
- package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +5060 -4827
- package/oclif.manifest.json +37416 -31416
- package/package.json +43 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { DedicatedRuntimeSignInStatus } from '@skrr-ai/data-provider';
|
|
2
|
+
import { DedicatedLeaseCommand } from '../../../lib/dedicated-lease-command';
|
|
3
|
+
/**
|
|
4
|
+
* `skrr machines dedicated sign-in-status` — the read half of `sign-in`.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately a separate command, not a flag on `sign-in`: the whole reason
|
|
7
|
+
* the endpoint exists is to answer the question WITHOUT starting a sign-in,
|
|
8
|
+
* and folding it into the verb that signs in would make the distinction a
|
|
9
|
+
* matter of remembering a flag.
|
|
10
|
+
*/
|
|
11
|
+
export default class DedicatedMachinesSignInStatus extends DedicatedLeaseCommand {
|
|
12
|
+
static description: string;
|
|
13
|
+
static examples: string[];
|
|
14
|
+
static args: {
|
|
15
|
+
lease: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
16
|
+
};
|
|
17
|
+
static flags: {
|
|
18
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
19
|
+
};
|
|
20
|
+
run(): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export declare function describeSignInStatus(status: DedicatedRuntimeSignInStatus): string;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.describeSignInStatus = describeSignInStatus;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
|
+
const dedicated_lease_command_1 = require("../../../lib/dedicated-lease-command");
|
|
7
|
+
const dedicated_machines_1 = require("../../../lib/dedicated-machines");
|
|
8
|
+
const LABELS = new Map(data_provider_1.DEDICATED_RUNTIME_SIGN_IN_PRESETS.map((preset) => [preset.tool, preset.label]));
|
|
9
|
+
/**
|
|
10
|
+
* `skrr machines dedicated sign-in-status` — the read half of `sign-in`.
|
|
11
|
+
*
|
|
12
|
+
* Deliberately a separate command, not a flag on `sign-in`: the whole reason
|
|
13
|
+
* the endpoint exists is to answer the question WITHOUT starting a sign-in,
|
|
14
|
+
* and folding it into the verb that signs in would make the distinction a
|
|
15
|
+
* matter of remembering a flag.
|
|
16
|
+
*/
|
|
17
|
+
class DedicatedMachinesSignInStatus extends dedicated_lease_command_1.DedicatedLeaseCommand {
|
|
18
|
+
static description = 'Report whether a Dedicated Runtime is signed in to GitHub CLI, Claude Code and Codex, without starting a sign-in. Read-only on the machine.';
|
|
19
|
+
static examples = [
|
|
20
|
+
'<%= config.bin %> machines dedicated sign-in-status <lease-id>',
|
|
21
|
+
'<%= config.bin %> machines dedicated sign-in-status <lease-id> --json',
|
|
22
|
+
];
|
|
23
|
+
static args = {
|
|
24
|
+
lease: core_1.Args.string({
|
|
25
|
+
description: dedicated_lease_command_1.DEDICATED_LEASE_ARG_DESCRIPTION,
|
|
26
|
+
required: true,
|
|
27
|
+
ignoreStdin: true,
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
static flags = {
|
|
31
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
32
|
+
};
|
|
33
|
+
async run() {
|
|
34
|
+
this.requireAuth();
|
|
35
|
+
const { args, flags } = await this.parse(DedicatedMachinesSignInStatus);
|
|
36
|
+
const leaseId = await this.resolveLeaseArg(args.lease);
|
|
37
|
+
const response = await this.callDedicated(() => (0, dedicated_machines_1.getDedicatedRuntimeSignInStatus)(leaseId, this.scopeFrom(flags)));
|
|
38
|
+
if (flags.json) {
|
|
39
|
+
this.log(JSON.stringify(response, null, 2));
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const statuses = response?.statuses ?? [];
|
|
43
|
+
if (!statuses.length) {
|
|
44
|
+
this.log('The machine reported no sign-in status.');
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
for (const status of statuses)
|
|
48
|
+
this.log(describeSignInStatus(status));
|
|
49
|
+
// `unknown` is not `signed_out`, and the difference decides whether anyone
|
|
50
|
+
// should go and re-authenticate. Saying it once, at the end, rather than
|
|
51
|
+
// on every row, keeps the common all-signed-in case one line per tool.
|
|
52
|
+
if (statuses.every((status) => status.state === 'unknown')) {
|
|
53
|
+
this.log('\nNothing could be read. The probe may have timed out or the machine may be unreachable — ' +
|
|
54
|
+
'that is not evidence the credentials are gone. Check again shortly.');
|
|
55
|
+
}
|
|
56
|
+
else if (statuses.some((status) => status.state === 'unknown')) {
|
|
57
|
+
this.log('\n`unknown` means the check could not answer, not that the tool is signed out — ' +
|
|
58
|
+
'it may not be installed on this image.');
|
|
59
|
+
}
|
|
60
|
+
if (response.checkedAt)
|
|
61
|
+
this.log(`\nChecked ${response.checkedAt}.`);
|
|
62
|
+
// No state-derived exit code, on purpose. The one a script would reach for
|
|
63
|
+
// — non-zero when "not signed in" — has no honest definition here, because
|
|
64
|
+
// it would have to put `unknown` on one side or the other and both are
|
|
65
|
+
// wrong. `--json` carries the three states; let the caller decide which of
|
|
66
|
+
// them it cares about.
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.default = DedicatedMachinesSignInStatus;
|
|
70
|
+
const STATE_LABEL = {
|
|
71
|
+
signed_in: 'signed in',
|
|
72
|
+
signed_out: 'signed out',
|
|
73
|
+
unknown: 'unknown',
|
|
74
|
+
};
|
|
75
|
+
function describeSignInStatus(status) {
|
|
76
|
+
const label = LABELS.get(status.tool) ?? status.tool;
|
|
77
|
+
const account = status.account ? ` (${status.account})` : '';
|
|
78
|
+
return `${label.padEnd(12)} ${STATE_LABEL[status.state] ?? status.state}${account}`;
|
|
79
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DedicatedLeaseCommand } from '../../../lib/dedicated-lease-command';
|
|
2
|
+
/**
|
|
3
|
+
* `skrr machines dedicated ssh-config` — the OpenSSH stanza for every lease.
|
|
4
|
+
*
|
|
5
|
+
* The block is a wildcard `Host rtl_*.skrr`: installing it once makes
|
|
6
|
+
* `ssh rtl_<id>.skrr` (and therefore `scp`, `rsync`, `git`, VS Code
|
|
7
|
+
* Remote-SSH, JetBrains Gateway) work for every Dedicated Runtime the user
|
|
8
|
+
* ever leases — one device identity and one pin file under ~/.skrr/ssh/,
|
|
9
|
+
* nothing of the user's own ~/.ssh shared with it.
|
|
10
|
+
*
|
|
11
|
+
* By default the block is installed into ~/.ssh/config as a managed region
|
|
12
|
+
* between the skrr markers, and refuses — rather than edits — a config whose
|
|
13
|
+
* markers cannot bound a region. `--print` writes the block to stdout for
|
|
14
|
+
* people who keep their ssh config by hand.
|
|
15
|
+
*/
|
|
16
|
+
export default class DedicatedMachinesSshConfig extends DedicatedLeaseCommand {
|
|
17
|
+
static description: string;
|
|
18
|
+
static examples: string[];
|
|
19
|
+
static args: {
|
|
20
|
+
lease: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
21
|
+
};
|
|
22
|
+
static flags: {
|
|
23
|
+
workspace: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
24
|
+
print: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
25
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
26
|
+
};
|
|
27
|
+
run(): Promise<void>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const dedicated_lease_command_1 = require("../../../lib/dedicated-lease-command");
|
|
5
|
+
const dedicated_ssh_1 = require("../../../lib/dedicated-ssh");
|
|
6
|
+
/**
|
|
7
|
+
* `skrr machines dedicated ssh-config` — the OpenSSH stanza for every lease.
|
|
8
|
+
*
|
|
9
|
+
* The block is a wildcard `Host rtl_*.skrr`: installing it once makes
|
|
10
|
+
* `ssh rtl_<id>.skrr` (and therefore `scp`, `rsync`, `git`, VS Code
|
|
11
|
+
* Remote-SSH, JetBrains Gateway) work for every Dedicated Runtime the user
|
|
12
|
+
* ever leases — one device identity and one pin file under ~/.skrr/ssh/,
|
|
13
|
+
* nothing of the user's own ~/.ssh shared with it.
|
|
14
|
+
*
|
|
15
|
+
* By default the block is installed into ~/.ssh/config as a managed region
|
|
16
|
+
* between the skrr markers, and refuses — rather than edits — a config whose
|
|
17
|
+
* markers cannot bound a region. `--print` writes the block to stdout for
|
|
18
|
+
* people who keep their ssh config by hand.
|
|
19
|
+
*/
|
|
20
|
+
class DedicatedMachinesSshConfig extends dedicated_lease_command_1.DedicatedLeaseCommand {
|
|
21
|
+
static description = 'Install (or --print) the ~/.ssh/config block that lets plain ssh/scp/rsync/Remote-SSH reach any Dedicated Runtime.';
|
|
22
|
+
static examples = [
|
|
23
|
+
'<%= config.bin %> machines dedicated ssh-config <lease-id>',
|
|
24
|
+
'<%= config.bin %> machines dedicated ssh-config <lease-id> --print',
|
|
25
|
+
'<%= config.bin %> machines dedicated ssh-config <lease-id> --json',
|
|
26
|
+
];
|
|
27
|
+
static args = {
|
|
28
|
+
lease: core_1.Args.string({
|
|
29
|
+
description: 'Dedicated Runtime lease id, or `self`',
|
|
30
|
+
required: true,
|
|
31
|
+
ignoreStdin: true,
|
|
32
|
+
}),
|
|
33
|
+
};
|
|
34
|
+
static flags = {
|
|
35
|
+
workspace: core_1.Flags.string({ description: 'Workspace scope' }),
|
|
36
|
+
print: core_1.Flags.boolean({ description: 'Print the block instead of installing it' }),
|
|
37
|
+
json: core_1.Flags.boolean({ description: 'Output the block as JSON' }),
|
|
38
|
+
};
|
|
39
|
+
async run() {
|
|
40
|
+
const { args, flags } = await this.parse(DedicatedMachinesSshConfig);
|
|
41
|
+
const leaseId = await this.resolveLeaseArg(args.lease);
|
|
42
|
+
// First use creates the device identity so the block names a file that
|
|
43
|
+
// exists; its admission still happens per-connection, by the daemon.
|
|
44
|
+
(0, dedicated_ssh_1.ensureSshIdentity)();
|
|
45
|
+
const block = (0, dedicated_ssh_1.sshConfigBlock)();
|
|
46
|
+
if (flags.json) {
|
|
47
|
+
this.log(JSON.stringify({ leaseId, config: block }, null, 2));
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (flags.print) {
|
|
51
|
+
this.log(`${block}\n`);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
const { configPath } = (0, dedicated_ssh_1.installSshConfigBlock)();
|
|
56
|
+
process.stderr.write(`Installed the skrr block in ${configPath}. \`ssh ${leaseId}.skrr\` (and scp, rsync, Remote-SSH) just work.\n`);
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
if (error instanceof dedicated_ssh_1.DedicatedSshError) {
|
|
60
|
+
this.error(error.message, { exit: 1 });
|
|
61
|
+
}
|
|
62
|
+
throw error;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.default = DedicatedMachinesSshConfig;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DedicatedLeaseCommand } from '../../../lib/dedicated-lease-command';
|
|
2
|
+
/**
|
|
3
|
+
* `skrr machines dedicated ssh-proxy` — the ProxyCommand half of owner SSH.
|
|
4
|
+
*
|
|
5
|
+
* OpenSSH runs this with stdin/stdout wired to the SSH protocol: whatever the
|
|
6
|
+
* client writes arrives on the machine's sshd, whatever sshd writes is read
|
|
7
|
+
* back here. Everything else — admission, generation fencing, the ephemeral
|
|
8
|
+
* key's admission, host-key delivery — is carried by the channel, so this
|
|
9
|
+
* command's only job is to move bytes honestly and say why it cannot.
|
|
10
|
+
*
|
|
11
|
+
* Not for typing into: it writes protocol bytes to stdout and diagnostics to
|
|
12
|
+
* stderr, exactly like `ssh -W`. Humans want `ssh` (the next command) or the
|
|
13
|
+
* `ssh-config` block it can print.
|
|
14
|
+
*/
|
|
15
|
+
export default class DedicatedMachinesSshProxy extends DedicatedLeaseCommand {
|
|
16
|
+
static description: string;
|
|
17
|
+
static examples: string[];
|
|
18
|
+
static args: {
|
|
19
|
+
host: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
20
|
+
};
|
|
21
|
+
run(): Promise<void>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const dedicated_lease_command_1 = require("../../../lib/dedicated-lease-command");
|
|
5
|
+
const dedicated_ssh_1 = require("../../../lib/dedicated-ssh");
|
|
6
|
+
/**
|
|
7
|
+
* `skrr machines dedicated ssh-proxy` — the ProxyCommand half of owner SSH.
|
|
8
|
+
*
|
|
9
|
+
* OpenSSH runs this with stdin/stdout wired to the SSH protocol: whatever the
|
|
10
|
+
* client writes arrives on the machine's sshd, whatever sshd writes is read
|
|
11
|
+
* back here. Everything else — admission, generation fencing, the ephemeral
|
|
12
|
+
* key's admission, host-key delivery — is carried by the channel, so this
|
|
13
|
+
* command's only job is to move bytes honestly and say why it cannot.
|
|
14
|
+
*
|
|
15
|
+
* Not for typing into: it writes protocol bytes to stdout and diagnostics to
|
|
16
|
+
* stderr, exactly like `ssh -W`. Humans want `ssh` (the next command) or the
|
|
17
|
+
* `ssh-config` block it can print.
|
|
18
|
+
*/
|
|
19
|
+
class DedicatedMachinesSshProxy extends dedicated_lease_command_1.DedicatedLeaseCommand {
|
|
20
|
+
static description = 'Bridge stdio to a Dedicated Runtime’s SSH server — the ProxyCommand ssh/scp/rsync/Remote-SSH use. Not an interactive command.';
|
|
21
|
+
static examples = [
|
|
22
|
+
"ssh -o ProxyCommand='skrr machines dedicated ssh-proxy %h' rtl_abc123.skrr",
|
|
23
|
+
'<%= config.bin %> machines dedicated ssh-proxy rtl_abc123.skrr',
|
|
24
|
+
];
|
|
25
|
+
static args = {
|
|
26
|
+
host: core_1.Args.string({
|
|
27
|
+
description: 'The ssh host alias (rtl_<id>.skrr) or a bare lease id',
|
|
28
|
+
required: true,
|
|
29
|
+
ignoreStdin: true,
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
32
|
+
async run() {
|
|
33
|
+
this.requireAuth();
|
|
34
|
+
const { args } = await this.parse(DedicatedMachinesSshProxy);
|
|
35
|
+
// `%h` arrives as the Host alias (`rtl_<id>.skrr`); a bare id or `self`
|
|
36
|
+
// work too, so the command is callable by hand.
|
|
37
|
+
const lease = (0, dedicated_ssh_1.leaseIdForSshHost)(args.host) ??
|
|
38
|
+
(args.host === 'self' ? await this.resolveLeaseArg('self') : null);
|
|
39
|
+
if (!lease) {
|
|
40
|
+
this.error(`Cannot read a lease id from '${args.host}'. Expected rtl_<id> or rtl_<id>.skrr.`, { exit: 2 });
|
|
41
|
+
}
|
|
42
|
+
let code;
|
|
43
|
+
try {
|
|
44
|
+
code = await (0, dedicated_ssh_1.runSshProxy)({
|
|
45
|
+
baseURL: this.cliConfig.baseURL,
|
|
46
|
+
token: this.resolvedCredential.token,
|
|
47
|
+
leaseId: lease,
|
|
48
|
+
input: process.stdin,
|
|
49
|
+
output: process.stdout,
|
|
50
|
+
errorOutput: process.stderr,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
if (err instanceof dedicated_ssh_1.DedicatedSshError)
|
|
55
|
+
this.error(err.message, { exit: 1 });
|
|
56
|
+
throw err;
|
|
57
|
+
}
|
|
58
|
+
if (code !== 0)
|
|
59
|
+
this.exit(code);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.default = DedicatedMachinesSshProxy;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DedicatedLeaseCommand } from '../../../lib/dedicated-lease-command';
|
|
2
|
+
/**
|
|
3
|
+
* `skrr machines dedicated ssh` — a real OpenSSH session on a Dedicated
|
|
4
|
+
* Runtime, as skrr-workload.
|
|
5
|
+
*
|
|
6
|
+
* The client on this machine is ordinary `ssh`: this command builds the
|
|
7
|
+
* options (`-o ProxyCommand=… ssh-proxy %h`, the lease's identity file and
|
|
8
|
+
* known_hosts) and execs it, so tab-completion, `-L`, agent forwarding and
|
|
9
|
+
* every other OpenSSH feature behave the way `man ssh` says they do.
|
|
10
|
+
* `ssh-proxy` carries the protocol over the admitted relay; there is no port
|
|
11
|
+
* on the machine for the session to have arrived on.
|
|
12
|
+
*
|
|
13
|
+
* `scp`, `rsync`, `git` over SSH, VS Code Remote-SSH and JetBrains Gateway
|
|
14
|
+
* take the same path — they just need the Host block, which `ssh-config`
|
|
15
|
+
* prints.
|
|
16
|
+
*/
|
|
17
|
+
export default class DedicatedMachinesSsh extends DedicatedLeaseCommand {
|
|
18
|
+
static description: string;
|
|
19
|
+
static examples: string[];
|
|
20
|
+
static usage: string;
|
|
21
|
+
static strict: boolean;
|
|
22
|
+
static args: {
|
|
23
|
+
lease: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
24
|
+
};
|
|
25
|
+
static flags: {
|
|
26
|
+
workspace: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
27
|
+
};
|
|
28
|
+
run(): Promise<void>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const node_child_process_1 = require("node:child_process");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const dedicated_lease_command_1 = require("../../../lib/dedicated-lease-command");
|
|
6
|
+
const dedicated_machines_1 = require("../../../lib/dedicated-machines");
|
|
7
|
+
const harnesses_1 = require("../../../lib/harnesses");
|
|
8
|
+
const dedicated_ssh_1 = require("../../../lib/dedicated-ssh");
|
|
9
|
+
const exec_1 = require("../hosted/exec");
|
|
10
|
+
const SSH_READY_STATES = new Set(['ready', 'active', 'idle']);
|
|
11
|
+
/**
|
|
12
|
+
* `skrr machines dedicated ssh` — a real OpenSSH session on a Dedicated
|
|
13
|
+
* Runtime, as skrr-workload.
|
|
14
|
+
*
|
|
15
|
+
* The client on this machine is ordinary `ssh`: this command builds the
|
|
16
|
+
* options (`-o ProxyCommand=… ssh-proxy %h`, the lease's identity file and
|
|
17
|
+
* known_hosts) and execs it, so tab-completion, `-L`, agent forwarding and
|
|
18
|
+
* every other OpenSSH feature behave the way `man ssh` says they do.
|
|
19
|
+
* `ssh-proxy` carries the protocol over the admitted relay; there is no port
|
|
20
|
+
* on the machine for the session to have arrived on.
|
|
21
|
+
*
|
|
22
|
+
* `scp`, `rsync`, `git` over SSH, VS Code Remote-SSH and JetBrains Gateway
|
|
23
|
+
* take the same path — they just need the Host block, which `ssh-config`
|
|
24
|
+
* prints.
|
|
25
|
+
*/
|
|
26
|
+
class DedicatedMachinesSsh extends dedicated_lease_command_1.DedicatedLeaseCommand {
|
|
27
|
+
static description = 'SSH into a Dedicated Runtime as skrr-workload — a real OpenSSH session. For port forwards and other ssh options use the `ssh-config` block plus plain `ssh`, which takes them before the host.';
|
|
28
|
+
static examples = [
|
|
29
|
+
'<%= config.bin %> machines dedicated ssh <lease-id>',
|
|
30
|
+
'<%= config.bin %> machines dedicated ssh <lease-id> -- ls -la',
|
|
31
|
+
'<%= config.bin %> machines dedicated ssh-config <lease-id> >> ~/.ssh/config # then: ssh -L 3000:localhost:3000 rtl_<id>.skrr',
|
|
32
|
+
];
|
|
33
|
+
static usage = 'machines dedicated ssh <lease-id> -- [command...]';
|
|
34
|
+
static strict = false;
|
|
35
|
+
static args = {
|
|
36
|
+
lease: core_1.Args.string({
|
|
37
|
+
description: 'Dedicated Runtime lease id, or `self`',
|
|
38
|
+
required: true,
|
|
39
|
+
ignoreStdin: true,
|
|
40
|
+
}),
|
|
41
|
+
};
|
|
42
|
+
static flags = {
|
|
43
|
+
workspace: core_1.Flags.string({ description: 'Workspace scope' }),
|
|
44
|
+
};
|
|
45
|
+
async run() {
|
|
46
|
+
this.requireAuth();
|
|
47
|
+
const { head, tail } = (0, exec_1.splitExecArgv)(this.argv);
|
|
48
|
+
let parsed;
|
|
49
|
+
try {
|
|
50
|
+
parsed = await this.parse(DedicatedMachinesSsh, head);
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
// An ssh-looking flag before -- (say `-L`) is not this command's flag —
|
|
54
|
+
// and cannot be: ssh options must precede the destination on ssh's own
|
|
55
|
+
// argv, so there is no honest place to forward it to. Say where it goes.
|
|
56
|
+
this.error('ssh options cannot be forwarded here. Put a remote command after --, or add the option to the Host block from `skrr machines dedicated ssh-config <lease-id>` and run ssh directly.', { exit: 2 });
|
|
57
|
+
}
|
|
58
|
+
const { args, flags, argv } = parsed;
|
|
59
|
+
if (argv.length > 1) {
|
|
60
|
+
this.error(`Extra arguments before -- are not forwarded to ssh. Put a remote command after --, or add ssh options to the block from \`${this.config.bin} machines dedicated ssh-config ${args.lease}\`.`, { exit: 2 });
|
|
61
|
+
}
|
|
62
|
+
const leaseId = await this.resolveLeaseArg(args.lease);
|
|
63
|
+
const remoteCommand = tail ?? [];
|
|
64
|
+
// Refuse BEFORE ssh starts where the answer is already knowable — a
|
|
65
|
+
// stopped machine or an absent daemon — so the error is a sentence, not a
|
|
66
|
+
// ProxyCommand failure buried in ssh's own diagnostics.
|
|
67
|
+
const response = await this.callDedicated(() => (0, dedicated_machines_1.getDedicatedRuntime)(leaseId, this.scopeFrom(flags)));
|
|
68
|
+
const lease = response?.lease;
|
|
69
|
+
if (!lease)
|
|
70
|
+
this.error('Dedicated Runtime lease not found.', { exit: 1 });
|
|
71
|
+
const state = (0, dedicated_machines_1.dedicatedLeaseState)(lease);
|
|
72
|
+
if (!SSH_READY_STATES.has(state)) {
|
|
73
|
+
this.error(state === 'stopped'
|
|
74
|
+
? `${leaseId} is stopped. Start it first: \`${this.config.bin} machines dedicated start ${leaseId} --wait\`.`
|
|
75
|
+
: `${leaseId} is ${state}; SSH connects once it is ready.`, { exit: 1 });
|
|
76
|
+
}
|
|
77
|
+
const listed = await this.callDedicated(() => (0, harnesses_1.listHarnesses)());
|
|
78
|
+
const harness = (0, dedicated_machines_1.dedicatedTerminalHarness)(lease, listed?.harnesses ?? []);
|
|
79
|
+
if (!harness?.daemonId) {
|
|
80
|
+
this.error(`${leaseId} is ${state}, but its daemon is not connected yet. Wait a moment, or run \`${this.config.bin} machines dedicated health-check ${leaseId}\`.`, { exit: 1 });
|
|
81
|
+
}
|
|
82
|
+
const identity = (0, dedicated_ssh_1.ensureSshIdentity)();
|
|
83
|
+
const host = `${leaseId}${dedicated_ssh_1.SSH_HOST_SUFFIX}`;
|
|
84
|
+
const sshArgv = [
|
|
85
|
+
'-o',
|
|
86
|
+
`ProxyCommand=${(0, dedicated_ssh_1.sshProxyCommand)()}`,
|
|
87
|
+
'-o',
|
|
88
|
+
`UserKnownHostsFile=${(0, dedicated_ssh_1.knownHostsPath)()}`,
|
|
89
|
+
'-o',
|
|
90
|
+
'StrictHostKeyChecking=yes',
|
|
91
|
+
'-o',
|
|
92
|
+
'IdentitiesOnly=yes',
|
|
93
|
+
'-o',
|
|
94
|
+
'ServerAliveInterval=30',
|
|
95
|
+
'-i',
|
|
96
|
+
identity.privateKey,
|
|
97
|
+
`${dedicated_ssh_1.SSH_USER}@${host}`,
|
|
98
|
+
...remoteCommand,
|
|
99
|
+
];
|
|
100
|
+
const code = await new Promise((resolve) => {
|
|
101
|
+
const child = (0, node_child_process_1.spawn)('ssh', sshArgv, { stdio: 'inherit' });
|
|
102
|
+
child.on('error', (err) => {
|
|
103
|
+
process.stderr.write(`${err.message}\n`);
|
|
104
|
+
resolve(1);
|
|
105
|
+
});
|
|
106
|
+
child.on('close', (exitCode, signal) => {
|
|
107
|
+
if (exitCode !== null) {
|
|
108
|
+
resolve(exitCode);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
// A signal means ssh was killed, not that it finished; give the shell
|
|
112
|
+
// reading this command's status the conventional 128+signal.
|
|
113
|
+
const SIGNAL_CODES = { SIGINT: 130, SIGTERM: 143 };
|
|
114
|
+
resolve((signal && SIGNAL_CODES[signal]) ?? 1);
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
if (code !== 0)
|
|
118
|
+
this.exit(code);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
exports.default = DedicatedMachinesSsh;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* Remove the application restriction. Blocked applications stay blocked, and
|
|
4
|
+
* password managers are never included either way.
|
|
5
|
+
*/
|
|
6
|
+
export default class NativeAllowAll extends Command {
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static flags: {
|
|
10
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const native_1 = require("../native");
|
|
5
|
+
/**
|
|
6
|
+
* Remove the application restriction. Blocked applications stay blocked, and
|
|
7
|
+
* password managers are never included either way.
|
|
8
|
+
*/
|
|
9
|
+
class NativeAllowAll extends core_1.Command {
|
|
10
|
+
static description = 'Remove the application restriction (blocked apps stay blocked)';
|
|
11
|
+
static examples = ['<%= config.bin %> native allow-all'];
|
|
12
|
+
static flags = {
|
|
13
|
+
...native_1.nativeProfileFlag,
|
|
14
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
15
|
+
};
|
|
16
|
+
async run() {
|
|
17
|
+
const { flags } = await this.parse(NativeAllowAll);
|
|
18
|
+
await (0, native_1.forwardNativeCommand)(this, [
|
|
19
|
+
'allow-all',
|
|
20
|
+
...(0, native_1.profilePassthrough)(flags.profile),
|
|
21
|
+
...(flags.json ? ['--json'] : []),
|
|
22
|
+
]);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.default = NativeAllowAll;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* Make sure one application is in scope.
|
|
4
|
+
*
|
|
5
|
+
* It unblocks an app that `native deny` blocked, and adds one to a restriction
|
|
6
|
+
* if a restriction exists. With no restriction set it reports that the app was
|
|
7
|
+
* already in scope — because every application is, by default.
|
|
8
|
+
*
|
|
9
|
+
* It deliberately does NOT create a restriction out of an empty list. Doing so
|
|
10
|
+
* would silently narrow scope from "every app" to "this one app", which is the
|
|
11
|
+
* opposite of what the word promises. Use `native restrict-to` to narrow.
|
|
12
|
+
*/
|
|
13
|
+
export default class NativeAllow extends Command {
|
|
14
|
+
static description: string;
|
|
15
|
+
static examples: string[];
|
|
16
|
+
static args: {
|
|
17
|
+
app: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
18
|
+
};
|
|
19
|
+
static flags: {
|
|
20
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
21
|
+
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
22
|
+
};
|
|
23
|
+
run(): Promise<void>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const native_1 = require("../native");
|
|
5
|
+
/**
|
|
6
|
+
* Make sure one application is in scope.
|
|
7
|
+
*
|
|
8
|
+
* It unblocks an app that `native deny` blocked, and adds one to a restriction
|
|
9
|
+
* if a restriction exists. With no restriction set it reports that the app was
|
|
10
|
+
* already in scope — because every application is, by default.
|
|
11
|
+
*
|
|
12
|
+
* It deliberately does NOT create a restriction out of an empty list. Doing so
|
|
13
|
+
* would silently narrow scope from "every app" to "this one app", which is the
|
|
14
|
+
* opposite of what the word promises. Use `native restrict-to` to narrow.
|
|
15
|
+
*/
|
|
16
|
+
class NativeAllow extends core_1.Command {
|
|
17
|
+
static description = 'Make sure an application is in scope (unblocks it, or adds it to a restriction)';
|
|
18
|
+
static examples = [
|
|
19
|
+
'<%= config.bin %> native allow "Slack"',
|
|
20
|
+
'<%= config.bin %> native allow com.apple.Notes',
|
|
21
|
+
];
|
|
22
|
+
static args = {
|
|
23
|
+
app: core_1.Args.string({
|
|
24
|
+
description: 'Application name or bundle id',
|
|
25
|
+
required: true,
|
|
26
|
+
// Without this oclif reads stdin for a missing positional, so the command
|
|
27
|
+
// hangs from a pipe instead of refusing.
|
|
28
|
+
ignoreStdin: true,
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
31
|
+
static flags = {
|
|
32
|
+
...native_1.nativeProfileFlag,
|
|
33
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
34
|
+
};
|
|
35
|
+
async run() {
|
|
36
|
+
const { args, flags } = await this.parse(NativeAllow);
|
|
37
|
+
await (0, native_1.forwardNativeCommand)(this, [
|
|
38
|
+
'allow',
|
|
39
|
+
args.app,
|
|
40
|
+
...(0, native_1.profilePassthrough)(flags.profile),
|
|
41
|
+
...(flags.json ? ['--json'] : []),
|
|
42
|
+
]);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.default = NativeAllow;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* Block one application from ever being driven on this computer.
|
|
4
|
+
*
|
|
5
|
+
* The counterpart of the allow-everything default: it lets someone keep the
|
|
6
|
+
* default and carve out the two or three apps they do not want touched, which
|
|
7
|
+
* is a far smaller thing to write down than enumerating every app they do.
|
|
8
|
+
*
|
|
9
|
+
* Takes effect on the NEXT call, not the next restart — revocation is the
|
|
10
|
+
* user's only stop button, and one that waited for a restart would fail at
|
|
11
|
+
* exactly the moment they wanted it.
|
|
12
|
+
*/
|
|
13
|
+
export default class NativeDeny extends Command {
|
|
14
|
+
static description: string;
|
|
15
|
+
static examples: string[];
|
|
16
|
+
static args: {
|
|
17
|
+
app: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
18
|
+
};
|
|
19
|
+
static flags: {
|
|
20
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
21
|
+
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
22
|
+
};
|
|
23
|
+
run(): Promise<void>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const native_1 = require("../native");
|
|
5
|
+
/**
|
|
6
|
+
* Block one application from ever being driven on this computer.
|
|
7
|
+
*
|
|
8
|
+
* The counterpart of the allow-everything default: it lets someone keep the
|
|
9
|
+
* default and carve out the two or three apps they do not want touched, which
|
|
10
|
+
* is a far smaller thing to write down than enumerating every app they do.
|
|
11
|
+
*
|
|
12
|
+
* Takes effect on the NEXT call, not the next restart — revocation is the
|
|
13
|
+
* user's only stop button, and one that waited for a restart would fail at
|
|
14
|
+
* exactly the moment they wanted it.
|
|
15
|
+
*/
|
|
16
|
+
class NativeDeny extends core_1.Command {
|
|
17
|
+
static description = 'Block an application from ever being driven on this computer';
|
|
18
|
+
static examples = [
|
|
19
|
+
'<%= config.bin %> native deny "Slack"',
|
|
20
|
+
'<%= config.bin %> native deny "*"',
|
|
21
|
+
];
|
|
22
|
+
static args = {
|
|
23
|
+
app: core_1.Args.string({
|
|
24
|
+
description: 'Application name or bundle id',
|
|
25
|
+
required: true,
|
|
26
|
+
ignoreStdin: true,
|
|
27
|
+
}),
|
|
28
|
+
};
|
|
29
|
+
static flags = {
|
|
30
|
+
...native_1.nativeProfileFlag,
|
|
31
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
32
|
+
};
|
|
33
|
+
async run() {
|
|
34
|
+
const { args, flags } = await this.parse(NativeDeny);
|
|
35
|
+
await (0, native_1.forwardNativeCommand)(this, [
|
|
36
|
+
'deny',
|
|
37
|
+
args.app,
|
|
38
|
+
...(0, native_1.profilePassthrough)(flags.profile),
|
|
39
|
+
...(flags.json ? ['--json'] : []),
|
|
40
|
+
]);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.default = NativeDeny;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* Turn native application control off.
|
|
4
|
+
*
|
|
5
|
+
* Both flags go off together: leaving `allowCloudAgents` true under
|
|
6
|
+
* `enabled: false` is a state that reads like a grant, is not one, and would
|
|
7
|
+
* come back the moment someone re-enabled.
|
|
8
|
+
*/
|
|
9
|
+
export default class NativeDisable extends Command {
|
|
10
|
+
static description: string;
|
|
11
|
+
static examples: string[];
|
|
12
|
+
static flags: {
|
|
13
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<void>;
|
|
17
|
+
}
|