@korso/shepherd 0.11.0 → 0.11.1

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.
Files changed (2) hide show
  1. package/dist/index.js +14 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1723,8 +1723,12 @@ ${nudge}` : text;
1723
1723
  syncToolSurface();
1724
1724
  }
1725
1725
  let joinFailure = null;
1726
+ let joinFailureTransient = false;
1727
+ let targetWorkspaceSlug = null;
1728
+ let gateRetry = null;
1726
1729
  let joinInFlight = Promise.resolve();
1727
1730
  async function activate(workspaceSlug) {
1731
+ targetWorkspaceSlug = workspaceSlug;
1728
1732
  if (sessionId !== null && activeWorkspaceSlug === workspaceSlug) {
1729
1733
  return { ok: true };
1730
1734
  }
@@ -1744,6 +1748,7 @@ ${nudge}` : text;
1744
1748
  const parsed = JoinResponse.safeParse(raw);
1745
1749
  if (!parsed.success || !parsed.data.sessionId) {
1746
1750
  joinFailure = "validation";
1751
+ joinFailureTransient = false;
1747
1752
  console.error(
1748
1753
  "[shepherd] join failed (validation): hub returned a malformed join response (no usable sessionId)"
1749
1754
  );
@@ -1759,10 +1764,12 @@ ${nudge}` : text;
1759
1764
  linked = true;
1760
1765
  hostedWorkspaceRejected = false;
1761
1766
  joinFailure = null;
1767
+ joinFailureTransient = false;
1762
1768
  return { ok: true };
1763
1769
  } catch (err) {
1764
1770
  const reason = classifyActivateFailure(err);
1765
1771
  joinFailure = classifyJoinFailure(err);
1772
+ joinFailureTransient = err instanceof HubUnreachable || err instanceof HubRequestError && reason === "unknown";
1766
1773
  if (reason === "workspaceRejected") {
1767
1774
  hostedWorkspaceRejected = true;
1768
1775
  console.error(
@@ -1823,6 +1830,13 @@ ${nudge}` : text;
1823
1830
  await awaitJoin();
1824
1831
  if (!linked) return notLinked();
1825
1832
  if (selfHostMismatch || hostedWorkspaceRejected) return workspaceMismatch();
1833
+ if (sessionId === null && targetWorkspaceSlug !== null && joinFailureTransient) {
1834
+ gateRetry ??= activate(targetWorkspaceSlug).finally(() => {
1835
+ gateRetry = null;
1836
+ });
1837
+ await gateRetry;
1838
+ if (hostedWorkspaceRejected) return workspaceMismatch();
1839
+ }
1826
1840
  if (sessionId === null) return sessionNotReady();
1827
1841
  return null;
1828
1842
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@korso/shepherd",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "Shepherd MCP server — gives any MCP-capable agent (Claude Code, Codex, etc.) advisory cross-session coordination tools (work/done/announce/sync, plus link/unlink/decline) backed by the shared Shepherd hub. Joins the workspace automatically and ships standing instructions so the agent self-coordinates.",
5
5
  "homepage": "https://github.com/Korso-AI/shepherd#readme",
6
6
  "bugs": {