@schoolai/shipyard-mcp 0.2.2-next.507 → 0.2.2-next.508

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.
@@ -28490,383 +28490,18 @@ init_cjs_shims();
28490
28490
 
28491
28491
  // ../../packages/shared/dist/instructions/index.mjs
28492
28492
  init_cjs_shims();
28493
- var CRITICAL_USAGE_SECTION = `## CRITICAL: When to Use Shipyard
28494
-
28495
- \u26A0\uFE0F **MANDATORY USAGE RULE:**
28496
-
28497
- If Shipyard is available, you MUST use it for:
28498
- - Creating implementation plans
28499
- - Tracking work that needs human review
28500
- - Documenting proof of work (screenshots, videos, test results)
28501
- - ANY user request involving "plan", "track", "verify", or "prove"
28502
-
28503
- **DO NOT:**
28504
- - Create plans manually in chat or as markdown files
28505
- - Write implementation docs yourself when Shipyard is available
28506
- - Suggest alternatives to Shipyard for trackable work
28507
- - Overthink whether to use it - WHEN IN DOUBT, USE SHIPYARD
28508
-
28509
- **Decision Tree:**
28510
- \`\`\`
28511
- Need to create/track/verify work?
28512
- \u2502
28513
- \u25BC
28514
- Shipyard available?
28515
- \u2502 \u2502
28516
- YES NO
28517
- \u2502 \u2502
28518
- \u25BC \u25BC
28519
- USE IT Manual approach
28520
- NOW (tell user why)
28521
- \`\`\``;
28522
- var DELIVERABLES_SECTION = `## What are Deliverables?
28523
-
28524
- Deliverables are measurable outcomes you can **prove** with artifacts (screenshots, videos, test results).
28525
-
28526
- **Good deliverables (provable):**
28527
- \`\`\`
28528
- - [ ] Screenshot of working login page {#deliverable}
28529
- - [ ] Video showing drag-and-drop feature {#deliverable}
28530
- - [ ] Test results showing all tests pass {#deliverable}
28531
- \`\`\`
28532
-
28533
- **Bad deliverables (not provable - these are tasks, not deliverables):**
28534
- \`\`\`
28535
- - [ ] Implement getUserMedia API \u2190 Implementation detail, not provable
28536
- - [ ] Add error handling \u2190 Can't capture this with an artifact
28537
- - [ ] Refactor authentication \u2190 Too vague, no visual proof
28538
- \`\`\`
28539
-
28540
- **Rule:** If you can't screenshot/record/export it, it's not a deliverable.`;
28541
- var ARTIFACT_TYPES_SECTION = `## Artifact Types
28542
-
28543
- | Type | Use For | File Formats |
28544
- |------|---------|--------------|
28545
- | \`screenshot\` | UI changes, visual proof, error states | .png, .jpg, .webp |
28546
- | \`video\` | Complex flows, interactions, animations | .mp4, .webm |
28547
- | \`test_results\` | Test output, coverage reports | .json, .txt, .xml |
28548
- | \`diff\` | Code changes, before/after comparisons | .diff, .patch |`;
28549
- var TIPS_SECTION = `## Tips for Effective Use
28550
-
28551
- 1. **Plan deliverables first** - Decide what proves success before coding
28552
- 2. **Capture during work** - Take screenshots as you implement, not after
28553
- 3. **Be specific** - "Login page with error state" beats "Screenshot"
28554
- 4. **Link every artifact** - Always set \`deliverableId\` for auto-completion
28555
- 5. **Check feedback** - Read reviewer comments and iterate`;
28556
- var WHEN_NOT_TO_USE_SECTION = `## When NOT to Use Shipyard
28557
-
28558
- Skip Shipyard for:
28559
- - Quick answers or research questions (no artifacts to capture)
28560
- - Internal refactoring with no visible output
28561
- - Tasks where proof adds no value (trivial fixes)
28562
- - Exploration or debugging sessions
28563
- - Pure documentation without implementation`;
28564
- var TROUBLESHOOTING_SECTION = `## Troubleshooting
28565
-
28566
- **Browser doesn't open:** Check MCP server is running and accessible.
28567
-
28568
- **Upload fails:** Verify file path exists. For GitHub uploads, check \`GITHUB_TOKEN\` has repo write access.
28569
-
28570
- **No auto-complete:** Ensure every deliverable has an artifact with matching \`deliverableId\`.
28571
-
28572
- **Plan not syncing:** Check WebSocket connection to registry server.`;
28573
- var COMMON_INSTRUCTIONS = [
28574
- CRITICAL_USAGE_SECTION,
28575
- DELIVERABLES_SECTION,
28576
- ARTIFACT_TYPES_SECTION,
28577
- TIPS_SECTION,
28578
- WHEN_NOT_TO_USE_SECTION,
28579
- TROUBLESHOOTING_SECTION
28580
- ].join("\n\n");
28581
- var CLAUDE_CODE_HEADER = `[SHIPYARD] Collaborative planning with human review & proof-of-work tracking.`;
28582
- var PLAN_MODE_WORKFLOW = `## How to Use (Claude Code with Hooks)
28583
-
28584
- You have the **full Shipyard experience** with automatic hooks. Use native plan mode:
28585
-
28586
- ### Workflow
28587
-
28588
- 1. **Enter plan mode** (Shift+Tab) \u2192 Browser opens with live plan automatically
28589
- 2. **Write your plan** with \`{#deliverable}\` markers for provable outcomes
28590
- 3. **Exit plan mode** \u2192 Hook **BLOCKS** until human approves or requests changes
28591
- 4. **On approval** \u2192 You automatically receive: planId, sessionToken, deliverable IDs
28592
- 5. **Do the work** \u2192 Take screenshots/videos as you implement
28593
- 6. **Upload artifacts** \u2192 \`add_artifact(filePath, deliverableId)\` for each deliverable
28594
- 7. **Auto-complete** \u2192 When all deliverables have artifacts, task completes with snapshot URL
28595
-
28596
- ### After Approval
28597
-
28598
- You only need ONE tool: \`add_artifact\`
28599
-
28600
- The hook automatically injects everything you need (planId, sessionToken, deliverables).
28601
- Just call \`add_artifact\` with the file path and deliverable ID.
28602
-
28603
- \`\`\`typescript
28604
- // Example: After approval, you'll have these in context
28605
- // planId: "abc123"
28606
- // sessionToken: "xyz..."
28607
- // deliverables: [{ id: "del_xxx", text: "Screenshot of login" }]
28608
-
28609
- await addArtifact({
28610
- planId,
28611
- sessionToken,
28612
- type: 'screenshot',
28613
- filename: 'login-page.png',
28614
- source: 'file',
28615
- filePath: '/tmp/screenshot.png',
28616
- deliverableId: deliverables[0].id
28617
- });
28618
- \`\`\`
28619
-
28620
- When the last deliverable gets an artifact, the task auto-completes and returns a snapshot URL.`;
28621
- var IMPORTANT_NOTES = `## Important Notes for Claude Code
28622
-
28623
- - **DO NOT call \`createPlan()\` directly** - The hook handles plan creation when you enter plan mode
28624
- - **DO NOT use the Shipyard skill** - The hook provides everything you need
28625
- - **DO NOT poll for approval** - The hook blocks automatically until human decides
28626
- - **DO use plan mode** for ANY work that needs tracking, verification, or human review`;
28627
- var CLAUDE_CODE_INSTRUCTIONS = [
28628
- CLAUDE_CODE_HEADER,
28629
- "",
28630
- CRITICAL_USAGE_SECTION,
28631
- "",
28632
- PLAN_MODE_WORKFLOW,
28633
- "",
28634
- DELIVERABLES_SECTION,
28635
- "",
28636
- ARTIFACT_TYPES_SECTION,
28637
- "",
28638
- IMPORTANT_NOTES,
28639
- "",
28640
- TIPS_SECTION,
28641
- "",
28642
- WHEN_NOT_TO_USE_SECTION,
28643
- "",
28644
- TROUBLESHOOTING_SECTION
28645
- ].join("\n");
28646
- var MCP_DIRECT_HEADER = `# Shipyard: Verified Work Tasks
28647
-
28648
- > **MCP Integration:** Use \`execute_code\` to call Shipyard APIs. This skill teaches the workflow.
28649
-
28650
- Shipyard turns invisible agent work into reviewable, verifiable tasks. Instead of trusting that code was written correctly, reviewers see screenshots, videos, and test results as proof.`;
28651
- var MCP_TOOLS_OVERVIEW = `## Available MCP Tools
28652
-
28653
- | Tool | Purpose |
28654
- |------|---------|
28655
- | \`execute_code\` | Run TypeScript that calls Shipyard APIs (recommended) |
28656
- | \`request_user_input\` | Ask user questions via browser modal |
28657
-
28658
- **Preferred approach:** Use \`execute_code\` to chain multiple API calls in one step.`;
28659
- var MCP_WORKFLOW = `## Workflow (MCP Direct)
28660
-
28661
- ### Step 1: Create Plan
28662
-
28663
- \`\`\`typescript
28664
- const plan = await createPlan({
28665
- title: "Add user authentication",
28666
- content: \`
28667
- ## Deliverables
28668
- - [ ] Screenshot of login page {#deliverable}
28669
- - [ ] Screenshot of error handling {#deliverable}
28670
-
28671
- ## Implementation
28672
- 1. Create login form component
28673
- 2. Add validation
28674
- 3. Connect to auth API
28675
- \`
28676
- });
28677
-
28678
- const { planId, sessionToken, deliverables, monitoringScript } = plan;
28679
- // deliverables = [{ id: "del_xxx", text: "Screenshot of login page" }, ...]
28680
- \`\`\`
28681
-
28682
- ### Step 2: Wait for Approval
28683
-
28684
- For platforms without hooks, run the monitoring script in the background:
28685
-
28686
- \`\`\`bash
28687
- # The monitoringScript polls for approval status
28688
- # Run it in background while you wait
28689
- bash <(echo "$monitoringScript") &
28690
- \`\`\`
28691
-
28692
- Or poll manually:
28693
-
28694
- \`\`\`typescript
28695
- const status = await readPlan(planId, sessionToken);
28696
- if (status.status === "in_progress") {
28697
- // Approved! Proceed with work
28698
- }
28699
- if (status.status === "changes_requested") {
28700
- // Read feedback, make changes
28701
- }
28702
- \`\`\`
28703
-
28704
- ### Step 3: Do the Work
28705
-
28706
- Implement the feature, taking screenshots/recordings as you go.
28707
-
28708
- ### Step 4: Upload Artifacts
28709
-
28710
- \`\`\`typescript
28711
- await addArtifact({
28712
- planId,
28713
- sessionToken,
28714
- type: 'screenshot',
28715
- filename: 'login-page.png',
28716
- source: 'file',
28717
- filePath: '/path/to/screenshot.png',
28718
- deliverableId: deliverables[0].id // Links to specific deliverable
28719
- });
28720
-
28721
- const result = await addArtifact({
28722
- planId,
28723
- sessionToken,
28724
- type: 'screenshot',
28725
- filename: 'error-handling.png',
28726
- source: 'file',
28727
- filePath: '/path/to/error.png',
28728
- deliverableId: deliverables[1].id
28729
- });
28730
-
28731
- // Auto-complete triggers when ALL deliverables have artifacts
28732
- if (result.allDeliverablesComplete) {
28733
- console.log('Done!', result.snapshotUrl);
28734
- }
28735
- \`\`\``;
28736
- var API_REFERENCE = `## API Reference
28737
-
28738
- ### createPlan(options)
28739
-
28740
- Creates a new plan and opens it in the browser.
28741
28493
 
28742
- **Parameters:**
28743
- - \`title\` (string) - Plan title
28744
- - \`content\` (string) - Markdown content with \`{#deliverable}\` markers
28745
- - \`repo\` (string, optional) - GitHub repo for artifact storage
28746
- - \`prNumber\` (number, optional) - PR number to link
28494
+ // ../../packages/schema/dist/index.mjs
28495
+ init_cjs_shims();
28747
28496
 
28748
- **Returns:** \`{ planId, sessionToken, url, deliverables, monitoringScript }\`
28497
+ // ../../packages/schema/dist/yjs-helpers-Dg3vErAn.mjs
28498
+ init_cjs_shims();
28749
28499
 
28750
- ### readPlan(planId, sessionToken, options?)
28500
+ // ../../packages/schema/dist/plan.mjs
28501
+ init_cjs_shims();
28751
28502
 
28752
- Reads current plan state.
28753
-
28754
- **Parameters:**
28755
- - \`planId\` (string) - Plan ID
28756
- - \`sessionToken\` (string) - Session token from createPlan
28757
- - \`options.includeAnnotations\` (boolean) - Include reviewer comments
28758
-
28759
- **Returns:** \`{ content, status, title, deliverables }\`
28760
-
28761
- ### addArtifact(options)
28762
-
28763
- Uploads proof-of-work artifact.
28764
-
28765
- **Parameters:**
28766
- - \`planId\` (string) - Plan ID
28767
- - \`sessionToken\` (string) - Session token
28768
- - \`type\` ('screenshot' | 'video' | 'test_results' | 'diff')
28769
- - \`filename\` (string) - File name
28770
- - \`source\` ('file' | 'url' | 'base64')
28771
- - \`filePath\` (string) - Local file path (when source='file')
28772
- - \`deliverableId\` (string, optional) - Links artifact to deliverable
28773
-
28774
- **Returns:** \`{ artifactId, url, allDeliverablesComplete, snapshotUrl? }\`
28775
-
28776
- ### requestUserInput(options)
28777
-
28778
- Asks user a question via browser modal.
28779
-
28780
- **Parameters:**
28781
- - \`message\` (string) - Question to ask
28782
- - \`type\` (string) - Input type (see below)
28783
- - \`options\` (string[], for 'choice') - Available choices
28784
- - \`timeout\` (number, optional) - Timeout in seconds
28785
- - Type-specific parameters (min, max, format, etc.)
28786
-
28787
- **Returns:** \`{ success, response?, status }\`
28788
-
28789
- **Supported types (8 total):**
28790
- 1. \`text\` - Single-line text
28791
- 2. \`multiline\` - Multi-line text area
28792
- 3. \`choice\` - Radio/checkbox/dropdown (auto-adds "Other" option)
28793
- - Auto-switches: 1-8 options = radio/checkbox, 9+ = dropdown
28794
- - \`multiSelect: true\` for checkboxes
28795
- - \`displayAs: 'dropdown'\` to force dropdown UI
28796
- 4. \`confirm\` - Yes/No buttons
28797
- 5. \`number\` - Numeric input with validation
28798
- - \`min\`, \`max\`, \`format\` ('integer' | 'decimal' | 'currency' | 'percentage')
28799
- 6. \`email\` - Email validation
28800
- - \`domain\` for restriction
28801
- 7. \`date\` - Date picker with range
28802
- - \`minDate\`, \`maxDate\` (YYYY-MM-DD format)
28803
- 8. \`rating\` - Scale rating (auto-selects stars/numbers)
28804
- - \`min\`, \`max\`, \`style\` ('stars' | 'numbers' | 'emoji'), \`labels\`
28805
-
28806
- **Response format:**
28807
- - All responses are strings
28808
- - choice (single): \`"PostgreSQL"\` or custom text from "Other"
28809
- - choice (multi): \`"option1, option2"\` (comma-space separated)
28810
- - confirm: \`"yes"\` or \`"no"\` (lowercase)
28811
- - number: \`"42"\` or \`"3.14"\`
28812
- - email: \`"user@example.com"\`
28813
- - date: \`"2026-01-24"\` (ISO 8601)
28814
- - rating: \`"4"\` (integer as string)
28815
- - See docs/INPUT-RESPONSE-FORMATS.md for complete specification`;
28816
- var HANDLING_FEEDBACK = `## Handling Reviewer Feedback
28817
-
28818
- \`\`\`typescript
28819
- const status = await readPlan(planId, sessionToken, {
28820
- includeAnnotations: true
28821
- });
28822
-
28823
- if (status.status === "changes_requested") {
28824
- // Read the content for inline comments
28825
- console.log(status.content);
28826
-
28827
- // Make changes based on feedback
28828
- // Upload new artifacts
28829
- // Plan will transition back to pending_review
28830
- }
28831
- \`\`\``;
28832
- var MCP_DIRECT_INSTRUCTIONS = [
28833
- MCP_DIRECT_HEADER,
28834
- "",
28835
- CRITICAL_USAGE_SECTION,
28836
- "",
28837
- MCP_TOOLS_OVERVIEW,
28838
- "",
28839
- MCP_WORKFLOW,
28840
- "",
28841
- DELIVERABLES_SECTION,
28842
- "",
28843
- ARTIFACT_TYPES_SECTION,
28844
- "",
28845
- API_REFERENCE,
28846
- "",
28847
- HANDLING_FEEDBACK,
28848
- "",
28849
- TIPS_SECTION,
28850
- "",
28851
- WHEN_NOT_TO_USE_SECTION,
28852
- "",
28853
- TROUBLESHOOTING_SECTION
28854
- ].join("\n");
28855
-
28856
- // src/adapters/claude-code.ts
28857
- init_cjs_shims();
28858
-
28859
- // ../../packages/schema/dist/index.mjs
28860
- init_cjs_shims();
28861
-
28862
- // ../../packages/schema/dist/yjs-helpers-Dg3vErAn.mjs
28863
- init_cjs_shims();
28864
-
28865
- // ../../packages/schema/dist/plan.mjs
28866
- init_cjs_shims();
28867
-
28868
- // ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/index.js
28869
- init_cjs_shims();
28503
+ // ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/index.js
28504
+ init_cjs_shims();
28870
28505
 
