@skrr-ai/cli 0.1.49 → 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.
- package/README.md +5 -4
- package/dist/base-command.js +16 -4
- package/dist/commands/agents/create.js +14 -7
- package/dist/commands/agents/update.js +11 -5
- package/dist/commands/code/index.d.ts +1 -0
- package/dist/commands/code/index.js +49 -5
- package/dist/commands/code/run.js +5 -1
- package/dist/commands/commitments/cycles.d.ts +19 -0
- package/dist/commands/commitments/cycles.js +46 -0
- package/dist/commands/commitments/effective-policy.js +26 -1
- package/dist/commands/commitments/explain.d.ts +17 -0
- package/dist/commands/commitments/explain.js +40 -0
- package/dist/commands/goals/create.d.ts +1 -0
- package/dist/commands/goals/create.js +22 -0
- package/dist/commands/logout.js +12 -1
- package/dist/commands/machines/dedicated/index.js +1 -1
- package/dist/commands/machines/dedicated/sign-in.js +4 -1
- package/dist/commands/machines/dedicated/terminal/kill.d.ts +21 -0
- package/dist/commands/machines/dedicated/terminal/kill.js +55 -0
- package/dist/commands/machines/dedicated/terminal/ls.d.ts +22 -0
- package/dist/commands/machines/dedicated/terminal/ls.js +70 -0
- package/dist/commands/machines/dedicated/terminal/rename.d.ts +23 -0
- package/dist/commands/machines/dedicated/terminal/rename.js +64 -0
- package/dist/commands/machines/dedicated/terminal.d.ts +9 -0
- package/dist/commands/machines/dedicated/terminal.js +27 -2
- package/dist/commands/machines/hosted/connect.js +2 -2
- package/dist/commands/machines/hosted/destroy.js +1 -1
- package/dist/commands/machines/hosted/exec.js +1 -1
- package/dist/commands/machines/hosted/list.js +1 -1
- package/dist/commands/machines/hosted/pause.js +1 -1
- package/dist/commands/machines/hosted/pull.js +1 -1
- package/dist/commands/machines/hosted/resume.js +1 -1
- package/dist/commands/machines/hosted/start.js +2 -2
- package/dist/commands/machines/hosted/status.js +2 -1
- package/dist/commands/tasks/create.js +1 -0
- package/dist/commands/tasks/list.js +1 -0
- package/dist/commands/tasks/update.js +1 -0
- package/dist/lib/agent-config.d.ts +2 -0
- package/dist/lib/agent-config.js +3 -1
- package/dist/lib/api-fetch.js +19 -0
- package/dist/lib/auth-storage.d.ts +14 -0
- package/dist/lib/auth-storage.js +14 -0
- package/dist/lib/commitments.d.ts +17 -2
- package/dist/lib/commitments.js +114 -0
- package/dist/lib/daemonBroker.d.ts +120 -31
- package/dist/lib/daemonBroker.js +313 -20
- package/dist/lib/dedicated-lease-command.d.ts +14 -0
- package/dist/lib/dedicated-lease-command.js +30 -1
- package/dist/lib/dedicated-machines.js +8 -25
- package/dist/lib/dedicated-service-command.d.ts +11 -3
- package/dist/lib/dedicated-service-command.js +20 -3
- package/dist/lib/dedicated-service.d.ts +46 -0
- package/dist/lib/dedicated-service.js +85 -7
- package/dist/lib/dedicated-terminal.d.ts +21 -0
- package/dist/lib/dedicated-terminal.js +104 -9
- package/dist/lib/first-party-harness-broker.d.ts +10 -0
- package/dist/lib/first-party-harness-broker.js +9 -0
- package/dist/lib/first-party-harness-doctor.js +41 -1
- package/dist/lib/first-party-harness-managed.d.ts +4 -3
- package/dist/lib/first-party-harness-project-trust.d.ts +125 -0
- package/dist/lib/first-party-harness-project-trust.js +364 -0
- package/dist/lib/first-party-harness.d.ts +9 -2
- package/dist/lib/first-party-harness.js +6 -5
- package/dist/lib/hosted-machines.d.ts +10 -1
- package/dist/lib/hosted-machines.js +36 -2
- package/dist/lib/login.js +16 -0
- package/dist/lib/machine-spend-cap.d.ts +23 -0
- package/dist/lib/machine-spend-cap.js +68 -0
- package/dist/lib/node-adapter.js +15 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.d.ts +90 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.js +113 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialSession.d.ts +47 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialSession.js +69 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonToolApproval.d.ts +109 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonToolApproval.js +171 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/messages.d.ts +8 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/messages.js +9 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +8 -9
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refreshClassification.d.ts +6 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refreshClassification.js +32 -9
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.d.ts +81 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.js +87 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/types.d.ts +6 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.d.ts +90 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.js +105 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialSession.d.ts +47 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialSession.js +66 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonToolApproval.d.ts +109 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonToolApproval.js +164 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/messages.d.ts +8 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/messages.js +9 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +8 -9
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refreshClassification.d.ts +6 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refreshClassification.js +31 -9
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.d.ts +81 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.js +80 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/types.d.ts +6 -1
- package/dist/node_modules/@skrr-ai/auth-core/package.json +40 -0
- package/dist/node_modules/@skrr-ai/data-provider/index.js +3413 -3343
- package/oclif.manifest.json +15769 -15342
- package/package.json +4 -1
|
@@ -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-]
|
|
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.
|
package/dist/lib/agent-config.js
CHANGED
|
@@ -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.
|
package/dist/lib/api-fetch.js
CHANGED
|
@@ -42,6 +42,7 @@ const idempotency_scope_1 = require("./idempotency-scope");
|
|
|
42
42
|
const node_adapter_1 = require("./node-adapter");
|
|
43
43
|
const refresh_1 = require("./refresh");
|
|
44
44
|
const delegated_cli_1 = require("./delegated-cli");
|
|
45
|
+
const daemonBroker_1 = require("./daemonBroker");
|
|
45
46
|
const workspace_header_1 = require("./workspace-header");
|
|
46
47
|
const non_json_response_1 = require("./non-json-response");
|
|
47
48
|
class ApiFetchError extends Error {
|
|
@@ -191,6 +192,24 @@ async function apiFetch(pathOrUrl, opts = {}) {
|
|
|
191
192
|
res = await fetchWithCredential(cred);
|
|
192
193
|
}
|
|
193
194
|
}
|
|
195
|
+
else if (res.status === 401 &&
|
|
196
|
+
(0, daemonBroker_1.isBrokeredHandoffToken)(cred.token) &&
|
|
197
|
+
!isAuthEndpoint(pathOrUrl)) {
|
|
198
|
+
// Broker-mode hand-off credential: nothing was persisted, so there is no
|
|
199
|
+
// stored family for `ensureFreshCliCredential` to rotate. Re-redeem over
|
|
200
|
+
// loopback once (forceRefresh bypasses the daemon's cached token) and
|
|
201
|
+
// retry once — the same recovery contract the delegated path has.
|
|
202
|
+
const fresh = await (0, daemonBroker_1.redeemBrokeredHandoffToken)(true);
|
|
203
|
+
if (fresh?.accessToken) {
|
|
204
|
+
cred = {
|
|
205
|
+
token: fresh.accessToken,
|
|
206
|
+
source: 'env-token',
|
|
207
|
+
kind: (0, credential_resolver_1.kindOf)(fresh.accessToken),
|
|
208
|
+
};
|
|
209
|
+
(0, node_adapter_1.setAdapterCredentialOverride)(cred);
|
|
210
|
+
res = await fetchWithCredential(cred);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
194
213
|
else if (res.status === 401 && !autonomousCredential && !isAuthEndpoint(pathOrUrl)) {
|
|
195
214
|
const fresh = await (0, refresh_1.ensureFreshCliCredential)({ credential: cred, force: true });
|
|
196
215
|
if (fresh.refreshed && fresh.credential.token) {
|
|
@@ -21,6 +21,20 @@ export interface WriteOptions {
|
|
|
21
21
|
/** Clear a stale needs-reauth latch after a server has issued fresh credentials. */
|
|
22
22
|
clearReauth?: boolean;
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* File-backend-only read. Exported for the brokered-hand-off migration
|
|
26
|
+
* cleanup (`daemonBroker.maybeRetireStoredCliAuthFile`), which must inspect
|
|
27
|
+
* `~/.skrr/cli-auth.json` specifically — not the keychain-preferred
|
|
28
|
+
* `readFromBackend()` — to prove the stored family's provenance before
|
|
29
|
+
* retiring it. Everything else should keep using `readFromBackend()`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function readFromFile(): AuthBundle | null;
|
|
32
|
+
/**
|
|
33
|
+
* Delete `~/.skrr/cli-auth.json` only (the keychain is untouched). Exported
|
|
34
|
+
* for the brokered-hand-off migration cleanup; `skrr logout` continues to
|
|
35
|
+
* use `clearAllBackends()`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function deleteFileBackend(): void;
|
|
24
38
|
/**
|
|
25
39
|
* Read the CLI's auth bundle from the preferred backend.
|
|
26
40
|
*
|
package/dist/lib/auth-storage.js
CHANGED
|
@@ -34,6 +34,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.backends = void 0;
|
|
37
|
+
exports.readFromFile = readFromFile;
|
|
38
|
+
exports.deleteFileBackend = deleteFileBackend;
|
|
37
39
|
exports.readFromBackend = readFromBackend;
|
|
38
40
|
exports.writeToBackend = writeToBackend;
|
|
39
41
|
exports.clearAllBackends = clearAllBackends;
|
|
@@ -96,6 +98,13 @@ function authFilePath() {
|
|
|
96
98
|
// ---------------------------------------------------------------------
|
|
97
99
|
// File backend
|
|
98
100
|
// ---------------------------------------------------------------------
|
|
101
|
+
/**
|
|
102
|
+
* File-backend-only read. Exported for the brokered-hand-off migration
|
|
103
|
+
* cleanup (`daemonBroker.maybeRetireStoredCliAuthFile`), which must inspect
|
|
104
|
+
* `~/.skrr/cli-auth.json` specifically — not the keychain-preferred
|
|
105
|
+
* `readFromBackend()` — to prove the stored family's provenance before
|
|
106
|
+
* retiring it. Everything else should keep using `readFromBackend()`.
|
|
107
|
+
*/
|
|
99
108
|
function readFromFile() {
|
|
100
109
|
const p = authFilePath();
|
|
101
110
|
if (!fs.existsSync(p))
|
|
@@ -235,6 +244,11 @@ function writeToFile(bundle) {
|
|
|
235
244
|
throw err;
|
|
236
245
|
}
|
|
237
246
|
}
|
|
247
|
+
/**
|
|
248
|
+
* Delete `~/.skrr/cli-auth.json` only (the keychain is untouched). Exported
|
|
249
|
+
* for the brokered-hand-off migration cleanup; `skrr logout` continues to
|
|
250
|
+
* use `clearAllBackends()`.
|
|
251
|
+
*/
|
|
238
252
|
function deleteFileBackend() {
|
|
239
253
|
const p = authFilePath();
|
|
240
254
|
try {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* "hold this state", derived from a Compass invariant — not authored here).
|
|
18
18
|
*/
|
|
19
19
|
import { COMMITMENT_WATCHED_SOURCES, COMMITMENT_TEMPLATE_IDS, COMMITMENT_CADENCE_MODES, COMMITMENT_CADENCE_TIME_PATTERN, COMMITMENT_CADENCE_MAX_TIMES, COMMITMENT_AUTONOMY_MODES, COMMITMENT_EXECUTION_ISOLATION_MODES, COMMITMENT_STATUSES, COMMITMENT_KIND_VALUES } from '@skrr-ai/data-provider';
|
|
20
|
-
import type { CommitmentCheck, CommitmentChecksResponse, Commitment, CommitmentActionProposal, CommitmentListResponse, CommitmentPlanResponse, CommitmentStatusResponse, CommitmentWorkLink, CommitmentExecutionReceiptListResponse, CommitmentExecutionReceiptQuarterlyMetricsResponse, CommitmentCapabilitySource, CommitmentDeliveryPatchResponse, CommitmentDeliveryBundleResponse } from '@skrr-ai/data-provider';
|
|
20
|
+
import type { CommitmentCheck, CommitmentChecksResponse, Commitment, CommitmentActionProposal, CommitmentListResponse, CommitmentPlanResponse, CommitmentStatusResponse, CommitmentWorkLink, CommitmentExecutionReceiptListResponse, CommitmentExecutionReceiptQuarterlyMetricsResponse, CommitmentCapabilitySource, CommitmentDeliveryPatchResponse, CommitmentDeliveryBundleResponse, CommitmentCyclesResponse, CommitmentExplanationResponse } from '@skrr-ai/data-provider';
|
|
21
21
|
import { withQuery } from './triggers';
|
|
22
22
|
export { COMMITMENT_WATCHED_SOURCES, COMMITMENT_TEMPLATE_IDS, COMMITMENT_CADENCE_MODES, COMMITMENT_CADENCE_TIME_PATTERN, COMMITMENT_CADENCE_MAX_TIMES, COMMITMENT_STATUSES, COMMITMENT_KIND_VALUES, };
|
|
23
23
|
export type { CommitmentCheck, CommitmentChecksResponse, Commitment, CommitmentActionProposal, CommitmentListResponse, CommitmentPlanResponse, CommitmentStatusResponse, CommitmentWorkLink, };
|
|
@@ -351,6 +351,13 @@ export declare const commitmentApi: {
|
|
|
351
351
|
limit?: number;
|
|
352
352
|
cursor?: string;
|
|
353
353
|
}) => Promise<Record<string, unknown>>;
|
|
354
|
+
/** One Cycle per Check, newest first — the unit a person reads (D8). */
|
|
355
|
+
cycles: (id: string, query?: {
|
|
356
|
+
limit?: number;
|
|
357
|
+
cursor?: string;
|
|
358
|
+
}) => Promise<CommitmentCyclesResponse>;
|
|
359
|
+
/** The latest Cycle walked as six questions; the first "no" is where it stopped. */
|
|
360
|
+
explain: (id: string) => Promise<CommitmentExplanationResponse>;
|
|
354
361
|
ledger: (id: string, query?: Record<string, string | number | undefined>) => Promise<Record<string, unknown>>;
|
|
355
362
|
wakeCapabilities: (id: string) => Promise<CommitmentWakeCapabilities>;
|
|
356
363
|
dailyMetrics: (id: string, query?: {
|
|
@@ -759,8 +766,16 @@ export declare function renderCheckList(checks: CommitmentCheckView[], log: (lin
|
|
|
759
766
|
type ReadModelRecord = Record<string, unknown>;
|
|
760
767
|
/** Human view for `commitments ledger`; JSON remains the automation surface. */
|
|
761
768
|
export declare function renderCommitmentLedger(ledger: ReadModelRecord, log: (line: string) => void): void;
|
|
762
|
-
/** Human view for the ordered commitment trace. */
|
|
763
769
|
export declare function renderCommitmentTrace(trace: ReadModelRecord, log: (line: string) => void): void;
|
|
770
|
+
/**
|
|
771
|
+
* One line per Cycle:
|
|
772
|
+
* `09-22 12:04 ● stopped act commitment_execution_budget_exhausted — Raise maxRunsPerDay…`
|
|
773
|
+
* A run that failed is named under its Cycle with who has to move (machine
|
|
774
|
+
* or model), because that is the next question every reader asks.
|
|
775
|
+
*/
|
|
776
|
+
export declare function formatCommitmentCycles(page: Partial<CommitmentCyclesResponse>): string[];
|
|
777
|
+
/** The six questions for the latest Cycle, the first ✗ carrying its fix. */
|
|
778
|
+
export declare function formatCommitmentExplanation(explanation: Partial<CommitmentExplanationResponse>): string[];
|
|
764
779
|
/**
|
|
765
780
|
* Print the continuation hint for a paged `object:'list'` response — the line
|
|
766
781
|
* that makes history beyond the newest page reachable instead of invisible.
|