@schoolai/shipyard-mcp 0.2.2-next.485 → 0.2.2-next.487

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.
@@ -43793,6 +43793,29 @@ var GitHubPRResponseSchema = external_exports.object({
43793
43793
  merged: external_exports.boolean(),
43794
43794
  head: external_exports.object({ ref: external_exports.string() })
43795
43795
  });
43796
+ var ROUTES = {
43797
+ REGISTRY_LIST: "/registry",
43798
+ REGISTRY_REGISTER: "/register",
43799
+ REGISTRY_UNREGISTER: "/unregister",
43800
+ PLAN_STATUS: (planId) => `/api/plan/${planId}/status`,
43801
+ PLAN_HAS_CONNECTIONS: (planId) => `/api/plan/${planId}/has-connections`,
43802
+ PLAN_TRANSCRIPT: (planId) => `/api/plan/${planId}/transcript`,
43803
+ PLAN_SUBSCRIBE: (planId) => `/api/plan/${planId}/subscribe`,
43804
+ PLAN_CHANGES: (planId) => `/api/plan/${planId}/changes`,
43805
+ PLAN_UNSUBSCRIBE: (planId) => `/api/plan/${planId}/unsubscribe`,
43806
+ PLAN_PR_DIFF: (planId, prNumber) => `/api/plans/${planId}/pr-diff/${prNumber}`,
43807
+ PLAN_PR_FILES: (planId, prNumber) => `/api/plans/${planId}/pr-files/${prNumber}`,
43808
+ HOOK_SESSION: "/api/hook/session",
43809
+ HOOK_CONTENT: (planId) => `/api/hook/plan/${planId}/content`,
43810
+ HOOK_REVIEW: (planId) => `/api/hook/plan/${planId}/review`,
43811
+ HOOK_SESSION_TOKEN: (planId) => `/api/hook/plan/${planId}/session-token`,
43812
+ HOOK_PRESENCE: (planId) => `/api/hook/plan/${planId}/presence`,
43813
+ CONVERSATION_IMPORT: "/api/conversation/import",
43814
+ WEB_TASK: (planId) => `/task/${planId}`
43815
+ };
43816
+ function createPlanWebUrl(baseUrl, planId) {
43817
+ return `${baseUrl.replace(/\/$/, "")}${ROUTES.WEB_TASK(planId)}`;
43818
+ }
43796
43819
  var InviteTokenSchema = external_exports.object({
43797
43820
  id: external_exports.string(),
43798
43821
  tokenHash: external_exports.string(),
@@ -45750,7 +45773,7 @@ async function handleUpdatedPlanReview(sessionId, planId, planContent, _originMe
45750
45773
  }
45751
45774
  const baseUrl = webConfig.SHIPYARD_WEB_URL;
45752
45775
  logger.info(
45753
- { planId, url: `${baseUrl}/plan/${planId}` },
45776
+ { planId, url: createPlanWebUrl(baseUrl, planId) },
45754
45777
  "Content synced, browser already open. Waiting for server approval..."
45755
45778
  );
45756
45779
  const decision = await waitForReviewDecision(planId, "");
@@ -45907,7 +45930,7 @@ Reviewer comment: ${decision.reviewComment}` : "";
45907
45930
  allow: false,
45908
45931
  message: `Plan is pending review.
45909
45932
 
45910
- Open: ${baseUrl}/plan/${planId}`,
45933
+ Open: ${createPlanWebUrl(baseUrl, planId)}`,
45911
45934
  planId
45912
45935
  };
45913
45936
  case "draft":
@@ -45915,7 +45938,7 @@ Open: ${baseUrl}/plan/${planId}`,
45915
45938
  allow: false,
45916
45939
  message: `Plan is still in draft.
45917
45940
 
45918
- Submit for review at: ${baseUrl}/plan/${planId}`,
45941
+ Submit for review at: ${createPlanWebUrl(baseUrl, planId)}`,
45919
45942
  planId
45920
45943
  };