28871
28506
  // ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/external.js
28872
28507
  var external_exports = {};
@@ -44446,6 +44081,20 @@ function truncate(text, maxLength) {
44446
44081
  if (cleaned.length <= maxLength) return cleaned;
44447
44082
  return `${cleaned.slice(0, maxLength)}...`;
44448
44083
  }
44084
+ var TOOL_NAMES = {
44085
+ ADD_ARTIFACT: "add_artifact",
44086
+ ADD_PR_REVIEW_COMMENT: "add_pr_review_comment",
44087
+ COMPLETE_TASK: "complete_task",
44088
+ CREATE_PLAN: "create_plan",
44089
+ EXECUTE_CODE: "execute_code",
44090
+ LINK_PR: "link_pr",
44091
+ READ_PLAN: "read_plan",
44092
+ REGENERATE_SESSION_TOKEN: "regenerate_session_token",
44093
+ REQUEST_USER_INPUT: "request_user_input",
44094
+ SETUP_REVIEW_NOTIFICATION: "setup_review_notification",
44095
+ UPDATE_BLOCK_CONTENT: "update_block_content",
44096
+ UPDATE_PLAN: "update_plan"
44097
+ };
44449
44098
  var PlanIdSchema = external_exports.object({ planId: external_exports.string().min(1) });
