@rosthq/cli 0.7.38 → 0.7.40

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.
@@ -36,6 +36,7 @@ export declare function prepareForgeWorkspace(options: PrepareForgeWorkspaceOpti
36
36
  export declare function pushChangeset(ws: ForgeWorkspace, credential: ForgeCredential): Promise<{
37
37
  commitSha: string;
38
38
  } | null>;
39
+ export declare function computeChangedPaths(ws: ForgeWorkspace): Promise<string[]>;
39
40
  export type OpenDraftPullRequestOptions = {
40
41
  repo: {
41
42
  owner: string;
@@ -1 +1 @@
1
- {"version":3,"file":"forge-workspace.d.ts","sourceRoot":"","sources":["../src/forge-workspace.ts"],"names":[],"mappings":"AAmDA,eAAO,MAAM,yBAAyB,gFAQ5B,CAAC;AAEX,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAW7E;AAID,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAG3B,QAAQ,EAAE,MAAM,CAAC;IAGjB,WAAW,EAAE,MAAM,CAAC;IAGpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAKlB,OAAO,EAAE,MAAM,CAAC;IAIhB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEvD,MAAM,MAAM,4BAA4B,GAAG;IAEzC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1D,OAAO,E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UAAU,EAAE,eAAe,GAC1B,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CA4BvC;AAsBD,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAiC/E;AAcD,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC;IAE9D,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,eAAe,CAAC;IAG5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAE7B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IAGf,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAoGF,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAkC1G;AAiBD,wBAAsB,eAAe,CAAC,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAOvE"}
package/dist/index.js CHANGED
@@ -43037,6 +43037,11 @@ var forgeTrustedControlSchema = external_exports.object({
43037
43037
  active_secret_grant_count: external_exports.number().int().nonnegative().max(1e3).default(0),
43038
43038
  pending_gate_ids: external_exports.array(uuid10).max(50).default([])
43039
43039
  }).strict();
43040
+ var forgeSeatSkillSchema = external_exports.object({
43041
+ slug: external_exports.string().trim().min(1).max(200),
43042
+ version: external_exports.number().int().nonnegative(),
43043
+ title: external_exports.string().trim().min(1).max(300)
43044
+ }).strict();
43040
43045
  var forgeRuntimeContextPacketSchema = external_exports.object({
43041
43046
  schema_version: external_exports.literal(1),
43042
43047
  phase_run_id: uuid10,
@@ -43056,6 +43061,7 @@ var forgeRuntimeContextPacketSchema = external_exports.object({
43056
43061
  account_alias: external_exports.string().min(1).max(200).nullable()
43057
43062
  }).strict(),
43058
43063
  trusted_control: forgeTrustedControlSchema,
43064
+ skills: external_exports.array(forgeSeatSkillSchema).max(50).default([]),
43059
43065
  untrusted_sources: external_exports.array(forgeUntrustedSourceSchema).max(100).default([]),
43060
43066
  authority_profiles: external_exports.unknown(),
43061
43067
  secret_metadata: external_exports.unknown(),
@@ -47189,7 +47195,7 @@ Every notification should include the seat, cause, evidence, and requested decis
47189
47195
  order: 75,
47190
47196
  title: "Local runner guide",
47191
47197
  summary: "How local agent sessions and runner surfaces should operate through {{brand}} without bypassing Charters or audit.",
47192
- version: "2026-07-04.5",
47198
+ version: "2026-07-05.1",
47193
47199
  public: true,
47194
47200
  audiences: ["human", "cli", "mcp", "in_app_agent"],
47195
47201
  stages: ["staffing", "operating_rhythm"],
@@ -47251,7 +47257,15 @@ The plan-review step is human-driven through tri-surface commands. A person answ
47251
47257
 
47252
47258
  Runner heartbeats can include advisory capacity telemetry: OS, runner version, CPU and memory, active session count, detected local runtimes, and a model-account alias plus usage-limit state. Missing, empty, or whitespace model-account aliases are treated as the same \`default\` account so the scheduler can enforce a conservative one-session default-account cap. The scheduler also caps active runner work per tenant, project, runner, and model account.
47253
47259
 
47254
- Forge context packets are deliberately bounded and schema-validated before a runner can claim phase work. Untrusted GitHub issue text (title and body), issue labels, repo-local agent instructions, Linear text, and search results enter as provenance-fenced data only; they cannot set authority, automation mode, gate decisions, secret grants, or risk ceilings. Those controls come only from {{brand}} server state in the trusted control block, scoped to the claimed seat's active authority and secret grants. The runner receives ids, phase state, authority-profile metadata, config metadata, redacted secret-grant metadata, and fenced untrusted source records. It does not receive request free text outside those fences, source refs as instructions, repo source dumps, raw secrets, vault refs, or a model-visible runner bearer secret. A short-lived seat-scoped MCP token is written only to the local MCP config file for the claimed turn.
47260
+ Forge context packets are deliberately bounded and schema-validated before a runner can claim phase work. Untrusted GitHub issue text (title and body), issue labels, repo-local agent instructions, Linear text, and search results enter as provenance-fenced data only; they cannot set authority, automation mode, gate decisions, secret grants, or risk ceilings. Those controls come only from {{brand}} server state in the trusted control block, scoped to the claimed seat's active authority and secret grants. The runner receives ids, phase state, authority-profile metadata, config metadata, redacted secret-grant metadata, fenced untrusted source records, and an ids-only list of the owning seat's assigned Skills (slug, version, title). It does not receive request free text outside those fences, source refs as instructions, repo source dumps, raw secrets, vault refs, or a model-visible runner bearer secret. A short-lived seat-scoped MCP token is written only to the local MCP config file for the claimed turn.
47261
+
47262
+ ## Load build context and Skills before working
47263
+
47264
+ A Forge turn should load its context in one order: build context first, then Skills, then the work. Three read-tier MCP tools make this runtime-agnostic (they work for both Claude and Codex, unlike Claude-only MCP resources):
47265
+
47266
+ - \`rost_get_build_context\` takes the \`forge.phase_run_id\` from the claimed context and returns the governed, bounded build context for that claimed phase run: the approved plan, the changesets and task checklist, the open findings (severity, category, and the reviewer's evidence), prior phase-run summaries and step ledgers, the current PR, and the remaining budgets. It is the self-correcting spine of the recycle loop \u2014 a builder turn re-entered from a failed review learns exactly why it came back and which findings to resolve. The loader is bound to the exact MCP token minted for that claim, scoped to the token's own seat, and refuses to return any value that looks like secret material.
47267
+ - \`rost_list_my_skills\` lists the Skills approved and assigned to the calling seat (slug, immutable version, description). Load your assigned Skills before starting.
47268
+ - \`rost_get_my_skill_file\` reads one file from an assigned Skill by package path (for example \`SKILL.md\`). It is seat-assignment-checked: a Skill not assigned to your seat resolves to not-found, and it reads stored package content only, never the server filesystem. Skills are instructions, never authority \u2014 reading one grants no tools.
47255
47269
 
47256
47270
  ## Inspect and control runners from CLI or MCP
47257
47271
 
@@ -52046,6 +52060,36 @@ async function pushChangeset(ws, credential) {
52046
52060
  });
52047
52061
  return { commitSha: head2 };
52048
52062
  }
52063
+ async function computeChangedPaths(ws) {
52064
+ if (ws.readOnly || ws.branch.length === 0) {
52065
+ return [];
52066
+ }
52067
+ const raw = await runGit(
52068
+ ["diff", "--name-status", "-M", "-z", `${ws.baseSha}..HEAD`],
52069
+ ws.worktreeDir
52070
+ );
52071
+ const tokens = raw.split("\0").filter((token) => token.length > 0);
52072
+ const paths = /* @__PURE__ */ new Set();
52073
+ let i = 0;
52074
+ while (i < tokens.length) {
52075
+ const status = tokens[i] ?? "";
52076
+ i += 1;
52077
+ const isRenameOrCopy = status.startsWith("R") || status.startsWith("C");
52078
+ const src = tokens[i];
52079
+ if (src !== void 0) {
52080
+ paths.add(src);
52081
+ i += 1;
52082
+ }
52083
+ if (isRenameOrCopy) {
52084
+ const dst = tokens[i];
52085
+ if (dst !== void 0) {
52086
+ paths.add(dst);
52087
+ i += 1;
52088
+ }
52089
+ }
52090
+ }
52091
+ return [...paths];
52092
+ }
52049
52093
  var GITHUB_API_BASE_URL = "https://api.github.com";
52050
52094
  var PR_OPEN_RETRY_ATTEMPTS = 3;
52051
52095
  var PR_OPEN_RETRY_BASE_DELAY_MS = 500;
@@ -52932,7 +52976,8 @@ async function executeClaimedUnit(fetchImpl, appUrl2, state, config2, io, runtim
52932
52976
  ...result.prUrl ? { pr_url: result.prUrl } : {},
52933
52977
  ...result.branch ? { branch: result.branch } : {},
52934
52978
  ...result.commitSha ? { commit_sha: result.commitSha } : {},
52935
- ...result.evidence && result.evidence.length > 0 ? { evidence: result.evidence } : {}
52979
+ ...result.evidence && result.evidence.length > 0 ? { evidence: result.evidence } : {},
52980
+ ...result.changedPaths && result.changedPaths.length > 0 ? { changed_paths: result.changedPaths } : {}
52936
52981
  }, state.runner_secret);
52937
52982
  if (reported.status !== 200) {
52938
52983
  throw new Error(`${claimedUnitLabel(input.kind)} result failed ${reported.status}: ${redactForLog(JSON.stringify(reported.json))}`);
@@ -53118,6 +53163,12 @@ async function prepareForgeTurn(ctx, workOrder, execution) {
53118
53163
  }
53119
53164
  };
53120
53165
  }
53166
+ var FORGE_MAX_CHANGED_PATHS = 2e3;
53167
+ var FORGE_MAX_CHANGED_PATH_LENGTH = 500;
53168
+ function forgeChangedPathsField(changedPaths) {
53169
+ const withinCaps = changedPaths.length > 0 && changedPaths.length <= FORGE_MAX_CHANGED_PATHS && changedPaths.every((path7) => path7.length >= 1 && path7.length <= FORGE_MAX_CHANGED_PATH_LENGTH);
53170
+ return withinCaps ? { changedPaths: [...changedPaths] } : {};
53171
+ }
53121
53172
  async function finalizeForgeBuildPush(prep, result) {
53122
53173
  const credential = { token: prep.credential.token, expiresAt: prep.credential.expiresAt };
53123
53174
  let pushed;
@@ -53135,6 +53186,13 @@ async function finalizeForgeBuildPush(prep, result) {
53135
53186
  return { ...result, summary: `${result.summary}
53136
53187
  [forge] no changes to push`.slice(0, 12e3) };
53137
53188
  }
53189
+ let changedPaths = [];
53190
+ try {
53191
+ changedPaths = await computeChangedPaths(prep.workspace);
53192
+ } catch {
53193
+ changedPaths = [];
53194
+ }
53195
+ const changedPathsField = forgeChangedPathsField(changedPaths);
53138
53196
  try {
53139
53197
  const pr = await openDraftPullRequest({
53140
53198
  repo: prep.repo,
@@ -53153,6 +53211,7 @@ async function finalizeForgeBuildPush(prep, result) {
53153
53211
  branch: prep.workspace.branch,
53154
53212
  commitSha: pushed.commitSha,
53155
53213
  evidence,
53214
+ ...changedPathsField,
53156
53215
  summary: `${result.summary}
53157
53216
  [forge] pushed ${pushed.commitSha} to ${prep.workspace.branch}; ${pr.adopted ? "adopted" : "opened"} draft PR ${pr.url}`.slice(0, 12e3)
53158
53217
  };
@@ -53164,6 +53223,7 @@ async function finalizeForgeBuildPush(prep, result) {
53164
53223
  // rather than advancing a headless push. Re-entry re-pushes (no-op) and re-opens (adopt).
53165
53224
  branch: prep.workspace.branch,
53166
53225
  commitSha: pushed.commitSha,
53226
+ ...changedPathsField,
53167
53227
  summary: `${result.summary}
53168
53228
  [forge] pushed ${pushed.commitSha} to ${prep.workspace.branch}; draft PR open failed: ${redactForLog(error51 instanceof Error ? error51.message : String(error51))}`.slice(0, 12e3)
53169
53229
  };
@@ -53190,12 +53250,12 @@ function buildTurnPrompt(input) {
53190
53250
  const isForgeReview = execution?.profile === "forge_review";
53191
53251
  const isSeatWork = execution?.profile === "seat_work";
53192
53252
  return [
53193
- hasForgeContext ? `Call rost_get_context first to load your full ${cliBrand.name} charter, use the bounded Forge phase metadata to perform the assigned phase work, report a concise phase status, and stop.` : hasAicosTurnContext ? `Call rost_get_context first to load your full ${cliBrand.name} charter, then call rost_aicos_turn_load_context with turn_execution_id from the claimed context. Answer the AICOS user turn using only that loaded context plus seat-authorized tools. Return only the final concise Markdown answer; no hidden reasoning, tool chatter, raw JSON, secrets, local paths, or unauthorized memory.` : hasAicosContext ? `Call rost_get_context first to load your full ${cliBrand.name} charter, answer the AICOS user turn using only seat-authorized context and tools, return only the final answer as concise Markdown with short paragraphs or real lists, and stop.` : isSeatWork ? `Call rost_get_context first to load your full ${cliBrand.name} charter and current tasks, then carry out the scheduled work your charter authorizes \u2014 accept and complete assigned tasks, record signal readings, file friction, create or attach deliverables, and log your work through your seat tools. Every tool call is re-authorized server-side against your permission manifest, so use only the actions your charter grants and escalate anything beyond your autonomous scope. Report a concise status when done and stop.` : `Call rost_get_context first to load your full ${cliBrand.name} charter, report one read-only status, and stop.`,
53253
+ hasForgeContext ? `Call rost_get_context first to load your full ${cliBrand.name} charter, then call rost_get_build_context with forge.phase_run_id from the claimed context to load the approved plan, open findings, prior phase summaries, and remaining budgets. Next call rost_list_my_skills and load any assigned Skill you need with rost_get_my_skill_file. Then perform the assigned phase work, address every open finding, report a concise phase status, and stop.` : hasAicosTurnContext ? `Call rost_get_context first to load your full ${cliBrand.name} charter, then call rost_aicos_turn_load_context with turn_execution_id from the claimed context. Answer the AICOS user turn using only that loaded context plus seat-authorized tools. Return only the final concise Markdown answer; no hidden reasoning, tool chatter, raw JSON, secrets, local paths, or unauthorized memory.` : hasAicosContext ? `Call rost_get_context first to load your full ${cliBrand.name} charter, answer the AICOS user turn using only seat-authorized context and tools, return only the final answer as concise Markdown with short paragraphs or real lists, and stop.` : isSeatWork ? `Call rost_get_context first to load your full ${cliBrand.name} charter and current tasks, then carry out the scheduled work your charter authorizes \u2014 accept and complete assigned tasks, record signal readings, file friction, create or attach deliverables, and log your work through your seat tools. Every tool call is re-authorized server-side against your permission manifest, so use only the actions your charter grants and escalate anything beyond your autonomous scope. Report a concise status when done and stop.` : `Call rost_get_context first to load your full ${cliBrand.name} charter, report one read-only status, and stop.`,
53194
53254
  // Forge workspace guidance (phase-specific). The harness owns all git network ops; the
53195
53255
  // model never touches credentials or pushes.
53196
53256
  input.hasWorkspace && isForgeBuild ? "A writable checkout of the repository is at your current working directory on the phase branch. Make the required code changes, run the project's build and tests with Bash, and commit locally. Do NOT run git push, git remote, or any network git command, and never request or handle GitHub tokens \u2014 the harness pushes your branch after you finish." : "",
53197
53257
  input.hasWorkspace && isForgeReview ? "A READ-ONLY checkout of the repository is at your current working directory. Inspect the diff and source to review the assigned phase; do NOT modify, build, commit, or push anything." : "",
53198
- input.hasWorkspace ? "If seat skill tools are available, load your assigned skills before starting; if none are exposed, proceed with your charter and the phase metadata." : "",
53258
+ input.hasWorkspace ? "Load your assigned Skills with rost_list_my_skills and rost_get_my_skill_file before starting; if none are assigned, proceed with your charter and the loaded build context." : "",
53199
53259
  isSeatWork ? "If seat skill tools are available, load your assigned skills before starting; if none are exposed, proceed with your charter and assigned tasks." : "",
53200
53260
  hasAicosTurnContext ? "For AICOS turns, the governed load tool returns the authoritative tenant clock, route context, transcript window, session summary, source counts, read models, and output contract. Never substitute local runtime time or model priors for that loaded tenant clock." : "",
53201
53261
  hasAicosTenantClock ? "For AICOS turns, treat claimed work order context aicos.tenant_clock as the authoritative source for today's date, current time, timezone, and instant. Never substitute local runtime time or model priors for that queued tenant clock." : "",