@adhdev/mesh-shared 1.0.82-rc.47 → 1.0.82-rc.48

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/index.js CHANGED
@@ -221,6 +221,7 @@ __export(index_exports, {
221
221
  VIEWER_TO_SHARED_SESSION_TYPES: () => VIEWER_TO_SHARED_SESSION_TYPES,
222
222
  WORKER_BRANCH_STATES: () => WORKER_BRANCH_STATES,
223
223
  WORKER_COMMITS_MAX: () => WORKER_COMMITS_MAX,
224
+ WORKER_CURRENT_BRANCH_RULE: () => WORKER_CURRENT_BRANCH_RULE,
224
225
  WORKER_DECISIONS_NEEDED_MAX: () => WORKER_DECISIONS_NEEDED_MAX,
225
226
  WORKER_PROTOCOL_FOOTER_MARKER: () => WORKER_PROTOCOL_FOOTER_MARKER,
226
227
  WORKER_REPORT_OUTCOMES: () => WORKER_REPORT_OUTCOMES,
@@ -352,6 +353,7 @@ __export(index_exports, {
352
353
  isInputEnvelopeWire: () => isInputEnvelopeWire,
353
354
  isLaunchDefaultRole: () => isLaunchDefaultRole,
354
355
  isLaunchDefaultSource: () => isLaunchDefaultSource,
356
+ isLightWorkerSession: () => isLightWorkerSession,
355
357
  isMeshDeliveryMode: () => isMeshDeliveryMode,
356
358
  isMeshIndexQueryResponse: () => isMeshIndexQueryResponse,
357
359
  isMeshMissionStatusValue: () => isMeshMissionStatusValue,
@@ -2225,6 +2227,7 @@ function renderLightWorkspaceRules(light) {
2225
2227
  light.ownedPaths.length ? `Stay inside \`owned_paths\` (${light.ownedPaths.join(", ")}); if you must touch more, say why in the summary.` : "Stay inside the paths the task names; if you must touch more, say why in the summary."
2226
2228
  ];
2227
2229
  }
2230
+ var WORKER_CURRENT_BRANCH_RULE = "Commit your change on the branch that is currently checked out in this workspace. Do not create or switch branches (no `git checkout -b` / `git switch`) unless the task explicitly says to; report the branch you committed on.";
2228
2231
  function hasWorkerProtocolFooter(body) {
2229
2232
  return typeof body === "string" && body.includes(WORKER_PROTOCOL_FOOTER_MARKER);
2230
2233
  }
@@ -2247,6 +2250,7 @@ function renderWorkerProtocolFooter(input = {}) {
2247
2250
  if (scope.length) lines.push(`You are a delegated worker (${scope.join(", ")}).`);
2248
2251
  else lines.push("You are a delegated worker.");
2249
2252
  if (input.light) lines.push(...renderLightWorkspaceRules(input.light));
2253
+ else if (input.commitOnCurrentBranch && input.stage?.role !== "review") lines.push(WORKER_CURRENT_BRANCH_RULE);
2250
2254
  if (input.workerMcp === false) {
2251
2255
  lines.push(
2252
2256
  "This session has NO adhdev worker tools (`report_completion`, `progress_update`, `peer_context_pull`, `git_*`) \u2014 do not look for them. When your work is finished, blocked, or has failed, end your turn with a plain final summary: what you did, what you found, which files you changed, and where you left the branch. That final message is what the coordinator receives.",
@@ -4777,6 +4781,12 @@ var LIGHT_BLOCK_REASONS = [
4777
4781
  var LIGHT_WARNINGS = ["shared_checkout_changed_during_task", "light_base_dirty_overlap"];
4778
4782
  var LIGHT_LAND_MODES = ["refine", "apply_to_checkout"];
4779
4783
  var LIGHT_TESTS_RUN_MAX = 20;
4784
+ function isLightWorkerSession(session) {
4785
+ const s = session;
4786
+ if (!s || typeof s !== "object") return false;
4787
+ const has = (o) => !!o && typeof o === "object" && typeof o.lightWorkspaceId === "string" && o.lightWorkspaceId.trim() !== "";
4788
+ return has(s.settings) || has(s.launchRecord?.settings) || has(s);
4789
+ }
4780
4790
 
4781
4791
  // src/relay-reprobe.ts
4782
4792
  var RELAY_REPROBE_BASE_DELAY_MS = 6e4;
@@ -5343,6 +5353,7 @@ function formatStageVerdictLine(input) {
5343
5353
  VIEWER_TO_SHARED_SESSION_TYPES,
5344
5354
  WORKER_BRANCH_STATES,
5345
5355
  WORKER_COMMITS_MAX,
5356
+ WORKER_CURRENT_BRANCH_RULE,
5346
5357
  WORKER_DECISIONS_NEEDED_MAX,
5347
5358
  WORKER_PROTOCOL_FOOTER_MARKER,
5348
5359
  WORKER_REPORT_OUTCOMES,
@@ -5474,6 +5485,7 @@ function formatStageVerdictLine(input) {
5474
5485
  isInputEnvelopeWire,
5475
5486
  isLaunchDefaultRole,
5476
5487
  isLaunchDefaultSource,
5488
+ isLightWorkerSession,
5477
5489
  isMeshDeliveryMode,
5478
5490
  isMeshIndexQueryResponse,
5479
5491
  isMeshMissionStatusValue,