44450
44099
  var PlanStatusResponseSchema = external_exports.object({ status: external_exports.string() });
44451
44100
  var HasConnectionsResponseSchema = external_exports.object({ hasConnections: external_exports.boolean() });
@@ -44557,86 +44206,520 @@ var hookRouter = router({
44557
44206
  return ctx.hookHandlers.getSessionContext(input.sessionId, ctx);
44558
44207
  })
44559
44208
  });
44560
- var planRouter = router({
44561
- getStatus: publicProcedure.input(PlanIdSchema).output(PlanStatusResponseSchema).query(async ({ input, ctx }) => {
44562
- const metadata = getPlanMetadata(await ctx.getOrCreateDoc(input.planId));
44563
- if (!metadata) throw new TRPCError({
44564
- code: "NOT_FOUND",
44565
- message: "Plan not found"
44566
- });
44567
- return { status: metadata.status };
44568
- }),
44569
- hasConnections: publicProcedure.input(PlanIdSchema).output(HasConnectionsResponseSchema).query(async ({ input, ctx }) => {
44570
- return { hasConnections: await ctx.getPlanStore().hasActiveConnections(input.planId) };
44571
- }),
44572
- getLocalChanges: publicProcedure.input(PlanIdSchema).output(LocalChangesResultSchema).query(async ({ input, ctx }) => {
44573
- const metadata = getPlanMetadata(await ctx.getOrCreateDoc(input.planId));
44574
- if (!metadata) throw new TRPCError({
44575
- code: "NOT_FOUND",
44576
- message: "Plan not found"
44577
- });
44578
- const origin = metadata.origin;
44579
- const cwd = origin?.platform === "claude-code" ? origin.cwd : void 0;
44580
- if (!cwd) return {
44581
- available: false,
44582
- reason: "no_cwd",
44583
- message: "Plan has no associated working directory. Local changes are only available for plans created with working directory metadata."
44584
- };
44585
- return ctx.getLocalChanges(cwd);
44586
- }),
44587
- getFileContent: publicProcedure.input(external_exports.object({
44588
- planId: PlanIdSchema.shape.planId,
44589
- filePath: external_exports.string()
44590
- })).output(external_exports.object({
44591
- content: external_exports.string().nullable(),
44592
- error: external_exports.string().optional()
44593
- })).query(async ({ input, ctx }) => {
44594
- const metadata = getPlanMetadata(await ctx.getOrCreateDoc(input.planId));
44595
- if (!metadata) throw new TRPCError({
44596
- code: "NOT_FOUND",
44597
- message: "Plan not found"
44598
- });
44599
- const origin = metadata.origin;
44600
- const cwd = origin?.platform === "claude-code" ? origin.cwd : void 0;
44601
- if (!cwd) return {
44602
- content: null,
44603
- error: "No working directory available"
44604
- };
44605
- return ctx.getFileContent(cwd, input.filePath);
44606
- })
44209
+ var planRouter = router({
44210
+ getStatus: publicProcedure.input(PlanIdSchema).output(PlanStatusResponseSchema).query(async ({ input, ctx }) => {
44211
+ const metadata = getPlanMetadata(await ctx.getOrCreateDoc(input.planId));
44212
+ if (!metadata) throw new TRPCError({
44213
+ code: "NOT_FOUND",
44214
+ message: "Plan not found"
44215
+ });
44216
+ return { status: metadata.status };
44217
+ }),
44218
+ hasConnections: publicProcedure.input(PlanIdSchema).output(HasConnectionsResponseSchema).query(async ({ input, ctx }) => {
44219
+ return { hasConnections: await ctx.getPlanStore().hasActiveConnections(input.planId) };
44220
+ }),
44221
+ getLocalChanges: publicProcedure.input(PlanIdSchema).output(LocalChangesResultSchema).query(async ({ input, ctx }) => {
44222
+ const metadata = getPlanMetadata(await ctx.getOrCreateDoc(input.planId));
44223
+ if (!metadata) throw new TRPCError({
44224
+ code: "NOT_FOUND",
44225
+ message: "Plan not found"
44226
+ });
44227
+ const origin = metadata.origin;
44228
+ const cwd = origin?.platform === "claude-code" ? origin.cwd : void 0;
44229
+ if (!cwd) return {
44230
+ available: false,
44231
+ reason: "no_cwd",
44232
+ message: "Plan has no associated working directory. Local changes are only available for plans created with working directory metadata."
44233
+ };
44234
+ return ctx.getLocalChanges(cwd);
44235
+ }),
44236
+ getFileContent: publicProcedure.input(external_exports.object({
44237
+ planId: PlanIdSchema.shape.planId,
44238
+ filePath: external_exports.string()
44239
+ })).output(external_exports.object({
44240
+ content: external_exports.string().nullable(),
44241
+ error: external_exports.string().optional()
44242
+ })).query(async ({ input, ctx }) => {
44243
+ const metadata = getPlanMetadata(await ctx.getOrCreateDoc(input.planId));
44244
+ if (!metadata) throw new TRPCError({
44245
+ code: "NOT_FOUND",
44246
+ message: "Plan not found"
44247
+ });
44248
+ const origin = metadata.origin;
44249
+ const cwd = origin?.platform === "claude-code" ? origin.cwd : void 0;
44250
+ if (!cwd) return {
44251
+ content: null,
44252
+ error: "No working directory available"
44253
+ };
44254
+ return ctx.getFileContent(cwd, input.filePath);
44255
+ })
44256
+ });
44257
+ var subscriptionRouter = router({
44258
+ create: publicProcedure.input(PlanIdSchema.merge(CreateSubscriptionRequestSchema)).output(CreateSubscriptionResponseSchema).mutation(async ({ input, ctx }) => {
44259
+ const { planId, subscribe, windowMs, maxWindowMs, threshold } = input;
44260
+ return { clientId: ctx.getPlanStore().createSubscription({
44261
+ planId,
44262
+ subscribe: subscribe || ["status"],
44263
+ windowMs: windowMs ?? 5e3,
44264
+ maxWindowMs: maxWindowMs ?? 3e4,
44265
+ threshold: threshold ?? 1
44266
+ }) };
44267
+ }),
44268
+ getChanges: publicProcedure.input(SubscriptionClientIdSchema).output(ChangesResponseSchema).query(async ({ input, ctx }) => {
44269
+ const { planId, clientId } = input;
44270
+ const result = ctx.getPlanStore().getChanges(planId, clientId);
44271
+ if (!result) throw new TRPCError({
44272
+ code: "NOT_FOUND",
44273
+ message: "Subscription not found"
44274
+ });
44275
+ return result;
44276
+ }),
44277
+ delete: publicProcedure.input(SubscriptionClientIdSchema).output(DeleteSubscriptionResponseSchema).mutation(async ({ input, ctx }) => {
44278
+ const { planId, clientId } = input;
44279
+ return { success: ctx.getPlanStore().deleteSubscription(planId, clientId) };
44280
+ })
44281
+ });
44282
+ var appRouter = router({
44283
+ hook: hookRouter,
44284
+ plan: planRouter,
44285
+ subscription: subscriptionRouter,
44286
+ conversation: conversationRouter
44287
+ });
44288
+
44289
+ // ../../packages/shared/dist/instructions/index.mjs
44290
+ var CRITICAL_USAGE_SECTION = `## CRITICAL: When to Use Shipyard
44291
+
44292
+ \u26A0\uFE0F **MANDATORY USAGE RULE:**
44293
+
44294
+ If Shipyard is available, you MUST use it for:
44295
+ - Creating implementation plans
44296
+ - Tracking work that needs human review
44297
+ - Documenting proof of work (screenshots, videos, test results)
44298
+ - ANY user request involving "plan", "track", "verify", or "prove"
44299
+
44300
+ **DO NOT:**
44301
+ - Create plans manually in chat or as markdown files
44302
+ - Write implementation docs yourself when Shipyard is available
44303
+ - Suggest alternatives to Shipyard for trackable work
44304
+ - Overthink whether to use it - WHEN IN DOUBT, USE SHIPYARD
44305
+
44306
+ **Decision Tree:**
44307
+ \`\`\`
44308
+ Need to create/track/verify work?
44309
+ \u2502
44310
+ \u25BC
44311
+ Shipyard available?
44312
+ \u2502 \u2502
44313
+ YES NO
44314
+ \u2502 \u2502
44315
+ \u25BC \u25BC
44316
+ USE IT Manual approach
44317
+ NOW (tell user why)
44318
+ \`\`\``;
44319
+ var DELIVERABLES_SECTION = `## What are Deliverables?
44320
+
44321
+ Deliverables are measurable outcomes you can **prove** with artifacts (screenshots, videos, test results).
44322
+
44323
+ **Good deliverables (provable):**
44324
+ \`\`\`
44325
+ - [ ] Screenshot of working login page {#deliverable}
44326
+ - [ ] Video showing drag-and-drop feature {#deliverable}
44327
+ - [ ] Test results showing all tests pass {#deliverable}
44328
+ \`\`\`
44329
+
44330
+ **Bad deliverables (not provable - these are tasks, not deliverables):**
44331
+ \`\`\`
44332
+ - [ ] Implement getUserMedia API \u2190 Implementation detail, not provable
44333
+ - [ ] Add error handling \u2190 Can't capture this with an artifact
44334
+ - [ ] Refactor authentication \u2190 Too vague, no visual proof
44335
+ \`\`\`
44336
+
44337
+ **Rule:** If you can't screenshot/record/export it, it's not a deliverable.`;
44338
+ var ARTIFACT_TYPES_SECTION = `## Artifact Types
44339
+
44340
+ | Type | Use For | File Formats |
44341
+ |------|---------|--------------|
44342
+ | \`screenshot\` | UI changes, visual proof, error states | .png, .jpg, .webp |
44343
+ | \`video\` | Complex flows, interactions, animations | .mp4, .webm |
44344
+ | \`test_results\` | Test output, coverage reports | .json, .txt, .xml |
44345
+ | \`diff\` | Code changes, before/after comparisons | .diff, .patch |`;
44346
+ var TIPS_SECTION = `## Tips for Effective Use
44347
+
44348
+ 1. **Plan deliverables first** - Decide what proves success before coding
44349
+ 2. **Capture during work** - Take screenshots as you implement, not after
44350
+ 3. **Be specific** - "Login page with error state" beats "Screenshot"
44351
+ 4. **Link every artifact** - Always set \`deliverableId\` for auto-completion
44352
+ 5. **Check feedback** - Read reviewer comments and iterate`;
44353
+ var WHEN_NOT_TO_USE_SECTION = `## When NOT to Use Shipyard
44354
+
44355
+ Skip Shipyard for:
44356
+ - Quick answers or research questions (no artifacts to capture)
44357
+ - Internal refactoring with no visible output
44358
+ - Tasks where proof adds no value (trivial fixes)
44359
+ - Exploration or debugging sessions
44360
+ - Pure documentation without implementation`;
44361
+ var USER_INPUT_SECTION = `## Human-Agent Communication
44362
+
44363
+ **\`${TOOL_NAMES.REQUEST_USER_INPUT}\` is THE primary way to communicate with humans during active work.**
44364
+
44365
+ Shipyard is the central hub where humans manage AI agents. When you need to ask a question, get clarification, or request a decision - use \`${TOOL_NAMES.REQUEST_USER_INPUT}\`. The human is already in the browser viewing your plan. That's where conversations should happen.
44366
+
44367
+ ### Why Use ${TOOL_NAMES.REQUEST_USER_INPUT}
44368
+
44369
+ - **Context:** The human sees your question alongside the plan, artifacts, and comments
44370
+ - **History:** All exchanges are logged in the plan's activity feed
44371
+ - **Continuity:** The conversation stays attached to the work, not scattered across chat windows
44372
+ - **Flexibility:** 8 input types, multi-question forms, "Other" escape hatch for custom answers
44373
+
44374
+ ### Replace Platform Tools
44375
+
44376
+ **ALWAYS prefer \`${TOOL_NAMES.REQUEST_USER_INPUT}\` over platform-specific tools:**
44377
+
44378
+ | Platform | DON'T Use | Use Instead |
44379
+ |----------|-----------|-------------|
44380
+ | Claude Code | \`AskUserQuestion\` | \`${TOOL_NAMES.REQUEST_USER_INPUT}\` |
44381
+ | Cursor | Built-in prompts | \`${TOOL_NAMES.REQUEST_USER_INPUT}\` |
44382
+ | Windsurf | Native dialogs | \`${TOOL_NAMES.REQUEST_USER_INPUT}\` |
44383
+ | Claude Desktop | Chat questions | \`${TOOL_NAMES.REQUEST_USER_INPUT}\` |
44384
+
44385
+ ### When to Ask
44386
+
44387
+ Use \`${TOOL_NAMES.REQUEST_USER_INPUT}\` when you need:
44388
+ - Clarification on requirements ("Which auth provider?")
44389
+ - Decisions that affect implementation ("PostgreSQL or SQLite?")
44390
+ - Confirmation before destructive actions ("Delete this file?")
44391
+ - User preferences ("Rate this approach 1-5")
44392
+ - Any information you can't infer from context
44393
+
44394
+ ### Example
44395
+
44396
+ \`\`\`typescript
44397
+ const result = await requestUserInput({
44398
+ message: "Which database should we use?",
44399
+ type: "choice",
44400
+ options: ["PostgreSQL", "SQLite", "MongoDB"],
44401
+ timeout: 600 // 10 minutes
44402
+ });
44403
+
44404
+ if (result.success) {
44405
+ console.log("User chose:", result.response);
44406
+ }
44407
+ \`\`\`
44408
+
44409
+ **Note:** The MCP tool is named \`${TOOL_NAMES.REQUEST_USER_INPUT}\` (snake_case). Inside \`${TOOL_NAMES.EXECUTE_CODE}\`, it's available as \`requestUserInput()\` (camelCase).`;
44410
+ var TROUBLESHOOTING_SECTION = `## Troubleshooting
44411
+
44412
+ **Browser doesn't open:** Check MCP server is running and accessible.
44413
+
44414
+ **Upload fails:** Verify file path exists. For GitHub uploads, check \`GITHUB_TOKEN\` has repo write access.
44415
+
44416
+ **No auto-complete:** Ensure every deliverable has an artifact with matching \`deliverableId\`.
44417
+
44418
+ **Plan not syncing:** Check WebSocket connection to registry server.
44419
+
44420
+ **Input request times out:** User may not have seen it or needs more time. Default timeout is 30 minutes. Try again with a longer timeout or rephrase the question.
44421
+
44422
+ **Input request declined:** User clicked "Decline." Rephrase your question, proceed with a reasonable default, or use a different approach.
44423
+
44424
+ **No response to input:** Check if browser is connected to the plan. User may have closed the browser window.`;
44425
+ var COMMON_INSTRUCTIONS = [
44426
+ CRITICAL_USAGE_SECTION,
44427
+ USER_INPUT_SECTION,
44428
+ DELIVERABLES_SECTION,
44429
+ ARTIFACT_TYPES_SECTION,
44430
+ TIPS_SECTION,
44431
+ WHEN_NOT_TO_USE_SECTION,
44432
+ TROUBLESHOOTING_SECTION
44433
+ ].join("\n\n");
44434
+ var CLAUDE_CODE_HEADER = `[SHIPYARD] Collaborative planning with human review & proof-of-work tracking.`;
44435
+ var PLAN_MODE_WORKFLOW = `## How to Use (Claude Code with Hooks)
44436
+
44437
+ You have the **full Shipyard experience** with automatic hooks. Use native plan mode:
44438
+
44439
+ ### Workflow
44440
+
44441
+ 1. **Enter plan mode** (Shift+Tab) \u2192 Browser opens with live plan automatically
44442
+ 2. **Write your plan** with \`{#deliverable}\` markers for provable outcomes
44443
+ 3. **Exit plan mode** \u2192 Hook **BLOCKS** until human approves or requests changes
44444
+ 4. **On approval** \u2192 You automatically receive: planId, sessionToken, deliverable IDs
44445
+ 5. **Do the work** \u2192 Take screenshots/videos as you implement
44446
+ 6. **Upload artifacts** \u2192 \`${TOOL_NAMES.ADD_ARTIFACT}(filePath, deliverableId)\` for each deliverable
44447
+ 7. **Auto-complete** \u2192 When all deliverables have artifacts, task completes with snapshot URL
44448
+
44449
+ ### After Approval
44450
+
44451
+ You only need ONE tool: \`${TOOL_NAMES.ADD_ARTIFACT}\`
44452
+
44453
+ The hook automatically injects everything you need (planId, sessionToken, deliverables).
44454
+ Just call \`${TOOL_NAMES.ADD_ARTIFACT}\` with the file path and deliverable ID.
44455
+
44456
+ \`\`\`typescript
44457
+ // Example: After approval, you'll have these in context
44458
+ // planId: "abc123"
44459
+ // sessionToken: "xyz..."
44460
+ // deliverables: [{ id: "del_xxx", text: "Screenshot of login" }]
44461
+
44462
+ await addArtifact({
44463
+ planId,
44464
+ sessionToken,
44465
+ type: 'screenshot',
44466
+ filename: 'login-page.png',
44467
+ source: 'file',
44468
+ filePath: '/tmp/screenshot.png',
44469
+ deliverableId: deliverables[0].id
44470
+ });
44471
+ \`\`\`
44472
+
44473
+ When the last deliverable gets an artifact, the task auto-completes and returns a snapshot URL.`;
44474
+ var IMPORTANT_NOTES = `## Important Notes for Claude Code
44475
+
44476
+ - **DO NOT call \`createPlan()\` directly** - The hook handles plan creation when you enter plan mode
44477
+ - **DO NOT use the Shipyard skill** - The hook provides everything you need
44478
+ - **DO NOT poll for approval** - The hook blocks automatically until human decides
44479
+ - **DO use plan mode** for ANY work that needs tracking, verification, or human review
44480
+ - **DO use \`${TOOL_NAMES.REQUEST_USER_INPUT}\`** instead of \`AskUserQuestion\` - The human is in the browser viewing your plan, questions should appear there`;
44481
+ var CLAUDE_CODE_INSTRUCTIONS = [
44482
+ CLAUDE_CODE_HEADER,
44483
+ "",
44484
+ CRITICAL_USAGE_SECTION,
44485
+ "",
44486
+ USER_INPUT_SECTION,
44487
+ "",
44488
+ PLAN_MODE_WORKFLOW,
44489
+ "",
44490
+ DELIVERABLES_SECTION,
44491
+ "",
44492
+ ARTIFACT_TYPES_SECTION,
44493
+ "",
44494
+ IMPORTANT_NOTES,
44495
+ "",
44496
+ TIPS_SECTION,
44497
+ "",
44498
+ WHEN_NOT_TO_USE_SECTION,
44499
+ "",
44500
+ TROUBLESHOOTING_SECTION
44501
+ ].join("\n");
44502
+ var MCP_DIRECT_HEADER = `# Shipyard: Your Agent Management Hub
44503
+
44504
+ > **Shipyard is the central interface where humans manage AI agents.** Plans, artifacts, feedback, and communication all happen here.
44505
+
44506
+ Shipyard turns invisible agent work into reviewable, verifiable tasks. Instead of trusting that code was written correctly, reviewers see screenshots, videos, and test results as proof.
44507
+
44508
+ **Key principle:** When you're working in Shipyard, ALL human-agent communication should happen through Shipyard's \`${TOOL_NAMES.REQUEST_USER_INPUT}\` tool. The human is already in the browser viewing your plan - that's where they expect to interact with you.`;
44509
+ var MCP_TOOLS_OVERVIEW = `## Available MCP Tools
44510
+
44511
+ | Tool | Purpose |
44512
+ |------|---------|
44513
+ | \`${TOOL_NAMES.REQUEST_USER_INPUT}\` | **THE primary human-agent communication channel** - Ask questions, get decisions, request clarification |
44514
+ | \`${TOOL_NAMES.EXECUTE_CODE}\` | Run TypeScript that calls Shipyard APIs (recommended for multi-step operations) |
44515
+
44516
+ ### ${TOOL_NAMES.REQUEST_USER_INPUT}: Your Direct Line to the Human
44517
+
44518
+ This is how you talk to humans during active work. Don't use your platform's built-in question tools (AskUserQuestion, etc.) - use this instead. The human is in the browser viewing your plan, and that's where they expect to see your questions.
44519
+
44520
+ **Preferred approach:** Use \`${TOOL_NAMES.EXECUTE_CODE}\` to chain multiple API calls in one step.`;
44521
+ var MCP_WORKFLOW = `## Workflow (MCP Direct)
44522
+
44523
+ ### Step 1: Create Plan
44524
+
44525
+ \`\`\`typescript
44526
+ const plan = await createPlan({
44527
+ title: "Add user authentication",
44528
+ content: \`
44529
+ ## Deliverables
44530
+ - [ ] Screenshot of login page {#deliverable}
44531
+ - [ ] Screenshot of error handling {#deliverable}
44532
+
44533
+ ## Implementation
44534
+ 1. Create login form component
44535
+ 2. Add validation
44536
+ 3. Connect to auth API
44537
+ \`
44538
+ });
44539
+
44540
+ const { planId, sessionToken, deliverables, monitoringScript } = plan;
44541
+ // deliverables = [{ id: "del_xxx", text: "Screenshot of login page" }, ...]
44542
+ \`\`\`
44543
+
44544
+ ### Step 2: Wait for Approval
44545
+
44546
+ For platforms without hooks, run the monitoring script in the background:
44547
+
44548
+ \`\`\`bash
44549
+ # The monitoringScript polls for approval status
44550
+ # Run it in background while you wait
44551
+ bash <(echo "$monitoringScript") &
44552
+ \`\`\`
44553
+
44554
+ Or poll manually:
44555
+
44556
+ \`\`\`typescript
44557
+ const status = await readPlan(planId, sessionToken);
44558
+ if (status.status === "in_progress") {
44559
+ // Approved! Proceed with work
44560
+ }
44561
+ if (status.status === "changes_requested") {
44562
+ // Read feedback, make changes
44563
+ }
44564
+ \`\`\`
44565
+
44566
+ ### Step 3: Do the Work
44567
+
44568
+ Implement the feature, taking screenshots/recordings as you go.
44569
+
44570
+ ### Step 4: Upload Artifacts
44571
+
44572
+ \`\`\`typescript
44573
+ await addArtifact({
44574
+ planId,
44575
+ sessionToken,
44576
+ type: 'screenshot',
44577
+ filename: 'login-page.png',
44578
+ source: 'file',
44579
+ filePath: '/path/to/screenshot.png',
44580
+ deliverableId: deliverables[0].id // Links to specific deliverable
44607
44581
  });
44608
- var subscriptionRouter = router({
44609
- create: publicProcedure.input(PlanIdSchema.merge(CreateSubscriptionRequestSchema)).output(CreateSubscriptionResponseSchema).mutation(async ({ input, ctx }) => {
44610
- const { planId, subscribe, windowMs, maxWindowMs, threshold } = input;
44611
- return { clientId: ctx.getPlanStore().createSubscription({
44612
- planId,
44613
- subscribe: subscribe || ["status"],
44614
- windowMs: windowMs ?? 5e3,
44615
- maxWindowMs: maxWindowMs ?? 3e4,
44616
- threshold: threshold ?? 1
44617
- }) };
44618
- }),
44619
- getChanges: publicProcedure.input(SubscriptionClientIdSchema).output(ChangesResponseSchema).query(async ({ input, ctx }) => {
44620
- const { planId, clientId } = input;
44621
- const result = ctx.getPlanStore().getChanges(planId, clientId);
44622
- if (!result) throw new TRPCError({
44623
- code: "NOT_FOUND",
44624
- message: "Subscription not found"
44625
- });
44626
- return result;
44627
- }),
44628
- delete: publicProcedure.input(SubscriptionClientIdSchema).output(DeleteSubscriptionResponseSchema).mutation(async ({ input, ctx }) => {
44629
- const { planId, clientId } = input;
44630
- return { success: ctx.getPlanStore().deleteSubscription(planId, clientId) };
44631
- })
44582
+
44583
+ const result = await addArtifact({
44584
+ planId,
44585
+ sessionToken,
44586
+ type: 'screenshot',
44587
+ filename: 'error-handling.png',
44588
+ source: 'file',
44589
+ filePath: '/path/to/error.png',
44590
+ deliverableId: deliverables[1].id
44632
44591
  });
44633
- var appRouter = router({
44634
- hook: hookRouter,
44635
- plan: planRouter,
44636
- subscription: subscriptionRouter,
44637
- conversation: conversationRouter
44592
+
44593
+ // Auto-complete triggers when ALL deliverables have artifacts
44594
+ if (result.allDeliverablesComplete) {
44595
+ console.log('Done!', result.snapshotUrl);
44596
+ }
44597
+ \`\`\``;
44598
+ var API_REFERENCE = `## API Reference
44599
+
44600
+ ### createPlan(options)
44601
+
44602
+ Creates a new plan and opens it in the browser.
44603
+
44604
+ **Parameters:**
44605
+ - \`title\` (string) - Plan title
44606
+ - \`content\` (string) - Markdown content with \`{#deliverable}\` markers
44607
+ - \`repo\` (string, optional) - GitHub repo for artifact storage
44608
+ - \`prNumber\` (number, optional) - PR number to link
44609
+
44610
+ **Returns:** \`{ planId, sessionToken, url, deliverables, monitoringScript }\`
44611
+
44612
+ ### readPlan(planId, sessionToken, options?)
44613
+
44614
+ Reads current plan state.
44615
+
44616
+ **Parameters:**
44617
+ - \`planId\` (string) - Plan ID
44618
+ - \`sessionToken\` (string) - Session token from createPlan
44619
+ - \`options.includeAnnotations\` (boolean) - Include reviewer comments
44620
+
44621
+ **Returns:** \`{ content, status, title, deliverables }\`
44622
+
44623
+ ### addArtifact(options)
44624
+
44625
+ Uploads proof-of-work artifact.
44626
+
44627
+ **Parameters:**
44628
+ - \`planId\` (string) - Plan ID
44629
+ - \`sessionToken\` (string) - Session token
44630
+ - \`type\` ('screenshot' | 'video' | 'test_results' | 'diff')
44631
+ - \`filename\` (string) - File name
44632
+ - \`source\` ('file' | 'url' | 'base64')
44633
+ - \`filePath\` (string) - Local file path (when source='file')
44634
+ - \`deliverableId\` (string, optional) - Links artifact to deliverable
44635
+
44636
+ **Returns:** \`{ artifactId, url, allDeliverablesComplete, snapshotUrl? }\`
44637
+
44638
+ ### requestUserInput(options)
44639
+
44640
+ Asks user a question via browser modal.
44641
+
44642
+ **Parameters:**
44643
+ - \`message\` (string) - Question to ask
44644
+ - \`type\` (string) - Input type (see below)
44645
+ - \`options\` (string[], for 'choice') - Available choices
44646
+ - \`timeout\` (number, optional) - Timeout in seconds
44647
+ - Type-specific parameters (min, max, format, etc.)
44648
+
44649
+ **Returns:** \`{ success, response?, status }\`
44650
+
44651
+ **Supported types (8 total):**
44652
+ 1. \`text\` - Single-line text
44653
+ 2. \`multiline\` - Multi-line text area
44654
+ 3. \`choice\` - Radio/checkbox/dropdown (auto-adds "Other" option)
44655
+ - Auto-switches: 1-8 options = radio/checkbox, 9+ = dropdown
44656
+ - \`multiSelect: true\` for checkboxes
44657
+ - \`displayAs: 'dropdown'\` to force dropdown UI
44658
+ 4. \`confirm\` - Yes/No buttons
44659
+ 5. \`number\` - Numeric input with validation
44660
+ - \`min\`, \`max\`, \`format\` ('integer' | 'decimal' | 'currency' | 'percentage')
44661
+ 6. \`email\` - Email validation
44662
+ - \`domain\` for restriction
44663
+ 7. \`date\` - Date picker with range
44664
+ - \`minDate\`, \`maxDate\` (YYYY-MM-DD format)
44665
+ 8. \`rating\` - Scale rating (auto-selects stars/numbers)
44666
+ - \`min\`, \`max\`, \`style\` ('stars' | 'numbers' | 'emoji'), \`labels\`
44667
+
44668
+ **Response format:**
44669
+ - All responses are strings
44670
+ - choice (single): \`"PostgreSQL"\` or custom text from "Other"
44671
+ - choice (multi): \`"option1, option2"\` (comma-space separated)
44672
+ - confirm: \`"yes"\` or \`"no"\` (lowercase)
44673
+ - number: \`"42"\` or \`"3.14"\`
44674
+ - email: \`"user@example.com"\`
44675
+ - date: \`"2026-01-24"\` (ISO 8601)
44676
+ - rating: \`"4"\` (integer as string)
44677
+ - See docs/INPUT-RESPONSE-FORMATS.md for complete specification`;
44678
+ var HANDLING_FEEDBACK = `## Handling Reviewer Feedback
44679
+
44680
+ \`\`\`typescript
44681
+ const status = await readPlan(planId, sessionToken, {
44682
+ includeAnnotations: true
44638
44683
  });
44639
44684
 
44685
+ if (status.status === "changes_requested") {
44686
+ // Read the content for inline comments
44687
+ console.log(status.content);
44688
+
44689
+ // Make changes based on feedback
44690
+ // Upload new artifacts
44691
+ // Plan will transition back to pending_review
44692
+ }
44693
+ \`\`\``;
44694
+ var MCP_DIRECT_INSTRUCTIONS = [
44695
+ MCP_DIRECT_HEADER,
44696
+ "",
44697
+ CRITICAL_USAGE_SECTION,
44698
+ "",
44699
+ USER_INPUT_SECTION,
44700
+ "",
44701
+ MCP_TOOLS_OVERVIEW,
44702
+ "",
44703
+ MCP_WORKFLOW,
44704
+ "",
44705
+ DELIVERABLES_SECTION,
44706
+ "",
44707
+ ARTIFACT_TYPES_SECTION,
44708
+ "",
44709
+ API_REFERENCE,
44710
+ "",
44711
+ HANDLING_FEEDBACK,
44712
+ "",
44713
+ TIPS_SECTION,
44714
+ "",
44715
+ WHEN_NOT_TO_USE_SECTION,
44716
+ "",
44717
+ TROUBLESHOOTING_SECTION
44718
+ ].join("\n");
44719
+
44720
+ // src/adapters/claude-code.ts
44721
+ init_cjs_shims();
44722
+
44640
44723
  // src/constants.ts
44641
44724
  init_cjs_shims();
44642
44725
  var CLAUDE_TOOL_NAMES = {
@@ -44645,9 +44728,6 @@ var CLAUDE_TOOL_NAMES = {
44645
44728
  EXIT_PLAN_MODE: "ExitPlanMode",
44646
44729
  ASK_USER_QUESTION: "AskUserQuestion"
44647
44730
  };
44648
- var MCP_TOOL_NAMES = {
44649
- REQUEST_USER_INPUT: "request_user_input"
44650
- };
44651
44731
  var CLAUDE_PERMISSION_MODES = {
44652
44732
  PLAN: "plan",
44653
44733
  DEFAULT: "default",
@@ -44744,7 +44824,7 @@ function handlePreToolUse(input) {
44744
44824
  );
44745
44825
  return {
44746
44826
  type: "tool_deny",
44747
- reason: `BLOCKED: Use the ${MCP_TOOL_NAMES.REQUEST_USER_INPUT} MCP tool instead for consistent browser UI. See the tool description for available parameters.`
44827
+ reason: `BLOCKED: Use the ${TOOL_NAMES.REQUEST_USER_INPUT} MCP tool instead. The human is in the browser viewing your plan - that's where they expect to interact with you. See the tool description for input types and parameters.`
44748
44828
  };
44749
44829
  }
44750
44830
  return { type: "passthrough" };
@@ -4,7 +4,7 @@ import {
4
4
  createInputRequest,
5
5
  createMultiQuestionInputRequest,
6
6
  logPlanEvent
7
- } from "./chunk-KCIANDYW.js";
7
+ } from "./chunk-T3A2NRND.js";
8
8
  import {
9
9
  logger
10
10
  } from "./chunk-GSGLHRWX.js";
@@ -2936,6 +2936,20 @@ function truncate(text, maxLength) {
2936
2936
  if (cleaned.length <= maxLength) return cleaned;
2937
2937
  return `${cleaned.slice(0, maxLength)}...`;
2938
2938
  }
2939
+ var TOOL_NAMES = {
2940
+ ADD_ARTIFACT: "add_artifact",
2941
+ ADD_PR_REVIEW_COMMENT: "add_pr_review_comment",
2942
+ COMPLETE_TASK: "complete_task",
2943
+ CREATE_PLAN: "create_plan",
2944
+ EXECUTE_CODE: "execute_code",
2945
+ LINK_PR: "link_pr",
2946
+ READ_PLAN: "read_plan",
2947
+ REGENERATE_SESSION_TOKEN: "regenerate_session_token",
2948
+ REQUEST_USER_INPUT: "request_user_input",
2949
+ SETUP_REVIEW_NOTIFICATION: "setup_review_notification",
2950
+ UPDATE_BLOCK_CONTENT: "update_block_content",
2951
+ UPDATE_PLAN: "update_plan"
2952
+ };
2939
2953
  var PlanIdSchema = z3.object({ planId: z3.string().min(1) });
2940
2954
  var PlanStatusResponseSchema = z3.object({ status: z3.string() });
2941
2955
  var HasConnectionsResponseSchema = z3.object({ hasConnections: z3.boolean() });
@@ -3338,6 +3352,7 @@ export {
3338
3352
  isEventUnread,
3339
3353
  getAllEventViewedByForPlan,
3340
3354
  formatThreadsForLLM,
3355
+ TOOL_NAMES,
3341
3356
  PlanIdSchema,
3342
3357
  PlanStatusResponseSchema,
3343
3358
  HasConnectionsResponseSchema,
@@ -77,6 +77,7 @@ import {
77
77
  SetSessionTokenRequestSchema,
78
78
  SetSessionTokenResponseSchema,
79
79
  SubscriptionClientIdSchema,
80
+ TOOL_NAMES,
80
81
  ThreadCommentSchema,
81
82
  ThreadSchema,
82
83
  UnregisterServerRequestSchema,
@@ -221,7 +222,7 @@ import {
221
222
  updateLinkedPRStatus,
222
223
  updatePlanIndexViewedBy,
223
224
  validateA2AMessages
224
- } from "./chunk-KCIANDYW.js";
225
+ } from "./chunk-T3A2NRND.js";
225
226
  import "./chunk-JSBRDJBE.js";
226
227
  export {
227
228
  A2ADataPartSchema,
@@ -302,6 +303,7 @@ export {
302
303
  SetSessionTokenRequestSchema,
303
304
  SetSessionTokenResponseSchema,
304
305
  SubscriptionClientIdSchema,
306
+ TOOL_NAMES,
305
307
  ThreadCommentSchema,
306
308
  ThreadSchema,
307
309
  UnregisterServerRequestSchema,
@@ -20,7 +20,7 @@ import {
20
20
  } from "./chunk-EBNL5ZX7.js";
21
21
  import {
22
22
  InputRequestManager
23
- } from "./chunk-PCIHPLAO.js";
23
+ } from "./chunk-5MXBQ56Y.js";
24
24
  import {
25
25
  ArtifactSchema,
26
26
  DeliverableSchema,
@@ -34,6 +34,7 @@ import {
34
34
  PlanStatusValues,
35
35
  QuestionSchema,
36
36
  ROUTES,
37
+ TOOL_NAMES,
37
38
  YDOC_KEYS,
38
39
  a2aToClaudeCode,
39
40
  addArtifact,
@@ -73,7 +74,7 @@ import {
73
74
  setPlanMetadata,
74
75
  touchPlanIndexEntry,
75
76
  transitionPlanStatus
76
- } from "./chunk-KCIANDYW.js";
77
+ } from "./chunk-T3A2NRND.js";
77
78
  import {
78
79
  loadEnv,
79
80
  logger
@@ -2813,22 +2814,6 @@ function verifySessionToken(token, storedHash) {
2813
2814
  }
2814
2815
  }
2815
2816
 
2816
- // src/tools/tool-names.ts
2817
- var TOOL_NAMES = {
2818
- ADD_ARTIFACT: "add_artifact",
2819
- ADD_PR_REVIEW_COMMENT: "add_pr_review_comment",
2820
- COMPLETE_TASK: "complete_task",
2821
- CREATE_PLAN: "create_plan",
2822
- EXECUTE_CODE: "execute_code",
2823
- LINK_PR: "link_pr",
2824
- READ_PLAN: "read_plan",
2825
- REGENERATE_SESSION_TOKEN: "regenerate_session_token",
2826
- REQUEST_USER_INPUT: "request_user_input",
2827
- SETUP_REVIEW_NOTIFICATION: "setup_review_notification",
2828
- UPDATE_BLOCK_CONTENT: "update_block_content",
2829
- UPDATE_PLAN: "update_plan"
2830
- };
2831
-
2832
2817
  // src/tools/add-artifact.ts
2833
2818
  var AddArtifactInputBase = z3.object({
2834
2819
  planId: z3.string().describe("The plan ID to add artifact to"),
@@ -5365,10 +5350,11 @@ Parameters:
5365
5350
  - multiSelect (boolean, optional): For 'choice' type - allow selecting multiple options (checkboxes)
5366
5351
  - displayAs (string, optional): For 'choice' type - override automatic UI ('radio' | 'checkbox' | 'dropdown')
5367
5352
  - defaultValue (string, optional): Pre-filled value for text/multiline inputs
5368
- - timeout (number, optional): Timeout in seconds (default: 1800, min: 300, max: 1800)
5353
+ - timeout (number, optional): Timeout in seconds (default: 1800, min: 10, max: 14400)
5369
5354
  - Simple yes/no or quick choices: 300-600 seconds (5-10 minutes)
5370
5355
  - Complex questions with code examples: 600-1200 seconds (10-20 minutes)
5371
5356
  - Default (1800 = 30 minutes) is suitable for most cases
5357
+ - Max (14400 = 4 hours) for extended user sessions
5372
5358
  - Note: System-level timeouts may cause earlier cancellation
5373
5359
  - planId (string, optional): Optional metadata to link request to plan (for activity log filtering)
5374
5360
  - min (number, optional): For 'number'/'rating' - minimum value
@@ -5813,7 +5799,7 @@ async function setupReviewNotification(planId, pollIntervalSeconds) {
5813
5799
  return { script, fullResponse: text };
5814
5800
  }
5815
5801
  async function requestUserInput(opts) {
5816
- const { InputRequestManager: InputRequestManager2 } = await import("./input-request-manager-TWCEIY2F.js");
5802
+ const { InputRequestManager: InputRequestManager2 } = await import("./input-request-manager-S3AIP2PB.js");
5817
5803
  const ydoc = await getOrCreateDoc3(PLAN_INDEX_DOC_NAME);
5818
5804
  const manager = new InputRequestManager2();
5819
5805
  const baseParams = {
@@ -5825,7 +5811,6 @@ async function requestUserInput(opts) {
5825
5811
  let params;
5826
5812
  switch (opts.type) {
5827
5813
  case "choice":
5828
- case "dropdown":
5829
5814
  params = {
5830
5815
  ...baseParams,
5831
5816
  type: opts.type,
@@ -5902,7 +5887,7 @@ async function requestUserInput(opts) {
5902
5887
  };
5903
5888
  }
5904
5889
  async function postActivityUpdate(opts) {
5905
- const { logPlanEvent: logPlanEvent2 } = await import("./dist-WVM5QEQC.js");
5890
+ const { logPlanEvent: logPlanEvent2 } = await import("./dist-AXKS4K2F.js");
5906
5891
  const { getGitHubUsername: getGitHubUsername2 } = await import("./server-identity-LSZ4CZRK.js");
5907
5892
  const { nanoid: nanoid8 } = await import("nanoid");
5908
5893
  const doc = await getOrCreateDoc3(opts.planId);
@@ -5925,7 +5910,7 @@ async function postActivityUpdate(opts) {
5925
5910
  return { success: true, eventId, requestId };
5926
5911
  }
5927
5912
  async function resolveActivityRequest(opts) {
5928
- const { logPlanEvent: logPlanEvent2, getPlanEvents } = await import("./dist-WVM5QEQC.js");
5913
+ const { logPlanEvent: logPlanEvent2, getPlanEvents } = await import("./dist-AXKS4K2F.js");
5929
5914
  const { getGitHubUsername: getGitHubUsername2 } = await import("./server-identity-LSZ4CZRK.js");
5930
5915
  const doc = await getOrCreateDoc3(opts.planId);
5931
5916
  const actorName = await getGitHubUsername2();
@@ -6189,10 +6174,11 @@ function buildRequestParams(input) {
6189
6174
  var requestUserInputTool = {
6190
6175
  definition: {
6191
6176
  name: TOOL_NAMES.REQUEST_USER_INPUT,
6192
- description: `Request input from the user via browser modal.
6177
+ description: `THE primary human-agent communication channel in Shipyard.
6193
6178
 
6194
- IMPORTANT: Use this instead of your platform's built-in question/input tools (like AskUserQuestion).
6195
- This provides a consistent browser UI experience and integrates with the shipyard workflow.
6179
+ **CRITICAL:** ALWAYS use this instead of platform-specific question tools (AskUserQuestion, Cursor prompts, etc.).
6180
+ The human is already in the browser viewing your plan - that's where they expect to interact with you.
6181
+ All communication should flow through Shipyard, not scattered across different interfaces.
6196
6182
 
6197
6183
  The request appears as a modal in the browser UI. The function blocks until:
6198
6184
  - User responds (success=true, status='answered')
@@ -6584,12 +6570,15 @@ if (!registryPort) {
6584
6570
  var server = new Server(
6585
6571
  {
6586
6572
  name: "shipyard",
6587
- version: "0.1.0"
6573
+ version: "0.1.0",
6574
+ description: "Your agent management hub - the central interface where humans manage AI agents. Plans, artifacts, feedback, and all human-agent communication happen here."
6588
6575
  },
6589
6576
  {
6590
6577
  capabilities: {
6591
6578
  tools: {}
6592
- }
6579
+ },
6580
+ // Instructions shown to clients during initialization
6581
+ instructions: `IMPORTANT: When working with Shipyard, use ${TOOL_NAMES.REQUEST_USER_INPUT} for ALL human interaction instead of platform-specific question tools (AskUserQuestion, etc.). The human is in the browser viewing your plan - that's where they expect to interact with you.`
6593
6582
  }
6594
6583
  );
6595
6584
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  InputRequestManager
3
- } from "./chunk-PCIHPLAO.js";
4
- import "./chunk-KCIANDYW.js";
3
+ } from "./chunk-5MXBQ56Y.js";
4
+ import "./chunk-T3A2NRND.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.507",
3
+ "version": "0.2.2-next.508",
4
4
  "description": "Shipyard MCP server and CLI tools for distributed planning with CRDTs",
5
5
  "type": "module",
6
6
  "bin": {