@skrr-ai/cli 0.1.48 → 0.1.50

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.
Files changed (117) hide show
  1. package/README.md +5 -4
  2. package/dist/base-command.js +16 -4
  3. package/dist/commands/agent-worker.d.ts +12 -0
  4. package/dist/commands/agent-worker.js +140 -0
  5. package/dist/commands/agents/create.js +14 -7
  6. package/dist/commands/agents/update.js +11 -5
  7. package/dist/commands/code/index.d.ts +1 -0
  8. package/dist/commands/code/index.js +49 -5
  9. package/dist/commands/code/run.js +5 -1
  10. package/dist/commands/commitments/cycles.d.ts +19 -0
  11. package/dist/commands/commitments/cycles.js +46 -0
  12. package/dist/commands/commitments/effective-policy.js +26 -1
  13. package/dist/commands/commitments/explain.d.ts +17 -0
  14. package/dist/commands/commitments/explain.js +40 -0
  15. package/dist/commands/goals/create.d.ts +1 -0
  16. package/dist/commands/goals/create.js +22 -0
  17. package/dist/commands/logout.js +12 -1
  18. package/dist/commands/machines/dedicated/index.js +1 -1
  19. package/dist/commands/machines/dedicated/sign-in.js +4 -1
  20. package/dist/commands/machines/dedicated/terminal/kill.d.ts +21 -0
  21. package/dist/commands/machines/dedicated/terminal/kill.js +55 -0
  22. package/dist/commands/machines/dedicated/terminal/ls.d.ts +22 -0
  23. package/dist/commands/machines/dedicated/terminal/ls.js +70 -0
  24. package/dist/commands/machines/dedicated/terminal/rename.d.ts +23 -0
  25. package/dist/commands/machines/dedicated/terminal/rename.js +64 -0
  26. package/dist/commands/machines/dedicated/terminal.d.ts +9 -0
  27. package/dist/commands/machines/dedicated/terminal.js +27 -2
  28. package/dist/commands/machines/hosted/connect.js +2 -2
  29. package/dist/commands/machines/hosted/destroy.js +1 -1
  30. package/dist/commands/machines/hosted/exec.js +1 -1
  31. package/dist/commands/machines/hosted/list.js +1 -1
  32. package/dist/commands/machines/hosted/pause.js +1 -1
  33. package/dist/commands/machines/hosted/pull.js +1 -1
  34. package/dist/commands/machines/hosted/resume.js +1 -1
  35. package/dist/commands/machines/hosted/start.js +2 -2
  36. package/dist/commands/machines/hosted/status.js +2 -1
  37. package/dist/commands/tasks/create.js +1 -0
  38. package/dist/commands/tasks/list.js +1 -0
  39. package/dist/commands/tasks/update.js +1 -0
  40. package/dist/lib/agent-config.d.ts +2 -0
  41. package/dist/lib/agent-config.js +3 -1
  42. package/dist/lib/api-fetch.js +19 -0
  43. package/dist/lib/auth-storage.d.ts +14 -0
  44. package/dist/lib/auth-storage.js +14 -0
  45. package/dist/lib/commitments.d.ts +17 -2
  46. package/dist/lib/commitments.js +114 -0
  47. package/dist/lib/daemon-installer.d.ts +6 -5
  48. package/dist/lib/daemon-installer.js +4 -17
  49. package/dist/lib/daemonBroker.d.ts +120 -31
  50. package/dist/lib/daemonBroker.js +313 -20
  51. package/dist/lib/dedicated-lease-command.d.ts +14 -0
  52. package/dist/lib/dedicated-lease-command.js +30 -1
  53. package/dist/lib/dedicated-machines.js +8 -25
  54. package/dist/lib/dedicated-service-command.d.ts +11 -3
  55. package/dist/lib/dedicated-service-command.js +20 -3
  56. package/dist/lib/dedicated-service.d.ts +46 -0
  57. package/dist/lib/dedicated-service.js +85 -7
  58. package/dist/lib/dedicated-terminal.d.ts +21 -0
  59. package/dist/lib/dedicated-terminal.js +104 -9
  60. package/dist/lib/first-party-harness-broker.d.ts +10 -0
  61. package/dist/lib/first-party-harness-broker.js +9 -0
  62. package/dist/lib/first-party-harness-doctor.js +41 -1
  63. package/dist/lib/first-party-harness-managed.d.ts +4 -3
  64. package/dist/lib/first-party-harness-project-trust.d.ts +125 -0
  65. package/dist/lib/first-party-harness-project-trust.js +364 -0
  66. package/dist/lib/first-party-harness.d.ts +9 -2
  67. package/dist/lib/first-party-harness.js +6 -5
  68. package/dist/lib/hosted-machines.d.ts +10 -1
  69. package/dist/lib/hosted-machines.js +36 -2
  70. package/dist/lib/login.js +16 -0
  71. package/dist/lib/machine-spend-cap.d.ts +23 -0
  72. package/dist/lib/machine-spend-cap.js +68 -0
  73. package/dist/lib/node-adapter.js +15 -3
  74. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.d.ts +90 -0
  75. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.js +113 -0
  76. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialSession.d.ts +47 -0
  77. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialSession.js +69 -0
  78. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonToolApproval.d.ts +109 -0
  79. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonToolApproval.js +171 -0
  80. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.d.ts +1 -1
  81. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.js +1 -1
  82. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +1 -1
  83. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +4 -2
  84. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/messages.d.ts +8 -3
  85. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/messages.js +9 -4
  86. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +8 -9
  87. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refreshClassification.d.ts +6 -0
  88. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refreshClassification.js +32 -9
  89. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseManifest.d.ts +38 -0
  90. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseManifest.js +66 -1
  91. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.d.ts +81 -0
  92. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.js +87 -0
  93. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/types.d.ts +6 -1
  94. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.d.ts +90 -0
  95. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.js +105 -0
  96. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialSession.d.ts +47 -0
  97. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialSession.js +66 -0
  98. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonToolApproval.d.ts +109 -0
  99. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonToolApproval.js +164 -0
  100. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.d.ts +1 -1
  101. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.js +1 -1
  102. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +1 -1
  103. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +1 -1
  104. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/messages.d.ts +8 -3
  105. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/messages.js +9 -4
  106. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +8 -9
  107. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refreshClassification.d.ts +6 -0
  108. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refreshClassification.js +31 -9
  109. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseManifest.d.ts +38 -0
  110. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseManifest.js +64 -0
  111. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.d.ts +81 -0
  112. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.js +80 -0
  113. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/types.d.ts +6 -1
  114. package/dist/node_modules/@skrr-ai/auth-core/package.json +41 -1
  115. package/dist/node_modules/@skrr-ai/data-provider/index.js +3413 -3343
  116. package/oclif.manifest.json +8930 -8466
  117. package/package.json +4 -1
