@indigoai-us/hq-cli 5.247.0 → 5.248.0
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/CHANGELOG.md +15 -0
- package/assets/scaffold/core/scripts/hq-session.sh +2 -2
- package/assets/scaffold/core/scripts/lib/session-scope-capability.sh +1 -1
- package/dist/commands/bot.js +10 -4
- package/dist/commands/lanes-message.d.ts +9 -0
- package/dist/commands/lanes-message.js +558 -0
- package/dist/commands/lanes-resume.d.ts +6 -0
- package/dist/commands/lanes-resume.js +455 -0
- package/dist/commands/lanes-shared.d.ts +153 -1
- package/dist/commands/lanes-shared.js +94 -1
- package/dist/commands/lanes.d.ts +1 -1
- package/dist/commands/lanes.js +59 -1086
- package/package.json +1 -1
|
@@ -1,2 +1,95 @@
|
|
|
1
|
-
|
|
1
|
+
import { resolveLaneEffort } from "../lib/lanes/effort.js";
|
|
2
|
+
import { LanesError } from "../lib/lanes/errors.js";
|
|
3
|
+
import { AccountResolutionError, accountStatus, loadLanesConfig } from "../lib/lanes/index.js";
|
|
4
|
+
import { resolveLaneModel } from "../lib/lanes/spawn.js";
|
|
5
|
+
export function accountRequestKeepsCurrentLane(lane, rawAccount) {
|
|
6
|
+
const raw = rawAccount.trim();
|
|
7
|
+
const colon = raw.indexOf(":");
|
|
8
|
+
const requestedProvider = colon > 0 ? raw.slice(0, colon) : undefined;
|
|
9
|
+
const requestedAccount = colon > 0 ? raw.slice(colon + 1) : raw;
|
|
10
|
+
return requestedAccount.length > 0 &&
|
|
11
|
+
requestedAccount === lane.account &&
|
|
12
|
+
(requestedProvider === undefined || requestedProvider === lane.provider);
|
|
13
|
+
}
|
|
14
|
+
export function assertCurrentResumeAccountAvailable(ctx, lane) {
|
|
15
|
+
const config = loadLanesConfig(ctx.hqRoot());
|
|
16
|
+
const account = lane.account === undefined
|
|
17
|
+
? undefined
|
|
18
|
+
: config.providers[lane.provider].accounts[lane.account];
|
|
19
|
+
if (account === undefined || !account.enabled) {
|
|
20
|
+
throw new AccountResolutionError(account === undefined ? "unknown_account" : "account_disabled", account === undefined
|
|
21
|
+
? `Lane ${lane.lane_id} records account ${JSON.stringify(lane.account)} which is not configured for ${lane.provider}`
|
|
22
|
+
: `Account ${JSON.stringify(lane.account)} is disabled${account.disabled_reason ? `: ${account.disabled_reason}` : ""}`, { provider: lane.provider, account: lane.account ?? "", ...(account?.disabled_reason !== undefined ? { reason: account.disabled_reason } : {}) });
|
|
23
|
+
}
|
|
24
|
+
if (accountStatus(lane.provider, lane.account, config, {
|
|
25
|
+
existsSync: ctx.existsSync,
|
|
26
|
+
hostname: ctx.hostname(),
|
|
27
|
+
probe: ctx.probeProvider,
|
|
28
|
+
env: ctx.env,
|
|
29
|
+
}).logged_in !== true) {
|
|
30
|
+
throw new LanesError("account_not_logged_in", `Account ${lane.account} for ${lane.provider} is not logged in (no credential file)`, { provider: lane.provider, account: lane.account, lane_id: lane.lane_id });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export function accountMoveSummary(move) {
|
|
34
|
+
return {
|
|
35
|
+
from: move.from,
|
|
36
|
+
to: move.to,
|
|
37
|
+
queued: move.queued,
|
|
38
|
+
copied: move.copy.copied,
|
|
39
|
+
sources: move.copy.sources,
|
|
40
|
+
targets: move.copy.targets,
|
|
41
|
+
source_dir: move.copy.source_dir,
|
|
42
|
+
target_dir: move.copy.target_dir,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export function hasKeepAliveProgress(lane) {
|
|
46
|
+
return (lane.keep_alive_resume_count ?? 0) !== 0 ||
|
|
47
|
+
lane.keep_alive_last_resume_at !== undefined ||
|
|
48
|
+
lane.keep_alive_next_eligible_at !== undefined ||
|
|
49
|
+
lane.keep_alive_exhausted_at !== undefined;
|
|
50
|
+
}
|
|
51
|
+
export function resetKeepAliveProgress(lane) {
|
|
52
|
+
if (!hasKeepAliveProgress(lane))
|
|
53
|
+
return lane;
|
|
54
|
+
return {
|
|
55
|
+
...lane,
|
|
56
|
+
keep_alive_resume_count: 0,
|
|
57
|
+
keep_alive_last_resume_at: undefined,
|
|
58
|
+
keep_alive_next_eligible_at: undefined,
|
|
59
|
+
keep_alive_exhausted_at: undefined,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export function resolveResumeEffort(ctx, lane, input) {
|
|
63
|
+
if (input.cliEffort === undefined && input.profile === undefined)
|
|
64
|
+
return undefined;
|
|
65
|
+
const config = loadLanesConfig(ctx.hqRoot());
|
|
66
|
+
const providerConfig = config.providers[lane.provider];
|
|
67
|
+
const accountId = input.account?.trim() || lane.account;
|
|
68
|
+
const accountConfig = accountId === undefined
|
|
69
|
+
? undefined
|
|
70
|
+
: providerConfig.accounts[accountId];
|
|
71
|
+
const profileDefaultsApply = input.profile?.profile.meta.provider === lane.provider;
|
|
72
|
+
const pinnedModel = lane.model_source === undefined || lane.model_source === "cli" || lane.model_source === "preserved"
|
|
73
|
+
? lane.model
|
|
74
|
+
: undefined;
|
|
75
|
+
const model = resolveLaneModel({
|
|
76
|
+
cliModel: input.model?.trim() || pinnedModel,
|
|
77
|
+
profileModel: profileDefaultsApply ? input.profile?.profile.meta.model : undefined,
|
|
78
|
+
accountModel: accountConfig?.model,
|
|
79
|
+
providerModel: providerConfig.model,
|
|
80
|
+
});
|
|
81
|
+
return resolveLaneEffort({
|
|
82
|
+
cliEffort: input.cliEffort,
|
|
83
|
+
profileEffort: profileDefaultsApply ? input.profile?.profile.meta.effort : undefined,
|
|
84
|
+
accountEffort: accountConfig?.effort,
|
|
85
|
+
providerEffort: providerConfig.effort,
|
|
86
|
+
model,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
export function recordedResumeEffort(lane) {
|
|
90
|
+
return {
|
|
91
|
+
...(lane.effort !== undefined ? { effort: lane.effort } : {}),
|
|
92
|
+
source: lane.effort_source ?? "none",
|
|
93
|
+
};
|
|
94
|
+
}
|
|
2
95
|
//# sourceMappingURL=lanes-shared.js.map
|
package/dist/commands/lanes.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* `watch` and the monitor reminder are the line-oriented text surfaces.
|
|
7
7
|
*/
|
|
8
8
|
import { Command } from "commander";
|
|
9
|
-
import type
|
|
9
|
+
import { type LanesMesh, type SpawnLoginResult } from "./lanes-shared.js";
|
|
10
10
|
export type { LanesMesh, SpawnLoginResult } from "./lanes-shared.js";
|
|
11
11
|
export { resolveAnswerChoice } from "./lanes-questions.js";
|
|
12
12
|
import type { OutpostIdentity } from "../lib/lanes/admission-host.js";
|