45921
45944
  case "in_progress":
@@ -3,7 +3,7 @@ import {
3
3
  YDOC_KEYS,
4
4
  createInputRequest,
5
5
  logPlanEvent
6
- } from "./chunk-BBYZISY2.js";
6
+ } from "./chunk-UFE5KX7E.js";
7
7
  import {
8
8
  logger
9
9
  } from "./chunk-GSGLHRWX.js";
@@ -2274,6 +2274,29 @@ function asWebRTCPeerId(id) {
2274
2274
  function asGitHubUsername(username) {
2275
2275
  return username;
2276
2276
  }
2277
+ var ROUTES = {
2278
+ REGISTRY_LIST: "/registry",
2279
+ REGISTRY_REGISTER: "/register",
2280
+ REGISTRY_UNREGISTER: "/unregister",
2281
+ PLAN_STATUS: (planId) => `/api/plan/${planId}/status`,
2282
+ PLAN_HAS_CONNECTIONS: (planId) => `/api/plan/${planId}/has-connections`,
2283
+ PLAN_TRANSCRIPT: (planId) => `/api/plan/${planId}/transcript`,
2284
+ PLAN_SUBSCRIBE: (planId) => `/api/plan/${planId}/subscribe`,
2285
+ PLAN_CHANGES: (planId) => `/api/plan/${planId}/changes`,
2286
+ PLAN_UNSUBSCRIBE: (planId) => `/api/plan/${planId}/unsubscribe`,
2287
+ PLAN_PR_DIFF: (planId, prNumber) => `/api/plans/${planId}/pr-diff/${prNumber}`,
2288
+ PLAN_PR_FILES: (planId, prNumber) => `/api/plans/${planId}/pr-files/${prNumber}`,
2289
+ HOOK_SESSION: "/api/hook/session",
2290
+ HOOK_CONTENT: (planId) => `/api/hook/plan/${planId}/content`,
2291
+ HOOK_REVIEW: (planId) => `/api/hook/plan/${planId}/review`,
2292
+ HOOK_SESSION_TOKEN: (planId) => `/api/hook/plan/${planId}/session-token`,
2293
+ HOOK_PRESENCE: (planId) => `/api/hook/plan/${planId}/presence`,
2294
+ CONVERSATION_IMPORT: "/api/conversation/import",
2295
+ WEB_TASK: (planId) => `/task/${planId}`
2296
+ };
2297
+ function createPlanWebUrl(baseUrl, planId) {
2298
+ return `${baseUrl.replace(/\/$/, "")}${ROUTES.WEB_TASK(planId)}`;
2299
+ }
2277
2300
  var InviteTokenSchema = z3.object({
2278
2301
  id: z3.string(),
2279
2302
  tokenHash: z3.string(),
@@ -2307,7 +2330,7 @@ function parseInviteFromUrl(url) {
2307
2330
  }
2308
2331
  function buildInviteUrl(baseUrl, planId, tokenId, tokenValue) {
2309
2332
  const normalizedBase = baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl;
2310
- const url = new URL(`${normalizedBase}/task/${planId}`);
2333
+ const url = new URL(`${normalizedBase}${ROUTES.WEB_TASK(planId)}`);
2311
2334
  url.searchParams.set("invite", `${tokenId}:${tokenValue}`);
2312
2335
  return url.toString();
2313
2336
  }
@@ -2588,25 +2611,6 @@ function getAllEventViewedByForPlan(ydoc, planId) {
2588
2611
  }
2589
2612
  return result;
2590
2613
  }
2591
- var ROUTES = {
2592
- REGISTRY_LIST: "/registry",
2593
- REGISTRY_REGISTER: "/register",
2594
- REGISTRY_UNREGISTER: "/unregister",
2595
- PLAN_STATUS: (planId) => `/api/plan/${planId}/status`,
2596
- PLAN_HAS_CONNECTIONS: (planId) => `/api/plan/${planId}/has-connections`,
2597
- PLAN_TRANSCRIPT: (planId) => `/api/plan/${planId}/transcript`,
2598
- PLAN_SUBSCRIBE: (planId) => `/api/plan/${planId}/subscribe`,
2599
- PLAN_CHANGES: (planId) => `/api/plan/${planId}/changes`,
2600
- PLAN_UNSUBSCRIBE: (planId) => `/api/plan/${planId}/unsubscribe`,
2601
- PLAN_PR_DIFF: (planId, prNumber) => `/api/plans/${planId}/pr-diff/${prNumber}`,
2602
- PLAN_PR_FILES: (planId, prNumber) => `/api/plans/${planId}/pr-files/${prNumber}`,
2603
- HOOK_SESSION: "/api/hook/session",
2604
- HOOK_CONTENT: (planId) => `/api/hook/plan/${planId}/content`,
2605
- HOOK_REVIEW: (planId) => `/api/hook/plan/${planId}/review`,
2606
- HOOK_SESSION_TOKEN: (planId) => `/api/hook/plan/${planId}/session-token`,
2607
- HOOK_PRESENCE: (planId) => `/api/hook/plan/${planId}/presence`,
2608
- CONVERSATION_IMPORT: "/api/conversation/import"
2609
- };
2610
2614
  function formatThreadsForLLM(threads, options = {}) {
2611
2615
  const { includeResolved = false, selectedTextMaxLength = 100, resolveUser } = options;
2612
2616
  const unresolvedThreads = threads.filter((t$1) => !t$1.resolved);
@@ -2947,6 +2951,8 @@ export {
2947
2951
  asAwarenessClientId,
2948
2952
  asWebRTCPeerId,
2949
2953
  asGitHubUsername,
2954
+ ROUTES,
2955
+ createPlanWebUrl,
2950
2956
  InviteTokenSchema,
2951
2957
  InviteRedemptionSchema,
2952
2958
  parseInviteFromUrl,
@@ -2987,7 +2993,6 @@ export {
2987
2993
  clearEventViewedBy,
2988
2994
  isEventUnread,
2989
2995
  getAllEventViewedByForPlan,
2990
- ROUTES,
2991
2996
  formatThreadsForLLM,
2992
2997
  PlanIdSchema,
2993
2998
  PlanStatusResponseSchema,
@@ -109,6 +109,7 @@ import {
109
109
  createPlanSnapshot,
110
110
  createPlanUrl,
111
111
  createPlanUrlWithHistory,
112
+ createPlanWebUrl,
112
113
  createUserResolver,
113
114
  declineInputRequest,
114
115
  decodeChunkMessage,
@@ -205,7 +206,7 @@ import {
205
206
  updateLinkedPRStatus,
206
207
  updatePlanIndexViewedBy,
207
208
  validateA2AMessages
208
- } from "./chunk-BBYZISY2.js";
209
+ } from "./chunk-UFE5KX7E.js";
209
210
  import "./chunk-JSBRDJBE.js";
210
211
  export {
211
212
  A2ADataPartSchema,
@@ -318,6 +319,7 @@ export {
318
319
  createPlanSnapshot,
319
320
  createPlanUrl,
320
321
  createPlanUrlWithHistory,
322
+ createPlanWebUrl,
321
323
  createUserResolver,
322
324
  declineInputRequest,
323
325
  decodeChunkMessage,
@@ -20,7 +20,7 @@ import {
20
20
  } from "./chunk-EBNL5ZX7.js";
21
21
  import {
22
22
  InputRequestManager
23
- } from "./chunk-NH6GXGQO.js";
23
+ } from "./chunk-B4TQH7Q3.js";
24
24
  import {
25
25
  ArtifactSchema,
26
26
  DeliverableSchema,
@@ -46,6 +46,7 @@ import {
46
46
  createLinkedPR,
47
47
  createPlanSnapshot,
48
48
  createPlanUrlWithHistory,
49
+ createPlanWebUrl,
49
50
  createUserResolver,
50
51
  extractDeliverables,
51
52
  extractMentions,
@@ -71,7 +72,7 @@ import {
71
72
  setPlanMetadata,
72
73
  touchPlanIndexEntry,
73
74
  transitionPlanStatus
74
- } from "./chunk-BBYZISY2.js";
75
+ } from "./chunk-UFE5KX7E.js";
75
76
  import {
76
77
  loadEnv,
77
78
  logger
@@ -592,8 +593,7 @@ function extractTitleFromBlocks(blocks) {
592
593
  async function createSessionHandler(input, ctx) {
593
594
  const existingSession = getSessionState(input.sessionId);
594
595
  if (existingSession) {
595
- const webUrl2 = webConfig.SHIPYARD_WEB_URL;
596
- const url2 = `${webUrl2}/plan/${existingSession.planId}`;
596
+ const url2 = createPlanWebUrl(webConfig.SHIPYARD_WEB_URL, existingSession.planId);
597
597
  ctx.logger.info(
598
598
  { planId: existingSession.planId, sessionId: input.sessionId },
599
599
  "Returning existing session (idempotent)"
@@ -658,8 +658,7 @@ async function createSessionHandler(input, ctx) {
658
658
  ownerId,
659
659
  deleted: false
660
660
  });
661
- const webUrl = webConfig.SHIPYARD_WEB_URL;
662
- const url = `${webUrl}/plan/${planId}`;
661
+ const url = createPlanWebUrl(webConfig.SHIPYARD_WEB_URL, planId);
663
662
  ctx.logger.info({ url }, "Plan URL generated");
664
663
  setSessionState(input.sessionId, {
665
664
  lifecycle: "created",
@@ -838,8 +837,7 @@ async function setSessionTokenHandler(planId, sessionTokenHash, ctx) {
838
837
  setPlanMetadata(ydoc, {
839
838
  sessionTokenHash
840
839
  });
841
- const webUrl = webConfig.SHIPYARD_WEB_URL;
842
- const url = `${webUrl}/plan/${planId}`;
840
+ const url = createPlanWebUrl(webConfig.SHIPYARD_WEB_URL, planId);
843
841
  const session = getSessionStateByPlanId(planId);
844
842
  const sessionId = getSessionIdByPlanId(planId);
845
843
  if (session && sessionId) {
@@ -1019,7 +1017,7 @@ async function waitForApprovalHandler(planId, _reviewRequestIdParam, ctx) {
1019
1017
  setSessionState(sessionId, {
1020
1018
  lifecycle: "approved_awaiting_token",
1021
1019
  ...baseState,
1022
- url: `${webUrl}/plan/${baseState.planId}`,
1020
+ url: createPlanWebUrl(webUrl, baseState.planId),
1023
1021
  approvedAt: extraData.approvedAt,
1024
1022
  deliverables: extraData.deliverables,
1025
1023
  reviewComment,
@@ -1038,7 +1036,7 @@ async function waitForApprovalHandler(planId, _reviewRequestIdParam, ctx) {
1038
1036
  ...baseState,
1039
1037
  contentHash: syncedFields?.contentHash ?? "",
1040
1038
  sessionToken: syncedFields?.sessionToken ?? "",
1041
- url: syncedFields?.url ?? `${webUrl}/plan/${baseState.planId}`,
1039
+ url: syncedFields?.url ?? createPlanWebUrl(webUrl, baseState.planId),
1042
1040
  deliverables,
1043
1041
  reviewComment: reviewComment || "",
1044
1042
  reviewedBy,
@@ -1231,8 +1229,7 @@ async function getDeliverableContextHandler(planId, sessionToken, ctx) {
1231
1229
  });
1232
1230
  }
1233
1231
  const deliverables = getDeliverables(ydoc);
1234
- const webUrl = webConfig.SHIPYARD_WEB_URL;
1235
- const url = `${webUrl}/plan/${planId}`;
1232
+ const url = createPlanWebUrl(webConfig.SHIPYARD_WEB_URL, planId);
1236
1233
  let deliverablesSection = "";
1237
1234
  if (deliverables.length > 0) {
1238
1235
  deliverablesSection = `
@@ -3630,7 +3627,7 @@ Bad deliverables (not provable):
3630
3627
  deleted: false
3631
3628
  });
3632
3629
  logger.info({ planId }, "Plan index updated");
3633
- const url = `${webConfig.SHIPYARD_WEB_URL}/plan/${planId}`;
3630
+ const url = createPlanWebUrl(webConfig.SHIPYARD_WEB_URL, planId);
3634
3631
  await openPlanInBrowser(planId, url);
3635
3632
  const repoInfo = repo ? `Repo: ${repo}${!input.repo ? " (auto-detected)" : ""}` : "Repo: Not set (provide repo and prNumber for artifact uploads)";
3636
3633
  return {
@@ -5386,7 +5383,7 @@ async function setupReviewNotification(planId, pollIntervalSeconds) {
5386
5383
  return { script, fullResponse: text };
5387
5384
  }
5388
5385
  async function requestUserInput(opts) {
5389
- const { InputRequestManager: InputRequestManager2 } = await import("./input-request-manager-3STPPPYU.js");
5386
+ const { InputRequestManager: InputRequestManager2 } = await import("./input-request-manager-IMVZDMUQ.js");
5390
5387
  const ydoc = await getOrCreateDoc3(PLAN_INDEX_DOC_NAME);
5391
5388
  const manager = new InputRequestManager2();
5392
5389
  const params = opts.type === "choice" ? {
@@ -5430,7 +5427,7 @@ async function requestUserInput(opts) {
5430
5427
  };
5431
5428
  }
5432
5429
  async function postActivityUpdate(opts) {
5433
- const { logPlanEvent: logPlanEvent2 } = await import("./dist-D4DG2R4R.js");
5430
+ const { logPlanEvent: logPlanEvent2 } = await import("./dist-E4CPV3SO.js");
5434
5431
  const { getGitHubUsername: getGitHubUsername2 } = await import("./server-identity-LSZ4CZRK.js");
5435
5432
  const { nanoid: nanoid8 } = await import("nanoid");
5436
5433
  const doc = await getOrCreateDoc3(opts.planId);
@@ -5453,7 +5450,7 @@ async function postActivityUpdate(opts) {
5453
5450
  return { success: true, eventId, requestId };
5454
5451
  }
5455
5452
  async function resolveActivityRequest(opts) {
5456
- const { logPlanEvent: logPlanEvent2, getPlanEvents } = await import("./dist-D4DG2R4R.js");
5453
+ const { logPlanEvent: logPlanEvent2, getPlanEvents } = await import("./dist-E4CPV3SO.js");
5457
5454
  const { getGitHubUsername: getGitHubUsername2 } = await import("./server-identity-LSZ4CZRK.js");
5458
5455
  const doc = await getOrCreateDoc3(opts.planId);
5459
5456
  const actorName = await getGitHubUsername2();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  InputRequestManager
3
- } from "./chunk-NH6GXGQO.js";
4
- import "./chunk-BBYZISY2.js";
3
+ } from "./chunk-B4TQH7Q3.js";
4
+ import "./chunk-UFE5KX7E.js";
5
5
  import "./chunk-GSGLHRWX.js";
6
6
  import "./chunk-JSBRDJBE.js";
7
7
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schoolai/shipyard-mcp",
3
- "version": "0.2.2-next.485",
3
+ "version": "0.2.2-next.487",
4
4
  "description": "Shipyard MCP server and CLI tools for distributed planning with CRDTs",
5
5
  "type": "module",
6
6
  "bin": {