@@ -5,6 +5,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
5
5
  const base_command_1 = require("../../base-command");
6
6
  const web_url_1 = require("../../lib/web-url");
7
7
  const prompt_1 = require("../../lib/prompt");
8
+ const label_ref_1 = require("../../lib/label-ref");
8
9
  const projects_1 = require("../../lib/projects");
9
10
  const created_line_1 = require("../../lib/created-line");
10
11
  class GoalsCreate extends base_command_1.BaseCommand {
@@ -30,6 +31,10 @@ class GoalsCreate extends base_command_1.BaseCommand {
30
31
  }),
31
32
  'target-date': core_1.Flags.string({ description: 'Target date (YYYY-MM-DD or ISO timestamp)' }),
32
33
  space: core_1.Flags.string({ description: 'Space ID to link this goal into after creation' }),
34
+ label: core_1.Flags.string({
35
+ description: 'Attach a label (repeatable) — id, or a name from `skrr labels list --applicable-to goal`. An unknown name is refused, never created.',
36
+ multiple: true,
37
+ }),
33
38
  project: core_1.Flags.string({
34
39
  description: 'Project to contain this goal — id, or a ref (OSK-P-12) alongside --space, or a qualified ref (OSK-S-3/OSK-P-12)',
35
40
  }),
@@ -102,6 +107,23 @@ class GoalsCreate extends base_command_1.BaseCommand {
102
107
  exit: 1,
103
108
  });
104
109
  }
110
+ let resolvedLabelIds;
111
+ try {
112
+ const ids = await (0, label_ref_1.resolveLabelRefs)(flags.label, {
113
+ applicableTo: 'goal',
114
+ ...(process.env.OVERSKY_WORKSPACE_ID
115
+ ? { workspaceId: process.env.OVERSKY_WORKSPACE_ID }
116
+ : {}),
117
+ });
118
+ resolvedLabelIds = ids.length > 0 ? ids : undefined;
119
+ }
120
+ catch (err) {
121
+ if (err instanceof label_ref_1.LabelRefError)
122
+ this.error(err.message, { exit: 1 });
123
+ this.handleApiError(err);
124
+ }
125
+ if (resolvedLabelIds)
126
+ payload.labelIds = resolvedLabelIds;
105
127
  let created;
106
128
  try {
107
129
  created = await data_provider_1.dataService.createGoal(payload);
@@ -39,6 +39,7 @@ const base_command_1 = require("../base-command");
39
39
  const config_1 = require("../lib/config");
40
40
  const first_party_harness_managed_1 = require("../lib/first-party-harness-managed");
41
41
  const auth_storage_1 = require("../lib/auth-storage");
42
+ const daemonBroker_1 = require("../lib/daemonBroker");
42
43
  const refresh_1 = require("../lib/refresh");
43
44
  const api_fetch_1 = require("../lib/api-fetch");
44
45
  const cred_envelope_1 = require("../lib/cred-envelope");
@@ -129,7 +130,17 @@ class Logout extends base_command_1.BaseCommand {
129
130
  hasUnreadableEncryptedToken,
130
131
  allDevices: flags['all-devices'],
131
132
  })) {
132
- this.log('Not signed in. Nothing to do.');
133
+ // On a broker-mode machine (a Dedicated guest descriptor advertising
134
+ // `access_token`) there IS no local credential to clear — the CLI holds
135
+ // a per-process token redeemed over loopback and nothing is persisted.
136
+ // Say that honestly rather than reporting a logout that did not happen.
137
+ if ((0, daemonBroker_1.findBrokeredHandoffDescriptor)()) {
138
+ this.log("This machine is signed in through the platform's managed hand-off; " +
139
+ 'there is no local credential to clear.');
140
+ }
141
+ else {
142
+ this.log('Not signed in. Nothing to do.');
143
+ }
133
144
  return;
134
145
  }
