@linzumi/cli 0.0.37-beta → 0.0.38-beta
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/dist/index.js +26 -33
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1683,7 +1683,7 @@ function initialChannelSessionState(cursor, rootSeq, kandanThreadId, codexThread
|
|
|
1683
1683
|
};
|
|
1684
1684
|
}
|
|
1685
1685
|
function startPortForwardWatchIfEnabled(args, state, payloadContext) {
|
|
1686
|
-
if (args.options.enablePortForwardWatch !== true || state.portForwardWatcher !== undefined) {
|
|
1686
|
+
if (args.options.enablePortForwardWatch !== true || state.portForwardWatcher !== undefined || state.kandanThreadId === undefined || state.codexThreadId === undefined) {
|
|
1687
1687
|
return;
|
|
1688
1688
|
}
|
|
1689
1689
|
const { start: configuredStart, ...watchOptions } = args.options.portForwardWatcher ?? {};
|
|
@@ -1715,13 +1715,6 @@ async function bindChannelSession(args, state, payloadContext) {
|
|
|
1715
1715
|
}
|
|
1716
1716
|
} else if (state.codexThreadId !== undefined) {
|
|
1717
1717
|
await bindCurrentCodexThread(args, state);
|
|
1718
|
-
switch (state.rootSeq) {
|
|
1719
|
-
case undefined:
|
|
1720
|
-
await postBoundThreadAvailability(args, state, payloadContext, codexVersion);
|
|
1721
|
-
break;
|
|
1722
|
-
default:
|
|
1723
|
-
break;
|
|
1724
|
-
}
|
|
1725
1718
|
} else {
|
|
1726
1719
|
const resolved = await pushOk(args.kandan, args.topic, "session:resolve_thread_session", {
|
|
1727
1720
|
workspace: session.workspaceSlug,
|
|
@@ -1733,22 +1726,9 @@ async function bindChannelSession(args, state, payloadContext) {
|
|
|
1733
1726
|
if (state.codexThreadId === undefined) {
|
|
1734
1727
|
throw new Error("Kandan thread root metadata did not include a Codex thread id");
|
|
1735
1728
|
}
|
|
1736
|
-
await
|
|
1729
|
+
await bindCurrentCodexThread(args, state);
|
|
1737
1730
|
}
|
|
1738
1731
|
}
|
|
1739
|
-
async function postBoundThreadAvailability(args, state, payloadContext, codexVersion) {
|
|
1740
|
-
if (state.kandanThreadId === undefined || state.codexThreadId === undefined) {
|
|
1741
|
-
throw new Error("cannot post local Codex availability before thread binding");
|
|
1742
|
-
}
|
|
1743
|
-
const session = args.options.channelSession;
|
|
1744
|
-
await pushOk(args.kandan, args.topic, "session:post_thread_message", {
|
|
1745
|
-
workspace: session.workspaceSlug,
|
|
1746
|
-
channel: session.channelSlug,
|
|
1747
|
-
thread_id: state.kandanThreadId,
|
|
1748
|
-
body: availabilityMessage(args.options, codexVersion, state.codexThreadId),
|
|
1749
|
-
payload: localRunnerPayload(args.options, args.instanceId, "availability", state.codexThreadId, payloadContext)
|
|
1750
|
-
});
|
|
1751
|
-
}
|
|
1752
1732
|
async function handleChannelSessionControl(args, state, payloadContext, control) {
|
|
1753
1733
|
if (control.type === "update_session_settings") {
|
|
1754
1734
|
return updateSessionSettings(args, state, control);
|
|
@@ -2201,6 +2181,7 @@ async function handleKandanChatEvent(args, state, runnerIdentity, payloadContext
|
|
|
2201
2181
|
state.kandanThreadId = event.threadId;
|
|
2202
2182
|
}
|
|
2203
2183
|
}
|
|
2184
|
+
startPortForwardWatchIfEnabled(args, state, payloadContext);
|
|
2204
2185
|
if (event.threadId !== state.kandanThreadId) {
|
|
2205
2186
|
args.log("kandan.message_ignored", {
|
|
2206
2187
|
seq: event.seq,
|
|
@@ -7053,6 +7034,7 @@ async function openLocalCodexRunner(options, log, cleanup, close) {
|
|
|
7053
7034
|
if (listenUser === undefined) {
|
|
7054
7035
|
throw new Error("missing listen user for Commander-started Codex session");
|
|
7055
7036
|
}
|
|
7037
|
+
const runtimeSettings = startInstanceRuntimeSettings(options, control);
|
|
7056
7038
|
const session = await attachChannelSession({
|
|
7057
7039
|
kandan,
|
|
7058
7040
|
codex,
|
|
@@ -7085,10 +7067,10 @@ async function openLocalCodexRunner(options, log, cleanup, close) {
|
|
|
7085
7067
|
rootSeq: integerValue(control.rootSeq),
|
|
7086
7068
|
codexThreadId,
|
|
7087
7069
|
listenUser,
|
|
7088
|
-
model:
|
|
7089
|
-
reasoningEffort:
|
|
7090
|
-
sandbox:
|
|
7091
|
-
approvalPolicy:
|
|
7070
|
+
model: runtimeSettings.model,
|
|
7071
|
+
reasoningEffort: runtimeSettings.reasoningEffort,
|
|
7072
|
+
sandbox: runtimeSettings.sandbox,
|
|
7073
|
+
approvalPolicy: runtimeSettings.approvalPolicy
|
|
7092
7074
|
}
|
|
7093
7075
|
},
|
|
7094
7076
|
log
|
|
@@ -7465,6 +7447,7 @@ async function applyControl(codex, kandan, topic, instanceId, options, allowedCw
|
|
|
7465
7447
|
ensureCodexProjectTrusted(cwd.cwd);
|
|
7466
7448
|
}
|
|
7467
7449
|
const developerPrompt = normalizedWorkDescription(control.developerPrompt);
|
|
7450
|
+
const runtimeSettings = startInstanceRuntimeSettings(options, control);
|
|
7468
7451
|
const response = await codex.request("thread/start", {
|
|
7469
7452
|
cwd: cwd.cwd,
|
|
7470
7453
|
serviceName: "kandan-local-runner",
|
|
@@ -7473,11 +7456,11 @@ async function applyControl(codex, kandan, topic, instanceId, options, allowedCw
|
|
|
7473
7456
|
cwd: cwd.cwd,
|
|
7474
7457
|
developerPrompt
|
|
7475
7458
|
}),
|
|
7476
|
-
...
|
|
7477
|
-
...
|
|
7478
|
-
...
|
|
7479
|
-
...
|
|
7480
|
-
...
|
|
7459
|
+
...runtimeSettings.model === undefined ? {} : { model: runtimeSettings.model },
|
|
7460
|
+
...runtimeSettings.reasoningEffort === undefined ? {} : { reasoningEffort: runtimeSettings.reasoningEffort },
|
|
7461
|
+
...runtimeSettings.approvalPolicy === undefined ? {} : { approvalPolicy: runtimeSettings.approvalPolicy },
|
|
7462
|
+
...runtimeSettings.sandbox === undefined ? {} : { sandbox: runtimeSettings.sandbox },
|
|
7463
|
+
...runtimeSettings.fast === true ? { serviceTier: "fast" } : {}
|
|
7481
7464
|
});
|
|
7482
7465
|
const codexThreadId = extractStartedThreadId(response);
|
|
7483
7466
|
const workDescription = normalizedWorkDescription(control.workDescription);
|
|
@@ -7649,6 +7632,16 @@ ${developerPrompt}`,
|
|
|
7649
7632
|
client_message_id: `codex-start-instructions-${threadId}`
|
|
7650
7633
|
});
|
|
7651
7634
|
}
|
|
7635
|
+
function startInstanceRuntimeSettings(options, control) {
|
|
7636
|
+
const session = options.channelSession;
|
|
7637
|
+
return {
|
|
7638
|
+
model: control.model ?? session?.model,
|
|
7639
|
+
reasoningEffort: control.reasoningEffort ?? session?.reasoningEffort,
|
|
7640
|
+
approvalPolicy: control.approvalPolicy ?? session?.approvalPolicy,
|
|
7641
|
+
sandbox: control.sandbox ?? session?.sandbox,
|
|
7642
|
+
fast: control.fast ?? options.fast
|
|
7643
|
+
};
|
|
7644
|
+
}
|
|
7652
7645
|
async function startOwnedCodexAppServer(options) {
|
|
7653
7646
|
ensureCodexProjectTrusted(options.cwd);
|
|
7654
7647
|
return await startCodexAppServer(options.codexBin, options.cwd, {
|
|
@@ -9495,7 +9488,7 @@ async function main(args) {
|
|
|
9495
9488
|
process.stdout.write(connectGuideText());
|
|
9496
9489
|
return;
|
|
9497
9490
|
case "version":
|
|
9498
|
-
process.stdout.write(`linzumi 0.0.
|
|
9491
|
+
process.stdout.write(`linzumi 0.0.38-beta
|
|
9499
9492
|
`);
|
|
9500
9493
|
return;
|
|
9501
9494
|
case "auth":
|
|
@@ -10009,7 +10002,7 @@ async function parseRunnerArgs(args, deps = {
|
|
|
10009
10002
|
process.exit(0);
|
|
10010
10003
|
}
|
|
10011
10004
|
if (values.get("version") === true) {
|
|
10012
|
-
process.stdout.write(`linzumi 0.0.
|
|
10005
|
+
process.stdout.write(`linzumi 0.0.38-beta
|
|
10013
10006
|
`);
|
|
10014
10007
|
process.exit(0);
|
|
10015
10008
|
}
|
package/package.json
CHANGED