@skrr-ai/cli 0.1.46 → 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/code/handover.d.ts +2 -2
- package/dist/commands/code/handover.js +12 -13
- package/dist/commands/code/install.js +31 -0
- package/dist/commands/code/update.d.ts +46 -0
- package/dist/commands/code/update.js +242 -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/convos/handover.d.ts +1 -0
- package/dist/commands/convos/handover.js +4 -0
- package/dist/commands/daemon/index.js +2 -0
- package/dist/commands/daemon/update.d.ts +19 -0
- package/dist/commands/daemon/update.js +48 -0
- 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/spaces/briefs/get.js +8 -0
- package/dist/commands/spaces/briefs/list.js +2 -0
- package/dist/commands/spaces/briefs/set.d.ts +3 -0
- package/dist/commands/spaces/briefs/set.js +78 -13
- package/dist/commands/spaces/expertise-suggestions.d.ts +12 -0
- package/dist/commands/spaces/expertise-suggestions.js +71 -0
- package/dist/commands/spaces/members/add.d.ts +1 -0
- package/dist/commands/spaces/members/add.js +11 -3
- package/dist/commands/spaces/members/list.js +11 -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/assign.d.ts +9 -0
- package/dist/commands/tasks/assign.js +108 -1
- 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/assignee-resolver.d.ts +22 -0
- package/dist/lib/assignee-resolver.js +26 -0
- package/dist/lib/balance.d.ts +6 -1
- package/dist/lib/balance.js +15 -0
- package/dist/lib/code-handover.d.ts +0 -10
- package/dist/lib/code-handover.js +20 -5
- 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/lib/update-check.d.ts +80 -7
- package/dist/lib/update-check.js +365 -33
- 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/firstPartyHarness.d.ts +9 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.js +8 -0
- 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/firstPartyHarness.d.ts +9 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.js +8 -0
- 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 +5067 -4821
- package/oclif.manifest.json +34877 -28659
- package/package.json +43 -1
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
* Turn native application control off.
|
|
7
|
+
*
|
|
8
|
+
* Both flags go off together: leaving `allowCloudAgents` true under
|
|
9
|
+
* `enabled: false` is a state that reads like a grant, is not one, and would
|
|
10
|
+
* come back the moment someone re-enabled.
|
|
11
|
+
*/
|
|
12
|
+
class NativeDisable extends core_1.Command {
|
|
13
|
+
static description = 'Turn native application control off for this computer';
|
|
14
|
+
static examples = ['<%= config.bin %> native disable'];
|
|
15
|
+
static flags = {
|
|
16
|
+
...native_1.nativeProfileFlag,
|
|
17
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
const { flags } = await this.parse(NativeDisable);
|
|
21
|
+
await (0, native_1.forwardNativeCommand)(this, [
|
|
22
|
+
'disable',
|
|
23
|
+
...(0, native_1.profilePassthrough)(flags.profile),
|
|
24
|
+
...(flags.json ? ['--json'] : []),
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.default = NativeDisable;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/** Turn native application control on for this computer. */
|
|
3
|
+
export default class NativeEnable extends Command {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
'cloud-agents': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const native_1 = require("../native");
|
|
5
|
+
/** Turn native application control on for this computer. */
|
|
6
|
+
class NativeEnable extends core_1.Command {
|
|
7
|
+
static description = 'Turn native application control on for this computer';
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> native enable',
|
|
10
|
+
'<%= config.bin %> native enable --cloud-agents',
|
|
11
|
+
];
|
|
12
|
+
static flags = {
|
|
13
|
+
...native_1.nativeProfileFlag,
|
|
14
|
+
'cloud-agents': core_1.Flags.boolean({
|
|
15
|
+
description: 'Also allow cloud agents to drive native apps on this computer',
|
|
16
|
+
}),
|
|
17
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
const { flags } = await this.parse(NativeEnable);
|
|
21
|
+
await (0, native_1.forwardNativeCommand)(this, [
|
|
22
|
+
'enable',
|
|
23
|
+
...(0, native_1.profilePassthrough)(flags.profile),
|
|
24
|
+
...(flags['cloud-agents'] ? ['--cloud-agents'] : []),
|
|
25
|
+
...(flags.json ? ['--json'] : []),
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.default = NativeEnable;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* List the applications running on this computer, marking which may take
|
|
4
|
+
* irreversible actions.
|
|
5
|
+
*
|
|
6
|
+
* This is how the scope gets CHOSEN, so it works before anything is in scope —
|
|
7
|
+
* the same reason `list_apps` is one of two verbs the policy exempts from the
|
|
8
|
+
* app check. Without it a user had to guess an application's exact name and
|
|
9
|
+
* hope the comparison matched.
|
|
10
|
+
*/
|
|
11
|
+
export default class NativeListApps extends Command {
|
|
12
|
+
static description: string;
|
|
13
|
+
static examples: string[];
|
|
14
|
+
static flags: {
|
|
15
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
|
+
};
|
|
18
|
+
run(): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
* List the applications running on this computer, marking which may take
|
|
7
|
+
* irreversible actions.
|
|
8
|
+
*
|
|
9
|
+
* This is how the scope gets CHOSEN, so it works before anything is in scope —
|
|
10
|
+
* the same reason `list_apps` is one of two verbs the policy exempts from the
|
|
11
|
+
* app check. Without it a user had to guess an application's exact name and
|
|
12
|
+
* hope the comparison matched.
|
|
13
|
+
*/
|
|
14
|
+
class NativeListApps extends core_1.Command {
|
|
15
|
+
static description = 'List running applications and which may take irreversible actions';
|
|
16
|
+
static examples = ['<%= config.bin %> native list-apps'];
|
|
17
|
+
static flags = {
|
|
18
|
+
...native_1.nativeProfileFlag,
|
|
19
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
20
|
+
};
|
|
21
|
+
async run() {
|
|
22
|
+
const { flags } = await this.parse(NativeListApps);
|
|
23
|
+
await (0, native_1.forwardNativeCommand)(this, [
|
|
24
|
+
'list-apps',
|
|
25
|
+
...(0, native_1.profilePassthrough)(flags.profile),
|
|
26
|
+
...(flags.json ? ['--json'] : []),
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.default = NativeListApps;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* Narrow native control to a specific set of applications.
|
|
4
|
+
*
|
|
5
|
+
* The default is every application — enabling native control IS the consent,
|
|
6
|
+
* and this is for someone who wants less than that. It used to be the other
|
|
7
|
+
* way round: an allow-list that authorized nothing when empty, so the shipped
|
|
8
|
+
* default was a session that could do nothing and the escape was `"*"`.
|
|
9
|
+
*/
|
|
10
|
+
export default class NativeRestrictTo extends Command {
|
|
11
|
+
static description: string;
|
|
12
|
+
static examples: string[];
|
|
13
|
+
static strict: boolean;
|
|
14
|
+
static args: {
|
|
15
|
+
apps: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
16
|
+
};
|
|
17
|
+
static flags: {
|
|
18
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
19
|
+
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
|
+
};
|
|
21
|
+
run(): Promise<void>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
* Narrow native control to a specific set of applications.
|
|
7
|
+
*
|
|
8
|
+
* The default is every application — enabling native control IS the consent,
|
|
9
|
+
* and this is for someone who wants less than that. It used to be the other
|
|
10
|
+
* way round: an allow-list that authorized nothing when empty, so the shipped
|
|
11
|
+
* default was a session that could do nothing and the escape was `"*"`.
|
|
12
|
+
*/
|
|
13
|
+
class NativeRestrictTo extends core_1.Command {
|
|
14
|
+
static description = 'Narrow native control to a specific set of applications';
|
|
15
|
+
static examples = [
|
|
16
|
+
'<%= config.bin %> native restrict-to "Slack" "Notes"',
|
|
17
|
+
'<%= config.bin %> native restrict-to com.apple.Notes',
|
|
18
|
+
];
|
|
19
|
+
static strict = false;
|
|
20
|
+
static args = {
|
|
21
|
+
apps: core_1.Args.string({
|
|
22
|
+
description: 'Application names or bundle ids',
|
|
23
|
+
required: true,
|
|
24
|
+
ignoreStdin: true,
|
|
25
|
+
}),
|
|
26
|
+
};
|
|
27
|
+
static flags = {
|
|
28
|
+
...native_1.nativeProfileFlag,
|
|
29
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
30
|
+
};
|
|
31
|
+
async run() {
|
|
32
|
+
const { argv, flags } = await this.parse(NativeRestrictTo);
|
|
33
|
+
await (0, native_1.forwardNativeCommand)(this, [
|
|
34
|
+
'restrict-to',
|
|
35
|
+
...(0, native_1.profilePassthrough)(flags.profile),
|
|
36
|
+
...argv.filter((a) => a !== '--json'),
|
|
37
|
+
...(flags.json ? ['--json'] : []),
|
|
38
|
+
]);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.default = NativeRestrictTo;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* Whether native control is on, which apps may take irreversible actions, and
|
|
4
|
+
* whether the helper can actually run.
|
|
5
|
+
*
|
|
6
|
+
* The last part is the one that had nowhere to appear. `/health` has carried
|
|
7
|
+
* seven `nativeUi` diagnostic fields since OSK-11016 and NOTHING read them, so
|
|
8
|
+
* a user could not tell "turned off" from "helper not installed" from "TCC not
|
|
9
|
+
* granted" — three different repairs behind one silence.
|
|
10
|
+
*/
|
|
11
|
+
export default class NativeStatus extends Command {
|
|
12
|
+
static description: string;
|
|
13
|
+
static examples: string[];
|
|
14
|
+
static flags: {
|
|
15
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
|
+
};
|
|
18
|
+
run(): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
* Whether native control is on, which apps may take irreversible actions, and
|
|
7
|
+
* whether the helper can actually run.
|
|
8
|
+
*
|
|
9
|
+
* The last part is the one that had nowhere to appear. `/health` has carried
|
|
10
|
+
* seven `nativeUi` diagnostic fields since OSK-11016 and NOTHING read them, so
|
|
11
|
+
* a user could not tell "turned off" from "helper not installed" from "TCC not
|
|
12
|
+
* granted" — three different repairs behind one silence.
|
|
13
|
+
*/
|
|
14
|
+
class NativeStatus extends core_1.Command {
|
|
15
|
+
static description = 'Show whether native control is on, which apps may send or delete, and helper health';
|
|
16
|
+
static examples = [
|
|
17
|
+
'<%= config.bin %> native status',
|
|
18
|
+
'<%= config.bin %> native status --json',
|
|
19
|
+
];
|
|
20
|
+
static flags = {
|
|
21
|
+
...native_1.nativeProfileFlag,
|
|
22
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
23
|
+
};
|
|
24
|
+
async run() {
|
|
25
|
+
const { flags } = await this.parse(NativeStatus);
|
|
26
|
+
await (0, native_1.forwardNativeCommand)(this, [
|
|
27
|
+
'status',
|
|
28
|
+
...(0, native_1.profilePassthrough)(flags.profile),
|
|
29
|
+
...(flags.json ? ['--json'] : []),
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.default = NativeStatus;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* `--profile` is a GLOBAL flag on the runtime binary, so every `skrr native`
|
|
4
|
+
* subcommand has to declare it to be reachable — `native status` itself tells
|
|
5
|
+
* users "use --profile to target one" when sibling profiles have live daemons,
|
|
6
|
+
* and without this declaration that advice could not be followed (OSK-11100).
|
|
7
|
+
*/
|
|
8
|
+
export declare const nativeProfileFlag: {
|
|
9
|
+
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
};
|
|
11
|
+
/** The passthrough form of the parsed profile flag, or nothing. */
|
|
12
|
+
export declare function profilePassthrough(profile: string | undefined): string[];
|
|
13
|
+
export declare function buildNativeArgs(passthrough: readonly string[]): string[];
|
|
14
|
+
/**
|
|
15
|
+
* Forward one `skrr native` command to the daemon.
|
|
16
|
+
*
|
|
17
|
+
* Native application control is consent that belongs to the person at the
|
|
18
|
+
* machine, so the setting lives in that machine's `daemon.json` and a cloud
|
|
19
|
+
* request can never write it (OSK-11018). The CLI is a bridge for the same
|
|
20
|
+
* reason `skrr browser` is: the capability is the daemon's, and a second
|
|
21
|
+
* implementation here would be a second place for the policy to drift.
|
|
22
|
+
*
|
|
23
|
+
* Until this existed the setting had NO command at all. The executor's own
|
|
24
|
+
* refusal told users to "set `nativeUi.enabled` and `nativeUi.allowCloudAgents`
|
|
25
|
+
* in the local daemon configuration" — a file it did not name — so the product's
|
|
26
|
+
* answer to "how do I turn this on" was to open a JSON file.
|
|
27
|
+
*/
|
|
28
|
+
export declare function forwardNativeCommand(command: Command, passthrough: readonly string[]): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* `skrr native` is the stable user-facing entry point for native application
|
|
31
|
+
* control. Keeping it a thin bridge is what stops the REST CLI acquiring its
|
|
32
|
+
* own copy of the app-scope rules.
|
|
33
|
+
*/
|
|
34
|
+
export default class Native extends Command {
|
|
35
|
+
static description: string;
|
|
36
|
+
static examples: string[];
|
|
37
|
+
static strict: boolean;
|
|
38
|
+
run(): Promise<void>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nativeProfileFlag = void 0;
|
|
4
|
+
exports.profilePassthrough = profilePassthrough;
|
|
5
|
+
exports.buildNativeArgs = buildNativeArgs;
|
|
6
|
+
exports.forwardNativeCommand = forwardNativeCommand;
|
|
7
|
+
const core_1 = require("@oclif/core");
|
|
8
|
+
const exec_runtime_binary_1 = require("../lib/exec-runtime-binary");
|
|
9
|
+
/**
|
|
10
|
+
* `--profile` is a GLOBAL flag on the runtime binary, so every `skrr native`
|
|
11
|
+
* subcommand has to declare it to be reachable — `native status` itself tells
|
|
12
|
+
* users "use --profile to target one" when sibling profiles have live daemons,
|
|
13
|
+
* and without this declaration that advice could not be followed (OSK-11100).
|
|
14
|
+
*/
|
|
15
|
+
exports.nativeProfileFlag = {
|
|
16
|
+
profile: core_1.Flags.string({
|
|
17
|
+
description: 'Which daemon profile to target — `native status` lists the running ones',
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
20
|
+
/** The passthrough form of the parsed profile flag, or nothing. */
|
|
21
|
+
function profilePassthrough(profile) {
|
|
22
|
+
return profile ? ['--profile', profile] : [];
|
|
23
|
+
}
|
|
24
|
+
function buildNativeArgs(passthrough) {
|
|
25
|
+
return ['native', ...passthrough];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Forward one `skrr native` command to the daemon.
|
|
29
|
+
*
|
|
30
|
+
* Native application control is consent that belongs to the person at the
|
|
31
|
+
* machine, so the setting lives in that machine's `daemon.json` and a cloud
|
|
32
|
+
* request can never write it (OSK-11018). The CLI is a bridge for the same
|
|
33
|
+
* reason `skrr browser` is: the capability is the daemon's, and a second
|
|
34
|
+
* implementation here would be a second place for the policy to drift.
|
|
35
|
+
*
|
|
36
|
+
* Until this existed the setting had NO command at all. The executor's own
|
|
37
|
+
* refusal told users to "set `nativeUi.enabled` and `nativeUi.allowCloudAgents`
|
|
38
|
+
* in the local daemon configuration" — a file it did not name — so the product's
|
|
39
|
+
* answer to "how do I turn this on" was to open a JSON file.
|
|
40
|
+
*/
|
|
41
|
+
async function forwardNativeCommand(command, passthrough) {
|
|
42
|
+
try {
|
|
43
|
+
if ((await (0, exec_runtime_binary_1.runtimeBinarySupportsSubcommand)('native')) === false) {
|
|
44
|
+
command.error('The local `skrr` daemon does not support native application control yet. ' +
|
|
45
|
+
'Update or reinstall the daemon, then retry `skrr native`.', { exit: 2 });
|
|
46
|
+
}
|
|
47
|
+
command.exit(await (0, exec_runtime_binary_1.execRuntimeBinary)(buildNativeArgs(passthrough)));
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
if (error.message === 'runtime-binary-not-installed') {
|
|
51
|
+
command.log((0, exec_runtime_binary_1.notInstalledMessage)());
|
|
52
|
+
command.exit(127);
|
|
53
|
+
}
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* `skrr native` is the stable user-facing entry point for native application
|
|
59
|
+
* control. Keeping it a thin bridge is what stops the REST CLI acquiring its
|
|
60
|
+
* own copy of the app-scope rules.
|
|
61
|
+
*/
|
|
62
|
+
class Native extends core_1.Command {
|
|
63
|
+
static description = 'Configure and diagnose native application control on this computer';
|
|
64
|
+
static examples = [
|
|
65
|
+
'<%= config.bin %> native status',
|
|
66
|
+
'<%= config.bin %> native enable --cloud-agents',
|
|
67
|
+
'<%= config.bin %> native list-apps',
|
|
68
|
+
'<%= config.bin %> native allow "Slack"',
|
|
69
|
+
];
|
|
70
|
+
static strict = false;
|
|
71
|
+
async run() {
|
|
72
|
+
const { argv } = await this.parse(Native);
|
|
73
|
+
await forwardNativeCommand(this, argv);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.default = Native;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* `skrr service` — the guest-local face of declared services.
|
|
4
|
+
*
|
|
5
|
+
* These commands run INSIDE a Dedicated Runtime guest, on the daemon's
|
|
6
|
+
* workload socket — the lane agents use to propose a service to the owner
|
|
7
|
+
* and to read what services exist. The owner-facing equivalents live at
|
|
8
|
+
* `skrr machines dedicated service`.
|
|
9
|
+
*/
|
|
10
|
+
export default class ServiceCommands extends Command {
|
|
11
|
+
static description: string;
|
|
12
|
+
static examples: string[];
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
/**
|
|
5
|
+
* `skrr service` — the guest-local face of declared services.
|
|
6
|
+
*
|
|
7
|
+
* These commands run INSIDE a Dedicated Runtime guest, on the daemon's
|
|
8
|
+
* workload socket — the lane agents use to propose a service to the owner
|
|
9
|
+
* and to read what services exist. The owner-facing equivalents live at
|
|
10
|
+
* `skrr machines dedicated service`.
|
|
11
|
+
*/
|
|
12
|
+
class ServiceCommands extends core_1.Command {
|
|
13
|
+
static description = 'Services on this Dedicated Runtime — propose one to the owner, or list/status/logs what is declared (guest-local)';
|
|
14
|
+
static examples = [
|
|
15
|
+
'<%= config.bin %> service propose --file service.json',
|
|
16
|
+
'<%= config.bin %> service propose --name worker --cwd /workspace/repos/app -- node dist/worker.js',
|
|
17
|
+
'<%= config.bin %> service ls',
|
|
18
|
+
'<%= config.bin %> service status <name>',
|
|
19
|
+
'<%= config.bin %> service logs <name> --tail 4096',
|
|
20
|
+
];
|
|
21
|
+
async run() {
|
|
22
|
+
this.log('skrr service commands (run on the machine itself):');
|
|
23
|
+
this.log(' skrr service propose ask the owner to declare a service (agent lane)');
|
|
24
|
+
this.log(' skrr service ls list declared services');
|
|
25
|
+
this.log(' skrr service status one service’s computed state');
|
|
26
|
+
this.log(' skrr service logs print a service’s log tail');
|
|
27
|
+
this.log('');
|
|
28
|
+
this.log('Owner-side management from your own machine: `skrr machines dedicated service`.');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.default = ServiceCommands;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { GuestServiceCommand } from '../../lib/guest-service-command';
|
|
2
|
+
/**
|
|
3
|
+
* `skrr service logs` — a byte tail of a service's stored log, read on the
|
|
4
|
+
* machine itself (guest-local, read-only, no follow — the owner lane follows
|
|
5
|
+
* over the relay).
|
|
6
|
+
*/
|
|
7
|
+
export default class ServiceLogs extends GuestServiceCommand {
|
|
8
|
+
static summary: string;
|
|
9
|
+
static examples: string[];
|
|
10
|
+
static args: {
|
|
11
|
+
name: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
12
|
+
};
|
|
13
|
+
static flags: {
|
|
14
|
+
tail: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const guest_service_command_1 = require("../../lib/guest-service-command");
|
|
5
|
+
/**
|
|
6
|
+
* `skrr service logs` — a byte tail of a service's stored log, read on the
|
|
7
|
+
* machine itself (guest-local, read-only, no follow — the owner lane follows
|
|
8
|
+
* over the relay).
|
|
9
|
+
*/
|
|
10
|
+
class ServiceLogs extends guest_service_command_1.GuestServiceCommand {
|
|
11
|
+
static summary = 'Print a service’s log tail on this machine (guest-local)';
|
|
12
|
+
static examples = [
|
|
13
|
+
'<%= config.bin %> service logs <name>',
|
|
14
|
+
'<%= config.bin %> service logs <name> --tail 4096',
|
|
15
|
+
];
|
|
16
|
+
static args = {
|
|
17
|
+
name: core_1.Args.string({ description: 'Service name', required: true, ignoreStdin: true }),
|
|
18
|
+
};
|
|
19
|
+
static flags = {
|
|
20
|
+
tail: core_1.Flags.integer({
|
|
21
|
+
description: 'Bytes from the end of the stored log to print (daemon rotates at 8 MiB)',
|
|
22
|
+
min: 0,
|
|
23
|
+
}),
|
|
24
|
+
json: core_1.Flags.boolean({ description: 'Output the reply as JSON' }),
|
|
25
|
+
};
|
|
26
|
+
async run() {
|
|
27
|
+
this.requireGuest();
|
|
28
|
+
const { args, flags } = await this.parse(ServiceLogs);
|
|
29
|
+
const reply = await this.guestRead('logs', {
|
|
30
|
+
name: args.name,
|
|
31
|
+
...(flags.tail !== undefined ? { tailBytes: flags.tail } : {}),
|
|
32
|
+
});
|
|
33
|
+
const result = (reply.result ?? reply);
|
|
34
|
+
if (flags.json) {
|
|
35
|
+
this.log(JSON.stringify(result, null, 2));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
// The daemon's `data` is base64 — write the decoded BYTES verbatim; a
|
|
39
|
+
// utf8 round-trip mangles non-text output (the same rule the owner-lane
|
|
40
|
+
// `service logs` follows).
|
|
41
|
+
if (typeof result.data === 'string' && result.data.length > 0) {
|
|
42
|
+
const bytes = Buffer.from(result.data, 'base64');
|
|
43
|
+
process.stdout.write(bytes);
|
|
44
|
+
if (bytes.length > 0 && bytes[bytes.length - 1] !== 0x0a)
|
|
45
|
+
process.stdout.write('\n');
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const text = result.log ?? '';
|
|
49
|
+
if (text)
|
|
50
|
+
process.stdout.write(text.endsWith('\n') ? text : `${text}\n`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.default = ServiceLogs;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GuestServiceCommand } from '../../lib/guest-service-command';
|
|
2
|
+
/**
|
|
3
|
+
* `skrr service ls` — the services declared on this machine, read from the
|
|
4
|
+
* daemon's workload socket (guest-local, read-only).
|
|
5
|
+
*/
|
|
6
|
+
export default class ServiceLs extends GuestServiceCommand {
|
|
7
|
+
static summary: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static flags: {
|
|
10
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|