135
146
  if (flags['all-devices'] && !hasUsableLocalToken) {
@@ -40,7 +40,7 @@ class DedicatedMachines extends core_1.Command {
40
40
  ['show', 'state, size, spend, health and engines of one lease'],
41
41
  ['current', 'the lease of the machine this runs on (or pass `self`)'],
42
42
  ['attach', 'pin an agent so its work runs on the machine'],
43
- ['terminal', 'open an interactive shell on the machine'],
43
+ ['terminal', 'open a shell that survives disconnect (ls|kill|rename manage it)'],
44
44
  ['sign-in', 'sign in to GitHub CLI, Claude Code or Codex there'],
45
45
  ['exec', 'run one command; output and exit code'],
46
46
  ['cp', 'copy a file to or from the machine'],
@@ -44,7 +44,10 @@ class DedicatedMachinesSignIn extends dedicated_lease_command_1.DedicatedLeaseCo
44
44
  // Said before, not after: once the code is entered the credential already
45
45
  // sits on the workspace volume, in every later snapshot.
46
46
  process.stderr.write(`${preset.label} sign-in is stored on the workspace volume and shared by everything running as skrr-workload on this machine, including agents. Prefer a narrowly-scoped account or token.\n`);
47
- await this.openDedicatedTerminal(args.lease, flags, preset.command);
47
+ // Its own named session — not `main`: a sign-in typed into a shell that
48
+ // is running a dev server would wait forever for a prompt that is not
49
+ // coming, and the session survives a detached OAuth flow either way.
50
+ await this.openDedicatedTerminal(args.lease, { ...flags, name: 'sign-in' }, preset.command);
48
51
  }
49
52
  }
50
53
  exports.default = DedicatedMachinesSignIn;
