@codexhost/cli-darwin-x64 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/host-runtime.mjs +336 -117
- package/app/plugins/antigravity/plugin.mjs +9 -7
- package/app/plugins/deepseek-harness/plugin.mjs +7695 -10516
- package/app/plugins/grok/plugin.mjs +921 -74
- package/app/plugins/kiro-cli/plugin.mjs +29 -6
- package/app/renderer-extension.js +563 -293
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
package/app/host-runtime.mjs
CHANGED
|
@@ -3709,6 +3709,92 @@ var require_websocket_server = __commonJS({
|
|
|
3709
3709
|
}
|
|
3710
3710
|
});
|
|
3711
3711
|
|
|
3712
|
+
// packages/host-runtime/src/delegation-cli-help.ts
|
|
3713
|
+
var COMMAND_HELP = {
|
|
3714
|
+
"harness list": `codexhost harness list [--format json|compact]
|
|
3715
|
+
List Harnesses available in the active Runtime.`,
|
|
3716
|
+
"harness inspect": `codexhost harness inspect <harness> [--cwd <path>] [--refresh true|false] [--format json|compact]
|
|
3717
|
+
Read available Models, native defaults, Thinking options, and configuration capabilities.
|
|
3718
|
+
Use the returned Model and Thinking IDs for explicit selections.`,
|
|
3719
|
+
"delegate start": `codexhost delegate start --harness <id> --task <text> [--cwd <path>] [--model <opaque-ref>] [--thinking <option-id>] [--parent-thread <thread>] [--request-id <id>] [--format json|compact]
|
|
3720
|
+
Create an independent child Thread, submit the task, and return immediately.
|
|
3721
|
+
Omit --model and --thinking to use the Harness native defaults.
|
|
3722
|
+
--cwd overrides the child workspace. Otherwise use the resolved parent Thread workspace, then the Host Runtime process cwd.
|
|
3723
|
+
--parent-thread overrides caller inference. PARENT_THREAD_AMBIGUOUS requires an explicit parent.
|
|
3724
|
+
Reuse --request-id for an idempotent retry. Identical recent parent/target/task/configuration requests are also deduplicated briefly.
|
|
3725
|
+
The response confirms cwd and parent. Use its Thread reference with thread read, wait, send, or cancel.`,
|
|
3726
|
+
"thread send": `codexhost thread send <thread> --message <text> [--format json|compact]
|
|
3727
|
+
Start a new Turn in an idle writable Thread and return immediately.
|
|
3728
|
+
THREAD_BUSY means the current Turn is still active: wait or cancel before sending. Messages are not queued.`,
|
|
3729
|
+
"thread cancel": `codexhost thread cancel <thread> [--format json|compact]
|
|
3730
|
+
Request cancellation of the active Turn while preserving the Thread and history.
|
|
3731
|
+
cancelled=true (compact: cancelRequested=true) means the cancellation request was accepted. Read or wait to confirm the terminal state. An idle Thread returns false.`,
|
|
3732
|
+
"thread read": `codexhost thread read <thread> [--view result|messages] [--cursor <cursor>] [--limit <n>] [--format json|compact]
|
|
3733
|
+
Read immediately without starting a Turn. The default result view reports the latest Turn's status and result.
|
|
3734
|
+
The messages view pages visible user/Agent messages, oldest first. Default limit 25, maximum 100; --cursor and --limit require --view messages.
|
|
3735
|
+
hasMore describes remaining messages now. Save nextCursor for later incremental reads even when hasMore=false.
|
|
3736
|
+
Compact messages output contains only the message page and status; compact result output includes the latest nonempty progress while running.
|
|
3737
|
+
Full JSON retains the complete snapshot. Tool calls/output, file activity, and reasoning are not included in either format.`,
|
|
3738
|
+
"thread wait": `codexhost thread wait <thread> [--timeout-ms <n>] [--view result|messages] [--cursor <cursor>] [--limit <n>] [--format json|compact]
|
|
3739
|
+
Wait until the Thread is terminal or the timeout expires (default 30000 ms), then return the same snapshot as thread read plus timedOut.
|
|
3740
|
+
timedOut=true is a running checkpoint: the child keeps running. The response already includes the result when available; another read is unnecessary unless more information is needed.
|
|
3741
|
+
Message pagination uses --view messages, default limit 25, maximum 100. hasMore is for current pages; nextCursor also supports future incremental reads.`,
|
|
3742
|
+
"thread list": `codexhost thread list [--cwd <path>] [--parent <thread>] [--limit <n>] [--cursor <cursor>] [--sort created-asc|created-desc|updated-asc|updated-desc|recency-asc|recency-desc] [--format json|compact]
|
|
3743
|
+
Find existing Threads by workspace, or use --parent to list a Thread's delegated children.
|
|
3744
|
+
Workspace listing defaults to the caller process cwd. Default limit 25 (maximum 100), sorted created-desc.
|
|
3745
|
+
--parent uses Delegation relationships. A null nextCursor ends the list.
|
|
3746
|
+
Compact output keeps task links, Harness, status, title, and workspace.`
|
|
3747
|
+
};
|
|
3748
|
+
var COMMON_HELP = `Thread references accept a bare ID or codex://threads/<id>.
|
|
3749
|
+
--format json is the compatible full JSON output (default); --format compact returns concise JSON using task links instead of internal IDs.
|
|
3750
|
+
Success is written to stdout; errors {"error":{"code":"...","message":"...","details":{...}}} go to stderr with exit code 1. Exit code 0 means the command succeeded, not that the delegated task succeeded.
|
|
3751
|
+
read/wait are non-consuming. Native Codex callers need local Runtime access; RUNTIME_UNREACHABLE requires the Host-provided environment and a sandbox that permits that connection.`;
|
|
3752
|
+
var DELEGATION_HELP = `usage:
|
|
3753
|
+
codexhost harness list
|
|
3754
|
+
codexhost harness inspect <harness>
|
|
3755
|
+
codexhost delegate start --harness <id> --task <text>
|
|
3756
|
+
codexhost thread send <thread> --message <text>
|
|
3757
|
+
codexhost thread cancel <thread>
|
|
3758
|
+
codexhost thread read <thread>
|
|
3759
|
+
codexhost thread wait <thread>
|
|
3760
|
+
codexhost thread list
|
|
3761
|
+
|
|
3762
|
+
Use <command> --help for its options. Use harness list to discover targets.
|
|
3763
|
+
${COMMON_HELP}
|
|
3764
|
+
`;
|
|
3765
|
+
function hasHelpOption(arguments_2) {
|
|
3766
|
+
for (let index = 0; index < arguments_2.length; index += 1) {
|
|
3767
|
+
const argument = arguments_2[index];
|
|
3768
|
+
if (argument === "--help" || argument === "-h") return true;
|
|
3769
|
+
if (argument?.startsWith("--")) index += 1;
|
|
3770
|
+
}
|
|
3771
|
+
return false;
|
|
3772
|
+
}
|
|
3773
|
+
function delegationCliHelp(arguments_2) {
|
|
3774
|
+
const [group, command, ...rest] = arguments_2;
|
|
3775
|
+
if (!group || group === "--help" || group === "-h") return DELEGATION_HELP;
|
|
3776
|
+
if (!command || command === "--help" || command === "-h" || command === "help") {
|
|
3777
|
+
if (group === "delegate") return DELEGATION_HELP;
|
|
3778
|
+
if (group === "harness" || group === "thread") {
|
|
3779
|
+
const usages = Object.entries(COMMAND_HELP).filter(([name]) => name.startsWith(`${group} `)).map(([, help]) => help.split("\n")[0]);
|
|
3780
|
+
return `${usages.join("\n")}
|
|
3781
|
+
|
|
3782
|
+
${COMMON_HELP}
|
|
3783
|
+
`;
|
|
3784
|
+
}
|
|
3785
|
+
}
|
|
3786
|
+
if (hasHelpOption(rest)) {
|
|
3787
|
+
const name = `${group} ${command}`;
|
|
3788
|
+
if (Object.hasOwn(COMMAND_HELP, name)) {
|
|
3789
|
+
return `${COMMAND_HELP[name]}
|
|
3790
|
+
|
|
3791
|
+
${COMMON_HELP}
|
|
3792
|
+
`;
|
|
3793
|
+
}
|
|
3794
|
+
}
|
|
3795
|
+
return void 0;
|
|
3796
|
+
}
|
|
3797
|
+
|
|
3712
3798
|
// packages/host-runtime/src/delegation-types.ts
|
|
3713
3799
|
var DELEGATION_RUNTIME_ENDPOINT_ENV = "CODEXHOST_RUNTIME_ENDPOINT";
|
|
3714
3800
|
var DELEGATION_RUNTIME_TOKEN_ENV = "CODEXHOST_RUNTIME_TOKEN";
|
|
@@ -3725,6 +3811,114 @@ var DelegationControlError = class extends Error {
|
|
|
3725
3811
|
details;
|
|
3726
3812
|
};
|
|
3727
3813
|
|
|
3814
|
+
// packages/host-runtime/src/delegation-cli-output.ts
|
|
3815
|
+
function threadLink(threadId3) {
|
|
3816
|
+
return `codex://threads/${threadId3}`;
|
|
3817
|
+
}
|
|
3818
|
+
function inspectOutput({ harnessId, inspection }) {
|
|
3819
|
+
if (inspection.status !== "ready") return { harnessId, ...inspection };
|
|
3820
|
+
const { catalog } = inspection;
|
|
3821
|
+
return {
|
|
3822
|
+
harnessId,
|
|
3823
|
+
status: inspection.status,
|
|
3824
|
+
models: catalog.models.map(({ ref, label, supportedThinkingOptionIds }) => ({
|
|
3825
|
+
id: ref.id,
|
|
3826
|
+
label,
|
|
3827
|
+
...supportedThinkingOptionIds ? { thinking: supportedThinkingOptionIds } : {}
|
|
3828
|
+
})),
|
|
3829
|
+
...catalog.defaultModel ? { defaultModel: catalog.defaultModel.id } : {},
|
|
3830
|
+
thinkingOptions: catalog.thinkingOptions,
|
|
3831
|
+
...catalog.defaultThinkingOptionId ? { defaultThinkingOptionId: catalog.defaultThinkingOptionId } : {},
|
|
3832
|
+
capabilities: inspection.capabilities
|
|
3833
|
+
};
|
|
3834
|
+
}
|
|
3835
|
+
function snapshotOutput(snapshot, view) {
|
|
3836
|
+
const common = {
|
|
3837
|
+
thread: threadLink(snapshot.threadId),
|
|
3838
|
+
harnessId: snapshot.harnessId,
|
|
3839
|
+
status: snapshot.status,
|
|
3840
|
+
...snapshot.timedOut !== void 0 ? { timedOut: snapshot.timedOut } : {}
|
|
3841
|
+
};
|
|
3842
|
+
if (view === "messages") {
|
|
3843
|
+
if (typeof snapshot.hasMore !== "boolean") {
|
|
3844
|
+
throw new DelegationControlError(
|
|
3845
|
+
"INTERNAL_ERROR",
|
|
3846
|
+
"Compact message pagination requires an updated Host Runtime; use --format json with this Runtime."
|
|
3847
|
+
);
|
|
3848
|
+
}
|
|
3849
|
+
return {
|
|
3850
|
+
...common,
|
|
3851
|
+
messages: (snapshot.messages ?? []).map(({ role, phase, text }) => ({
|
|
3852
|
+
role,
|
|
3853
|
+
...phase ? { phase } : {},
|
|
3854
|
+
text
|
|
3855
|
+
})),
|
|
3856
|
+
hasMore: snapshot.hasMore,
|
|
3857
|
+
nextCursor: snapshot.nextCursor,
|
|
3858
|
+
...snapshot.result.message ? { error: snapshot.result.message } : {}
|
|
3859
|
+
};
|
|
3860
|
+
}
|
|
3861
|
+
const progress = snapshot.progress.filter(({ text }) => text.trim()).at(-1)?.text;
|
|
3862
|
+
return {
|
|
3863
|
+
...common,
|
|
3864
|
+
result: snapshot.result,
|
|
3865
|
+
...snapshot.status === "running" && progress ? { progress } : {}
|
|
3866
|
+
};
|
|
3867
|
+
}
|
|
3868
|
+
function compactDelegationOutput(command, body, view = "result") {
|
|
3869
|
+
switch (command) {
|
|
3870
|
+
case "harness list":
|
|
3871
|
+
return body;
|
|
3872
|
+
case "harness inspect":
|
|
3873
|
+
return inspectOutput(body);
|
|
3874
|
+
case "delegate start": {
|
|
3875
|
+
const result = body;
|
|
3876
|
+
const effective = result.configuration?.effective;
|
|
3877
|
+
return {
|
|
3878
|
+
thread: result.deepLink,
|
|
3879
|
+
harnessId: result.harnessId,
|
|
3880
|
+
status: result.status,
|
|
3881
|
+
...result.cwd ? { cwd: result.cwd } : {},
|
|
3882
|
+
...result.parentThreadId ? { parent: threadLink(result.parentThreadId) } : {},
|
|
3883
|
+
...effective?.resolvedModelLabel ? { model: effective.resolvedModelLabel } : {},
|
|
3884
|
+
...effective?.effectiveThinkingOptionId ? { thinking: effective.effectiveThinkingOptionId } : {}
|
|
3885
|
+
};
|
|
3886
|
+
}
|
|
3887
|
+
case "thread send": {
|
|
3888
|
+
const result = body;
|
|
3889
|
+
return {
|
|
3890
|
+
thread: threadLink(result.threadId),
|
|
3891
|
+
harnessId: result.harnessId,
|
|
3892
|
+
status: result.status
|
|
3893
|
+
};
|
|
3894
|
+
}
|
|
3895
|
+
case "thread cancel": {
|
|
3896
|
+
const result = body;
|
|
3897
|
+
return {
|
|
3898
|
+
thread: threadLink(result.threadId),
|
|
3899
|
+
harnessId: result.harnessId,
|
|
3900
|
+
cancelRequested: result.cancelled
|
|
3901
|
+
};
|
|
3902
|
+
}
|
|
3903
|
+
case "thread read":
|
|
3904
|
+
case "thread wait":
|
|
3905
|
+
return snapshotOutput(body, view);
|
|
3906
|
+
case "thread list": {
|
|
3907
|
+
const result = body;
|
|
3908
|
+
return {
|
|
3909
|
+
threads: result.threads.map(({ deepLink, harnessId, status, title, cwd }) => ({
|
|
3910
|
+
thread: deepLink,
|
|
3911
|
+
harnessId,
|
|
3912
|
+
status,
|
|
3913
|
+
...title ? { title } : {},
|
|
3914
|
+
...cwd ? { cwd } : {}
|
|
3915
|
+
})),
|
|
3916
|
+
nextCursor: result.nextCursor
|
|
3917
|
+
};
|
|
3918
|
+
}
|
|
3919
|
+
}
|
|
3920
|
+
}
|
|
3921
|
+
|
|
3728
3922
|
// packages/host-runtime/src/delegation-cli.ts
|
|
3729
3923
|
var DEFAULT_WAIT_TIMEOUT_MS = 3e4;
|
|
3730
3924
|
var DEFAULT_LIMIT = 25;
|
|
@@ -3771,44 +3965,12 @@ function value(parsed, name) {
|
|
|
3771
3965
|
return parsed.options.get(name);
|
|
3772
3966
|
}
|
|
3773
3967
|
function rejectUnknown(parsed, allowed) {
|
|
3774
|
-
const known = new Set(allowed);
|
|
3968
|
+
const known = /* @__PURE__ */ new Set([...allowed, "--format"]);
|
|
3775
3969
|
for (const name of parsed.options.keys()) {
|
|
3776
3970
|
if (!known.has(name))
|
|
3777
3971
|
throw new DelegationControlError("INVALID_ARGUMENT", `Unknown option '${name}'`);
|
|
3778
3972
|
}
|
|
3779
3973
|
}
|
|
3780
|
-
var DELEGATION_HELP = `usage:
|
|
3781
|
-
codexhost harness inspect <harness> [--cwd <path>] [--refresh true|false]
|
|
3782
|
-
codexhost delegate start --harness <id> --task <text> [--model <opaque-ref>] [--thinking <option-id>] [--parent-thread <thread>] [--request-id <id>]
|
|
3783
|
-
codexhost thread send <thread> --message <text>
|
|
3784
|
-
codexhost thread cancel <thread>
|
|
3785
|
-
codexhost thread read <thread> [--view result|messages] [--cursor <cursor>] [--limit <n>]
|
|
3786
|
-
codexhost thread wait <thread> [--timeout-ms <n>] [--view result|messages] [--cursor <cursor>] [--limit <n>]
|
|
3787
|
-
codexhost thread list [--cwd <path>] [--parent <thread>] [--limit <n>] [--cursor <cursor>] [--sort created-asc|created-desc|updated-asc|updated-desc|recency-asc|recency-desc]
|
|
3788
|
-
|
|
3789
|
-
Thread identifiers accept a bare ID or codex://threads/<id>. Output is JSON by default.
|
|
3790
|
-
harness inspect returns the target Model catalog, default Model, Thinking options, and configuration capabilities without creating a Thread. Use opaque IDs exactly as returned.
|
|
3791
|
-
delegate start requires --harness and --task, creates and submits the child Thread, then returns immediately. --model and --thinking select values returned by harness inspect. Omit either option to preserve that target's current default behavior. --parent-thread overrides caller inference. Reuse --request-id for idempotent retries; without it, identical recent parent/target/task/configuration requests are deduplicated briefly.
|
|
3792
|
-
Successful start fields: delegationId, threadId, turnId, harnessId, deepLink, status, next.read, next.wait.
|
|
3793
|
-
thread send starts a new Turn in an idle writable Thread and returns immediately. It fails with THREAD_BUSY instead of queueing or starting a concurrent Turn.
|
|
3794
|
-
thread cancel requests cancellation of the current Turn while preserving the Thread. An idle Thread returns cancelled=false.
|
|
3795
|
-
thread read is non-blocking. Its default result view returns threadId, harnessId, status, latest turn, visible progress, result.availability/result.text, and nextCursor.
|
|
3796
|
-
thread read --view messages additionally returns paginated user/Agent-visible messages. The default page is 25 and --limit is capped at 100; --cursor and --limit require the messages view. Tool calls, tool output, file activity, reasoning summaries, hidden reasoning, and private Harness transcripts are never returned.
|
|
3797
|
-
thread wait defaults to 30000 ms and waits only until the Thread reaches a terminal state or the bounded timeout expires. A timeout is a successful running checkpoint with timedOut=true; the child keeps running.
|
|
3798
|
-
thread list defaults to the caller cwd, limit 25, created-desc; limit is capped at 100. --parent uses Delegation lineage, not Codex Subagent relationships.
|
|
3799
|
-
read and wait are non-consuming: they do not start a Turn, send input, wake an Agent, mark messages read, or inject a result into the parent Session.
|
|
3800
|
-
Native Codex as caller requires a session sandbox that permits local Runtime connections; otherwise RUNTIME_UNREACHABLE is returned. Native Codex as a target uses brokered official requests and is unaffected.
|
|
3801
|
-
|
|
3802
|
-
Errors are JSON: {"error":{"code":"...","message":"...","details":{...}}}.
|
|
3803
|
-
INVALID_ARGUMENT: fix the named argument or incompatible option combination.
|
|
3804
|
-
HARNESS_NOT_FOUND: choose a Harness ID listed in error.details.validHarnessIds.
|
|
3805
|
-
THREAD_NOT_FOUND: verify the bare ID or codex:// deep link.
|
|
3806
|
-
THREAD_BUSY: wait for or cancel the active Turn before sending another message.
|
|
3807
|
-
PARENT_THREAD_AMBIGUOUS: pass --parent-thread explicitly.
|
|
3808
|
-
RUNTIME_UNREACHABLE: run inside the Host-provided environment and, for native Codex, allow local Runtime connections; codexhost never falls back to PATH or another Runtime.
|
|
3809
|
-
DELEGATION_FAILED: the target Session or initial task delivery failed and no successful child was published.
|
|
3810
|
-
INTERNAL_ERROR: retry after checking the Host Runtime diagnostics.
|
|
3811
|
-
`;
|
|
3812
3974
|
async function requestRuntime(input) {
|
|
3813
3975
|
const endpoint = input.environment[DELEGATION_RUNTIME_ENDPOINT_ENV];
|
|
3814
3976
|
const token = input.environment[DELEGATION_RUNTIME_TOKEN_ENV];
|
|
@@ -3854,12 +4016,37 @@ async function runDelegationCli(input) {
|
|
|
3854
4016
|
const environment = input.environment ?? process.env;
|
|
3855
4017
|
try {
|
|
3856
4018
|
const [group, command, ...rest] = input.arguments;
|
|
3857
|
-
|
|
3858
|
-
|
|
4019
|
+
const help = delegationCliHelp(input.arguments);
|
|
4020
|
+
if (help !== void 0) {
|
|
4021
|
+
output.write(help);
|
|
4022
|
+
return 0;
|
|
4023
|
+
}
|
|
4024
|
+
const parsed = options(rest);
|
|
4025
|
+
const format = value(parsed, "--format") ?? "json";
|
|
4026
|
+
if (format !== "json" && format !== "compact") {
|
|
4027
|
+
throw new DelegationControlError("INVALID_ARGUMENT", "--format must be json or compact");
|
|
4028
|
+
}
|
|
4029
|
+
const writeResult = (name, body, view = "result") => writeJson(output, format === "json" ? body : compactDelegationOutput(name, body, view));
|
|
4030
|
+
if (group === "harness" && command === "list") {
|
|
4031
|
+
rejectUnknown(parsed, []);
|
|
4032
|
+
if (parsed.positionals.length > 0) {
|
|
4033
|
+
throw new DelegationControlError(
|
|
4034
|
+
"INVALID_ARGUMENT",
|
|
4035
|
+
"harness list accepts no positional arguments"
|
|
4036
|
+
);
|
|
4037
|
+
}
|
|
4038
|
+
writeResult(
|
|
4039
|
+
"harness list",
|
|
4040
|
+
await requestRuntime({
|
|
4041
|
+
environment,
|
|
4042
|
+
path: "/v1/harness/list",
|
|
4043
|
+
body: {},
|
|
4044
|
+
...input.fetchImpl ? { fetchImpl: input.fetchImpl } : {}
|
|
4045
|
+
})
|
|
4046
|
+
);
|
|
3859
4047
|
return 0;
|
|
3860
4048
|
}
|
|
3861
4049
|
if (group === "harness" && command === "inspect") {
|
|
3862
|
-
const parsed = options(rest);
|
|
3863
4050
|
rejectUnknown(parsed, ["--cwd", "--refresh"]);
|
|
3864
4051
|
if (parsed.positionals.length !== 1) {
|
|
3865
4052
|
throw new DelegationControlError(
|
|
@@ -3875,8 +4062,8 @@ async function runDelegationCli(input) {
|
|
|
3875
4062
|
if (refresh !== void 0 && refresh !== "true" && refresh !== "false") {
|
|
3876
4063
|
throw new DelegationControlError("INVALID_ARGUMENT", "--refresh must be true or false");
|
|
3877
4064
|
}
|
|
3878
|
-
|
|
3879
|
-
|
|
4065
|
+
writeResult(
|
|
4066
|
+
"harness inspect",
|
|
3880
4067
|
await requestRuntime({
|
|
3881
4068
|
environment,
|
|
3882
4069
|
path: "/v1/harness/inspect",
|
|
@@ -3891,10 +4078,10 @@ async function runDelegationCli(input) {
|
|
|
3891
4078
|
return 0;
|
|
3892
4079
|
}
|
|
3893
4080
|
if (group === "delegate" && command === "start") {
|
|
3894
|
-
const parsed = options(rest);
|
|
3895
4081
|
rejectUnknown(parsed, [
|
|
3896
4082
|
"--harness",
|
|
3897
4083
|
"--task",
|
|
4084
|
+
"--cwd",
|
|
3898
4085
|
"--model",
|
|
3899
4086
|
"--thinking",
|
|
3900
4087
|
"--parent-thread",
|
|
@@ -3910,15 +4097,15 @@ async function runDelegationCli(input) {
|
|
|
3910
4097
|
if (!harnessId || !task)
|
|
3911
4098
|
throw new DelegationControlError("INVALID_ARGUMENT", "--harness and --task are required");
|
|
3912
4099
|
const parentThread = value(parsed, "--parent-thread") ?? environment[DELEGATION_THREAD_ID_ENV];
|
|
3913
|
-
|
|
3914
|
-
|
|
4100
|
+
writeResult(
|
|
4101
|
+
"delegate start",
|
|
3915
4102
|
await requestRuntime({
|
|
3916
4103
|
environment,
|
|
3917
4104
|
path: "/v1/delegate/start",
|
|
3918
4105
|
body: {
|
|
3919
4106
|
harnessId,
|
|
3920
4107
|
task,
|
|
3921
|
-
cwd:
|
|
4108
|
+
...value(parsed, "--cwd") ? { cwd: value(parsed, "--cwd") } : {},
|
|
3922
4109
|
...value(parsed, "--model") ? { model: { id: value(parsed, "--model") } } : {},
|
|
3923
4110
|
...value(parsed, "--thinking") ? { thinkingOptionId: value(parsed, "--thinking") } : {},
|
|
3924
4111
|
...parentThread ? { parentThreadId: normalizeThreadId(parentThread) } : {},
|
|
@@ -3930,7 +4117,6 @@ async function runDelegationCli(input) {
|
|
|
3930
4117
|
return 0;
|
|
3931
4118
|
}
|
|
3932
4119
|
if (group === "thread" && command === "send") {
|
|
3933
|
-
const parsed = options(rest);
|
|
3934
4120
|
rejectUnknown(parsed, ["--message"]);
|
|
3935
4121
|
if (parsed.positionals.length !== 1) {
|
|
3936
4122
|
throw new DelegationControlError(
|
|
@@ -3946,8 +4132,8 @@ async function runDelegationCli(input) {
|
|
|
3946
4132
|
"Thread identifier and --message are required"
|
|
3947
4133
|
);
|
|
3948
4134
|
}
|
|
3949
|
-
|
|
3950
|
-
|
|
4135
|
+
writeResult(
|
|
4136
|
+
"thread send",
|
|
3951
4137
|
await requestRuntime({
|
|
3952
4138
|
environment,
|
|
3953
4139
|
path: "/v1/thread/send",
|
|
@@ -3958,7 +4144,6 @@ async function runDelegationCli(input) {
|
|
|
3958
4144
|
return 0;
|
|
3959
4145
|
}
|
|
3960
4146
|
if (group === "thread" && command === "cancel") {
|
|
3961
|
-
const parsed = options(rest);
|
|
3962
4147
|
rejectUnknown(parsed, []);
|
|
3963
4148
|
if (parsed.positionals.length !== 1) {
|
|
3964
4149
|
throw new DelegationControlError(
|
|
@@ -3970,8 +4155,8 @@ async function runDelegationCli(input) {
|
|
|
3970
4155
|
if (!threadId3) {
|
|
3971
4156
|
throw new DelegationControlError("INVALID_ARGUMENT", "Thread identifier is required");
|
|
3972
4157
|
}
|
|
3973
|
-
|
|
3974
|
-
|
|
4158
|
+
writeResult(
|
|
4159
|
+
"thread cancel",
|
|
3975
4160
|
await requestRuntime({
|
|
3976
4161
|
environment,
|
|
3977
4162
|
path: "/v1/thread/cancel",
|
|
@@ -3982,7 +4167,6 @@ async function runDelegationCli(input) {
|
|
|
3982
4167
|
return 0;
|
|
3983
4168
|
}
|
|
3984
4169
|
if (group === "thread" && (command === "read" || command === "wait")) {
|
|
3985
|
-
const parsed = options(rest);
|
|
3986
4170
|
rejectUnknown(parsed, ["--view", "--cursor", "--limit", "--timeout-ms"]);
|
|
3987
4171
|
if (parsed.positionals.length !== 1)
|
|
3988
4172
|
throw new DelegationControlError(
|
|
@@ -4014,19 +4198,19 @@ async function runDelegationCli(input) {
|
|
|
4014
4198
|
timeoutMs: value(parsed, "--timeout-ms") ? positiveInteger(value(parsed, "--timeout-ms"), "--timeout-ms") : DEFAULT_WAIT_TIMEOUT_MS
|
|
4015
4199
|
} : {}
|
|
4016
4200
|
};
|
|
4017
|
-
|
|
4018
|
-
|
|
4201
|
+
writeResult(
|
|
4202
|
+
command === "read" ? "thread read" : "thread wait",
|
|
4019
4203
|
await requestRuntime({
|
|
4020
4204
|
environment,
|
|
4021
4205
|
path: command === "read" ? "/v1/thread/read" : "/v1/thread/wait",
|
|
4022
4206
|
body,
|
|
4023
4207
|
...input.fetchImpl ? { fetchImpl: input.fetchImpl } : {}
|
|
4024
|
-
})
|
|
4208
|
+
}),
|
|
4209
|
+
view
|
|
4025
4210
|
);
|
|
4026
4211
|
return 0;
|
|
4027
4212
|
}
|
|
4028
4213
|
if (group === "thread" && command === "list") {
|
|
4029
|
-
const parsed = options(rest);
|
|
4030
4214
|
rejectUnknown(parsed, ["--cwd", "--parent", "--limit", "--cursor", "--sort"]);
|
|
4031
4215
|
if (parsed.positionals.length > 0)
|
|
4032
4216
|
throw new DelegationControlError(
|
|
@@ -4044,8 +4228,8 @@ async function runDelegationCli(input) {
|
|
|
4044
4228
|
])).has(sort))
|
|
4045
4229
|
throw new DelegationControlError("INVALID_ARGUMENT", "--sort is invalid");
|
|
4046
4230
|
const parentThread = value(parsed, "--parent");
|
|
4047
|
-
|
|
4048
|
-
|
|
4231
|
+
writeResult(
|
|
4232
|
+
"thread list",
|
|
4049
4233
|
await requestRuntime({
|
|
4050
4234
|
environment,
|
|
4051
4235
|
path: "/v1/thread/list",
|
|
@@ -22253,7 +22437,9 @@ function projectItem(item, outcome, defaultCwd, includeCommandOutput = true, sen
|
|
|
22253
22437
|
changes: projectFileChanges(item.changes),
|
|
22254
22438
|
status: itemStatus(outcome)
|
|
22255
22439
|
};
|
|
22256
|
-
case "subagentDelegation":
|
|
22440
|
+
case "subagentDelegation": {
|
|
22441
|
+
const primary = item.subagents[0];
|
|
22442
|
+
const sameConfiguration = item.subagents.every((subagent) => subagent.model === primary?.model && subagent.reasoningEffort === primary?.reasoningEffort);
|
|
22257
22443
|
return {
|
|
22258
22444
|
id: item.itemId,
|
|
22259
22445
|
type: "collabAgentToolCall",
|
|
@@ -22262,13 +22448,14 @@ function projectItem(item, outcome, defaultCwd, includeCommandOutput = true, sen
|
|
|
22262
22448
|
senderThreadId: senderThreadId ?? "",
|
|
22263
22449
|
receiverThreadIds: item.subagents.map(({ subagentId }) => subagentId),
|
|
22264
22450
|
prompt: item.prompt ?? null,
|
|
22265
|
-
model: null,
|
|
22266
|
-
reasoningEffort: null,
|
|
22451
|
+
model: sameConfiguration ? primary?.model ?? null : null,
|
|
22452
|
+
reasoningEffort: sameConfiguration ? primary?.reasoningEffort ?? null : null,
|
|
22267
22453
|
agentsStates: Object.fromEntries(item.subagents.map(({ subagentId, status, resultSummary }) => [
|
|
22268
22454
|
subagentId,
|
|
22269
22455
|
{ status: collabAgentStatus(status), message: resultSummary ?? null }
|
|
22270
22456
|
]))
|
|
22271
22457
|
};
|
|
22458
|
+
}
|
|
22272
22459
|
}
|
|
22273
22460
|
}
|
|
22274
22461
|
function reasoningPreviewItemId(itemId) {
|
|
@@ -25898,15 +26085,21 @@ function projectDelegationThreadSnapshot(input) {
|
|
|
25898
26085
|
const latestTurnStatus = latestTurn ? turnStatus2(latestTurn.status) : null;
|
|
25899
26086
|
const status = input.running ? "running" : latestTurnStatus === "failed" || latestTurnStatus === "interrupted" ? latestTurnStatus : threadStatus(input.thread.status, input.running);
|
|
25900
26087
|
const latestTurnMessages = latestTurnId ? visible.filter((message) => message.turnId === latestTurnId && message.role === "agent") : [];
|
|
25901
|
-
const final = latestTurnMessages.filter((message) => message.phase === "final").at(-1);
|
|
25902
|
-
const progress = latestTurnMessages.filter((message) => message.phase !== "final").map(({ id: id2, turnId, text }) => ({ id: id2, turnId, text }));
|
|
26088
|
+
const final = latestTurnMessages.filter((message) => message.phase === "final" && message.text.trim()).at(-1);
|
|
26089
|
+
const progress = latestTurnMessages.filter((message) => message.phase !== "final" && message.text.trim()).map(({ id: id2, turnId, text }) => ({ id: id2, turnId, text }));
|
|
25903
26090
|
const result = input.running ? { availability: "pending" } : final ? { availability: "available", text: final.text } : {
|
|
25904
26091
|
availability: "unavailable",
|
|
25905
26092
|
...isRecord8(latestTurn?.error) && typeof latestTurn.error.message === "string" ? { message: latestTurn.error.message } : {}
|
|
25906
26093
|
};
|
|
25907
26094
|
const offset = options2.view === "messages" ? decodeCursor(input.threadId, options2.cursor) : visible.length;
|
|
25908
|
-
const page = options2.view === "messages" ?
|
|
25909
|
-
|
|
26095
|
+
const page = options2.view === "messages" ? [] : void 0;
|
|
26096
|
+
let nextOffset = offset;
|
|
26097
|
+
if (page) {
|
|
26098
|
+
while (nextOffset < visible.length && page.length < options2.limit) {
|
|
26099
|
+
const message = visible[nextOffset++];
|
|
26100
|
+
if (message?.text.trim()) page.push(message);
|
|
26101
|
+
}
|
|
26102
|
+
}
|
|
25910
26103
|
return {
|
|
25911
26104
|
threadId: input.threadId,
|
|
25912
26105
|
harnessId: input.harnessId,
|
|
@@ -25914,7 +26107,10 @@ function projectDelegationThreadSnapshot(input) {
|
|
|
25914
26107
|
turn: latestTurnId && latestTurnStatus ? { turnId: latestTurnId, status: latestTurnStatus } : null,
|
|
25915
26108
|
progress,
|
|
25916
26109
|
result,
|
|
25917
|
-
...page ? {
|
|
26110
|
+
...page ? {
|
|
26111
|
+
messages: page,
|
|
26112
|
+
hasMore: visible.slice(nextOffset).some((message) => message.text.trim())
|
|
26113
|
+
} : {},
|
|
25918
26114
|
nextCursor: encodeCursor(input.threadId, nextOffset)
|
|
25919
26115
|
};
|
|
25920
26116
|
}
|
|
@@ -25946,11 +26142,11 @@ function statusFromThread(thread) {
|
|
|
25946
26142
|
return last ? "completed" : "creating";
|
|
25947
26143
|
}
|
|
25948
26144
|
function validateStart(input) {
|
|
25949
|
-
if (!input.task
|
|
26145
|
+
if (typeof input.task !== "string" || !input.task.trim())
|
|
25950
26146
|
throw new DelegationControlError("INVALID_ARGUMENT", "Task must not be empty");
|
|
25951
|
-
if (!input.cwd
|
|
26147
|
+
if (input.cwd !== void 0 && (typeof input.cwd !== "string" || !input.cwd.trim()))
|
|
25952
26148
|
throw new DelegationControlError("INVALID_ARGUMENT", "cwd must not be empty");
|
|
25953
|
-
if (input.requestId !== void 0 && !input.requestId.trim()) {
|
|
26149
|
+
if (input.requestId !== void 0 && (typeof input.requestId !== "string" || !input.requestId.trim())) {
|
|
25954
26150
|
throw new DelegationControlError("INVALID_ARGUMENT", "Request ID must not be empty");
|
|
25955
26151
|
}
|
|
25956
26152
|
}
|
|
@@ -25968,6 +26164,7 @@ var HarnessDelegationCoordinator = class {
|
|
|
25968
26164
|
#cancelOfficial;
|
|
25969
26165
|
#startOfficial;
|
|
25970
26166
|
#listOfficial;
|
|
26167
|
+
#officialThreadCwd;
|
|
25971
26168
|
#activeOfficialParents;
|
|
25972
26169
|
constructor(input) {
|
|
25973
26170
|
this.#adapters = input.adapters;
|
|
@@ -25983,8 +26180,12 @@ var HarnessDelegationCoordinator = class {
|
|
|
25983
26180
|
this.#cancelOfficial = input.cancelOfficial;
|
|
25984
26181
|
this.#startOfficial = input.startOfficial;
|
|
25985
26182
|
this.#listOfficial = input.listOfficial;
|
|
26183
|
+
this.#officialThreadCwd = input.officialThreadCwd;
|
|
25986
26184
|
this.#activeOfficialParents = input.activeOfficialParents;
|
|
25987
26185
|
}
|
|
26186
|
+
async listHarnesses() {
|
|
26187
|
+
return { harnesses: ["codex", ...this.#adapters.keys()] };
|
|
26188
|
+
}
|
|
25988
26189
|
async inspect(input) {
|
|
25989
26190
|
if (input.harnessId === "codex") return this.#inspectOfficial(input);
|
|
25990
26191
|
const adapter = this.#adapters.get(input.harnessId);
|
|
@@ -26006,7 +26207,13 @@ var HarnessDelegationCoordinator = class {
|
|
|
26006
26207
|
async start(input) {
|
|
26007
26208
|
validateStart(input);
|
|
26008
26209
|
const parentThreadId = await this.#resolveParent(input.parentThreadId);
|
|
26009
|
-
|
|
26210
|
+
const parent = await this.#parentMetadata(parentThreadId);
|
|
26211
|
+
const selectedCwd = input.cwd ?? parent.cwd ?? process.cwd();
|
|
26212
|
+
if (input.harnessId === "codex") {
|
|
26213
|
+
const result = await this.#startOfficial({ ...input, parentThreadId, cwd: selectedCwd });
|
|
26214
|
+
return { ...result, parentThreadId, cwd: result.cwd ?? selectedCwd };
|
|
26215
|
+
}
|
|
26216
|
+
const startInput = { ...input, parentThreadId, cwd: path6.resolve(selectedCwd) };
|
|
26010
26217
|
if (!this.#adapters.has(input.harnessId)) {
|
|
26011
26218
|
throw new DelegationControlError(
|
|
26012
26219
|
"HARNESS_NOT_FOUND",
|
|
@@ -26015,7 +26222,7 @@ var HarnessDelegationCoordinator = class {
|
|
|
26015
26222
|
);
|
|
26016
26223
|
}
|
|
26017
26224
|
const targetHarnessId = input.harnessId;
|
|
26018
|
-
const digest2 = taskDigest(
|
|
26225
|
+
const digest2 = taskDigest(startInput);
|
|
26019
26226
|
const duplicate = input.requestId ? await this.#repository.findDelegationByRequest(input.requestId) : await this.#repository.findRecentDelegation({
|
|
26020
26227
|
parentHostThreadId: hostThreadIdSchema.parse(parentThreadId),
|
|
26021
26228
|
targetHarnessId: harnessIdSchema.parse(targetHarnessId),
|
|
@@ -26042,11 +26249,10 @@ var HarnessDelegationCoordinator = class {
|
|
|
26042
26249
|
if (input.model || input.thinkingOptionId) {
|
|
26043
26250
|
const inspected = await this.inspect({
|
|
26044
26251
|
harnessId: targetHarnessId,
|
|
26045
|
-
cwd:
|
|
26252
|
+
cwd: startInput.cwd
|
|
26046
26253
|
});
|
|
26047
26254
|
this.#validateConfiguration(inspected.inspection, input.model, input.thinkingOptionId);
|
|
26048
26255
|
}
|
|
26049
|
-
const parent = await this.#parentMetadata(parentThreadId);
|
|
26050
26256
|
const delegationId = hostThreadIdSchema.parse(randomUUID4());
|
|
26051
26257
|
const childThreadId = hostThreadIdSchema.parse(randomUUID4());
|
|
26052
26258
|
const turnId = hostTurnIdSchema.parse(randomUUID4());
|
|
@@ -26056,7 +26262,7 @@ var HarnessDelegationCoordinator = class {
|
|
|
26056
26262
|
hostThreadId: childThreadId,
|
|
26057
26263
|
createRequestId,
|
|
26058
26264
|
harnessId: harnessIdSchema.parse(targetHarnessId),
|
|
26059
|
-
cwd:
|
|
26265
|
+
cwd: startInput.cwd,
|
|
26060
26266
|
title: input.task.trim().slice(0, 120),
|
|
26061
26267
|
transportModelId: input.model || input.thinkingOptionId ? encodeExternalTransportSelection(targetHarnessId, {
|
|
26062
26268
|
...input.model ? { model: input.model } : {},
|
|
@@ -26127,17 +26333,21 @@ var HarnessDelegationCoordinator = class {
|
|
|
26127
26333
|
}
|
|
26128
26334
|
await this.#repository.setDelegationStatus(delegationId, "running");
|
|
26129
26335
|
await this.#notifyThreadStarted(thread.thread);
|
|
26130
|
-
return
|
|
26131
|
-
|
|
26132
|
-
|
|
26133
|
-
|
|
26134
|
-
|
|
26135
|
-
|
|
26136
|
-
|
|
26137
|
-
|
|
26138
|
-
|
|
26139
|
-
|
|
26140
|
-
|
|
26336
|
+
return {
|
|
26337
|
+
...this.#result(delegationId, childThreadId, turnId, targetHarnessId, "running", {
|
|
26338
|
+
requested: {
|
|
26339
|
+
...input.model ? { model: input.model } : {},
|
|
26340
|
+
...input.thinkingOptionId ? { thinkingOptionId: input.thinkingOptionId } : {}
|
|
26341
|
+
},
|
|
26342
|
+
effective: {
|
|
26343
|
+
...thread.stateObserver.state.effectiveModel ? { effectiveModel: thread.stateObserver.state.effectiveModel } : {},
|
|
26344
|
+
...thread.stateObserver.state.resolvedModelLabel ? { resolvedModelLabel: thread.stateObserver.state.resolvedModelLabel } : {},
|
|
26345
|
+
...thread.stateObserver.state.effectiveThinkingOptionId ? { effectiveThinkingOptionId: thread.stateObserver.state.effectiveThinkingOptionId } : {}
|
|
26346
|
+
}
|
|
26347
|
+
}),
|
|
26348
|
+
cwd: record3.cwd,
|
|
26349
|
+
parentThreadId
|
|
26350
|
+
};
|
|
26141
26351
|
} catch (error51) {
|
|
26142
26352
|
if (session) await session.close().catch(() => void 0);
|
|
26143
26353
|
this.#externalRuntime.remove(childThreadId);
|
|
@@ -26366,18 +26576,24 @@ var HarnessDelegationCoordinator = class {
|
|
|
26366
26576
|
}
|
|
26367
26577
|
async #parentMetadata(parentThreadId) {
|
|
26368
26578
|
const record3 = await this.#repository.find(parentThreadId);
|
|
26369
|
-
return { harnessId: record3
|
|
26579
|
+
if (record3) return { harnessId: record3.harnessId, cwd: record3.cwd };
|
|
26580
|
+
const cwd = await this.#officialThreadCwd(parentThreadId).catch(() => void 0);
|
|
26581
|
+
return { harnessId: "codex", ...cwd ? { cwd } : {} };
|
|
26370
26582
|
}
|
|
26371
26583
|
async #existingResult(delegation) {
|
|
26372
26584
|
const record3 = await this.#repository.find(delegation.childHostThreadId);
|
|
26373
26585
|
const turnId = record3?.turnMappings.at(-1)?.hostTurnId ?? "pending";
|
|
26374
|
-
return
|
|
26375
|
-
|
|
26376
|
-
|
|
26377
|
-
|
|
26378
|
-
|
|
26379
|
-
|
|
26380
|
-
|
|
26586
|
+
return {
|
|
26587
|
+
...this.#result(
|
|
26588
|
+
delegation.delegationId,
|
|
26589
|
+
delegation.childHostThreadId,
|
|
26590
|
+
turnId,
|
|
26591
|
+
delegation.targetHarnessId,
|
|
26592
|
+
delegation.status
|
|
26593
|
+
),
|
|
26594
|
+
...record3 ? { cwd: record3.cwd } : {},
|
|
26595
|
+
parentThreadId: delegation.parentHostThreadId
|
|
26596
|
+
};
|
|
26381
26597
|
}
|
|
26382
26598
|
#turnResult(threadId3, turnId, harnessId) {
|
|
26383
26599
|
return {
|
|
@@ -28199,9 +28415,11 @@ var AppServerHost = class {
|
|
|
28199
28415
|
cancelOfficial: (input) => this.#cancelOfficialDelegationThread(input),
|
|
28200
28416
|
startOfficial: (input) => this.#startOfficialDelegation(input),
|
|
28201
28417
|
listOfficial: (input) => this.#listDelegationThreads(input),
|
|
28418
|
+
officialThreadCwd: (threadId3) => this.#readOfficialThreadCwd(threadId3),
|
|
28202
28419
|
activeOfficialParents: () => [...this.#activeOfficialTurns.keys()]
|
|
28203
28420
|
});
|
|
28204
28421
|
const unregisterDelegationApi = options2.onDelegationApi?.({
|
|
28422
|
+
listHarnesses: () => this.#delegationCoordinator.listHarnesses(),
|
|
28205
28423
|
inspect: (input) => this.#delegationCoordinator.inspect(input),
|
|
28206
28424
|
start: (input) => this.#delegationCoordinator.start(input),
|
|
28207
28425
|
send: (input) => this.#delegationCoordinator.send(input),
|
|
@@ -29225,6 +29443,13 @@ var AppServerHost = class {
|
|
|
29225
29443
|
]);
|
|
29226
29444
|
return thread !== null || childDelegation !== null || delegation !== null;
|
|
29227
29445
|
}
|
|
29446
|
+
async #readOfficialThreadCwd(threadId3) {
|
|
29447
|
+
const response = await this.#requestOfficial("thread/read", { threadId: threadId3 });
|
|
29448
|
+
if (isRecord12(response.error)) return void 0;
|
|
29449
|
+
const result = isRecord12(response.result) ? response.result : null;
|
|
29450
|
+
const thread = result && isRecord12(result.thread) ? result.thread : null;
|
|
29451
|
+
return thread && typeof thread.cwd === "string" && thread.cwd.trim() ? thread.cwd : void 0;
|
|
29452
|
+
}
|
|
29228
29453
|
async #inspectOfficialDelegationTarget(input) {
|
|
29229
29454
|
const response = await this.#requestOfficial("model/list", {});
|
|
29230
29455
|
if (isRecord12(response.error)) {
|
|
@@ -29417,6 +29642,7 @@ var AppServerHost = class {
|
|
|
29417
29642
|
harnessId: "codex",
|
|
29418
29643
|
deepLink: `codex://threads/${threadId3}`,
|
|
29419
29644
|
status: pendingTerminal ?? "running",
|
|
29645
|
+
cwd: thread && typeof thread.cwd === "string" ? thread.cwd : input.cwd,
|
|
29420
29646
|
...requestedModel || input.thinkingOptionId ? {
|
|
29421
29647
|
configuration: {
|
|
29422
29648
|
requested: {
|
|
@@ -31667,6 +31893,12 @@ var DelegationControlRegistry = class {
|
|
|
31667
31893
|
"Harness inspection requires exactly one active Host Runtime session"
|
|
31668
31894
|
).inspect(input);
|
|
31669
31895
|
}
|
|
31896
|
+
async listHarnesses() {
|
|
31897
|
+
return only(
|
|
31898
|
+
[...this.#registrations],
|
|
31899
|
+
"Harness discovery requires exactly one active Host Runtime session"
|
|
31900
|
+
).listHarnesses();
|
|
31901
|
+
}
|
|
31670
31902
|
async start(input) {
|
|
31671
31903
|
return (await this.#registrationForStart(input)).start(input);
|
|
31672
31904
|
}
|
|
@@ -31898,6 +32130,9 @@ async function startDelegationControlServer(input) {
|
|
|
31898
32130
|
}
|
|
31899
32131
|
const body = await jsonBody(request);
|
|
31900
32132
|
switch (request.url) {
|
|
32133
|
+
case "/v1/harness/list":
|
|
32134
|
+
writeJson2(response, 200, await input.api.listHarnesses());
|
|
32135
|
+
return;
|
|
31901
32136
|
case "/v1/harness/inspect":
|
|
31902
32137
|
writeJson2(response, 200, await input.api.inspect(body));
|
|
31903
32138
|
return;
|
|
@@ -31945,9 +32180,11 @@ import { createHash as createHash6, randomUUID as randomUUID9 } from "node:crypt
|
|
|
31945
32180
|
import { mkdir as mkdir7, open as open5, readFile as readFile7, rename as rename5, rm as rm5, stat as stat3 } from "node:fs/promises";
|
|
31946
32181
|
import os4 from "node:os";
|
|
31947
32182
|
import path15 from "node:path";
|
|
31948
|
-
var SKILL_VERSION =
|
|
32183
|
+
var SKILL_VERSION = 7;
|
|
31949
32184
|
var SKILL_RELATIVE_PATH = path15.join("skills", "codexhost-delegation", "SKILL.md");
|
|
31950
32185
|
var PREVIOUS_MANAGED_DIGESTS = [
|
|
32186
|
+
"9d2f491850fb0b4084a31ba9b5e4a550b5e833747af322090d8ed0ff80b88c30",
|
|
32187
|
+
"2bb0aebb9b06febbc6c0c0bcdb0b32506c7cdbf8dc3b734cc6b2a86621270e4e",
|
|
31951
32188
|
"aff258622dc8ff321f32b15620d081e578cb9c9ed1134d6a57f35ca8e7762c0a",
|
|
31952
32189
|
"ba509f57e5448e796b3dfdd5031dcb08672eded50b61c0a54de84cfa02c49dd3",
|
|
31953
32190
|
"d3ddf6db9bc5c5df825479c885bbbf0ca08da66f7057a12e02e1fdf57525149e",
|
|
@@ -31971,21 +32208,13 @@ Before acting, run:
|
|
|
31971
32208
|
|
|
31972
32209
|
\`codexhost delegate --help\`
|
|
31973
32210
|
|
|
31974
|
-
|
|
31975
|
-
|
|
31976
|
-
|
|
31977
|
-
|
|
31978
|
-
- available target Harness IDs;
|
|
31979
|
-
- Thread identifier formats;
|
|
31980
|
-
- waiting and reading behavior;
|
|
31981
|
-
- response fields;
|
|
31982
|
-
- errors and recovery guidance.
|
|
32211
|
+
Use CLI help as the authoritative source for commands and behavior. Consult
|
|
32212
|
+
command-specific help for options and the Harness listing command when the
|
|
32213
|
+
target is unknown. Prefer compact output when supported, and use its task links
|
|
32214
|
+
directly for subsequent commands.
|
|
31983
32215
|
|
|
31984
|
-
|
|
31985
|
-
|
|
31986
|
-
When the user asks for a specific Model or Thinking level, inspect the target
|
|
31987
|
-
Harness first and use the exact opaque IDs returned by the authoritative CLI.
|
|
31988
|
-
When they do not specify either setting, omit it so the target keeps its default.
|
|
32216
|
+
Use the Harness native defaults. Inspect the target when a Model or Thinking
|
|
32217
|
+
selection is needed or the default is unavailable.
|
|
31989
32218
|
|
|
31990
32219
|
For a new delegation, create an independent child session and submit the
|
|
31991
32220
|
requested task. For an existing external session, resolve the target from the
|
|
@@ -32004,18 +32233,8 @@ user’s request and the task:
|
|
|
32004
32233
|
- check it again later;
|
|
32005
32234
|
- leave it running in the background.
|
|
32006
32235
|
|
|
32007
|
-
|
|
32008
|
-
|
|
32009
|
-
|
|
32010
|
-
Provide the user with the necessary tracking information available from the
|
|
32011
|
-
CLI; omit unavailable fields rather than inventing them:
|
|
32012
|
-
|
|
32013
|
-
- target agent;
|
|
32014
|
-
- \`delegationId\`;
|
|
32015
|
-
- \`threadId\`;
|
|
32016
|
-
- \`turnId\`;
|
|
32017
|
-
- \`deepLink\`;
|
|
32018
|
-
- current or final status.
|
|
32236
|
+
Report the result returned by read or a completed wait, together with the target
|
|
32237
|
+
agent, status, and a labeled task link. Keep internal tracking IDs in tool calls.
|
|
32019
32238
|
`;
|
|
32020
32239
|
var CURRENT_DIGEST = createHash6("sha256").update(CODEXHOST_DELEGATION_SKILL).digest("hex");
|
|
32021
32240
|
function digest(value2) {
|