@skrr-ai/cli 0.1.208 → 0.1.210
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/dist/base-command.js +2 -1
- package/dist/commands/agent/message/no-reply.js +1 -1
- package/dist/commands/agent/message/react.d.ts +23 -0
- package/dist/commands/agent/message/react.js +128 -0
- package/dist/commands/agent/message/resolve.js +1 -1
- package/dist/commands/agent/message/retract.js +1 -1
- package/dist/commands/agent/message/send.d.ts +8 -13
- package/dist/commands/agent/message/send.js +60 -28
- package/dist/commands/agents/access/approve.js +1 -1
- package/dist/commands/agents/access/deny.js +1 -1
- package/dist/commands/agents/access/list.js +3 -1
- package/dist/commands/agents/access/reach.js +1 -1
- package/dist/commands/agents/access/revoke.js +1 -1
- package/dist/commands/agents/always-on/recovery-review.d.ts +10 -0
- package/dist/commands/agents/always-on/recovery-review.js +45 -0
- package/dist/commands/agents/chat.d.ts +22 -0
- package/dist/commands/agents/chat.js +400 -90
- package/dist/commands/agents/import.js +3 -3
- package/dist/commands/agents/manager/status.js +7 -6
- package/dist/commands/agents/not-for-task.d.ts +24 -0
- package/dist/commands/agents/not-for-task.js +64 -0
- package/dist/commands/agents/schedule-overview.d.ts +20 -0
- package/dist/commands/agents/schedule-overview.js +35 -2
- package/dist/commands/agents/shared-memory.js +1 -1
- package/dist/commands/agents/stop.d.ts +23 -0
- package/dist/commands/agents/stop.js +61 -0
- package/dist/commands/agents/update.d.ts +7 -0
- package/dist/commands/agents/update.js +45 -2
- package/dist/commands/convos/messages.js +5 -0
- package/dist/commands/convos/transcript.js +2 -2
- package/dist/commands/daemon/logs.d.ts +3 -1
- package/dist/commands/daemon/logs.js +6 -2
- package/dist/commands/dm/work.js +38 -9
- package/dist/commands/duties/advance-next.js +1 -1
- package/dist/commands/duties/preflight.js +17 -13
- package/dist/commands/duties/show.js +5 -0
- package/dist/commands/followups/watch-pr.js +2 -1
- package/dist/commands/harnesses/evaluations/evidence.js +2 -2
- package/dist/commands/harnesses/evaluations/grant.js +1 -1
- package/dist/commands/harnesses/evaluations/revoke.js +1 -1
- package/dist/commands/harnesses/evaluations/show.js +1 -1
- package/dist/commands/harnesses/rollouts/grant.js +1 -1
- package/dist/commands/harnesses/rollouts/revoke.js +1 -1
- package/dist/commands/machines/hosted/identity-evaluations/revoke.js +1 -1
- package/dist/commands/machines/hosted/identity-evaluations/show.js +1 -1
- package/dist/commands/memory/consolidation/undo.js +1 -0
- package/dist/commands/messages/list.js +9 -1
- package/dist/commands/slack/mutes.js +1 -1
- package/dist/commands/slack/unmute.js +1 -1
- package/dist/commands/tasks/actionability.js +1 -0
- package/dist/commands/tasks/ask.d.ts +2 -0
- package/dist/commands/tasks/ask.js +7 -1
- package/dist/commands/tasks/bulk-update.js +12 -0
- package/dist/commands/tasks/deliverable/add.d.ts +2 -0
- package/dist/commands/tasks/deliverable/add.js +25 -6
- package/dist/commands/tasks/input/show.d.ts +2 -0
- package/dist/commands/tasks/input/show.js +18 -3
- package/dist/commands/tasks/list.d.ts +8 -0
- package/dist/commands/tasks/list.js +50 -9
- package/dist/commands/tasks/move.d.ts +2 -10
- package/dist/commands/tasks/move.js +7 -18
- package/dist/commands/tasks/resource/add.d.ts +2 -0
- package/dist/commands/tasks/resource/add.js +11 -1
- package/dist/commands/tasks/result/show.js +19 -7
- package/dist/commands/tasks/show.d.ts +4 -3
- package/dist/commands/tasks/show.js +20 -8
- package/dist/commands/tasks/start.js +35 -16
- package/dist/commands/tasks/update.js +3 -0
- package/dist/commands/tasks/wait.js +2 -2
- package/dist/generated/agent-guides.json +483 -183
- package/dist/lib/agent-proactive-baseline.js +4 -1
- package/dist/lib/chat-stop.d.ts +17 -0
- package/dist/lib/chat-stop.js +70 -0
- package/dist/lib/cloud-reply.d.ts +21 -0
- package/dist/lib/cloud-reply.js +52 -0
- package/dist/lib/duties.d.ts +10 -0
- package/dist/lib/duties.js +111 -7
- package/dist/lib/duty-ledgers.js +19 -2
- package/dist/lib/file-mime.js +8 -0
- package/dist/lib/inbound-messages.d.ts +156 -0
- package/dist/lib/inbound-messages.js +375 -0
- package/dist/lib/message-intent.d.ts +18 -2
- package/dist/lib/message-intent.js +23 -1
- package/dist/lib/preflight-copy.d.ts +16 -1
- package/dist/lib/preflight-copy.js +33 -1
- package/dist/lib/space-resolver.d.ts +9 -0
- package/dist/lib/space-resolver.js +13 -0
- package/dist/lib/task-operations.d.ts +2 -0
- package/dist/lib/task-operations.js +28 -4
- package/dist/lib/task-preflight.js +1 -0
- package/dist/lib/task-review-notice.d.ts +21 -0
- package/dist/lib/task-review-notice.js +46 -0
- package/dist/lib/task-version.d.ts +9 -0
- package/dist/lib/task-version.js +16 -0
- package/dist/lib/task-work.js +5 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelopeBridge.js +6 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/managedWorkRuntime.d.ts +5 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/managedWorkRuntime.js +21 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelopeBridge.js +45 -15
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/managedWorkRuntime.d.ts +5 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/managedWorkRuntime.js +31 -5
- package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +12307 -11838
- package/oclif.manifest.json +307 -23
- package/package.json +6 -2
|
@@ -20,7 +20,10 @@ function taskActionRemedies(action, taskId, targetId, bin = 'skrr', context = {}
|
|
|
20
20
|
const task = (0, shell_quote_1.shellQuoteArg)(taskId);
|
|
21
21
|
const target = targetId ? (0, shell_quote_1.shellQuoteArg)(targetId) : '<id>';
|
|
22
22
|
if (action === 'assign_task') {
|
|
23
|
-
|
|
23
|
+
const remedies = context.reasonCode === 'started_without_assignee'
|
|
24
|
+
? startedTaskAssignRemedies(task, context.task)
|
|
25
|
+
: assignTaskRemedies(task, context.task);
|
|
26
|
+
return remedies.map((remedy) => ({
|
|
24
27
|
...remedy,
|
|
25
28
|
command: `${bin} ${remedy.command}`,
|
|
26
29
|
}));
|
|
@@ -61,9 +64,10 @@ function taskActionCommand(action, taskId, targetId, bin = 'skrr', context = {})
|
|
|
61
64
|
/**
|
|
62
65
|
* The commands that answer `assign_task`.
|
|
63
66
|
*
|
|
64
|
-
* The server says "Choose an executor and assignee" (or, for a started Task
|
|
65
|
-
*
|
|
66
|
-
* so the reader learned what was missing
|
|
67
|
+
* The server says "Choose an executor and assignee" (or, for a started Task
|
|
68
|
+
* nobody is assigned to, `started_without_assignee`, OSK-20258) and this used
|
|
69
|
+
* to point at `tasks assign --help`, so the reader learned what was missing
|
|
70
|
+
* and not how to supply it (OSK-24355).
|
|
67
71
|
*
|
|
68
72
|
* Assigning settles both halves: when no executor was declared, the server
|
|
69
73
|
* records the assignee's kind as the executor. `tasks update --execution-mode`
|
|
@@ -108,6 +112,26 @@ function assignTaskRemedies(task, state) {
|
|
|
108
112
|
},
|
|
109
113
|
];
|
|
110
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* The command that answers `assign_task` on a started Task nobody is assigned to (OSK-20258).
|
|
117
|
+
*
|
|
118
|
+
* Somebody took it up, so the assignment names the person working it. The Agent path is not
|
|
119
|
+
* offered: an Agent assignee makes the Task Agent-ready work to start while that person may still
|
|
120
|
+
* be at it. A declared Agent executor also needs the switch to human execution. Assigning a person
|
|
121
|
+
* alone is refused there, so the one command carries both. Without the Task's state the caller
|
|
122
|
+
* cannot tell, and the flag is right for every executor.
|
|
123
|
+
*/
|
|
124
|
+
function startedTaskAssignRemedies(task, state) {
|
|
125
|
+
const declaredAgent = !state || state.executionMode === 'agent';
|
|
126
|
+
return [
|
|
127
|
+
declaredAgent
|
|
128
|
+
? {
|
|
129
|
+
command: `tasks assign ${task} <person> --execution-mode human`,
|
|
130
|
+
what: 'the person working it does it',
|
|
131
|
+
}
|
|
132
|
+
: { command: `tasks assign ${task} <person>`, what: 'the person working it does it' },
|
|
133
|
+
];
|
|
134
|
+
}
|
|
111
135
|
function hasIds(values) {
|
|
112
136
|
return Array.isArray(values) && values.some(Boolean);
|
|
113
137
|
}
|
|
@@ -138,6 +138,7 @@ function taskPreflightLines(report, bin = 'skrr') {
|
|
|
138
138
|
for (const action of a.allowedActions) {
|
|
139
139
|
const rows = (0, task_operations_1.taskActionRemedyRows)((0, task_operations_1.taskActionRemedies)(action.action, report.taskId, action.targetId, bin, {
|
|
140
140
|
allowedActions: a.allowedActions,
|
|
141
|
+
reasonCode: a.reasonCode,
|
|
141
142
|
}));
|
|
142
143
|
if (rows.length === 0)
|
|
143
144
|
lines.push(` ${action.action} (no single CLI remedy is mapped)`);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a move into review means when no Review is owed.
|
|
3
|
+
*
|
|
4
|
+
* Review is where a Review the Task's own `reviewPolicy` requires is waited for. Under `none`
|
|
5
|
+
* (the default) nobody owes one, so a Task parked there waits on a person who was never asked:
|
|
6
|
+
* thousands sat in review that way (OSK-33196). The move still lands; this says what it means,
|
|
7
|
+
* at the moment an agent made it.
|
|
8
|
+
*
|
|
9
|
+
* Every CLI door that moves a Task reads it from here. It used to live in `tasks move` alone,
|
|
10
|
+
* and `tasks bulk-update` moved 181 finished Tasks into review in one session without a word
|
|
11
|
+
* (OSK-33194).
|
|
12
|
+
*/
|
|
13
|
+
/** True when the moved Task now waits in review for a Review nobody owes it. */
|
|
14
|
+
export declare function waitsForUnowedReview(task: unknown): boolean;
|
|
15
|
+
/** The notice for one Task, or null when it is not waiting for an unowed Review. */
|
|
16
|
+
export declare function unowedReviewNotice(task: unknown, bin: string): string | null;
|
|
17
|
+
/**
|
|
18
|
+
* One notice for several moved Tasks, naming them, or null when none waits for an unowed Review.
|
|
19
|
+
* A bulk move says it once rather than once per row.
|
|
20
|
+
*/
|
|
21
|
+
export declare function unowedReviewSummary(labels: string[], bin: string): string | null;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* What a move into review means when no Review is owed.
|
|
4
|
+
*
|
|
5
|
+
* Review is where a Review the Task's own `reviewPolicy` requires is waited for. Under `none`
|
|
6
|
+
* (the default) nobody owes one, so a Task parked there waits on a person who was never asked:
|
|
7
|
+
* thousands sat in review that way (OSK-33196). The move still lands; this says what it means,
|
|
8
|
+
* at the moment an agent made it.
|
|
9
|
+
*
|
|
10
|
+
* Every CLI door that moves a Task reads it from here. It used to live in `tasks move` alone,
|
|
11
|
+
* and `tasks bulk-update` moved 181 finished Tasks into review in one session without a word
|
|
12
|
+
* (OSK-33194).
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.waitsForUnowedReview = waitsForUnowedReview;
|
|
16
|
+
exports.unowedReviewNotice = unowedReviewNotice;
|
|
17
|
+
exports.unowedReviewSummary = unowedReviewSummary;
|
|
18
|
+
/** True when the moved Task now waits in review for a Review nobody owes it. */
|
|
19
|
+
function waitsForUnowedReview(task) {
|
|
20
|
+
const t = (task ?? {});
|
|
21
|
+
return t.statusType === 'review' && t.reviewPolicy !== 'required';
|
|
22
|
+
}
|
|
23
|
+
/** The notice for one Task, or null when it is not waiting for an unowed Review. */
|
|
24
|
+
function unowedReviewNotice(task, bin) {
|
|
25
|
+
if (!waitsForUnowedReview(task))
|
|
26
|
+
return null;
|
|
27
|
+
return ('Nobody owes this Task a Review: its reviewPolicy is not `required`, so it waits in review ' +
|
|
28
|
+
`for a person who was never asked. Close finished work with \`${bin} tasks complete\`.`);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* One notice for several moved Tasks, naming them, or null when none waits for an unowed Review.
|
|
32
|
+
* A bulk move says it once rather than once per row.
|
|
33
|
+
*/
|
|
34
|
+
function unowedReviewSummary(labels, bin) {
|
|
35
|
+
if (labels.length === 0)
|
|
36
|
+
return null;
|
|
37
|
+
if (labels.length === 1) {
|
|
38
|
+
return (`Nobody owes ${labels[0]} a Review: its reviewPolicy is not \`required\`, so it waits in ` +
|
|
39
|
+
`review for a person who was never asked. Close finished work with \`${bin} tasks complete\`.`);
|
|
40
|
+
}
|
|
41
|
+
const shown = labels.slice(0, 10).join(', ');
|
|
42
|
+
const more = labels.length > 10 ? ` and ${labels.length - 10} more` : '';
|
|
43
|
+
return (`Nobody owes these ${labels.length} Tasks a Review (${shown}${more}): their reviewPolicy is ` +
|
|
44
|
+
'not `required`, so they wait in review for a person who was never asked. Close finished ' +
|
|
45
|
+
`work with \`${bin} tasks complete\`.`);
|
|
46
|
+
}
|
|
@@ -23,6 +23,15 @@ export type TaskVersionConflict = {
|
|
|
23
23
|
};
|
|
24
24
|
/** The version a Task reports, with an absent field read as 0 (the server's own reading). */
|
|
25
25
|
export declare function taskVersionOf(task: Record<string, unknown> | null | undefined): number;
|
|
26
|
+
/** The `Version:` line `tasks show` prints, with the flag that uses it. */
|
|
27
|
+
export declare function taskVersionLine(version: number): string;
|
|
28
|
+
/**
|
|
29
|
+
* The same line after a write, from the version the server answered with, or
|
|
30
|
+
* null when it answered without one. Every user edit moves the version, fenced
|
|
31
|
+
* or not, so the version a caller read before its own write is already stale:
|
|
32
|
+
* this is the one to fence the next write on.
|
|
33
|
+
*/
|
|
34
|
+
export declare function writtenTaskVersionLine(task: Record<string, unknown> | null | undefined): string | null;
|
|
26
35
|
/** The two versions of a `TASK_VERSION_CONFLICT` refusal, or null for any other error. */
|
|
27
36
|
export declare function taskVersionConflictOf(err: unknown): TaskVersionConflict | null;
|
|
28
37
|
/**
|
package/dist/lib/task-version.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EXPECTED_VERSION_FLAG_HELP = exports.TASK_VERSION_FENCE_UNSUPPORTED = exports.TASK_VERSION_CONFLICT_CODE = void 0;
|
|
4
4
|
exports.taskVersionOf = taskVersionOf;
|
|
5
|
+
exports.taskVersionLine = taskVersionLine;
|
|
6
|
+
exports.writtenTaskVersionLine = writtenTaskVersionLine;
|
|
5
7
|
exports.taskVersionConflictOf = taskVersionConflictOf;
|
|
6
8
|
exports.describeTaskVersionConflict = describeTaskVersionConflict;
|
|
7
9
|
exports.taskVersionFenceRefusal = taskVersionFenceRefusal;
|
|
@@ -33,6 +35,20 @@ function versionOf(value) {
|
|
|
33
35
|
function taskVersionOf(task) {
|
|
34
36
|
return versionOf(task?.version) ?? 0;
|
|
35
37
|
}
|
|
38
|
+
/** The `Version:` line `tasks show` prints, with the flag that uses it. */
|
|
39
|
+
function taskVersionLine(version) {
|
|
40
|
+
return `Version: ${version} (update only from this read: --expected-version ${version})`;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The same line after a write, from the version the server answered with, or
|
|
44
|
+
* null when it answered without one. Every user edit moves the version, fenced
|
|
45
|
+
* or not, so the version a caller read before its own write is already stale:
|
|
46
|
+
* this is the one to fence the next write on.
|
|
47
|
+
*/
|
|
48
|
+
function writtenTaskVersionLine(task) {
|
|
49
|
+
const version = versionOf(task?.version);
|
|
50
|
+
return version === undefined ? null : taskVersionLine(version);
|
|
51
|
+
}
|
|
36
52
|
/** The two versions of a `TASK_VERSION_CONFLICT` refusal, or null for any other error. */
|
|
37
53
|
function taskVersionConflictOf(err) {
|
|
38
54
|
const refusal = (0, base_command_1.apiRefusal)(err);
|
package/dist/lib/task-work.js
CHANGED
|
@@ -48,6 +48,11 @@ function describeExecutionState(state) {
|
|
|
48
48
|
...resources,
|
|
49
49
|
`Liveness: ${state.liveness.state}; last runtime signal ${state.liveness.lastRuntimeSignalAt ?? 'unavailable'}`,
|
|
50
50
|
`Health: ${state.health.condition}; ${state.health.reason}`,
|
|
51
|
+
...(state.health.condition === 'stop_unconfirmed'
|
|
52
|
+
? [
|
|
53
|
+
'Stop: requested more than 10 minutes ago and not confirmed; the original execution may still be running.',
|
|
54
|
+
]
|
|
55
|
+
: []),
|
|
51
56
|
...(state.waiting ? [`Waiting: ${state.waiting.kind}; ${state.waiting.referenceId}`] : []),
|
|
52
57
|
`Work input: ${state.work.latestWorkInputRevision}; ${state.work.pendingCommandCount} pending command(s); ${state.work.queuedExchangeCount} queued exchange(s)`,
|
|
53
58
|
`Result: ${state.result.currentResultId ?? 'none'} (${state.result.applicability})${state.result.reason ? `; ${state.result.reason}` : ''}`,
|
|
@@ -365,7 +365,12 @@ async function initNewIndependentCredEnvelope(profile) {
|
|
|
365
365
|
if (!stat.isDirectory() || stat.isSymbolicLink() || (stat.mode & 63) !== 0 || typeof process.getuid === "function" && stat.uid !== process.getuid()) {
|
|
366
366
|
throw new Error("Background credential enrollment is unavailable");
|
|
367
367
|
}
|
|
368
|
-
const artifacts = [
|
|
368
|
+
const artifacts = [
|
|
369
|
+
"device-private-key",
|
|
370
|
+
"device-public-key.jwk",
|
|
371
|
+
"auth-binding.json",
|
|
372
|
+
"auth.json"
|
|
373
|
+
];
|
|
369
374
|
const artifactDirs = [dir, ...resolved.legacyDir ? [resolved.legacyDir] : []];
|
|
370
375
|
const assertEmpty = () => {
|
|
371
376
|
if (paths.some(present) || artifactDirs.some((root) => artifacts.some((name) => present(import_node_path.default.join(root, name)))) || wrappedDekFilePath(profile) !== resolved.canonicalPath) {
|
|
@@ -12,6 +12,7 @@ export declare const MANAGED_WORK_ACP_WORKER = "managed_work_acp_worker_v1";
|
|
|
12
12
|
export declare const MANAGED_WORK_ACP_RECORDS = "managed_work_acp_task_records_v1";
|
|
13
13
|
export declare function managedWorkAdapter(provider: unknown): {
|
|
14
14
|
readonly engine: "sdk";
|
|
15
|
+
readonly taskCoordinator: true;
|
|
15
16
|
readonly manager: readonly ["native_interaction_profiles_v1", "sdk_pre_tool_use_exact_allowlist"];
|
|
16
17
|
readonly worker: readonly ["native_task_work_controls_v1", "sdk_pre_tool_use_task_work_controls"];
|
|
17
18
|
readonly taskRecords: readonly ["native_task_record_applicability_v1", "sdk_pre_tool_use_task_record_applicability"];
|
|
@@ -23,6 +24,7 @@ export declare function managedWorkAdapter(provider: unknown): {
|
|
|
23
24
|
readonly taskRecords: readonly ["managed_work_acp_task_records_v1", "acp_task_record_applicability"];
|
|
24
25
|
} | {
|
|
25
26
|
readonly engine: "app-server";
|
|
27
|
+
readonly taskCoordinator: true;
|
|
26
28
|
readonly freshSession: true;
|
|
27
29
|
readonly toolTransport: "daemon_rpc";
|
|
28
30
|
readonly manager: readonly ["managed_work_codex_manager_v1", "app_server_scoped_dynamic_tools"];
|
|
@@ -30,11 +32,14 @@ export declare function managedWorkAdapter(provider: unknown): {
|
|
|
30
32
|
readonly taskRecords: readonly ["managed_work_codex_task_records_v1", "app_server_canonical_task_records"];
|
|
31
33
|
} | {
|
|
32
34
|
readonly engine: "rpc";
|
|
35
|
+
readonly taskCoordinator: true;
|
|
33
36
|
readonly freshSession: true;
|
|
34
37
|
readonly toolTransport: "daemon_rpc";
|
|
35
38
|
readonly manager: readonly ["managed_work_pi_manager_v1", "pi_rpc_exact_tool_scope"];
|
|
36
39
|
readonly worker: readonly ["managed_work_pi_worker_v1", "pi_rpc_governed_work_tools"];
|
|
37
40
|
readonly taskRecords: readonly ["managed_work_pi_task_records_v1", "pi_rpc_canonical_task_records"];
|
|
38
41
|
} | undefined;
|
|
42
|
+
/** Whether this harness can run a Task coordinator turn with no tool offered to its model. */
|
|
43
|
+
export declare function managedWorkSupportsTaskCoordinator(provider: unknown): boolean;
|
|
39
44
|
export declare function managedWorkCapabilities(provider: string): string[];
|
|
40
45
|
export declare function advertisesManagedWorkAcp(value: unknown, worker: boolean, records: boolean): boolean;
|
|
@@ -25,21 +25,31 @@ __export(managedWorkRuntime_exports, {
|
|
|
25
25
|
MANAGED_WORK_ACP_WORKER: () => MANAGED_WORK_ACP_WORKER,
|
|
26
26
|
advertisesManagedWorkAcp: () => advertisesManagedWorkAcp,
|
|
27
27
|
managedWorkAdapter: () => managedWorkAdapter,
|
|
28
|
-
managedWorkCapabilities: () => managedWorkCapabilities
|
|
28
|
+
managedWorkCapabilities: () => managedWorkCapabilities,
|
|
29
|
+
managedWorkSupportsTaskCoordinator: () => managedWorkSupportsTaskCoordinator
|
|
29
30
|
});
|
|
30
31
|
module.exports = __toCommonJS(managedWorkRuntime_exports);
|
|
31
32
|
var import_firstPartyHarness = require("./firstPartyHarness.js");
|
|
32
33
|
const MANAGED_WORK_ACP_META = "oversky.dev/managed-work";
|
|
33
|
-
const MANAGED_WORK_ACP_CAPABILITY = {
|
|
34
|
+
const MANAGED_WORK_ACP_CAPABILITY = {
|
|
35
|
+
version: 1,
|
|
36
|
+
manager: true,
|
|
37
|
+
worker: true,
|
|
38
|
+
taskRecords: true
|
|
39
|
+
};
|
|
34
40
|
const MANAGED_WORK_ACP_MANAGER = "managed_work_acp_manager_v1";
|
|
35
41
|
const MANAGED_WORK_ACP_WORKER = "managed_work_acp_worker_v1";
|
|
36
42
|
const MANAGED_WORK_ACP_RECORDS = "managed_work_acp_task_records_v1";
|
|
37
43
|
const adapters = {
|
|
38
44
|
claude: {
|
|
39
45
|
engine: "sdk",
|
|
46
|
+
taskCoordinator: true,
|
|
40
47
|
manager: ["native_interaction_profiles_v1", "sdk_pre_tool_use_exact_allowlist"],
|
|
41
48
|
worker: ["native_task_work_controls_v1", "sdk_pre_tool_use_task_work_controls"],
|
|
42
|
-
taskRecords: [
|
|
49
|
+
taskRecords: [
|
|
50
|
+
"native_task_record_applicability_v1",
|
|
51
|
+
"sdk_pre_tool_use_task_record_applicability"
|
|
52
|
+
]
|
|
43
53
|
},
|
|
44
54
|
[import_firstPartyHarness.FIRST_PARTY_HARNESS_PROVIDER]: {
|
|
45
55
|
engine: "acp",
|
|
@@ -50,6 +60,7 @@ const adapters = {
|
|
|
50
60
|
},
|
|
51
61
|
codex: {
|
|
52
62
|
engine: "app-server",
|
|
63
|
+
taskCoordinator: true,
|
|
53
64
|
freshSession: true,
|
|
54
65
|
toolTransport: "daemon_rpc",
|
|
55
66
|
manager: ["managed_work_codex_manager_v1", "app_server_scoped_dynamic_tools"],
|
|
@@ -58,6 +69,7 @@ const adapters = {
|
|
|
58
69
|
},
|
|
59
70
|
pi: {
|
|
60
71
|
engine: "rpc",
|
|
72
|
+
taskCoordinator: true,
|
|
61
73
|
freshSession: true,
|
|
62
74
|
toolTransport: "daemon_rpc",
|
|
63
75
|
manager: ["managed_work_pi_manager_v1", "pi_rpc_exact_tool_scope"],
|
|
@@ -71,6 +83,10 @@ function managedWorkAdapter(provider) {
|
|
|
71
83
|
const name = ["claude-code", "claude_code", "local-claude-code"].includes(provider) ? "claude" : (0, import_firstPartyHarness.canonicalHarnessProvider)(provider);
|
|
72
84
|
return Object.hasOwn(adapters, name) ? adapters[name] : void 0;
|
|
73
85
|
}
|
|
86
|
+
function managedWorkSupportsTaskCoordinator(provider) {
|
|
87
|
+
const adapter = managedWorkAdapter(provider);
|
|
88
|
+
return Boolean(adapter && "taskCoordinator" in adapter);
|
|
89
|
+
}
|
|
74
90
|
function managedWorkCapabilities(provider) {
|
|
75
91
|
const adapter = managedWorkAdapter(provider);
|
|
76
92
|
return adapter ? [adapter.manager[0], adapter.worker[0], adapter.taskRecords[0]] : [];
|
|
@@ -90,5 +106,6 @@ function advertisesManagedWorkAcp(value, worker, records) {
|
|
|
90
106
|
MANAGED_WORK_ACP_WORKER,
|
|
91
107
|
advertisesManagedWorkAcp,
|
|
92
108
|
managedWorkAdapter,
|
|
93
|
-
managedWorkCapabilities
|
|
109
|
+
managedWorkCapabilities,
|
|
110
|
+
managedWorkSupportsTaskCoordinator
|
|
94
111
|
});
|
|
@@ -208,7 +208,7 @@ async function withCredEnvelopeLock(profile, body) {
|
|
|
208
208
|
/**
|
|
209
209
|
* Sticky record of the last consolidation refusal for this process — two usable
|
|
210
210
|
* and DIFFERENT wrapped DEKs for one profile. Surfaced through
|
|
211
|
-
* `describeCredEnvelopeState()` so `skrr
|
|
211
|
+
* `describeCredEnvelopeState()` so `skrr whoami` and `skrrd status` can say so:
|
|
212
212
|
* the split cannot be repaired here (each side's secrets live in its own
|
|
213
213
|
* keychain namespace, sealed under its own DEK, and re-sealing them is not
|
|
214
214
|
* auth-core's to do), so being loud about it IS the remedy.
|
|
@@ -501,8 +501,12 @@ export async function initExistingCredEnvelope(profile) {
|
|
|
501
501
|
const target = wrappedDekFilePath(profile);
|
|
502
502
|
fd = fs.openSync(target, fs.constants.O_RDONLY | (fs.constants.O_NOFOLLOW ?? 0));
|
|
503
503
|
const before = fs.fstatSync(fd);
|
|
504
|
-
const safe = (stat) => stat.isFile() &&
|
|
505
|
-
|
|
504
|
+
const safe = (stat) => stat.isFile() &&
|
|
505
|
+
stat.nlink === 1 &&
|
|
506
|
+
stat.size > 0 &&
|
|
507
|
+
stat.size <= 65_536 &&
|
|
508
|
+
(stat.mode & 0o077) === 0 &&
|
|
509
|
+
(typeof process.getuid !== 'function' || stat.uid === process.getuid());
|
|
506
510
|
if (!safe(before))
|
|
507
511
|
throw new Error('unsafe envelope');
|
|
508
512
|
const readBounded = () => {
|
|
@@ -529,18 +533,32 @@ export async function initExistingCredEnvelope(profile) {
|
|
|
529
533
|
throw new Error('changed envelope');
|
|
530
534
|
const after = fs.fstatSync(fd);
|
|
531
535
|
const current = fs.lstatSync(target);
|
|
532
|
-
if (!safe(after) ||
|
|
533
|
-
|
|
534
|
-
before.
|
|
535
|
-
before.
|
|
536
|
-
|
|
536
|
+
if (!safe(after) ||
|
|
537
|
+
!safe(current) ||
|
|
538
|
+
before.dev !== after.dev ||
|
|
539
|
+
before.ino !== after.ino ||
|
|
540
|
+
before.dev !== current.dev ||
|
|
541
|
+
before.ino !== current.ino ||
|
|
542
|
+
before.size !== after.size ||
|
|
543
|
+
before.size !== current.size ||
|
|
544
|
+
before.mtimeMs !== after.mtimeMs ||
|
|
545
|
+
before.ctimeMs !== after.ctimeMs ||
|
|
546
|
+
before.mtimeMs !== current.mtimeMs ||
|
|
547
|
+
before.ctimeMs !== current.ctimeMs ||
|
|
548
|
+
wrappedDekFilePath(profile) !== target ||
|
|
549
|
+
_state.kind !== 'uninit') {
|
|
537
550
|
throw new Error('changed envelope');
|
|
538
551
|
}
|
|
539
552
|
for (const old of _retiredDeks)
|
|
540
553
|
old.fill(0);
|
|
541
554
|
_retiredDeks = [];
|
|
542
|
-
_state = {
|
|
543
|
-
|
|
555
|
+
_state = {
|
|
556
|
+
kind: 'active',
|
|
557
|
+
dek: candidate,
|
|
558
|
+
kekId: kek.id,
|
|
559
|
+
kekKind: typeof kek.kind === 'string' || kek.kind === null ? (kek.kind ?? null) : null,
|
|
560
|
+
profile,
|
|
561
|
+
};
|
|
544
562
|
candidate = undefined;
|
|
545
563
|
}
|
|
546
564
|
catch {
|
|
@@ -582,14 +600,22 @@ export async function initNewIndependentCredEnvelope(profile) {
|
|
|
582
600
|
// recovery, not first enrollment, even if a retried caller says otherwise.
|
|
583
601
|
const dir = resolved.canonicalDir;
|
|
584
602
|
const stat = fs.lstatSync(dir);
|
|
585
|
-
if (!stat.isDirectory() ||
|
|
603
|
+
if (!stat.isDirectory() ||
|
|
604
|
+
stat.isSymbolicLink() ||
|
|
605
|
+
(stat.mode & 0o077) !== 0 ||
|
|
586
606
|
(typeof process.getuid === 'function' && stat.uid !== process.getuid())) {
|
|
587
607
|
throw new Error('Background credential enrollment is unavailable');
|
|
588
608
|
}
|
|
589
|
-
const artifacts = [
|
|
609
|
+
const artifacts = [
|
|
610
|
+
'device-private-key',
|
|
611
|
+
'device-public-key.jwk',
|
|
612
|
+
'auth-binding.json',
|
|
613
|
+
'auth.json',
|
|
614
|
+
];
|
|
590
615
|
const artifactDirs = [dir, ...(resolved.legacyDir ? [resolved.legacyDir] : [])];
|
|
591
616
|
const assertEmpty = () => {
|
|
592
|
-
if (paths.some(present) ||
|
|
617
|
+
if (paths.some(present) ||
|
|
618
|
+
artifactDirs.some((root) => artifacts.some((name) => present(path.join(root, name)))) ||
|
|
593
619
|
wrappedDekFilePath(profile) !== resolved.canonicalPath) {
|
|
594
620
|
throw new Error('Background credential enrollment needs recovery');
|
|
595
621
|
}
|
|
@@ -612,7 +638,9 @@ export async function initNewIndependentCredEnvelope(profile) {
|
|
|
612
638
|
return await initExistingCredEnvelope(profile);
|
|
613
639
|
assertEmpty();
|
|
614
640
|
const temporaryPath = path.join(dir, `.cred-dek-enrollment.${randomBytes(12).toString('hex')}.tmp`);
|
|
615
|
-
const fd = fs.openSync(temporaryPath, fs.constants.O_WRONLY |
|
|
641
|
+
const fd = fs.openSync(temporaryPath, fs.constants.O_WRONLY |
|
|
642
|
+
fs.constants.O_CREAT |
|
|
643
|
+
fs.constants.O_EXCL |
|
|
616
644
|
(fs.constants.O_NOFOLLOW ?? 0), 0o600);
|
|
617
645
|
temp = temporaryPath;
|
|
618
646
|
try {
|
|
@@ -834,7 +862,9 @@ export async function initCredEnvelope(profile) {
|
|
|
834
862
|
// was sealed under it.
|
|
835
863
|
if (unwrapAttemptedAndFailed && dek === null) {
|
|
836
864
|
_kekRotationDetected = true;
|
|
837
|
-
const keptAs = unreadableWrapped
|
|
865
|
+
const keptAs = unreadableWrapped
|
|
866
|
+
? keepUnreadableWrappedDek(profile, unreadableWrapped)
|
|
867
|
+
: null;
|
|
838
868
|
emit('cred_envelope.kek_rotated', false, {
|
|
839
869
|
kekId: kek.id,
|
|
840
870
|
kekKind: captureKind(),
|
|
@@ -12,6 +12,7 @@ export declare const MANAGED_WORK_ACP_WORKER = "managed_work_acp_worker_v1";
|
|
|
12
12
|
export declare const MANAGED_WORK_ACP_RECORDS = "managed_work_acp_task_records_v1";
|
|
13
13
|
export declare function managedWorkAdapter(provider: unknown): {
|
|
14
14
|
readonly engine: "sdk";
|
|
15
|
+
readonly taskCoordinator: true;
|
|
15
16
|
readonly manager: readonly ["native_interaction_profiles_v1", "sdk_pre_tool_use_exact_allowlist"];
|
|
16
17
|
readonly worker: readonly ["native_task_work_controls_v1", "sdk_pre_tool_use_task_work_controls"];
|
|
17
18
|
readonly taskRecords: readonly ["native_task_record_applicability_v1", "sdk_pre_tool_use_task_record_applicability"];
|
|
@@ -23,6 +24,7 @@ export declare function managedWorkAdapter(provider: unknown): {
|
|
|
23
24
|
readonly taskRecords: readonly ["managed_work_acp_task_records_v1", "acp_task_record_applicability"];
|
|
24
25
|
} | {
|
|
25
26
|
readonly engine: "app-server";
|
|
27
|
+
readonly taskCoordinator: true;
|
|
26
28
|
readonly freshSession: true;
|
|
27
29
|
readonly toolTransport: "daemon_rpc";
|
|
28
30
|
readonly manager: readonly ["managed_work_codex_manager_v1", "app_server_scoped_dynamic_tools"];
|
|
@@ -30,11 +32,14 @@ export declare function managedWorkAdapter(provider: unknown): {
|
|
|
30
32
|
readonly taskRecords: readonly ["managed_work_codex_task_records_v1", "app_server_canonical_task_records"];
|
|
31
33
|
} | {
|
|
32
34
|
readonly engine: "rpc";
|
|
35
|
+
readonly taskCoordinator: true;
|
|
33
36
|
readonly freshSession: true;
|
|
34
37
|
readonly toolTransport: "daemon_rpc";
|
|
35
38
|
readonly manager: readonly ["managed_work_pi_manager_v1", "pi_rpc_exact_tool_scope"];
|
|
36
39
|
readonly worker: readonly ["managed_work_pi_worker_v1", "pi_rpc_governed_work_tools"];
|
|
37
40
|
readonly taskRecords: readonly ["managed_work_pi_task_records_v1", "pi_rpc_canonical_task_records"];
|
|
38
41
|
} | undefined;
|
|
42
|
+
/** Whether this harness can run a Task coordinator turn with no tool offered to its model. */
|
|
43
|
+
export declare function managedWorkSupportsTaskCoordinator(provider: unknown): boolean;
|
|
39
44
|
export declare function managedWorkCapabilities(provider: string): string[];
|
|
40
45
|
export declare function advertisesManagedWorkAcp(value: unknown, worker: boolean, records: boolean): boolean;
|
|
@@ -2,16 +2,32 @@ import { canonicalHarnessProvider, FIRST_PARTY_HARNESS_PROVIDER } from './firstP
|
|
|
2
2
|
/** Server derives roles from its live Chat/Task/Run records. A transport may
|
|
3
3
|
* implement either role, but launch requires both on the configured target. */
|
|
4
4
|
export const MANAGED_WORK_ACP_META = 'oversky.dev/managed-work';
|
|
5
|
-
export const MANAGED_WORK_ACP_CAPABILITY = {
|
|
5
|
+
export const MANAGED_WORK_ACP_CAPABILITY = {
|
|
6
|
+
version: 1,
|
|
7
|
+
manager: true,
|
|
8
|
+
worker: true,
|
|
9
|
+
taskRecords: true,
|
|
10
|
+
};
|
|
6
11
|
export const MANAGED_WORK_ACP_MANAGER = 'managed_work_acp_manager_v1';
|
|
7
12
|
export const MANAGED_WORK_ACP_WORKER = 'managed_work_acp_worker_v1';
|
|
8
13
|
export const MANAGED_WORK_ACP_RECORDS = 'managed_work_acp_task_records_v1';
|
|
14
|
+
/**
|
|
15
|
+
* `taskCoordinator` marks an adapter that can run a Task coordinator turn: the `task_coordinator`
|
|
16
|
+
* interaction role with NO tool offered to the model. An adapter without it is refused the role by
|
|
17
|
+
* the server and by the daemon, and the caller sends the platform's template instead. The
|
|
18
|
+
* first-party ACP engine accepts a closed list of manager roles that does not hold this one, so it
|
|
19
|
+
* stays unmarked until a release of the engine does.
|
|
20
|
+
*/
|
|
9
21
|
const adapters = {
|
|
10
22
|
claude: {
|
|
11
23
|
engine: 'sdk',
|
|
24
|
+
taskCoordinator: true,
|
|
12
25
|
manager: ['native_interaction_profiles_v1', 'sdk_pre_tool_use_exact_allowlist'],
|
|
13
26
|
worker: ['native_task_work_controls_v1', 'sdk_pre_tool_use_task_work_controls'],
|
|
14
|
-
taskRecords: [
|
|
27
|
+
taskRecords: [
|
|
28
|
+
'native_task_record_applicability_v1',
|
|
29
|
+
'sdk_pre_tool_use_task_record_applicability',
|
|
30
|
+
],
|
|
15
31
|
},
|
|
16
32
|
[FIRST_PARTY_HARNESS_PROVIDER]: {
|
|
17
33
|
engine: 'acp',
|
|
@@ -22,6 +38,7 @@ const adapters = {
|
|
|
22
38
|
},
|
|
23
39
|
codex: {
|
|
24
40
|
engine: 'app-server',
|
|
41
|
+
taskCoordinator: true,
|
|
25
42
|
freshSession: true,
|
|
26
43
|
toolTransport: 'daemon_rpc',
|
|
27
44
|
manager: ['managed_work_codex_manager_v1', 'app_server_scoped_dynamic_tools'],
|
|
@@ -30,6 +47,7 @@ const adapters = {
|
|
|
30
47
|
},
|
|
31
48
|
pi: {
|
|
32
49
|
engine: 'rpc',
|
|
50
|
+
taskCoordinator: true,
|
|
33
51
|
freshSession: true,
|
|
34
52
|
toolTransport: 'daemon_rpc',
|
|
35
53
|
manager: ['managed_work_pi_manager_v1', 'pi_rpc_exact_tool_scope'],
|
|
@@ -40,9 +58,16 @@ const adapters = {
|
|
|
40
58
|
export function managedWorkAdapter(provider) {
|
|
41
59
|
if (typeof provider !== 'string')
|
|
42
60
|
return undefined;
|
|
43
|
-
const name = ['claude-code', 'claude_code', 'local-claude-code'].includes(provider)
|
|
61
|
+
const name = ['claude-code', 'claude_code', 'local-claude-code'].includes(provider)
|
|
62
|
+
? 'claude'
|
|
63
|
+
: canonicalHarnessProvider(provider);
|
|
44
64
|
return Object.hasOwn(adapters, name) ? adapters[name] : undefined;
|
|
45
65
|
}
|
|
66
|
+
/** Whether this harness can run a Task coordinator turn with no tool offered to its model. */
|
|
67
|
+
export function managedWorkSupportsTaskCoordinator(provider) {
|
|
68
|
+
const adapter = managedWorkAdapter(provider);
|
|
69
|
+
return Boolean(adapter && 'taskCoordinator' in adapter);
|
|
70
|
+
}
|
|
46
71
|
export function managedWorkCapabilities(provider) {
|
|
47
72
|
const adapter = managedWorkAdapter(provider);
|
|
48
73
|
return adapter ? [adapter.manager[0], adapter.worker[0], adapter.taskRecords[0]] : [];
|
|
@@ -51,6 +76,7 @@ export function advertisesManagedWorkAcp(value, worker, records) {
|
|
|
51
76
|
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
52
77
|
return false;
|
|
53
78
|
const caps = value;
|
|
54
|
-
return caps.version === MANAGED_WORK_ACP_CAPABILITY.version &&
|
|
55
|
-
|
|
79
|
+
return (caps.version === MANAGED_WORK_ACP_CAPABILITY.version &&
|
|
80
|
+
caps[worker ? 'worker' : 'manager'] === true &&
|
|
81
|
+
(!records || caps.taskRecords === true));
|
|
56
82
|
}
|