@@ -0,0 +1,21 @@
1
+ import { DedicatedServiceCommand } from '../../../../lib/dedicated-service-command';
2
+ /**
3
+ * `skrr machines dedicated terminal kill` — end a persistent session.
4
+ *
5
+ * Detaching (Ctrl-], a dropped connection, `terminal` exiting) never ends a
6
+ * session — the machine keeps the tmux session and everything in it alive
7
+ * by design. This is the explicit verb that destroys one: the shell and its
8
+ * whole process tree stop with it.
9
+ */
10
+ export default class DedicatedMachinesTerminalKill extends DedicatedServiceCommand {
11
+ static description: string;
12
+ static examples: string[];
13
+ static args: {
14
+ lease: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
15
+ name: 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
+ }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const dedicated_service_command_1 = require("../../../../lib/dedicated-service-command");
5
+ const dedicated_service_1 = require("../../../../lib/dedicated-service");
6
+ /**
7
+ * `skrr machines dedicated terminal kill` — end a persistent session.
8
+ *
9
+ * Detaching (Ctrl-], a dropped connection, `terminal` exiting) never ends a
10
+ * session — the machine keeps the tmux session and everything in it alive
11
+ * by design. This is the explicit verb that destroys one: the shell and its
12
+ * whole process tree stop with it.
13
+ */
14
+ class DedicatedMachinesTerminalKill extends dedicated_service_command_1.DedicatedServiceCommand {
15
+ static description = 'End a persistent terminal session on a Dedicated Runtime — its shell and everything running in it stop.';
16
+ static examples = [
17
+ '<%= config.bin %> machines dedicated terminal kill <lease-id> term-2',
18
+ '<%= config.bin %> machines dedicated terminal ls <lease-id>',
19
+ ];
20
+ static args = {
21
+ lease: core_1.Args.string({
22
+ description: dedicated_service_command_1.SERVICE_LEASE_ARG_DESCRIPTION,
23
+ required: true,
24
+ ignoreStdin: true,
25
+ }),
26
+ name: core_1.Args.string({
27
+ description: 'Session name, as `terminal ls` prints it (e.g. main, term-2)',
28
+ required: true,
29
+ ignoreStdin: true,
30
+ }),
31
+ };
32
+ static flags = {
33
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
34
+ };
35
+ async run() {
36
+ this.requireAuth();
37
+ const { args, flags } = await this.parse(DedicatedMachinesTerminalKill);
38
+ if (!dedicated_service_1.DEDICATED_TERMINAL_NAME_PATTERN.test(args.name)) {
39
+ this.error('A session name is lowercase letters, digits and dashes, up to 32 characters (e.g. `dev`, `build-2`).', { exit: 2 });
40
+ }
41
+ const leaseId = await this.resolveLeaseArg(args.lease);
42
+ const result = await this.callDedicatedTerminal('kill', {
43
+ leaseId,
44
+ name: args.name,
45
+ ...this.scopeFrom(flags),
46
+ });
47
+ this.closeServiceChannel();
48
+ if (flags.json) {
49
+ this.log(JSON.stringify(result ?? { name: args.name, killed: true }, null, 2));
50
+ return;
51
+ }
52
+ this.log(`Terminal session '${args.name}' ended — its shell and everything running in it stopped.`);
53
+ }
54
+ }
55
+ exports.default = DedicatedMachinesTerminalKill;
@@ -0,0 +1,22 @@
1
+ import { DedicatedServiceCommand } from '../../../../lib/dedicated-service-command';
2
+ /**
3
+ * `skrr machines dedicated terminal ls` — the sessions the machine is
4
+ * keeping alive.
5
+ *
6
+ * A persistent terminal is a tmux session on the guest (`skrr-term-<name>`)
7
+ * that survives Ctrl-] detaches, disconnects and daemon restarts; this is
8
+ * the read side of the web lease card's resume picker. Sessions only ever
9
+ * end through `terminal kill` or the shell's own `exit` — nothing here is
10
+ * created implicitly.
11
+ */
12
+ export default class DedicatedMachinesTerminalLs extends DedicatedServiceCommand {
13
+ static description: string;
14
+ static examples: string[];
15
+ static args: {
16
+ lease: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
17
+ };
18
+ static flags: {
19
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
20
+ };
21
+ run(): Promise<void>;
22
+ }
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const dedicated_service_command_1 = require("../../../../lib/dedicated-service-command");
5
+ const format_1 = require("../../../../lib/format");
6
+ /**
7
+ * `skrr machines dedicated terminal ls` — the sessions the machine is
8
+ * keeping alive.
9
+ *
10
+ * A persistent terminal is a tmux session on the guest (`skrr-term-<name>`)
11
+ * that survives Ctrl-] detaches, disconnects and daemon restarts; this is
12
+ * the read side of the web lease card's resume picker. Sessions only ever
13
+ * end through `terminal kill` or the shell's own `exit` — nothing here is
14
+ * created implicitly.
15
+ */
16
+ class DedicatedMachinesTerminalLs extends dedicated_service_command_1.DedicatedServiceCommand {
17
+ static description = 'List the persistent terminal sessions a Dedicated Runtime is keeping alive (the tmux sessions `terminal` attaches to).';
18
+ static examples = [
19
+ '<%= config.bin %> machines dedicated terminal ls <lease-id>',
20
+ '<%= config.bin %> machines dedicated terminal ls <lease-id> --json',
21
+ ];
22
+ static args = {
23
+ lease: core_1.Args.string({
24
+ description: dedicated_service_command_1.SERVICE_LEASE_ARG_DESCRIPTION,
25
+ required: true,
26
+ ignoreStdin: true,
27
+ }),
28
+ };
29
+ static flags = {
30
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
31
+ };
32
+ async run() {
33
+ this.requireAuth();
34
+ const { args, flags } = await this.parse(DedicatedMachinesTerminalLs);
35
+ const leaseId = await this.resolveLeaseArg(args.lease);
36
+ const result = await this.callDedicatedTerminal('list', {
37
+ leaseId,
38
+ ...this.scopeFrom(flags),
39
+ });
40
+ this.closeServiceChannel();
41
+ if (flags.json) {
42
+ this.log(JSON.stringify(result ?? { sessions: [] }, null, 2));
43
+ return;
44
+ }
45
+ const sessions = result?.sessions ?? [];
46
+ if (sessions.length === 0) {
47
+ this.log(`No terminal sessions on ${leaseId}.`);
48
+ this.log(`Open one with \`${this.config.bin} machines dedicated terminal ${leaseId}\`.`);
49
+ return;
50
+ }
51
+ (0, format_1.renderTable)(sessions.map((session) => ({
52
+ name: (0, format_1.formatCell)(session.name),
53
+ attached: session.attached ? 'yes' : 'no',
54
+ created: (0, format_1.formatCell)(
55
+ // The daemon reports tmux `session_created`, which is SECONDS —
56
+ // `localStamp` reads a number as milliseconds.
57
+ typeof session.createdAt === 'number'
58
+ ? (0, format_1.localStamp)(session.createdAt * 1000)
59
+ : session.createdAt !== undefined
60
+ ? (0, format_1.localStamp)(session.createdAt)
61
+ : undefined),
62
+ })), [
63
+ { key: 'name', header: 'NAME', verbatim: true },
64
+ { key: 'attached', header: 'ATTACHED' },
65
+ { key: 'created', header: 'CREATED' },
66
+ ], (line) => this.log(line));
67
+ this.log(`Attach with \`${this.config.bin} machines dedicated terminal ${leaseId} --name <name>\`; end one with \`terminal kill\`.`);
68
+ }
69
+ }
70
+ exports.default = DedicatedMachinesTerminalLs;
@@ -0,0 +1,23 @@
1
+ import { DedicatedServiceCommand } from '../../../../lib/dedicated-service-command';
2
+ /**
3
+ * `skrr machines dedicated terminal rename` — give a live session a better
4
+ * name.
5
+ *
6
+ * The machine auto-names sessions it allocates (`term-1`, `term-2`, …);
7
+ * renaming one to `dev` or `build` makes the `terminal --name` you attach
8
+ * with self-explanatory. The session keeps running — a rename never
9
+ * detaches or restarts it.
10
+ */
11
+ export default class DedicatedMachinesTerminalRename extends DedicatedServiceCommand {
12
+ static description: string;
13
+ static examples: string[];
14
+ static args: {
15
+ lease: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
16
+ name: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
17
+ newName: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
18
+ };
19
+ static flags: {
20
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
21
+ };
22
+ run(): Promise<void>;
23
+ }
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const dedicated_service_command_1 = require("../../../../lib/dedicated-service-command");
5
+ const dedicated_service_1 = require("../../../../lib/dedicated-service");
6
+ /**
7
+ * `skrr machines dedicated terminal rename` — give a live session a better
8
+ * name.
9
+ *
10
+ * The machine auto-names sessions it allocates (`term-1`, `term-2`, …);
11
+ * renaming one to `dev` or `build` makes the `terminal --name` you attach
12
+ * with self-explanatory. The session keeps running — a rename never
13
+ * detaches or restarts it.
14
+ */
15
+ class DedicatedMachinesTerminalRename extends dedicated_service_command_1.DedicatedServiceCommand {
16
+ static description = 'Rename a persistent terminal session on a Dedicated Runtime (the session keeps running).';
17
+ static examples = [
18
+ '<%= config.bin %> machines dedicated terminal rename <lease-id> term-2 dev',
19
+ '<%= config.bin %> machines dedicated terminal ls <lease-id>',
20
+ ];
21
+ static args = {
22
+ lease: core_1.Args.string({
23
+ description: dedicated_service_command_1.SERVICE_LEASE_ARG_DESCRIPTION,
24
+ required: true,
25
+ ignoreStdin: true,
26
+ }),
27
+ name: core_1.Args.string({
28
+ description: 'Current session name, as `terminal ls` prints it',
29
+ required: true,
30
+ ignoreStdin: true,
31
+ }),
32
+ newName: core_1.Args.string({
33
+ description: 'The name to give it — lowercase letters, digits and dashes',
34
+ required: true,
35
+ ignoreStdin: true,
36
+ }),
37
+ };
38
+ static flags = {
39
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
40
+ };
41
+ async run() {
42
+ this.requireAuth();
43
+ const { args, flags } = await this.parse(DedicatedMachinesTerminalRename);
44
+ for (const name of [args.name, args.newName]) {
45
+ if (!dedicated_service_1.DEDICATED_TERMINAL_NAME_PATTERN.test(name)) {
46
+ this.error('A session name is lowercase letters, digits and dashes, up to 32 characters (e.g. `dev`, `build-2`).', { exit: 2 });
47
+ }
48
+ }
49
+ const leaseId = await this.resolveLeaseArg(args.lease);
50
+ const result = await this.callDedicatedTerminal('rename', {
51
+ leaseId,
52
+ name: args.name,
53
+ newName: args.newName,
54
+ ...this.scopeFrom(flags),
55
+ });
56
+ this.closeServiceChannel();
57
+ if (flags.json) {
58
+ this.log(JSON.stringify(result ?? { name: args.name, newName: args.newName }, null, 2));
59
+ return;
60
+ }
61
+ this.log(`Terminal session '${args.name}' is now '${args.newName}'.`);
62
+ }
63
+ }
64
+ exports.default = DedicatedMachinesTerminalRename;
@@ -7,6 +7,12 @@ import { DedicatedLeaseCommand } from '../../../lib/dedicated-lease-command';
7
7
  * `gh auth login`, a REPL, a dev server's interactive setup and `claude` itself
8
8
  * reachable only from a browser. This opens the same real PTY the web does,
9
9
  * through the same relay and the same admission.
10
+ *
11
+ * Sessions are persistent by default (always-on §6.4): the machine runs the
12
+ * shell inside tmux, so Ctrl-] detaches and the same command re-attaches the
13
+ * same session — a lost connection re-attaches too, when the machine's image
14
+ * announces `persistent_terminal_v1`. `terminal ls|kill|rename` are the
15
+ * session's management verbs; `--ephemeral` is the old disposable shell.
10
16
  */
