@korso/shepherd 0.4.2 → 0.4.4

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 +21 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -109,9 +109,17 @@ function createHubClient({
109
109
  clearTimeout(timer);
110
110
  }
111
111
  if (!response.ok) {
112
+ let detail = "";
113
+ try {
114
+ const data = await response.json();
115
+ if (data && typeof data === "object" && "error" in data && typeof data.error === "string") {
116
+ detail = `: ${data.error}`;
117
+ }
118
+ } catch {
119
+ }
112
120
  throw new HubRequestError(
113
121
  response.status,
114
- `Hub returned HTTP ${response.status} for ${path2}`
122
+ `Hub returned HTTP ${response.status} for ${path2}${detail}`
115
123
  );
116
124
  }
117
125
  return response.json();
@@ -357,6 +365,10 @@ var WorkspaceAnnouncement = z2.object({
357
365
  // (no agent session). The dashboard renders these as "me" (right-aligned).
358
366
  // Defaulted for version-skew safety with older hubs.
359
367
  fromAdmin: z2.boolean().default(false),
368
+ // True when an agent addressed the message TO the operator (the mirror of
369
+ // fromAdmin). The dashboard renders these as "<agent> → admin". Not delivered
370
+ // to other agents. Defaulted for version-skew safety with older hubs.
371
+ toAdmin: z2.boolean().default(false),
360
372
  createdAt: IsoTimestamp
361
373
  });
362
374
  var WorkspaceLandscapeResponse = z2.object({
@@ -421,7 +433,13 @@ var AnnounceRequest = z2.object({
421
433
  sessionId: z2.string().uuid(),
422
434
  body: z2.string().min(1).max(8192),
423
435
  // absent or null => broadcast to all agents in the workspace
424
- targetAgentName: z2.string().nullable().optional()
436
+ targetAgentName: z2.string().nullable().optional(),
437
+ // true => address the human operator (the dashboard) instead of agents. The
438
+ // mirror of the operator's admin → agent DM: it shows in the workspace feed as
439
+ // "<agent> → admin" and is NOT delivered to other agents. Mutually exclusive
440
+ // with targetAgentName (the hub rejects setting both). Defaulted/optional for
441
+ // version skew with older clients.
442
+ toAdmin: z2.boolean().optional()
425
443
  });
426
444
  var AnnounceResponse = z2.object({
427
445
  ok: z2.literal(true),
@@ -1058,7 +1076,7 @@ ${msgs}` : base }
1058
1076
  "announce",
1059
1077
  {
1060
1078
  title: "Broadcast a message to teammates",
1061
- description: "Broadcast a heads-up to the other agents, or direct a finding to a specific agent. This is awareness only \u2014 not a task assignment. To direct it, pass that agent's name (exactly as shown in the landscape) as targetAgentName; omit it to broadcast to everyone in the workspace. Delivery is best-effort: the recipient sees it on their next work/sync, once.",
1079
+ description: "Broadcast a heads-up to the other agents, direct a finding to a specific agent, or reply to the human operator. This is awareness only \u2014 not a task assignment. To direct it to an agent, pass that agent's EXACT name as shown in the landscape \u2014 including its numeric suffix (e.g. 'alex-rivera-2', NOT the bare handle 'alex-rivera') \u2014 as targetAgentName. Several agents can share one handle (alex-rivera-1, alex-rivera-2, \u2026); the suffix is what picks one, so the bare handle is rejected. The hub rejects any targetAgentName that doesn't match a live agent in your repo \u2014 if you mean the whole team, omit it to broadcast. To reply to the operator (the dashboard), pass toAdmin: true. targetAgentName and toAdmin are mutually exclusive. Delivery is best-effort: the recipient sees it on their next work/sync, once.",
1062
1080
  inputSchema: AnnounceAgentInput.shape
1063
1081
  },
1064
1082
  async (args) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@korso/shepherd",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "Shepherd MCP server — gives any MCP-capable agent (Claude Code, Codex, etc.) four advisory cross-session coordination tools (work/done/announce/sync) backed by the shared Shepherd hub. Joins the workspace automatically and ships standing instructions so the agent self-coordinates.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",