@rosthq/cli 0.7.112 → 0.7.113
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/forge-workspace.d.ts +3 -1
- package/dist/forge-workspace.d.ts.map +1 -1
- package/dist/index.js +74 -10
- package/dist/index.js.map +3 -3
- package/dist/runner-sandbox.d.ts +1 -1
- package/dist/runner-sandbox.d.ts.map +1 -1
- package/dist/runner-serve.d.ts +1 -0
- package/dist/runner-serve.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type StepLedger } from "./step-ledger.js";
|
|
2
2
|
export declare const MODEL_SPAWN_ENV_ALLOWLIST: readonly ["PATH", "HOME", "USER", "LANG", "LC_ALL", "TMPDIR", "SHELL", "NODE_OPTIONS"];
|
|
3
|
-
export declare function buildModelSpawnEnv(base: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
3
|
+
export declare function buildModelSpawnEnv(base: NodeJS.ProcessEnv, claudeConfigDir?: string): NodeJS.ProcessEnv;
|
|
4
|
+
export declare function resolveSourceClaudeConfigDir(base: NodeJS.ProcessEnv): string;
|
|
5
|
+
export declare function provisionIsolatedClaudeConfigDir(base: NodeJS.ProcessEnv, configDir: string): Promise<string>;
|
|
4
6
|
export type ForgeCredential = {
|
|
5
7
|
token: string;
|
|
6
8
|
expiresAt: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forge-workspace.d.ts","sourceRoot":"","sources":["../src/forge-workspace.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"forge-workspace.d.ts","sourceRoot":"","sources":["../src/forge-workspace.ts"],"names":[],"mappings":"AA4CA,OAAO,EAAqB,KAAK,UAAU,EAAiB,MAAM,kBAAkB,CAAC;AASrF,eAAO,MAAM,yBAAyB,wFAc5B,CAAC;AAEX,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,CAAC,UAAU,EAOvB,eAAe,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CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAE9C;IAAE,MAAM,EAAE,QAAQ,CAAA;CAAE,CAAC;AAQzB,wBAAsB,gBAAgB,CAAC,OAAO,EAAE;IAC9C,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,qBAAqB,CAAC;IAC7B,UAAU,EAAE,eAAe,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAwC7B;AAID,wBAAsB,0BAA0B,CAAC,OAAO,EAAE;IACxD,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,eAAe,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBhB;AAgBD,wBAAsB,kBAAkB,CAAC,EAAE,EAAE,cAAc,EAAE,UAAU,EAAE,eAAe,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CA0BxH;AAiBD,wBAAsB,eAAe,CAAC,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAOvE"}
|
package/dist/index.js
CHANGED
|
@@ -38746,6 +38746,7 @@ var catalogEntries = CATALOG_ENTRIES.map(enrichCatalogEntry);
|
|
|
38746
38746
|
var catalogById = new Map(catalogEntries.map((entry) => [entry.id, entry]));
|
|
38747
38747
|
|
|
38748
38748
|
// ../../packages/protocol/src/skills.ts
|
|
38749
|
+
var SKILL_DESCRIPTION_MAX_CHARS = 500;
|
|
38749
38750
|
var skillVisibilitySchema = external_exports.enum(["private", "seat", "tenant"]);
|
|
38750
38751
|
var skillStatusSchema = external_exports.enum(["draft", "pending_review", "published", "archived"]);
|
|
38751
38752
|
var skillSourceTypeSchema = external_exports.enum([
|
|
@@ -38762,12 +38763,14 @@ var skillCatalogTierSchema = external_exports.enum(["free", "pro", "enterprise",
|
|
|
38762
38763
|
var skillLocalClientSchema = external_exports.enum(["claude-code", "codex", "cursor"]);
|
|
38763
38764
|
var skillSlugSchema = external_exports.string().regex(/^[a-z0-9][a-z0-9-]{1,80}$/);
|
|
38764
38765
|
var skillNameSchema = external_exports.string().trim().min(1).max(120);
|
|
38765
|
-
var
|
|
38766
|
+
var skillApplicationShape = {
|
|
38766
38767
|
domain: external_exports.string().trim().min(1).max(80).optional(),
|
|
38767
38768
|
summary: external_exports.string().trim().min(1).max(500),
|
|
38768
38769
|
best_for: external_exports.array(external_exports.string().trim().min(1).max(160)).max(20).default([]),
|
|
38769
38770
|
not_for: external_exports.array(external_exports.string().trim().min(1).max(160)).max(20).default([])
|
|
38770
|
-
}
|
|
38771
|
+
};
|
|
38772
|
+
var skillApplicationSchema = external_exports.object(skillApplicationShape).strict();
|
|
38773
|
+
var skillApplicationInputSchema = external_exports.object(skillApplicationShape);
|
|
38771
38774
|
var skillToolDependencySchema = external_exports.object({
|
|
38772
38775
|
tool: external_exports.string().trim().min(1).max(120),
|
|
38773
38776
|
min_scope_tier: toolScopeTierSchema,
|
|
@@ -38787,7 +38790,7 @@ var skillValidationIssueSchema = external_exports.object({
|
|
|
38787
38790
|
var normalizedSkillPackageSchema = external_exports.object({
|
|
38788
38791
|
slug: skillSlugSchema,
|
|
38789
38792
|
name: skillNameSchema,
|
|
38790
|
-
description: external_exports.string().trim().min(1).max(
|
|
38793
|
+
description: external_exports.string().trim().min(1).max(SKILL_DESCRIPTION_MAX_CHARS),
|
|
38791
38794
|
visibility: skillVisibilitySchema,
|
|
38792
38795
|
application: skillApplicationSchema,
|
|
38793
38796
|
frontmatter: external_exports.record(external_exports.string(), external_exports.unknown()),
|
|
@@ -55804,7 +55807,8 @@ var RUNNER_ASKPASS_DIR = path4.join(tmpdir(), "rost-runner-askpass");
|
|
|
55804
55807
|
var RUNNER_TEMP_PREFIXES = [
|
|
55805
55808
|
"rost-runner-mcp-",
|
|
55806
55809
|
"rost-runner-sandbox-",
|
|
55807
|
-
"rost-runner-askpass-"
|
|
55810
|
+
"rost-runner-askpass-",
|
|
55811
|
+
"rost-runner-claude-config-"
|
|
55808
55812
|
];
|
|
55809
55813
|
var RUNNER_TEMP_STARTUP_SWEEP_MAX_AGE_MS = 60 * 60 * 1e3;
|
|
55810
55814
|
var RUNNER_TEMP_TURN_SWEEP_MAX_AGE_MS = 45 * 60 * 1e3;
|
|
@@ -56901,7 +56905,7 @@ function parseSemver2(value) {
|
|
|
56901
56905
|
import { execFile as execFileCallback5, spawn } from "node:child_process";
|
|
56902
56906
|
import { createHash as createHash2 } from "node:crypto";
|
|
56903
56907
|
import { constants as fsConstants2 } from "node:fs";
|
|
56904
|
-
import { access as access3, chmod as chmod2, mkdir as mkdir5, readFile as
|
|
56908
|
+
import { access as access3, chmod as chmod2, mkdir as mkdir5, readFile as readFile6, rename, rm as rm5, statfs, writeFile as writeFile5 } from "node:fs/promises";
|
|
56905
56909
|
import { cpus, homedir as homedir4, hostname as hostname3, platform, totalmem, tmpdir as tmpdir2 } from "node:os";
|
|
56906
56910
|
import path7 from "node:path";
|
|
56907
56911
|
import { setTimeout as sleep3 } from "node:timers/promises";
|
|
@@ -56910,7 +56914,8 @@ import { promisify as promisify5 } from "node:util";
|
|
|
56910
56914
|
// src/forge-workspace.ts
|
|
56911
56915
|
import { execFile as execFileCallback4 } from "node:child_process";
|
|
56912
56916
|
import { createHash } from "node:crypto";
|
|
56913
|
-
import { chmod, lstat, mkdir as mkdir4, mkdtemp, realpath, rm as rm4, stat as stat3, writeFile as writeFile4 } from "node:fs/promises";
|
|
56917
|
+
import { chmod, lstat, mkdir as mkdir4, mkdtemp, readFile as readFile5, realpath, rm as rm4, stat as stat3, writeFile as writeFile4 } from "node:fs/promises";
|
|
56918
|
+
import os2 from "node:os";
|
|
56914
56919
|
import path6 from "node:path";
|
|
56915
56920
|
import { setTimeout as sleep2 } from "node:timers/promises";
|
|
56916
56921
|
import { promisify as promisify4 } from "node:util";
|
|
@@ -56989,7 +56994,7 @@ var MODEL_SPAWN_ENV_ALLOWLIST = [
|
|
|
56989
56994
|
"SHELL",
|
|
56990
56995
|
"NODE_OPTIONS"
|
|
56991
56996
|
];
|
|
56992
|
-
function buildModelSpawnEnv(base) {
|
|
56997
|
+
function buildModelSpawnEnv(base, claudeConfigDir) {
|
|
56993
56998
|
const out = {};
|
|
56994
56999
|
for (const key of MODEL_SPAWN_ENV_ALLOWLIST) {
|
|
56995
57000
|
const value = base[key];
|
|
@@ -56997,8 +57002,36 @@ function buildModelSpawnEnv(base) {
|
|
|
56997
57002
|
out[key] = value;
|
|
56998
57003
|
}
|
|
56999
57004
|
}
|
|
57005
|
+
if (typeof claudeConfigDir === "string" && claudeConfigDir.length > 0) {
|
|
57006
|
+
out.CLAUDE_CONFIG_DIR = claudeConfigDir;
|
|
57007
|
+
}
|
|
57000
57008
|
return out;
|
|
57001
57009
|
}
|
|
57010
|
+
var CLAUDE_CONFIG_AUTH_FILES = [".credentials.json", ".claude.json"];
|
|
57011
|
+
function resolveSourceClaudeConfigDir(base) {
|
|
57012
|
+
const explicit = base.CLAUDE_CONFIG_DIR;
|
|
57013
|
+
if (typeof explicit === "string" && explicit.length > 0) {
|
|
57014
|
+
return explicit;
|
|
57015
|
+
}
|
|
57016
|
+
const home = base.HOME;
|
|
57017
|
+
const homeDir = typeof home === "string" && home.length > 0 ? home : os2.homedir();
|
|
57018
|
+
return path6.join(homeDir, ".claude");
|
|
57019
|
+
}
|
|
57020
|
+
async function provisionIsolatedClaudeConfigDir(base, configDir) {
|
|
57021
|
+
await mkdir4(configDir, { recursive: true, mode: 448 });
|
|
57022
|
+
await chmod(configDir, 448);
|
|
57023
|
+
const source = resolveSourceClaudeConfigDir(base);
|
|
57024
|
+
for (const file2 of CLAUDE_CONFIG_AUTH_FILES) {
|
|
57025
|
+
try {
|
|
57026
|
+
const data = await readFile5(path6.join(source, file2));
|
|
57027
|
+
const dest = path6.join(configDir, file2);
|
|
57028
|
+
await writeFile4(dest, data, { mode: 384 });
|
|
57029
|
+
await chmod(dest, 384);
|
|
57030
|
+
} catch {
|
|
57031
|
+
}
|
|
57032
|
+
}
|
|
57033
|
+
return configDir;
|
|
57034
|
+
}
|
|
57002
57035
|
var GIT_HARDENING_ARGS = [
|
|
57003
57036
|
"-c",
|
|
57004
57037
|
"core.hooksPath=/dev/null",
|
|
@@ -58192,7 +58225,7 @@ async function pairIfNeeded(client, fetchImpl, appUrl2, config2, io) {
|
|
|
58192
58225
|
}
|
|
58193
58226
|
async function loadState(filePath, expectedTenantId) {
|
|
58194
58227
|
try {
|
|
58195
|
-
const parsed = JSON.parse(await
|
|
58228
|
+
const parsed = JSON.parse(await readFile6(filePath, "utf8"));
|
|
58196
58229
|
if (typeof parsed.runner_id === "string" && typeof parsed.runner_secret === "string") {
|
|
58197
58230
|
if (expectedTenantId && parsed.tenant_id !== expectedTenantId) {
|
|
58198
58231
|
return null;
|
|
@@ -58659,6 +58692,9 @@ function resolveTurnPlan(input) {
|
|
|
58659
58692
|
return {
|
|
58660
58693
|
profile: "read_status",
|
|
58661
58694
|
claudeAllowedTools: [...input.kind === "turn_execution" ? RUNNER_AICOS_TURN_TOOLS : RUNNER_WORK_ORDER_TOOLS],
|
|
58695
|
+
// DER-2104: the read stub is MCP-only — no local built-ins. `--tools ""` now enforces
|
|
58696
|
+
// that (previously nothing did, so a stub turn silently inherited full local access).
|
|
58697
|
+
localBuiltinTools: [],
|
|
58662
58698
|
codexSandbox: "read-only",
|
|
58663
58699
|
outputFormat: input.kind === "turn_execution" ? "json" : "text",
|
|
58664
58700
|
repoDir: null,
|
|
@@ -58673,6 +58709,9 @@ function resolveTurnPlan(input) {
|
|
|
58673
58709
|
...execution.allowed_mcp_tools.map(claudeMcpToolName),
|
|
58674
58710
|
...claudeLocalToolsFor(execution.local_tools)
|
|
58675
58711
|
],
|
|
58712
|
+
// DER-2104: the same built-in set, but as the `--tools` HARD whitelist (not the
|
|
58713
|
+
// auto-approve list). `none` → `[]` → `--tools ""` → zero built-ins for a seat_work turn.
|
|
58714
|
+
localBuiltinTools: claudeLocalToolsFor(execution.local_tools),
|
|
58676
58715
|
codexSandbox: execution.local_tools === "workspace_write" ? "workspace-write" : "read-only",
|
|
58677
58716
|
// Forge build/review turns emit a structured JSON envelope (reusing the AICOS
|
|
58678
58717
|
// --output-format json pattern) so their summary is a real contract, not a stdout slice.
|
|
@@ -58722,8 +58761,19 @@ function buildTurnCommand(input) {
|
|
|
58722
58761
|
"--mcp-config",
|
|
58723
58762
|
configPath,
|
|
58724
58763
|
"--strict-mcp-config",
|
|
58764
|
+
// DER-2104: --tools is the HARD built-in whitelist. `--tools ""` (empty join for
|
|
58765
|
+
// local_tools "none") removes Bash/Read/Write/Edit/… entirely, and the operator's
|
|
58766
|
+
// settings.json cannot widen it — the real enforcement of `local_tools`. --allowedTools
|
|
58767
|
+
// stays as the auto-approve list for the governed MCP + any declared local built-ins.
|
|
58768
|
+
"--tools",
|
|
58769
|
+
plan.localBuiltinTools.join(","),
|
|
58725
58770
|
"--allowedTools",
|
|
58726
58771
|
plan.claudeAllowedTools.join(","),
|
|
58772
|
+
// DER-2104: unattended turns must never wait on a prompt — dontAsk auto-denies any tool
|
|
58773
|
+
// call that would otherwise prompt. Governed MCP tools and the declared local built-ins
|
|
58774
|
+
// are in --allowedTools (auto-approved, never prompt), so this only denies the unexpected.
|
|
58775
|
+
"--permission-mode",
|
|
58776
|
+
"dontAsk",
|
|
58727
58777
|
"--output-format",
|
|
58728
58778
|
plan.outputFormat,
|
|
58729
58779
|
// DER-1397: turn off Claude Code's own nested Bash sandbox when the outer seatbelt confines
|
|
@@ -58975,6 +59025,10 @@ async function spawnRunnerTurn(ctx, workOrder, runtime, kind) {
|
|
|
58975
59025
|
await writeFile5(configPath, `${mcpConfig}
|
|
58976
59026
|
`, { mode: 384 });
|
|
58977
59027
|
await chmod2(configPath, 384);
|
|
59028
|
+
const claudeConfigDir = runtime === "claude" ? await provisionIsolatedClaudeConfigDir(
|
|
59029
|
+
process.env,
|
|
59030
|
+
path7.join(tmpdir2(), `rost-runner-claude-config-${createHash2("sha256").update(`${configPath}:cfg`).digest("hex").slice(0, 16)}`)
|
|
59031
|
+
) : null;
|
|
58978
59032
|
const resumeSessionId = runtime === "claude" ? getClaudeResumeSessionId(ctx.state, workOrder) : void 0;
|
|
58979
59033
|
const built = buildTurnCommand({
|
|
58980
59034
|
runtime,
|
|
@@ -59003,7 +59057,7 @@ async function spawnRunnerTurn(ctx, workOrder, runtime, kind) {
|
|
|
59003
59057
|
// A Forge turn's cwd is its worktree; every other turn stays in tmpdir.
|
|
59004
59058
|
cwd: plan.repoDir ?? tmpdir2(),
|
|
59005
59059
|
timeoutMs: plan.timeoutMs,
|
|
59006
|
-
env: buildModelSpawnEnv(process.env),
|
|
59060
|
+
env: buildModelSpawnEnv(process.env, claudeConfigDir ?? void 0),
|
|
59007
59061
|
expectSessionEnvelope,
|
|
59008
59062
|
resumeSessionId,
|
|
59009
59063
|
// T1.6: only Forge turns carry a structured evidence contract worth parsing.
|
|
@@ -59032,6 +59086,9 @@ async function spawnRunnerTurn(ctx, workOrder, runtime, kind) {
|
|
|
59032
59086
|
if (sandboxProfilePath) {
|
|
59033
59087
|
void rm5(sandboxProfilePath, { force: true });
|
|
59034
59088
|
}
|
|
59089
|
+
if (claudeConfigDir) {
|
|
59090
|
+
void rm5(claudeConfigDir, { recursive: true, force: true });
|
|
59091
|
+
}
|
|
59035
59092
|
void sweepOrphanedTurnTempFiles();
|
|
59036
59093
|
if (forgePrep) {
|
|
59037
59094
|
if (plan.profile === "forge_build" && result.ok && forgePrep.credential.canPush) {
|
|
@@ -59179,6 +59236,10 @@ async function spawnMergeConflictModel(ctx, input) {
|
|
|
59179
59236
|
await writeFile5(configPath, `${mcpConfig}
|
|
59180
59237
|
`, { mode: 384 });
|
|
59181
59238
|
await chmod2(configPath, 384);
|
|
59239
|
+
const claudeConfigDir = input.runtime === "claude" ? await provisionIsolatedClaudeConfigDir(
|
|
59240
|
+
process.env,
|
|
59241
|
+
path7.join(tmpdir2(), `rost-runner-claude-config-${createHash2("sha256").update(`${configPath}:cfg`).digest("hex").slice(0, 16)}`)
|
|
59242
|
+
) : null;
|
|
59182
59243
|
const plan = resolveTurnPlan({ kind: "work_order", execution: input.execution, repoDir: input.workspace.worktreeDir });
|
|
59183
59244
|
const prompt = [
|
|
59184
59245
|
"You are resolving a merge conflict on a pull request branch so it can merge into the base branch.",
|
|
@@ -59208,7 +59269,7 @@ async function spawnMergeConflictModel(ctx, input) {
|
|
|
59208
59269
|
cwd: input.workspace.worktreeDir,
|
|
59209
59270
|
timeoutMs: plan.timeoutMs,
|
|
59210
59271
|
// The model gets the EXPLICIT allowlist env — never the merge token, GIT_ASKPASS, or the bearer.
|
|
59211
|
-
env: buildModelSpawnEnv(process.env),
|
|
59272
|
+
env: buildModelSpawnEnv(process.env, claudeConfigDir ?? void 0),
|
|
59212
59273
|
expectSessionEnvelope: false
|
|
59213
59274
|
});
|
|
59214
59275
|
const exitClass = classifyModelExit(result);
|
|
@@ -59224,6 +59285,9 @@ async function spawnMergeConflictModel(ctx, input) {
|
|
|
59224
59285
|
if (sandboxProfilePath) {
|
|
59225
59286
|
void rm5(sandboxProfilePath, { force: true });
|
|
59226
59287
|
}
|
|
59288
|
+
if (claudeConfigDir) {
|
|
59289
|
+
void rm5(claudeConfigDir, { recursive: true, force: true });
|
|
59290
|
+
}
|
|
59227
59291
|
void sweepOrphanedTurnTempFiles();
|
|
59228
59292
|
return result;
|
|
59229
59293
|
}
|