11
17
  export default class DedicatedMachinesTerminal extends DedicatedLeaseCommand {
12
18
  static description: string;
@@ -17,6 +23,9 @@ export default class DedicatedMachinesTerminal extends DedicatedLeaseCommand {
17
23
  static flags: {
18
24
  cwd: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
25
  command: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
26
+ name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
27
+ new: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
28
+ ephemeral: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
20
29
  };
21
30
  run(): Promise<void>;
22
31
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
4
  const dedicated_lease_command_1 = require("../../../lib/dedicated-lease-command");
5
+ const dedicated_service_1 = require("../../../lib/dedicated-service");
5
6
  /**
6
7
  * `skrr machines dedicated terminal` — the web lease card's "Open terminal",
7
8
  * from a terminal.
@@ -10,13 +11,23 @@ const dedicated_lease_command_1 = require("../../../lib/dedicated-lease-command"
10
11
  * `gh auth login`, a REPL, a dev server's interactive setup and `claude` itself
11
12
  * reachable only from a browser. This opens the same real PTY the web does,
12
13
  * through the same relay and the same admission.
14
+ *
15
+ * Sessions are persistent by default (always-on §6.4): the machine runs the
16
+ * shell inside tmux, so Ctrl-] detaches and the same command re-attaches the
17
+ * same session — a lost connection re-attaches too, when the machine's image
18
+ * announces `persistent_terminal_v1`. `terminal ls|kill|rename` are the
19
+ * session's management verbs; `--ephemeral` is the old disposable shell.
13
20
  */
14
21
  class DedicatedMachinesTerminal extends dedicated_lease_command_1.DedicatedLeaseCommand {
15
- static description = 'Open an interactive shell on a Dedicated Runtime (a real PTY, as skrr-workload). Ctrl-] closes it.';
22
+ static description = 'Open an interactive shell on a Dedicated Runtime (a real PTY, as skrr-workload). The session persists on the machine: Ctrl-] detaches, and the same command re-attaches it.';
16
23
  static examples = [
17
24
  '<%= config.bin %> machines dedicated terminal <lease-id>',
25
+ '<%= config.bin %> machines dedicated terminal <lease-id> --name dev',
26
+ '<%= config.bin %> machines dedicated terminal <lease-id> --new',
27
+ '<%= config.bin %> machines dedicated terminal <lease-id> --ephemeral',
18
28
  '<%= config.bin %> machines dedicated terminal <lease-id> --cwd /workspace/repos/app',
19
29
  '<%= config.bin %> machines dedicated terminal <lease-id> --command "npm run dev"',
30
+ '<%= config.bin %> machines dedicated terminal ls <lease-id>',
20
31
  ];
21
32
  static args = {
22
33
  lease: core_1.Args.string({
@@ -27,15 +38,29 @@ class DedicatedMachinesTerminal extends dedicated_lease_command_1.DedicatedLease
27
38
  };
28
39
  static flags = {
29
40
  cwd: core_1.Flags.string({
30
- description: 'Directory to start in (defaults to HOME, /workspace/user-data)',
41
+ description: 'Directory to start in (defaults to HOME, /workspace/user-data). Only applied when the session is created — re-attaching one ignores it.',
31
42
  }),
32
43
  command: core_1.Flags.string({
33
44
  description: 'A command to type into the shell once it shows its prompt, as if you typed it. Not typed if you type first. The shell stays open after it.',
34
45
  }),
46
+ name: core_1.Flags.string({
47
+ description: "Attach or create the persistent session with this name (default 'main'). Lowercase letters, digits and dashes, up to 32 characters.",
48
+ }),
49
+ new: core_1.Flags.boolean({
50
+ description: 'Open a new persistent session instead of attaching one — the machine names it (term-1, term-2, …) and prints the name so it can be re-attached.',
51
+ exclusive: ['name'],
52
+ }),
53
+ ephemeral: core_1.Flags.boolean({
54
+ description: 'Open a disposable shell that ends with the connection — the pre-persistent semantics; nothing is kept on the machine.',
55
+ exclusive: ['name', 'new'],
56
+ }),
35
57
  };
36
58
  async run() {
37
59
  this.requireAuth();
38
60
  const { args, flags } = await this.parse(DedicatedMachinesTerminal);
61
+ if (flags.name !== undefined && !dedicated_service_1.DEDICATED_TERMINAL_NAME_PATTERN.test(flags.name)) {
62
+ this.error('A session name is lowercase letters, digits and dashes, up to 32 characters (e.g. `dev`, `build-2`).', { exit: 2 });
63
+ }
39
64
  await this.openDedicatedTerminal(args.lease, flags, flags.command);
40
65
  }
41
66
  }
@@ -45,7 +45,7 @@ class HostedMachinesConnect extends base_command_1.BaseCommand {
45
45
  this.log(`Preview: ${response.session.previewUrl}`);
46
46
  }
47
47
  catch (err) {
48
- const message = (0, hosted_machines_1.formatHostedMachineApiError)(err);
48
+ const message = (0, hosted_machines_1.formatHostedMachineApiError)(err, { bin: this.config.bin });
49
49
  if (message)
50
50
  this.error(message, { exit: 1 });
51
51
  this.handleApiError(err);
@@ -79,7 +79,7 @@ class HostedMachinesConnect extends base_command_1.BaseCommand {
79
79
  this.log(`[exit ${exitCode}]`);
80
80
  }
81
81
  catch (err) {
82
- const message = (0, hosted_machines_1.formatHostedMachineApiError)(err);
82
+ const message = (0, hosted_machines_1.formatHostedMachineApiError)(err, { bin: this.config.bin });
83
83
  this.log(message || err.message);
84
84
  }
85
85
  }
@@ -28,7 +28,7 @@ class HostedMachinesDestroy extends base_command_1.BaseCommand {
28
28
  response = await (0, hosted_machines_1.destroyHostedMachine)(args.id, { workspaceId: flags.workspace });
29
29
  }
30
30
  catch (err) {
31
- const message = (0, hosted_machines_1.formatHostedMachineApiError)(err);
31
+ const message = (0, hosted_machines_1.formatHostedMachineApiError)(err, { bin: this.config.bin });
32
32
  if (message)
33
33
  this.error(message, { exit: 1 });
34
34
  this.handleApiError(err);
@@ -95,7 +95,7 @@ class HostedMachinesExec extends base_command_1.BaseCommand {
95
95
  response = await (0, hosted_machines_1.execHostedMachine)(id, body, { workspaceId: flags.workspace });
96
96
  }
97
97
  catch (err) {
98
- const message = (0, hosted_machines_1.formatHostedMachineApiError)(err);
98
+ const message = (0, hosted_machines_1.formatHostedMachineApiError)(err, { bin: this.config.bin });
99
99
  if (message)
100
100
  this.error(message, { exit: 1 });
101
101
  this.handleApiError(err);
@@ -28,7 +28,7 @@ class HostedMachinesList extends base_command_1.BaseCommand {
28
28
  response = await (0, hosted_machines_1.listHostedMachines)({ workspaceId: flags.workspace, limit: flags.limit });
29
29
  }
30
30
  catch (err) {
31
- const message = (0, hosted_machines_1.formatHostedMachineApiError)(err);
31
+ const message = (0, hosted_machines_1.formatHostedMachineApiError)(err, { bin: this.config.bin });
32
32
  if (message)
33
33
  this.error(message, { exit: 1 });
34
34
  this.handleApiError(err);
@@ -28,7 +28,7 @@ class HostedMachinesPause extends base_command_1.BaseCommand {
28
28
  response = await (0, hosted_machines_1.pauseHostedMachine)(args.id, { workspaceId: flags.workspace });
29
29
  }
30
30
  catch (err) {
31
- const message = (0, hosted_machines_1.formatHostedMachineApiError)(err);
31
+ const message = (0, hosted_machines_1.formatHostedMachineApiError)(err, { bin: this.config.bin });
32
32
  if (message)
33
33
  this.error(message, { exit: 1 });
34
34
  this.handleApiError(err);
@@ -85,7 +85,7 @@ class HostedMachinesPull extends base_command_1.BaseCommand {
85
85
  }, { workspaceId: flags.workspace });
86
86
  }
87
87
  catch (err) {
88
- const message = (0, hosted_machines_1.formatHostedMachineApiError)(err);
88
+ const message = (0, hosted_machines_1.formatHostedMachineApiError)(err, { bin: this.config.bin });
89
89
  if (message) {
90
90
  this.failWithCliError({
91
91
  message,
@@ -48,7 +48,7 @@ class HostedMachinesResume extends base_command_1.BaseCommand {
48
48
  }
49
49
  }
50
50
  catch (err) {
51
- const message = (0, hosted_machines_1.formatHostedMachineApiError)(err);
51
+ const message = (0, hosted_machines_1.formatHostedMachineApiError)(err, { bin: this.config.bin });
52
52
  if (message)
53
53
  this.error(message, { exit: 1 });
54
54
  this.handleApiError(err);
@@ -128,7 +128,7 @@ class HostedMachinesStart extends base_command_1.BaseCommand {
128
128
  // than offering none.
129
129
  const strandedId = (0, hosted_machines_1.hostedMachineId)(session);
130
130
  if (strandedId) {
131
- const cause = (0, hosted_machines_1.formatHostedMachineApiError)(err) ||
131
+ const cause = (0, hosted_machines_1.formatHostedMachineApiError)(err, { bin: this.config.bin }) ||
132
132
  err?.message ||
133
133
  'Hosted Machine setup failed.';
134
134
  this.failWithCliError({
@@ -143,7 +143,7 @@ class HostedMachinesStart extends base_command_1.BaseCommand {
143
143
  retryable: false,
144
144
  });
145
145
  }
146
- const message = (0, hosted_machines_1.formatHostedMachineApiError)(err);
146
+ const message = (0, hosted_machines_1.formatHostedMachineApiError)(err, { bin: this.config.bin });
147
147
  if (message)
148
148
  this.error(message, { exit: 1 });
149
149
  this.handleApiError(err);
@@ -42,7 +42,7 @@ class HostedMachinesStatus extends base_command_1.BaseCommand {
42
42
  response = await (0, hosted_machines_1.getHostedMachine)(args.id, { workspaceId: flags.workspace });
43
43
  }
44
44
  catch (err) {
45
- const message = (0, hosted_machines_1.formatHostedMachineApiError)(err);
45
+ const message = (0, hosted_machines_1.formatHostedMachineApiError)(err, { bin: this.config.bin });
46
46
  if (message)
47
47
  this.error(message, { exit: 1 });
48
48
  this.handleApiError(err);
@@ -78,6 +78,7 @@ class HostedMachinesStatus extends base_command_1.BaseCommand {
78
78
  this.log(`Machine lease: ${session.machineLeaseId || '-'}`);
79
79
  this.log(`Repos: ${(0, hosted_machines_1.hostedMachineRepoSummary)(session)}`);
80
80
  this.log(`Preview: ${session.previewUrl || '-'}`);
81
+ this.log(`Isolation: ${(0, hosted_machines_1.hostedMachineIsolationSummary)(session)}`);
81
82
  if (session.idleTimeoutMs)
82
83
  this.log(`Idle timeout: ${session.idleTimeoutMs}ms`);
83
84
  const error = (0, hosted_machines_1.hostedMachineErrorSummary)(session);
@@ -221,6 +221,7 @@ class TasksCreate extends base_command_1.BaseCommand {
221
221
  }),
222
222
  tag: core_1.Flags.string({ description: 'Tag (repeatable)', multiple: true }),
223
223
  'label-id': core_1.Flags.string({
224
+ aliases: ['label'],
224
225
  description: 'Attach a task label (repeatable) — id, or a name from `skrr labels list --applicable-to task`. ' +
225
226
  'An unknown name is refused, never created. Manage labels with `skrr labels`.',
226
227
  multiple: true,
@@ -380,6 +380,7 @@ class TasksList extends base_command_1.BaseCommand {
380
380
  multiple: true,
381
381
  }),
382
382
  'label-id': core_1.Flags.string({
383
+ aliases: ['label'],
383
384
  description: 'Filter to tasks carrying EVERY listed label id (repeatable, AND-intersection)',
384
385
  multiple: true,
385
386
  }),
@@ -158,6 +158,7 @@ class TasksUpdate extends base_command_1.BaseCommand {
158
158
  }),
159
159
  tag: core_1.Flags.string({ description: 'Replace tags (repeatable)', multiple: true }),
160
160
  'label-id': core_1.Flags.string({
161
+ aliases: ['label'],
161
162
  description: 'Replace the task labels with these ids (repeatable, whole-list). ' +
162
163
  'Use `skrr tasks labels attach/detach` for incremental changes.',
163
164
  multiple: true,
@@ -1,5 +1,7 @@
1
1
  export declare const COMMITMENT_RESPONSIBILITY_LEVELS: readonly ["reasoning_only", "full_ownership"];
2
2
  export declare const REASONING_TOOL_ESCAPES: readonly ["bash", "browser"];
3
+ /** Warning printed by the three retired Commitment permission flags (OSK-11975). */
4
+ export declare const COMMITMENT_PERMISSION_FLAG_RETIRED = "This setting no longer has any effect: Commitment runs use the agent's own permissions.";
3
5
  export declare const RELEASE_INSTALL_CHANNELS: readonly ["latest", "manual"];
4
6
  /**
5
7
  * `09:00-18:00` or `09:00-18:00@America/Los_Angeles`, or a JSON object.
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RELEASE_INSTALL_CHANNELS = exports.REASONING_TOOL_ESCAPES = exports.COMMITMENT_RESPONSIBILITY_LEVELS = void 0;
3
+ exports.RELEASE_INSTALL_CHANNELS = exports.COMMITMENT_PERMISSION_FLAG_RETIRED = exports.REASONING_TOOL_ESCAPES = exports.COMMITMENT_RESPONSIBILITY_LEVELS = void 0;
4
4
  exports.parseWorkingHoursFlag = parseWorkingHoursFlag;
5
5
  exports.mergeAgentConfigFlags = mergeAgentConfigFlags;
6
6
  const prompt_1 = require("./prompt");
7
7
  const agent_visual_refs_1 = require("./agent-visual-refs");
8
8
  exports.COMMITMENT_RESPONSIBILITY_LEVELS = ['reasoning_only', 'full_ownership'];
9
9
  exports.REASONING_TOOL_ESCAPES = ['bash', 'browser'];
10
+ /** Warning printed by the three retired Commitment permission flags (OSK-11975). */
11
+ exports.COMMITMENT_PERMISSION_FLAG_RETIRED = "This setting no longer has any effect: Commitment runs use the agent's own permissions.";
10
12
  exports.RELEASE_INSTALL_CHANNELS = ['latest', 'manual'];
11
13
  /**
12
14
  * `09:00-18:00` or `09:00-18:00@America/Los_Angeles`, or a JSON object.