@skrr-ai/cli 0.1.108 → 0.1.109
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 +10 -0
- package/dist/base-command.d.ts +59 -0
- package/dist/base-command.js +118 -7
- package/dist/commands/agents/update.d.ts +14 -0
- package/dist/commands/agents/update.js +40 -1
- package/dist/commands/commitments/accounting.js +7 -2
- package/dist/commands/commitments/cost.d.ts +11 -0
- package/dist/commands/commitments/cost.js +26 -3
- package/dist/commands/commitments/create.js +2 -1
- package/dist/commands/commitments/operating-review.d.ts +15 -0
- package/dist/commands/commitments/operating-review.js +103 -50
- package/dist/commands/commitments/update.js +12 -5
- package/dist/commands/doctor.js +9 -0
- package/dist/commands/goals/list.js +6 -1
- package/dist/commands/grants/rotate.js +4 -0
- package/dist/commands/login.js +42 -14
- package/dist/commands/machines/list.js +28 -6
- package/dist/commands/projects/show.js +1 -1
- package/dist/commands/revoke-daemon.js +2 -1
- package/dist/commands/spaces/workflows/archive.d.ts +1 -0
- package/dist/commands/spaces/workflows/archive.js +1 -0
- package/dist/commands/spaces/workflows/artifact.d.ts +1 -0
- package/dist/commands/spaces/workflows/artifact.js +1 -0
- package/dist/commands/spaces/workflows/cancel-node.d.ts +1 -0
- package/dist/commands/spaces/workflows/cancel-node.js +1 -0
- package/dist/commands/spaces/workflows/cancel.d.ts +1 -0
- package/dist/commands/spaces/workflows/cancel.js +6 -2
- package/dist/commands/spaces/workflows/create.d.ts +1 -0
- package/dist/commands/spaces/workflows/create.js +7 -1
- package/dist/commands/spaces/workflows/events.d.ts +1 -0
- package/dist/commands/spaces/workflows/events.js +1 -0
- package/dist/commands/spaces/workflows/fixtures/create.d.ts +1 -0
- package/dist/commands/spaces/workflows/fixtures/create.js +1 -0
- package/dist/commands/spaces/workflows/fixtures/list.d.ts +1 -0
- package/dist/commands/spaces/workflows/fixtures/list.js +1 -0
- package/dist/commands/spaces/workflows/lifecycle-diagnostics.d.ts +1 -0
- package/dist/commands/spaces/workflows/lifecycle-diagnostics.js +1 -0
- package/dist/commands/spaces/workflows/list.d.ts +1 -0
- package/dist/commands/spaces/workflows/list.js +1 -0
- package/dist/commands/spaces/workflows/node-types.d.ts +2 -0
- package/dist/commands/spaces/workflows/node-types.js +24 -6
- package/dist/commands/spaces/workflows/pause.d.ts +1 -0
- package/dist/commands/spaces/workflows/pause.js +1 -0
- package/dist/commands/spaces/workflows/plan/show.d.ts +1 -0
- package/dist/commands/spaces/workflows/plan/show.js +1 -0
- package/dist/commands/spaces/workflows/plan/update.d.ts +1 -0
- package/dist/commands/spaces/workflows/plan/update.js +1 -0
- package/dist/commands/spaces/workflows/proposals/apply.d.ts +1 -0
- package/dist/commands/spaces/workflows/proposals/apply.js +1 -0
- package/dist/commands/spaces/workflows/proposals/confirm.d.ts +1 -0
- package/dist/commands/spaces/workflows/proposals/confirm.js +1 -0
- package/dist/commands/spaces/workflows/proposals/create.d.ts +1 -0
- package/dist/commands/spaces/workflows/proposals/create.js +1 -0
- package/dist/commands/spaces/workflows/proposals/dismiss.d.ts +1 -0
- package/dist/commands/spaces/workflows/proposals/dismiss.js +1 -0
- package/dist/commands/spaces/workflows/proposals/list.d.ts +1 -0
- package/dist/commands/spaces/workflows/proposals/list.js +1 -0
- package/dist/commands/spaces/workflows/publish.d.ts +1 -0
- package/dist/commands/spaces/workflows/publish.js +9 -0
- package/dist/commands/spaces/workflows/reconcile.d.ts +1 -0
- package/dist/commands/spaces/workflows/reconcile.js +1 -0
- package/dist/commands/spaces/workflows/resume.d.ts +1 -0
- package/dist/commands/spaces/workflows/resume.js +1 -0
- package/dist/commands/spaces/workflows/retry.d.ts +1 -0
- package/dist/commands/spaces/workflows/retry.js +1 -0
- package/dist/commands/spaces/workflows/run.d.ts +1 -0
- package/dist/commands/spaces/workflows/run.js +14 -7
- package/dist/commands/spaces/workflows/runs.d.ts +1 -0
- package/dist/commands/spaces/workflows/runs.js +1 -0
- package/dist/commands/spaces/workflows/show.d.ts +25 -0
- package/dist/commands/spaces/workflows/show.js +42 -4
- package/dist/commands/spaces/workflows/signal.d.ts +12 -0
- package/dist/commands/spaces/workflows/signal.js +40 -2
- package/dist/commands/spaces/workflows/start.d.ts +1 -0
- package/dist/commands/spaces/workflows/start.js +1 -0
- package/dist/commands/spaces/workflows/task-execution/create.d.ts +1 -0
- package/dist/commands/spaces/workflows/task-execution/create.js +1 -0
- package/dist/commands/spaces/workflows/test.d.ts +1 -0
- package/dist/commands/spaces/workflows/test.js +1 -0
- package/dist/commands/spaces/workflows/triggers/create.d.ts +1 -0
- package/dist/commands/spaces/workflows/triggers/create.js +1 -0
- package/dist/commands/spaces/workflows/triggers/fire.d.ts +1 -0
- package/dist/commands/spaces/workflows/triggers/fire.js +1 -0
- package/dist/commands/spaces/workflows/triggers/list.d.ts +1 -0
- package/dist/commands/spaces/workflows/triggers/list.js +1 -0
- package/dist/commands/spaces/workflows/triggers/update.d.ts +1 -0
- package/dist/commands/spaces/workflows/triggers/update.js +1 -0
- package/dist/commands/spaces/workflows/update.d.ts +1 -0
- package/dist/commands/spaces/workflows/update.js +4 -0
- package/dist/commands/spaces/workflows/validate.d.ts +1 -0
- package/dist/commands/spaces/workflows/validate.js +15 -0
- package/dist/commands/tasks/activity.js +6 -2
- package/dist/commands/tasks/bulk-update.d.ts +1 -0
- package/dist/commands/tasks/bulk-update.js +7 -0
- package/dist/commands/tasks/complete.js +2 -1
- package/dist/commands/tasks/create-tree.d.ts +69 -0
- package/dist/commands/tasks/create-tree.js +413 -47
- package/dist/commands/tasks/list.d.ts +2 -0
- package/dist/commands/tasks/list.js +19 -1
- package/dist/commands/tasks/rearm-recurrence.d.ts +22 -0
- package/dist/commands/tasks/rearm-recurrence.js +68 -0
- package/dist/commands/tasks/show.d.ts +1 -0
- package/dist/commands/tasks/show.js +17 -3
- package/dist/commands/tasks/timeline.js +4 -0
- package/dist/commands/tasks/update.d.ts +1 -0
- package/dist/commands/tasks/update.js +6 -1
- package/dist/commands/triggers/create.js +8 -2
- package/dist/commands/triggers/parse-intent.d.ts +7 -0
- package/dist/commands/triggers/parse-intent.js +31 -9
- package/dist/commands/workspaces/grants.js +23 -3
- package/dist/commands/workspaces/members.d.ts +20 -0
- package/dist/commands/workspaces/members.js +64 -0
- package/dist/commands/workspaces/stewardship.js +14 -2
- package/dist/help.js +12 -0
- package/dist/hooks/command-not-found.js +27 -1
- package/dist/lib/command-miss.d.ts +52 -2
- package/dist/lib/command-miss.js +187 -18
- package/dist/lib/commitment-loop-status.d.ts +8 -0
- package/dist/lib/commitment-loop-status.js +45 -0
- package/dist/lib/commitments.d.ts +16 -2
- package/dist/lib/commitments.js +48 -8
- package/dist/lib/daemon-command-hint.d.ts +15 -0
- package/dist/lib/daemon-command-hint.js +21 -0
- package/dist/lib/daemon-setup.js +10 -1
- package/dist/lib/daemonBrokerRefusal.js +3 -2
- package/dist/lib/daemonHandoff.js +2 -1
- package/dist/lib/deployed-build.d.ts +43 -0
- package/dist/lib/deployed-build.js +66 -0
- package/dist/lib/grants.d.ts +27 -1
- package/dist/lib/grants.js +39 -21
- package/dist/lib/json-mode.d.ts +11 -0
- package/dist/lib/json-mode.js +19 -0
- package/dist/lib/json-output.d.ts +25 -0
- package/dist/lib/json-output.js +30 -0
- package/dist/lib/list-output.d.ts +9 -0
- package/dist/lib/list-output.js +20 -1
- package/dist/lib/local-daemon-readiness.d.ts +90 -0
- package/dist/lib/local-daemon-readiness.js +143 -0
- package/dist/lib/machines.d.ts +117 -0
- package/dist/lib/machines.js +139 -0
- package/dist/lib/managed-instruction-local.d.ts +2 -0
- package/dist/lib/managed-instruction-local.js +2 -0
- package/dist/lib/profile-machine-identity-guard.d.ts +18 -0
- package/dist/lib/profile-machine-identity-guard.js +29 -0
- package/dist/lib/request-field-flags.d.ts +20 -0
- package/dist/lib/request-field-flags.js +34 -0
- package/dist/lib/stewardship-output.d.ts +1 -1
- package/dist/lib/stewardship-output.js +26 -30
- package/dist/lib/task-batch.d.ts +61 -4
- package/dist/lib/task-batch.js +316 -80
- package/dist/lib/task-economics.d.ts +5 -0
- package/dist/lib/task-economics.js +15 -0
- package/dist/lib/task-recurrence-outcome.d.ts +6 -6
- package/dist/lib/task-recurrence-outcome.js +27 -3
- package/dist/lib/tasks.d.ts +39 -0
- package/dist/lib/tasks.js +132 -0
- package/dist/lib/triggers.d.ts +31 -1
- package/dist/lib/triggers.js +55 -1
- package/dist/lib/workflow-issues.d.ts +14 -0
- package/dist/lib/workflow-issues.js +32 -0
- package/dist/lib/workflow-run-view.d.ts +55 -0
- package/dist/lib/workflow-run-view.js +105 -0
- package/dist/lib/workspaces.d.ts +31 -4
- package/dist/lib/workspaces.js +43 -0
- package/dist/lib/write-target.d.ts +29 -0
- package/dist/lib/write-target.js +72 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/workspaceIsolationProbeWire.d.ts +51 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/workspaceIsolationProbeWire.js +50 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/workspaceIsolationProbeWire.d.ts +51 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/workspaceIsolationProbeWire.js +46 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +6718 -6370
- package/oclif.manifest.json +376 -52
- package/package.json +19 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.expectTargetFlag = void 0;
|
|
4
|
+
exports.formatWriteTarget = formatWriteTarget;
|
|
5
|
+
exports.matchesExpectedTarget = matchesExpectedTarget;
|
|
6
|
+
exports.firstUnmetExpectation = firstUnmetExpectation;
|
|
7
|
+
/**
|
|
8
|
+
* Which account and which server a bulk write is about to touch.
|
|
9
|
+
*
|
|
10
|
+
* `skrr` is increasingly driven by agents, against a platform whose development
|
|
11
|
+
* and production share one database. A person (or an agent) who has run `skrr
|
|
12
|
+
* login` once can write 94 tasks to an account and a server they have not looked
|
|
13
|
+
* at since, and nothing in the command's own output said so — the target was
|
|
14
|
+
* visible only to someone who thought to run `whoami` first (OSK-S-440 #10).
|
|
15
|
+
* "I checked once" is not a control; the command that is about to write in bulk
|
|
16
|
+
* has to say where, and let its caller assert where.
|
|
17
|
+
*
|
|
18
|
+
* Pure: the command gathers the facts (a request or two), this decides how to say
|
|
19
|
+
* them and whether an expectation holds.
|
|
20
|
+
*/
|
|
21
|
+
const core_1 = require("@oclif/core");
|
|
22
|
+
/** `stevedu518@gmail.com on https://skrr.ai (no workspace)` */
|
|
23
|
+
function formatWriteTarget(target) {
|
|
24
|
+
const who = target.account ?? target.accountId ?? 'an account that could not be read';
|
|
25
|
+
const where = target.workspace ? `workspace ${target.workspace}` : 'no workspace';
|
|
26
|
+
return `${who} on ${target.server} (${where})`;
|
|
27
|
+
}
|
|
28
|
+
function hostOf(value) {
|
|
29
|
+
try {
|
|
30
|
+
return new URL(/^[a-z][a-z0-9+.-]*:\/\//i.test(value) ? value : `https://${value}`).host.toLowerCase();
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Does one `--expect-target` value describe this target?
|
|
38
|
+
*
|
|
39
|
+
* - contains `@` -> the account email (case-insensitive)
|
|
40
|
+
* - a URL or a host name -> the server's host (`skrr.ai` matches `https://skrr.ai`)
|
|
41
|
+
* - anything else -> the account id
|
|
42
|
+
*
|
|
43
|
+
* One value names one fact; pass the flag twice to pin both account and server.
|
|
44
|
+
* An unreadable fact never matches: an expectation about an account the command
|
|
45
|
+
* could not read is not met.
|
|
46
|
+
*/
|
|
47
|
+
function matchesExpectedTarget(target, expected) {
|
|
48
|
+
const value = expected.trim();
|
|
49
|
+
if (!value)
|
|
50
|
+
return false;
|
|
51
|
+
if (value.includes('@') && !/^[a-z][a-z0-9+.-]*:\/\//i.test(value)) {
|
|
52
|
+
return target.account !== null && target.account.toLowerCase() === value.toLowerCase();
|
|
53
|
+
}
|
|
54
|
+
if (/^[a-z][a-z0-9+.-]*:\/\//i.test(value) ||
|
|
55
|
+
value.includes('.') ||
|
|
56
|
+
value.startsWith('localhost')) {
|
|
57
|
+
const expectedHost = hostOf(value);
|
|
58
|
+
return expectedHost !== null && expectedHost === hostOf(target.server);
|
|
59
|
+
}
|
|
60
|
+
return target.accountId !== null && target.accountId === value;
|
|
61
|
+
}
|
|
62
|
+
/** The first expectation that does NOT hold, or undefined when all do. */
|
|
63
|
+
function firstUnmetExpectation(target, expected) {
|
|
64
|
+
return (expected ?? []).find((value) => !matchesExpectedTarget(target, value));
|
|
65
|
+
}
|
|
66
|
+
/** The assertion flag, declared once so every bulk writer spells it the same way. */
|
|
67
|
+
exports.expectTargetFlag = {
|
|
68
|
+
'expect-target': core_1.Flags.string({
|
|
69
|
+
description: 'Refuse to write unless the target matches: an account email, a server host (skrr.ai) or an account id. Repeat to pin more than one (account AND server). Checked before anything is created.',
|
|
70
|
+
multiple: true,
|
|
71
|
+
}),
|
|
72
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The workspace-isolation probe wire contract (OSK-15099).
|
|
3
|
+
*
|
|
4
|
+
* A Commitment Run is always isolated: the daemon cuts it a private git
|
|
5
|
+
* worktree from the directory the Run is rooted in, and refuses the Run with
|
|
6
|
+
* `EXECUTION_ISOLATION_UNAVAILABLE` before any tool when it cannot. Preflight
|
|
7
|
+
* had no way to read that machine's filesystem, so it reported `ready`,
|
|
8
|
+
* activation succeeded, and the first Run failed. The daemon now answers the
|
|
9
|
+
* same question BEFORE a Run, through the same predicate its executor refuses
|
|
10
|
+
* on, and this module is the one place both ends spell it.
|
|
11
|
+
*
|
|
12
|
+
* - The daemon announces {@link WORKSPACE_ISOLATION_PROBE_CAPABILITY}. A daemon
|
|
13
|
+
* that does not is never asked, and the server reports the prerequisite as
|
|
14
|
+
* UNVERIFIED — never as satisfied (unknown is never ok).
|
|
15
|
+
* - The server sends {@link WORKSPACE_ISOLATION_PROBE_METHOD} as a control RPC
|
|
16
|
+
* with `{ workingDirectory? }`: exactly the directory it would put on the
|
|
17
|
+
* Run's request (`agent.workingDirectory || daemon cwd`).
|
|
18
|
+
* - The daemon answers {@link WorkspaceIsolationProbeAnswer}.
|
|
19
|
+
*
|
|
20
|
+
* Pure: no I/O, safe for the browser, the CLI and the API.
|
|
21
|
+
*/
|
|
22
|
+
export declare const WORKSPACE_ISOLATION_PROBE_CAPABILITY: "workspace_isolation_probe_v1";
|
|
23
|
+
export declare const WORKSPACE_ISOLATION_PROBE_METHOD: "daemon:workspace:isolation-probe";
|
|
24
|
+
/**
|
|
25
|
+
* What an explicit isolation request can be given from a base directory.
|
|
26
|
+
*
|
|
27
|
+
* - `worktree` — a git repository with a commit: a worktree is cut;
|
|
28
|
+
* - `sandbox` — the daemon's own bare scratch workspace: an empty
|
|
29
|
+
* private sandbox is used instead;
|
|
30
|
+
* - `not_a_repository` — refused: not inside a git repository;
|
|
31
|
+
* - `no_initial_commit` — refused: a repository with an unborn HEAD.
|
|
32
|
+
*/
|
|
33
|
+
export declare const WORKTREE_BASE_VERDICTS: readonly ["worktree", "sandbox", "not_a_repository", "no_initial_commit"];
|
|
34
|
+
export type WorktreeBaseVerdict = (typeof WORKTREE_BASE_VERDICTS)[number];
|
|
35
|
+
/** The verdicts on which the daemon refuses an isolated Run before any tool. */
|
|
36
|
+
export declare const REFUSING_WORKTREE_BASE_VERDICTS: ReadonlySet<WorktreeBaseVerdict>;
|
|
37
|
+
export declare function isWorktreeBaseVerdict(value: unknown): value is WorktreeBaseVerdict;
|
|
38
|
+
export interface WorkspaceIsolationProbeRequest {
|
|
39
|
+
/** Omitted: the daemon resolves its own default, as it would for the Run. */
|
|
40
|
+
workingDirectory?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface WorkspaceIsolationProbeAnswer {
|
|
43
|
+
/** The directory a Run asked with this `workingDirectory` would be rooted in. */
|
|
44
|
+
baseCwd: string;
|
|
45
|
+
/** Whether a person chose it (agent/task directory or configured default). */
|
|
46
|
+
chosenExplicitly: boolean;
|
|
47
|
+
verdict: WorktreeBaseVerdict;
|
|
48
|
+
/** The refusal sentence the Run would fail with; null when it would be admitted. */
|
|
49
|
+
remedy: string | null;
|
|
50
|
+
checkedAt: string;
|
|
51
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The workspace-isolation probe wire contract (OSK-15099).
|
|
4
|
+
*
|
|
5
|
+
* A Commitment Run is always isolated: the daemon cuts it a private git
|
|
6
|
+
* worktree from the directory the Run is rooted in, and refuses the Run with
|
|
7
|
+
* `EXECUTION_ISOLATION_UNAVAILABLE` before any tool when it cannot. Preflight
|
|
8
|
+
* had no way to read that machine's filesystem, so it reported `ready`,
|
|
9
|
+
* activation succeeded, and the first Run failed. The daemon now answers the
|
|
10
|
+
* same question BEFORE a Run, through the same predicate its executor refuses
|
|
11
|
+
* on, and this module is the one place both ends spell it.
|
|
12
|
+
*
|
|
13
|
+
* - The daemon announces {@link WORKSPACE_ISOLATION_PROBE_CAPABILITY}. A daemon
|
|
14
|
+
* that does not is never asked, and the server reports the prerequisite as
|
|
15
|
+
* UNVERIFIED — never as satisfied (unknown is never ok).
|
|
16
|
+
* - The server sends {@link WORKSPACE_ISOLATION_PROBE_METHOD} as a control RPC
|
|
17
|
+
* with `{ workingDirectory? }`: exactly the directory it would put on the
|
|
18
|
+
* Run's request (`agent.workingDirectory || daemon cwd`).
|
|
19
|
+
* - The daemon answers {@link WorkspaceIsolationProbeAnswer}.
|
|
20
|
+
*
|
|
21
|
+
* Pure: no I/O, safe for the browser, the CLI and the API.
|
|
22
|
+
*/
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.REFUSING_WORKTREE_BASE_VERDICTS = exports.WORKTREE_BASE_VERDICTS = exports.WORKSPACE_ISOLATION_PROBE_METHOD = exports.WORKSPACE_ISOLATION_PROBE_CAPABILITY = void 0;
|
|
25
|
+
exports.isWorktreeBaseVerdict = isWorktreeBaseVerdict;
|
|
26
|
+
exports.WORKSPACE_ISOLATION_PROBE_CAPABILITY = 'workspace_isolation_probe_v1';
|
|
27
|
+
exports.WORKSPACE_ISOLATION_PROBE_METHOD = 'daemon:workspace:isolation-probe';
|
|
28
|
+
/**
|
|
29
|
+
* What an explicit isolation request can be given from a base directory.
|
|
30
|
+
*
|
|
31
|
+
* - `worktree` — a git repository with a commit: a worktree is cut;
|
|
32
|
+
* - `sandbox` — the daemon's own bare scratch workspace: an empty
|
|
33
|
+
* private sandbox is used instead;
|
|
34
|
+
* - `not_a_repository` — refused: not inside a git repository;
|
|
35
|
+
* - `no_initial_commit` — refused: a repository with an unborn HEAD.
|
|
36
|
+
*/
|
|
37
|
+
exports.WORKTREE_BASE_VERDICTS = Object.freeze([
|
|
38
|
+
'worktree',
|
|
39
|
+
'sandbox',
|
|
40
|
+
'not_a_repository',
|
|
41
|
+
'no_initial_commit',
|
|
42
|
+
]);
|
|
43
|
+
/** The verdicts on which the daemon refuses an isolated Run before any tool. */
|
|
44
|
+
exports.REFUSING_WORKTREE_BASE_VERDICTS = new Set([
|
|
45
|
+
'not_a_repository',
|
|
46
|
+
'no_initial_commit',
|
|
47
|
+
]);
|
|
48
|
+
function isWorktreeBaseVerdict(value) {
|
|
49
|
+
return typeof value === 'string' && exports.WORKTREE_BASE_VERDICTS.includes(value);
|
|
50
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The workspace-isolation probe wire contract (OSK-15099).
|
|
3
|
+
*
|
|
4
|
+
* A Commitment Run is always isolated: the daemon cuts it a private git
|
|
5
|
+
* worktree from the directory the Run is rooted in, and refuses the Run with
|
|
6
|
+
* `EXECUTION_ISOLATION_UNAVAILABLE` before any tool when it cannot. Preflight
|
|
7
|
+
* had no way to read that machine's filesystem, so it reported `ready`,
|
|
8
|
+
* activation succeeded, and the first Run failed. The daemon now answers the
|
|
9
|
+
* same question BEFORE a Run, through the same predicate its executor refuses
|
|
10
|
+
* on, and this module is the one place both ends spell it.
|
|
11
|
+
*
|
|
12
|
+
* - The daemon announces {@link WORKSPACE_ISOLATION_PROBE_CAPABILITY}. A daemon
|
|
13
|
+
* that does not is never asked, and the server reports the prerequisite as
|
|
14
|
+
* UNVERIFIED — never as satisfied (unknown is never ok).
|
|
15
|
+
* - The server sends {@link WORKSPACE_ISOLATION_PROBE_METHOD} as a control RPC
|
|
16
|
+
* with `{ workingDirectory? }`: exactly the directory it would put on the
|
|
17
|
+
* Run's request (`agent.workingDirectory || daemon cwd`).
|
|
18
|
+
* - The daemon answers {@link WorkspaceIsolationProbeAnswer}.
|
|
19
|
+
*
|
|
20
|
+
* Pure: no I/O, safe for the browser, the CLI and the API.
|
|
21
|
+
*/
|
|
22
|
+
export declare const WORKSPACE_ISOLATION_PROBE_CAPABILITY: "workspace_isolation_probe_v1";
|
|
23
|
+
export declare const WORKSPACE_ISOLATION_PROBE_METHOD: "daemon:workspace:isolation-probe";
|
|
24
|
+
/**
|
|
25
|
+
* What an explicit isolation request can be given from a base directory.
|
|
26
|
+
*
|
|
27
|
+
* - `worktree` — a git repository with a commit: a worktree is cut;
|
|
28
|
+
* - `sandbox` — the daemon's own bare scratch workspace: an empty
|
|
29
|
+
* private sandbox is used instead;
|
|
30
|
+
* - `not_a_repository` — refused: not inside a git repository;
|
|
31
|
+
* - `no_initial_commit` — refused: a repository with an unborn HEAD.
|
|
32
|
+
*/
|
|
33
|
+
export declare const WORKTREE_BASE_VERDICTS: readonly ["worktree", "sandbox", "not_a_repository", "no_initial_commit"];
|
|
34
|
+
export type WorktreeBaseVerdict = (typeof WORKTREE_BASE_VERDICTS)[number];
|
|
35
|
+
/** The verdicts on which the daemon refuses an isolated Run before any tool. */
|
|
36
|
+
export declare const REFUSING_WORKTREE_BASE_VERDICTS: ReadonlySet<WorktreeBaseVerdict>;
|
|
37
|
+
export declare function isWorktreeBaseVerdict(value: unknown): value is WorktreeBaseVerdict;
|
|
38
|
+
export interface WorkspaceIsolationProbeRequest {
|
|
39
|
+
/** Omitted: the daemon resolves its own default, as it would for the Run. */
|
|
40
|
+
workingDirectory?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface WorkspaceIsolationProbeAnswer {
|
|
43
|
+
/** The directory a Run asked with this `workingDirectory` would be rooted in. */
|
|
44
|
+
baseCwd: string;
|
|
45
|
+
/** Whether a person chose it (agent/task directory or configured default). */
|
|
46
|
+
chosenExplicitly: boolean;
|
|
47
|
+
verdict: WorktreeBaseVerdict;
|
|
48
|
+
/** The refusal sentence the Run would fail with; null when it would be admitted. */
|
|
49
|
+
remedy: string | null;
|
|
50
|
+
checkedAt: string;
|
|
51
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The workspace-isolation probe wire contract (OSK-15099).
|
|
3
|
+
*
|
|
4
|
+
* A Commitment Run is always isolated: the daemon cuts it a private git
|
|
5
|
+
* worktree from the directory the Run is rooted in, and refuses the Run with
|
|
6
|
+
* `EXECUTION_ISOLATION_UNAVAILABLE` before any tool when it cannot. Preflight
|
|
7
|
+
* had no way to read that machine's filesystem, so it reported `ready`,
|
|
8
|
+
* activation succeeded, and the first Run failed. The daemon now answers the
|
|
9
|
+
* same question BEFORE a Run, through the same predicate its executor refuses
|
|
10
|
+
* on, and this module is the one place both ends spell it.
|
|
11
|
+
*
|
|
12
|
+
* - The daemon announces {@link WORKSPACE_ISOLATION_PROBE_CAPABILITY}. A daemon
|
|
13
|
+
* that does not is never asked, and the server reports the prerequisite as
|
|
14
|
+
* UNVERIFIED — never as satisfied (unknown is never ok).
|
|
15
|
+
* - The server sends {@link WORKSPACE_ISOLATION_PROBE_METHOD} as a control RPC
|
|
16
|
+
* with `{ workingDirectory? }`: exactly the directory it would put on the
|
|
17
|
+
* Run's request (`agent.workingDirectory || daemon cwd`).
|
|
18
|
+
* - The daemon answers {@link WorkspaceIsolationProbeAnswer}.
|
|
19
|
+
*
|
|
20
|
+
* Pure: no I/O, safe for the browser, the CLI and the API.
|
|
21
|
+
*/
|
|
22
|
+
export const WORKSPACE_ISOLATION_PROBE_CAPABILITY = 'workspace_isolation_probe_v1';
|
|
23
|
+
export const WORKSPACE_ISOLATION_PROBE_METHOD = 'daemon:workspace:isolation-probe';
|
|
24
|
+
/**
|
|
25
|
+
* What an explicit isolation request can be given from a base directory.
|
|
26
|
+
*
|
|
27
|
+
* - `worktree` — a git repository with a commit: a worktree is cut;
|
|
28
|
+
* - `sandbox` — the daemon's own bare scratch workspace: an empty
|
|
29
|
+
* private sandbox is used instead;
|
|
30
|
+
* - `not_a_repository` — refused: not inside a git repository;
|
|
31
|
+
* - `no_initial_commit` — refused: a repository with an unborn HEAD.
|
|
32
|
+
*/
|
|
33
|
+
export const WORKTREE_BASE_VERDICTS = Object.freeze([
|
|
34
|
+
'worktree',
|
|
35
|
+
'sandbox',
|
|
36
|
+
'not_a_repository',
|
|
37
|
+
'no_initial_commit',
|
|
38
|
+
]);
|
|
39
|
+
/** The verdicts on which the daemon refuses an isolated Run before any tool. */
|
|
40
|
+
export const REFUSING_WORKTREE_BASE_VERDICTS = new Set([
|
|
41
|
+
'not_a_repository',
|
|
42
|
+
'no_initial_commit',
|
|
43
|
+
]);
|
|
44
|
+
export function isWorktreeBaseVerdict(value) {
|
|
45
|
+
return typeof value === 'string' && WORKTREE_BASE_VERDICTS.includes(value);
|
|
46
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skrr-ai/auth-core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.26",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"types": "dist/esm/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -144,6 +144,16 @@
|
|
|
144
144
|
"default": "./dist/cjs/dedicatedRuntimeWakeWire.js"
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
|
+
"./workspace-isolation-probe-wire": {
|
|
148
|
+
"import": {
|
|
149
|
+
"types": "./dist/esm/workspaceIsolationProbeWire.d.ts",
|
|
150
|
+
"default": "./dist/esm/workspaceIsolationProbeWire.js"
|
|
151
|
+
},
|
|
152
|
+
"require": {
|
|
153
|
+
"types": "./dist/cjs/workspaceIsolationProbeWire.d.ts",
|
|
154
|
+
"default": "./dist/cjs/workspaceIsolationProbeWire.js"
|
|
155
|
+
}
|
|
156
|
+
},
|
|
147
157
|
"./commitment-execution-contract": {
|
|
148
158
|
"import": {
|
|
149
159
|
"types": "./dist/esm/commitmentExecutionContract.d.ts",
|