@indigoai-us/hq-cli 5.156.0 → 5.158.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 +23 -0
- package/dist/command-catalog.generated.d.ts +101 -0
- package/dist/command-catalog.generated.js +130 -0
- package/dist/commands/agent-mcp.d.ts +1 -3
- package/dist/commands/agent-mcp.js +5 -26
- package/dist/commands/bot.js +13 -2
- package/dist/commands/lanes.d.ts +7 -0
- package/dist/commands/lanes.js +892 -46
- package/dist/lib/agent-kit/attachment-download.d.ts +24 -0
- package/dist/lib/agent-kit/attachment-download.js +47 -0
- package/dist/lib/agent-kit/inbox-state.d.ts +6 -2
- package/dist/lib/agent-kit/inbox-state.js +6 -2
- package/dist/lib/agent-kit/mcp/attachments.d.ts +28 -1
- package/dist/lib/agent-kit/mcp/attachments.js +48 -2
- package/dist/lib/agent-kit/mcp/tools.js +13 -19
- package/dist/lib/bot/api.d.ts +9 -0
- package/dist/lib/bot/attachments.d.ts +45 -0
- package/dist/lib/bot/attachments.js +89 -0
- package/dist/lib/bot/paths.d.ts +5 -0
- package/dist/lib/bot/paths.js +7 -0
- package/dist/lib/bot/run.d.ts +7 -0
- package/dist/lib/bot/run.js +34 -4
- package/dist/lib/bot/runtime/claude.d.ts +1 -0
- package/dist/lib/bot/runtime/claude.js +6 -0
- package/dist/lib/bot/runtime/types.d.ts +8 -0
- package/dist/lib/lanes/admission.d.ts +2 -0
- package/dist/lib/lanes/admission.js +7 -3
- package/dist/lib/lanes/host-capacity.d.ts +46 -0
- package/dist/lib/lanes/host-capacity.js +173 -0
- package/dist/lib/lanes/index.d.ts +4 -2
- package/dist/lib/lanes/index.js +2 -1
- package/dist/lib/lanes/outpost-dispatch.d.ts +11 -1
- package/dist/lib/lanes/outpost-dispatch.js +38 -2
- package/dist/lib/lanes/outpost-identity.d.ts +33 -0
- package/dist/lib/lanes/outpost-identity.js +59 -0
- package/dist/lib/lanes/spawn.js +11 -0
- package/dist/lib/lanes/store.js +12 -0
- package/dist/lib/lanes/types.d.ts +10 -0
- package/dist/lib/lanes/types.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [5.158.0] — 2026-09-24
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `hq lanes create --placement auto` selects a host with room for the provider and account. Managers can set `--default-placement` for their workers, `hq lanes list` shows capacity by host while `lanes.outpost-load-balancing` is enabled, and `hq lanes move` can relocate a queued lane that has not started. Remote worker profiles must match the creator's content hash.
|
|
10
|
+
- `hq lanes outpost-identity backfill --id <id>` fills a missing Outpost marker without replacing another value. New Outposts write their id to `/etc/outpost/outpost-id` so lane commands can identify the host.
|
|
11
|
+
|
|
12
|
+
## [5.157.0] — 2026-09-24
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Local bots (`hq bot run`) now receive HQ chat attachments. The runner reads
|
|
17
|
+
`attachments` on each inbox item, downloads every file with the bot's own
|
|
18
|
+
machine identity through the same checks `hq_attachment_fetch` uses (chat
|
|
19
|
+
attachment path only, DM must include the bot, company must be one of the
|
|
20
|
+
bot's own, 26 MiB cap), and saves it under `~/.hq/bots/<name>/attachments/`
|
|
21
|
+
(dir 0700, files 0600). The turn text lists each file's name, type, size and
|
|
22
|
+
local path, with small text files inlined; a file that could not be fetched
|
|
23
|
+
gets a one-line reason, which is also logged. A message that is only an
|
|
24
|
+
attachment is answered instead of being acked and dropped. Claude turns get
|
|
25
|
+
`--add-dir` for the attachments folder so gated permission modes can read it.
|
|
26
|
+
The MIME type is also read from the server's `kind` field.
|
|
27
|
+
|
|
5
28
|
## [5.156.0] — 2026-09-24
|
|
6
29
|
|
|
7
30
|
### Fixed
|
|
@@ -6809,6 +6809,12 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
6809
6809
|
}, {
|
|
6810
6810
|
readonly flags: "--outpost <id>";
|
|
6811
6811
|
readonly description: "Run on this Outpost instead of the local host";
|
|
6812
|
+
}, {
|
|
6813
|
+
readonly flags: "--placement <mode>";
|
|
6814
|
+
readonly description: "local | auto | outpost:<id>";
|
|
6815
|
+
}, {
|
|
6816
|
+
readonly flags: "--default-placement <mode>";
|
|
6817
|
+
readonly description: "Default placement for lanes launched by this lane: local | auto | outpost:<id>";
|
|
6812
6818
|
}, {
|
|
6813
6819
|
readonly flags: "--json";
|
|
6814
6820
|
readonly description: "JSON on stdout (always)";
|
|
@@ -6841,6 +6847,101 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
6841
6847
|
readonly description: "JSON on stdout (always)";
|
|
6842
6848
|
}];
|
|
6843
6849
|
readonly subcommands: readonly [];
|
|
6850
|
+
}, {
|
|
6851
|
+
readonly name: "capacity";
|
|
6852
|
+
readonly description: "Report this host's lane capacity by provider and account";
|
|
6853
|
+
readonly aliases: readonly [];
|
|
6854
|
+
readonly hidden: false;
|
|
6855
|
+
readonly usage: "[options]";
|
|
6856
|
+
readonly arguments: readonly [];
|
|
6857
|
+
readonly options: readonly [{
|
|
6858
|
+
readonly flags: "--json";
|
|
6859
|
+
readonly description: "JSON on stdout (always)";
|
|
6860
|
+
}];
|
|
6861
|
+
readonly subcommands: readonly [];
|
|
6862
|
+
}, {
|
|
6863
|
+
readonly name: "outpost-identity";
|
|
6864
|
+
readonly description: "Repair this host's Outpost identity marker";
|
|
6865
|
+
readonly aliases: readonly [];
|
|
6866
|
+
readonly hidden: false;
|
|
6867
|
+
readonly usage: "[options] [command]";
|
|
6868
|
+
readonly arguments: readonly [];
|
|
6869
|
+
readonly options: readonly [];
|
|
6870
|
+
readonly subcommands: readonly [{
|
|
6871
|
+
readonly name: "backfill";
|
|
6872
|
+
readonly description: "Write a missing Outpost identity marker without replacing an existing value";
|
|
6873
|
+
readonly aliases: readonly [];
|
|
6874
|
+
readonly hidden: false;
|
|
6875
|
+
readonly usage: "[options]";
|
|
6876
|
+
readonly arguments: readonly [];
|
|
6877
|
+
readonly options: readonly [{
|
|
6878
|
+
readonly flags: "--id <outpost-id>";
|
|
6879
|
+
readonly description: "Expected id of this host's Outpost";
|
|
6880
|
+
}, {
|
|
6881
|
+
readonly flags: "--json";
|
|
6882
|
+
readonly description: "JSON on stdout (always)";
|
|
6883
|
+
}];
|
|
6884
|
+
readonly subcommands: readonly [];
|
|
6885
|
+
}];
|
|
6886
|
+
}, {
|
|
6887
|
+
readonly name: "outpost-identity-backfill-target";
|
|
6888
|
+
readonly description: "";
|
|
6889
|
+
readonly aliases: readonly [];
|
|
6890
|
+
readonly hidden: true;
|
|
6891
|
+
readonly usage: "[options]";
|
|
6892
|
+
readonly arguments: readonly [];
|
|
6893
|
+
readonly options: readonly [{
|
|
6894
|
+
readonly flags: "--expected-id <outpost-id>";
|
|
6895
|
+
readonly description: "Expected id of this Outpost";
|
|
6896
|
+
}, {
|
|
6897
|
+
readonly flags: "--json";
|
|
6898
|
+
readonly description: "JSON on stdout (always)";
|
|
6899
|
+
}];
|
|
6900
|
+
readonly subcommands: readonly [];
|
|
6901
|
+
}, {
|
|
6902
|
+
readonly name: "move";
|
|
6903
|
+
readonly description: "Move an unstarted queued lane to a host with capacity";
|
|
6904
|
+
readonly aliases: readonly [];
|
|
6905
|
+
readonly hidden: false;
|
|
6906
|
+
readonly usage: "[options] <lane-id>";
|
|
6907
|
+
readonly arguments: readonly [{
|
|
6908
|
+
readonly name: "lane-id";
|
|
6909
|
+
readonly required: true;
|
|
6910
|
+
readonly variadic: false;
|
|
6911
|
+
}];
|
|
6912
|
+
readonly options: readonly [{
|
|
6913
|
+
readonly flags: "--placement <mode>";
|
|
6914
|
+
readonly description: "local | auto | outpost:<id>";
|
|
6915
|
+
}, {
|
|
6916
|
+
readonly flags: "--json";
|
|
6917
|
+
readonly description: "JSON on stdout (always)";
|
|
6918
|
+
}];
|
|
6919
|
+
readonly subcommands: readonly [];
|
|
6920
|
+
}, {
|
|
6921
|
+
readonly name: "move-target";
|
|
6922
|
+
readonly description: "";
|
|
6923
|
+
readonly aliases: readonly [];
|
|
6924
|
+
readonly hidden: true;
|
|
6925
|
+
readonly usage: "[options] <lane-id>";
|
|
6926
|
+
readonly arguments: readonly [{
|
|
6927
|
+
readonly name: "lane-id";
|
|
6928
|
+
readonly required: true;
|
|
6929
|
+
readonly variadic: false;
|
|
6930
|
+
}];
|
|
6931
|
+
readonly options: readonly [{
|
|
6932
|
+
readonly flags: "--host-kind <kind>";
|
|
6933
|
+
readonly description: "local | outpost";
|
|
6934
|
+
}, {
|
|
6935
|
+
readonly flags: "--host-id <id>";
|
|
6936
|
+
readonly description: "Target host id";
|
|
6937
|
+
}, {
|
|
6938
|
+
readonly flags: "--account <id>";
|
|
6939
|
+
readonly description: "Provider account id";
|
|
6940
|
+
}, {
|
|
6941
|
+
readonly flags: "--json";
|
|
6942
|
+
readonly description: "JSON on stdout (always)";
|
|
6943
|
+
}];
|
|
6944
|
+
readonly subcommands: readonly [];
|
|
6844
6945
|
}, {
|
|
6845
6946
|
readonly name: "admit";
|
|
6846
6947
|
readonly description: "Try to admit the oldest eligible queued lane";
|
|
@@ -8801,6 +8801,14 @@ export const COMMAND_CATALOG = [
|
|
|
8801
8801
|
"flags": "--outpost <id>",
|
|
8802
8802
|
"description": "Run on this Outpost instead of the local host"
|
|
8803
8803
|
},
|
|
8804
|
+
{
|
|
8805
|
+
"flags": "--placement <mode>",
|
|
8806
|
+
"description": "local | auto | outpost:<id>"
|
|
8807
|
+
},
|
|
8808
|
+
{
|
|
8809
|
+
"flags": "--default-placement <mode>",
|
|
8810
|
+
"description": "Default placement for lanes launched by this lane: local | auto | outpost:<id>"
|
|
8811
|
+
},
|
|
8804
8812
|
{
|
|
8805
8813
|
"flags": "--json",
|
|
8806
8814
|
"description": "JSON on stdout (always)"
|
|
@@ -8843,6 +8851,128 @@ export const COMMAND_CATALOG = [
|
|
|
8843
8851
|
],
|
|
8844
8852
|
"subcommands": []
|
|
8845
8853
|
},
|
|
8854
|
+
{
|
|
8855
|
+
"name": "capacity",
|
|
8856
|
+
"description": "Report this host's lane capacity by provider and account",
|
|
8857
|
+
"aliases": [],
|
|
8858
|
+
"hidden": false,
|
|
8859
|
+
"usage": "[options]",
|
|
8860
|
+
"arguments": [],
|
|
8861
|
+
"options": [
|
|
8862
|
+
{
|
|
8863
|
+
"flags": "--json",
|
|
8864
|
+
"description": "JSON on stdout (always)"
|
|
8865
|
+
}
|
|
8866
|
+
],
|
|
8867
|
+
"subcommands": []
|
|
8868
|
+
},
|
|
8869
|
+
{
|
|
8870
|
+
"name": "outpost-identity",
|
|
8871
|
+
"description": "Repair this host's Outpost identity marker",
|
|
8872
|
+
"aliases": [],
|
|
8873
|
+
"hidden": false,
|
|
8874
|
+
"usage": "[options] [command]",
|
|
8875
|
+
"arguments": [],
|
|
8876
|
+
"options": [],
|
|
8877
|
+
"subcommands": [
|
|
8878
|
+
{
|
|
8879
|
+
"name": "backfill",
|
|
8880
|
+
"description": "Write a missing Outpost identity marker without replacing an existing value",
|
|
8881
|
+
"aliases": [],
|
|
8882
|
+
"hidden": false,
|
|
8883
|
+
"usage": "[options]",
|
|
8884
|
+
"arguments": [],
|
|
8885
|
+
"options": [
|
|
8886
|
+
{
|
|
8887
|
+
"flags": "--id <outpost-id>",
|
|
8888
|
+
"description": "Expected id of this host's Outpost"
|
|
8889
|
+
},
|
|
8890
|
+
{
|
|
8891
|
+
"flags": "--json",
|
|
8892
|
+
"description": "JSON on stdout (always)"
|
|
8893
|
+
}
|
|
8894
|
+
],
|
|
8895
|
+
"subcommands": []
|
|
8896
|
+
}
|
|
8897
|
+
]
|
|
8898
|
+
},
|
|
8899
|
+
{
|
|
8900
|
+
"name": "outpost-identity-backfill-target",
|
|
8901
|
+
"description": "",
|
|
8902
|
+
"aliases": [],
|
|
8903
|
+
"hidden": true,
|
|
8904
|
+
"usage": "[options]",
|
|
8905
|
+
"arguments": [],
|
|
8906
|
+
"options": [
|
|
8907
|
+
{
|
|
8908
|
+
"flags": "--expected-id <outpost-id>",
|
|
8909
|
+
"description": "Expected id of this Outpost"
|
|
8910
|
+
},
|
|
8911
|
+
{
|
|
8912
|
+
"flags": "--json",
|
|
8913
|
+
"description": "JSON on stdout (always)"
|
|
8914
|
+
}
|
|
8915
|
+
],
|
|
8916
|
+
"subcommands": []
|
|
8917
|
+
},
|
|
8918
|
+
{
|
|
8919
|
+
"name": "move",
|
|
8920
|
+
"description": "Move an unstarted queued lane to a host with capacity",
|
|
8921
|
+
"aliases": [],
|
|
8922
|
+
"hidden": false,
|
|
8923
|
+
"usage": "[options] <lane-id>",
|
|
8924
|
+
"arguments": [
|
|
8925
|
+
{
|
|
8926
|
+
"name": "lane-id",
|
|
8927
|
+
"required": true,
|
|
8928
|
+
"variadic": false
|
|
8929
|
+
}
|
|
8930
|
+
],
|
|
8931
|
+
"options": [
|
|
8932
|
+
{
|
|
8933
|
+
"flags": "--placement <mode>",
|
|
8934
|
+
"description": "local | auto | outpost:<id>"
|
|
8935
|
+
},
|
|
8936
|
+
{
|
|
8937
|
+
"flags": "--json",
|
|
8938
|
+
"description": "JSON on stdout (always)"
|
|
8939
|
+
}
|
|
8940
|
+
],
|
|
8941
|
+
"subcommands": []
|
|
8942
|
+
},
|
|
8943
|
+
{
|
|
8944
|
+
"name": "move-target",
|
|
8945
|
+
"description": "",
|
|
8946
|
+
"aliases": [],
|
|
8947
|
+
"hidden": true,
|
|
8948
|
+
"usage": "[options] <lane-id>",
|
|
8949
|
+
"arguments": [
|
|
8950
|
+
{
|
|
8951
|
+
"name": "lane-id",
|
|
8952
|
+
"required": true,
|
|
8953
|
+
"variadic": false
|
|
8954
|
+
}
|
|
8955
|
+
],
|
|
8956
|
+
"options": [
|
|
8957
|
+
{
|
|
8958
|
+
"flags": "--host-kind <kind>",
|
|
8959
|
+
"description": "local | outpost"
|
|
8960
|
+
},
|
|
8961
|
+
{
|
|
8962
|
+
"flags": "--host-id <id>",
|
|
8963
|
+
"description": "Target host id"
|
|
8964
|
+
},
|
|
8965
|
+
{
|
|
8966
|
+
"flags": "--account <id>",
|
|
8967
|
+
"description": "Provider account id"
|
|
8968
|
+
},
|
|
8969
|
+
{
|
|
8970
|
+
"flags": "--json",
|
|
8971
|
+
"description": "JSON on stdout (always)"
|
|
8972
|
+
}
|
|
8973
|
+
],
|
|
8974
|
+
"subcommands": []
|
|
8975
|
+
},
|
|
8846
8976
|
{
|
|
8847
8977
|
"name": "admit",
|
|
8848
8978
|
"description": "Try to admit the oldest eligible queued lane",
|
|
@@ -9,18 +9,16 @@
|
|
|
9
9
|
* hq binary with the machine-identity env pinned.
|
|
10
10
|
*/
|
|
11
11
|
import { Command } from "commander";
|
|
12
|
-
import type { Readable } from "node:stream";
|
|
13
12
|
import { McpServer } from "../lib/agent-kit/mcp/jsonrpc.js";
|
|
14
13
|
import { type HqRunResult, type McpToolClients } from "../lib/agent-kit/mcp/tools.js";
|
|
15
14
|
import { type AgentKitPaths } from "../lib/agent-kit/paths.js";
|
|
16
15
|
import type { ExternalMachineCreds } from "../lib/agent-kit/creds.js";
|
|
16
|
+
export { readBounded } from "../lib/agent-kit/attachment-download.js";
|
|
17
17
|
export declare const AGENT_MCP_SERVER_NAME = "hq-agent";
|
|
18
18
|
export declare const AGENT_MCP_INSTRUCTIONS: string;
|
|
19
19
|
export declare const HQ_SUBPROCESS_TIMEOUT_MS = 120000;
|
|
20
20
|
export declare function defaultRunHq(nodeBinary: string, hqBinary: string, env: NodeJS.ProcessEnv): (args: string[]) => Promise<HqRunResult>;
|
|
21
21
|
export declare function defaultMcpClients(creds: ExternalMachineCreds, credsPath: string, paths?: Pick<AgentKitPaths, "inboxDir" | "attachmentsDir">): McpToolClients;
|
|
22
|
-
/** Drain a stream into memory, refusing past `max` bytes. */
|
|
23
|
-
export declare function readBounded(body: Readable, max: number): Promise<Buffer>;
|
|
24
22
|
export declare function createAgentMcpServer(clients: McpToolClients): McpServer;
|
|
25
23
|
export declare function registerAgentMcpCommand(agent: Command): void;
|
|
26
24
|
//# sourceMappingURL=agent-mcp.d.ts.map
|
|
@@ -12,15 +12,15 @@ import { spawn } from "node:child_process";
|
|
|
12
12
|
import * as os from "node:os";
|
|
13
13
|
import { CLI_VERSION } from "../cli-version.js";
|
|
14
14
|
import { ensureCognitoToken } from "../utils/cognito-session.js";
|
|
15
|
-
import { GetObjectCommand } from "@aws-sdk/client-s3";
|
|
16
15
|
import { getCompanyUid, vaultApiFetch } from "../utils/vault-api.js";
|
|
17
|
-
import { createCompanyPresignClient } from "./files-browse.js";
|
|
18
|
-
import { MAX_ATTACHMENT_BYTES } from "../lib/agent-kit/mcp/attachments.js";
|
|
19
16
|
import { McpServer } from "../lib/agent-kit/mcp/jsonrpc.js";
|
|
17
|
+
import { createVaultObjectDownloader } from "../lib/agent-kit/attachment-download.js";
|
|
20
18
|
import { buildAgentMcpTools } from "../lib/agent-kit/mcp/tools.js";
|
|
21
19
|
import { readKitConfig } from "../lib/agent-kit/kit-config.js";
|
|
22
20
|
import { agentKitPaths } from "../lib/agent-kit/paths.js";
|
|
23
21
|
import { requireExternalCreds } from "./agent-kit.js";
|
|
22
|
+
// Re-exported for callers that imported it from here before it moved.
|
|
23
|
+
export { readBounded } from "../lib/agent-kit/attachment-download.js";
|
|
24
24
|
export const AGENT_MCP_SERVER_NAME = "hq-agent";
|
|
25
25
|
export const AGENT_MCP_INSTRUCTIONS = "You are acting inside HQ as an enrolled external agent. Tools run as that machine identity: " +
|
|
26
26
|
"hq_whoami (identity), hq_search / hq_files_list / hq_files_read (company vault), " +
|
|
@@ -78,14 +78,8 @@ export function defaultMcpClients(creds, credsPath, paths = agentKitPaths(os.hom
|
|
|
78
78
|
throw err;
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const client = createCompanyPresignClient({ token: await getToken(), companyUid: scopeUid, baseUrl: creds.apiBaseUrl });
|
|
84
|
-
const res = await client.send(new GetObjectCommand({ Bucket: scopeUid, Key: key }));
|
|
85
|
-
if (!res.Body)
|
|
86
|
-
throw new Error(`no body returned for '${key}'`);
|
|
87
|
-
return readBounded(res.Body, MAX_ATTACHMENT_BYTES);
|
|
88
|
-
},
|
|
81
|
+
// Same presign path `hq files cat` uses; the vault API's per-key ACL decides.
|
|
82
|
+
downloadVaultObject: createVaultObjectDownloader({ getToken, baseUrl: creds.apiBaseUrl }),
|
|
89
83
|
apiJson: async (token, path, init) => {
|
|
90
84
|
const res = await vaultApiFetch({
|
|
91
85
|
token,
|
|
@@ -100,21 +94,6 @@ export function defaultMcpClients(creds, credsPath, paths = agentKitPaths(os.hom
|
|
|
100
94
|
},
|
|
101
95
|
};
|
|
102
96
|
}
|
|
103
|
-
/** Drain a stream into memory, refusing past `max` bytes. */
|
|
104
|
-
export async function readBounded(body, max) {
|
|
105
|
-
const chunks = [];
|
|
106
|
-
let total = 0;
|
|
107
|
-
for await (const chunk of body) {
|
|
108
|
-
const b = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
109
|
-
total += b.length;
|
|
110
|
-
if (total > max) {
|
|
111
|
-
body.destroy();
|
|
112
|
-
throw new Error(`object exceeds the ${max}-byte attachment limit`);
|
|
113
|
-
}
|
|
114
|
-
chunks.push(b);
|
|
115
|
-
}
|
|
116
|
-
return Buffer.concat(chunks);
|
|
117
|
-
}
|
|
118
97
|
export function createAgentMcpServer(clients) {
|
|
119
98
|
return new McpServer({
|
|
120
99
|
name: AGENT_MCP_SERVER_NAME,
|
package/dist/commands/bot.js
CHANGED
|
@@ -25,6 +25,7 @@ import { hasPromotionHold, promotionHoldSummary } from "../lib/bot/promotion-hol
|
|
|
25
25
|
* list (online flag), and rm. Secrets are never printed.
|
|
26
26
|
*/
|
|
27
27
|
import { promoteLocalBot } from "../lib/bot/promote.js";
|
|
28
|
+
import { createVaultObjectDownloader } from "../lib/agent-kit/attachment-download.js";
|
|
28
29
|
import { addBotToCompanies, describeCompanyFailures, removeBotFromCompanies } from "./bot-companies.js";
|
|
29
30
|
import { registerBotContinuityCommand } from "./bot-continuity.js";
|
|
30
31
|
import { registerBotJobsCommand } from "./bot-jobs.js";
|
|
@@ -680,9 +681,19 @@ async function runBotResident(nameArg) {
|
|
|
680
681
|
console.log(orphanBotRunMessage(name, outcome));
|
|
681
682
|
return;
|
|
682
683
|
}
|
|
683
|
-
const
|
|
684
|
+
const token = botTokenSupplier(dir);
|
|
685
|
+
const api = new BotApi({ token });
|
|
684
686
|
const owner = new OwnerContextCache(() => lookupOwnerContext(config.ownerUid), Date.now, undefined, config.ownerUid);
|
|
685
|
-
const handle = await runBot({
|
|
687
|
+
const handle = await runBot({
|
|
688
|
+
dir,
|
|
689
|
+
config,
|
|
690
|
+
api,
|
|
691
|
+
runtime: runtimeFor(config.runtime),
|
|
692
|
+
ownerContext: () => owner.get(),
|
|
693
|
+
// Chat attachments are fetched with the bot's own machine identity against
|
|
694
|
+
// the same API its inbox and posts use (BotApi has no baseUrl override either).
|
|
695
|
+
downloadAttachment: createVaultObjectDownloader({ getToken: token }),
|
|
696
|
+
});
|
|
686
697
|
await handle.done;
|
|
687
698
|
void name;
|
|
688
699
|
}
|
package/dist/commands/lanes.d.ts
CHANGED
|
@@ -66,12 +66,19 @@ export interface LanesCommandDeps {
|
|
|
66
66
|
dispatchOutpostExec?: (input: {
|
|
67
67
|
outpostId: string;
|
|
68
68
|
command: string;
|
|
69
|
+
timeoutSeconds?: number;
|
|
70
|
+
waitMs?: number;
|
|
69
71
|
}) => Promise<OutpostDispatchResult>;
|
|
72
|
+
/** Test seam for the atomic, non-overwriting marker repair. */
|
|
73
|
+
backfillOutpostIdentity?: (expectedId: string) => "created" | "unchanged";
|
|
70
74
|
fetchText?: (url: string) => Promise<string>;
|
|
71
75
|
runCompaction?: RunCompactionFn;
|
|
72
76
|
locateTranscript?: (home: string, sessionId: string) => string | null;
|
|
73
77
|
monitorEvidence?: MonitorEvidenceReader;
|
|
78
|
+
/** Test seam for the default-off outpost placement rollout flag. */
|
|
79
|
+
lanePlacementEnabled?: () => boolean;
|
|
74
80
|
}
|
|
81
|
+
export declare const LANE_OUTPOST_LOAD_BALANCING_FLAG = "lanes.outpost-load-balancing";
|
|
75
82
|
export declare function parseSeniorRef(raw: string): SeniorRef;
|
|
76
83
|
export declare function resolveAnswerChoice(choice: string, options: string[], freeform: boolean): string;
|
|
77
84
|
/**
|