@rosthq/cli 0.7.107 → 0.7.109
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/docs.d.ts.map +1 -1
- package/dist/index.js +56 -9
- package/dist/index.js.map +2 -2
- package/dist/runner-serve.d.ts +4 -0
- package/dist/runner-serve.d.ts.map +1 -1
- package/package.json +1 -1
- package/prompts/how-tos/human-confirmations-software-factory.md +41 -0
- package/prompts/how-tos/human-confirmations.md +1 -24
package/dist/docs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":"AAWA,wBAAgB,eAAe,IAAI,MAAM,CAexC;AAED,wBAAgB,sBAAsB,IAAI,MAAM,CAkD/C"}
|
package/dist/index.js
CHANGED
|
@@ -47593,6 +47593,23 @@ function loadAgentHowToPrompt(contract) {
|
|
|
47593
47593
|
function listAgentHowToPrompts() {
|
|
47594
47594
|
return Object.values(AGENT_HOW_TO_PROMPT_CONTRACTS);
|
|
47595
47595
|
}
|
|
47596
|
+
var HUMAN_CONFIRMATIONS_SOFTWARE_FACTORY_PROMPT_CONTRACT = {
|
|
47597
|
+
name: "human-confirmations-software-factory",
|
|
47598
|
+
version: "1.0.0",
|
|
47599
|
+
filename: "how-tos/human-confirmations-software-factory.md"
|
|
47600
|
+
};
|
|
47601
|
+
function loadHumanConfirmationsPrompt(options) {
|
|
47602
|
+
const core = loadAgentHowToPrompt(AGENT_HOW_TO_PROMPT_CONTRACTS.humanConfirmations);
|
|
47603
|
+
if (!options?.includeSoftwareFactory) {
|
|
47604
|
+
return core;
|
|
47605
|
+
}
|
|
47606
|
+
const softwareFactoryBranch = loadAgentHowToPrompt(HUMAN_CONFIRMATIONS_SOFTWARE_FACTORY_PROMPT_CONTRACT);
|
|
47607
|
+
return `${core}
|
|
47608
|
+
|
|
47609
|
+
---
|
|
47610
|
+
|
|
47611
|
+
${softwareFactoryBranch}`;
|
|
47612
|
+
}
|
|
47596
47613
|
|
|
47597
47614
|
// ../../packages/reference/src/schema.ts
|
|
47598
47615
|
var referenceAudiences = ["human", "cli", "mcp", "in_app_agent"];
|
|
@@ -50824,7 +50841,7 @@ Every notification should include the seat, cause, evidence, and requested decis
|
|
|
50824
50841
|
order: 75,
|
|
50825
50842
|
title: "Local runner guide",
|
|
50826
50843
|
summary: "How local agent sessions and runner surfaces should operate through {{brand}} without bypassing Charters or audit.",
|
|
50827
|
-
version: "2026-07-
|
|
50844
|
+
version: "2026-07-20.1",
|
|
50828
50845
|
public: true,
|
|
50829
50846
|
audiences: ["human", "cli", "mcp", "in_app_agent"],
|
|
50830
50847
|
stages: ["staffing", "operating_rhythm"],
|
|
@@ -50870,7 +50887,7 @@ Runner transport defaults to the canonical production host \`https://rost.elevat
|
|
|
50870
50887
|
|
|
50871
50888
|
Choose the local runtime with \`--runtime auto|claude|codex\` (default \`auto\`). The same short-lived seat-scoped MCP token and server-side guard apply regardless of runtime; results are tagged \`claude-cli\` or \`codex-cli\`.
|
|
50872
50889
|
|
|
50873
|
-
For always-on execution, \`runner serve --execute\` heartbeats on its normal interval and also checks for claimable work between heartbeats. The default interactive claim cadence is about one second; set \`RUNNER_INTERACTIVE_CLAIM_MS\` or \`--interactive-claim-ms\` to tune it for a host. Claude-backed turns reuse a per-seat Claude Code resume session when Claude reports a session id, so later turns can run with \`claude --resume <session-id>\` under the local subscription account. The runner stores only the opaque resume id in its owner-only state file; it does not use API-billed managed sessions to make subscription runner turns faster. A resident long-lived Claude/Codex process is still prototype-gated, so do not assume a fixed latency SLA from this guide alone.
|
|
50890
|
+
For always-on execution, \`runner serve --execute\` heartbeats on its normal interval and also checks for claimable work between heartbeats. The default interactive claim cadence is about one second; set \`RUNNER_INTERACTIVE_CLAIM_MS\` or \`--interactive-claim-ms\` to tune it for a host. Set how many turns the runner may run in parallel with \`--max-sessions <n>\` or \`RUNNER_MAX_SESSIONS\`; left unset, the runner estimates a value from host CPU and memory. The scheduler honors the declared value (clamped to a small ceiling) so a runner never claims more concurrent work than the capacity it reports. Claude-backed turns reuse a per-seat Claude Code resume session when Claude reports a session id, so later turns can run with \`claude --resume <session-id>\` under the local subscription account. The runner stores only the opaque resume id in its owner-only state file; it does not use API-billed managed sessions to make subscription runner turns faster. A resident long-lived Claude/Codex process is still prototype-gated, so do not assume a fixed latency SLA from this guide alone.
|
|
50874
50891
|
|
|
50875
50892
|
The runner bearer secret is stored locally and is never displayed. Each claimed turn receives a short-lived seat-scoped MCP token from {{brand}}, and server-side guards still decide what tools the Seat may use.
|
|
50876
50893
|
|
|
@@ -52070,8 +52087,11 @@ function countMatches(text, term) {
|
|
|
52070
52087
|
|
|
52071
52088
|
// src/docs.ts
|
|
52072
52089
|
function renderHowToDocs() {
|
|
52073
|
-
return listAgentHowToPrompts().map((contract) =>
|
|
52074
|
-
|
|
52090
|
+
return listAgentHowToPrompts().map((contract) => {
|
|
52091
|
+
const body = contract.filename === AGENT_HOW_TO_PROMPT_CONTRACTS.humanConfirmations.filename ? loadHumanConfirmationsPrompt({ includeSoftwareFactory: true }) : loadAgentHowToPrompt(contract);
|
|
52092
|
+
return `<!-- ${contract.name}@${contract.version} -->
|
|
52093
|
+
${body}`;
|
|
52094
|
+
}).join("\n\n---\n\n");
|
|
52075
52095
|
}
|
|
52076
52096
|
function renderOnboardRunPrompt() {
|
|
52077
52097
|
const tenantOnboarding = loadAgentHowToPrompt(AGENT_HOW_TO_PROMPT_CONTRACTS.tenantOnboarding);
|
|
@@ -57639,7 +57659,7 @@ ${usage()}
|
|
|
57639
57659
|
let activeSessions = 0;
|
|
57640
57660
|
const activeTurnExecutionIds = /* @__PURE__ */ new Set();
|
|
57641
57661
|
do {
|
|
57642
|
-
const detectedCapabilities = await detectCapabilities(cliVersion, env, homeDir);
|
|
57662
|
+
const detectedCapabilities = await detectCapabilities(cliVersion, env, homeDir, config2.maxSessionsOverride);
|
|
57643
57663
|
const capabilities = capabilitiesForConfiguredRuntime(detectedCapabilities, config2.runtime);
|
|
57644
57664
|
const localRuntime = config2.execute ? effectiveExecutionRuntime(config2.runtime, capabilities) : null;
|
|
57645
57665
|
try {
|
|
@@ -57819,6 +57839,7 @@ function parseServeArgs(args, appUrl2, env, homeDir) {
|
|
|
57819
57839
|
let once = false;
|
|
57820
57840
|
let runtime = parseRuntime(env.RUNNER_RUNTIME ?? "auto");
|
|
57821
57841
|
let userCode = env.RUNNER_USER_CODE;
|
|
57842
|
+
let maxSessionsOverride = parseMaxSessionsEnv(env.RUNNER_MAX_SESSIONS);
|
|
57822
57843
|
for (let index = 0; index < args.length; index += 1) {
|
|
57823
57844
|
const token = args[index];
|
|
57824
57845
|
if (token === "--name") {
|
|
@@ -57839,6 +57860,13 @@ function parseServeArgs(args, appUrl2, env, homeDir) {
|
|
|
57839
57860
|
} else if (token === "--runtime") {
|
|
57840
57861
|
runtime = parseRuntime(requiredValue(args, index));
|
|
57841
57862
|
index += 1;
|
|
57863
|
+
} else if (token === "--max-sessions") {
|
|
57864
|
+
const raw = Number(requiredValue(args, index));
|
|
57865
|
+
if (!Number.isSafeInteger(raw) || raw < 1) {
|
|
57866
|
+
throw new Error("--max-sessions must be an integer >= 1.");
|
|
57867
|
+
}
|
|
57868
|
+
maxSessionsOverride = raw;
|
|
57869
|
+
index += 1;
|
|
57842
57870
|
} else if (token === "--execute") {
|
|
57843
57871
|
execute2 = true;
|
|
57844
57872
|
} else if (token === "--once") {
|
|
@@ -57879,9 +57907,17 @@ function parseServeArgs(args, appUrl2, env, homeDir) {
|
|
|
57879
57907
|
sandboxAllowNetwork: network.allowNetwork,
|
|
57880
57908
|
homeDir,
|
|
57881
57909
|
...network.unrecognized !== null ? { sandboxNetworkWarning: `RUNNER_SANDBOX_NETWORK='${network.unrecognized}' not recognized (use allow|deny); defaulting to allow egress.` } : {},
|
|
57882
|
-
...userCode ? { userCode } : {}
|
|
57910
|
+
...userCode ? { userCode } : {},
|
|
57911
|
+
...maxSessionsOverride !== void 0 ? { maxSessionsOverride: Math.min(maxSessionsOverride, RUNNER_MAX_SESSIONS_CAP) } : {}
|
|
57883
57912
|
};
|
|
57884
57913
|
}
|
|
57914
|
+
function parseMaxSessionsEnv(value) {
|
|
57915
|
+
if (value === void 0) {
|
|
57916
|
+
return void 0;
|
|
57917
|
+
}
|
|
57918
|
+
const parsed = Number(value);
|
|
57919
|
+
return Number.isSafeInteger(parsed) && parsed >= 1 ? parsed : void 0;
|
|
57920
|
+
}
|
|
57885
57921
|
function parseRuntime(value) {
|
|
57886
57922
|
if (value === "auto" || value === "claude" || value === "codex") {
|
|
57887
57923
|
return value;
|
|
@@ -58020,7 +58056,14 @@ async function startPairing(client, config2) {
|
|
|
58020
58056
|
}
|
|
58021
58057
|
return userCode;
|
|
58022
58058
|
}
|
|
58023
|
-
|
|
58059
|
+
var RUNNER_MAX_SESSIONS_CAP = 8;
|
|
58060
|
+
function estimateMaxSessions(cpuCount, memoryMb) {
|
|
58061
|
+
const byCpu = Number.isFinite(cpuCount) && cpuCount > 0 ? Math.floor(cpuCount) : 1;
|
|
58062
|
+
const byMem = Number.isFinite(memoryMb) && memoryMb > 0 ? Math.floor(memoryMb / 2048) : 1;
|
|
58063
|
+
const estimate = Math.min(byCpu, byMem);
|
|
58064
|
+
return Math.min(Math.max(estimate, 1), RUNNER_MAX_SESSIONS_CAP);
|
|
58065
|
+
}
|
|
58066
|
+
async function detectCapabilities(cliVersion, env, homeDir, maxSessionsOverride) {
|
|
58024
58067
|
const [claude, codex, git, gh, forgeDiskFreeMb] = await Promise.all([
|
|
58025
58068
|
probeClaude(),
|
|
58026
58069
|
probe("codex"),
|
|
@@ -58029,6 +58072,7 @@ async function detectCapabilities(cliVersion, env, homeDir) {
|
|
|
58029
58072
|
probeForgeDiskFreeMb(homeDir)
|
|
58030
58073
|
]);
|
|
58031
58074
|
const accountAlias = resolveAccountAlias(env);
|
|
58075
|
+
const sessionEstimate = estimateMaxSessions(cpus().length, Math.round(totalmem() / (1024 * 1024)));
|
|
58032
58076
|
return {
|
|
58033
58077
|
claude: { ...claude, account_alias: accountAlias, rate_limited_until: null },
|
|
58034
58078
|
codex: { ...codex, account_alias: accountAlias, rate_limited_until: null },
|
|
@@ -58041,7 +58085,10 @@ async function detectCapabilities(cliVersion, env, homeDir) {
|
|
|
58041
58085
|
...cliVersion ? { forge_build: cliVersion, seat_work: cliVersion, forge_merge: cliVersion } : {},
|
|
58042
58086
|
git,
|
|
58043
58087
|
gh,
|
|
58044
|
-
scheduler: {
|
|
58088
|
+
scheduler: {
|
|
58089
|
+
max_active_sessions: maxSessionsOverride ?? sessionEstimate,
|
|
58090
|
+
max_parallel_sessions_estimate: sessionEstimate
|
|
58091
|
+
},
|
|
58045
58092
|
host: { forge_disk_free_mb: forgeDiskFreeMb }
|
|
58046
58093
|
};
|
|
58047
58094
|
}
|
|
@@ -59388,7 +59435,7 @@ async function clearClaudeSessionId(stateFile, state, workOrder) {
|
|
|
59388
59435
|
await saveState(stateFile, state);
|
|
59389
59436
|
}
|
|
59390
59437
|
function usage() {
|
|
59391
|
-
return "Usage: rost runner serve [--name <text>] [--state-file <path>] [--heartbeat-ms <n>] [--interactive-claim-ms <n>] [--user-code <code>] [--runtime auto|claude|codex] [--once] [--execute]";
|
|
59438
|
+
return "Usage: rost runner serve [--name <text>] [--state-file <path>] [--heartbeat-ms <n>] [--interactive-claim-ms <n>] [--user-code <code>] [--runtime auto|claude|codex] [--max-sessions <n>] [--once] [--execute]";
|
|
59392
59439
|
}
|
|
59393
59440
|
|
|
59394
59441
|
// src/index.ts
|