@schoolai/shipyard-mcp 0.3.2-next.518 → 0.3.2-next.523
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/apps/hook/dist/index.cjs +207 -75
- package/apps/server/dist/{chunk-XGFLIN7D.js → chunk-NNJ3ELQW.js} +349 -54
- package/apps/server/dist/chunk-WLIAQMMT.js +2779 -0
- package/apps/server/dist/{dist-GY2FDTC3.js → dist-STCVHI7H.js} +35 -3
- package/apps/server/dist/index.js +726 -3465
- package/apps/server/dist/{chunk-US64BNLQ.js → input-request-manager-OSA7HKQW.js} +97 -38
- package/package.json +1 -1
- package/apps/server/dist/input-request-manager-PGVST566.js +0 -9
package/apps/hook/dist/index.cjs
CHANGED
|
@@ -28491,7 +28491,7 @@ init_cjs_shims();
|
|
|
28491
28491
|
// ../../packages/schema/dist/index.mjs
|
|
28492
28492
|
init_cjs_shims();
|
|
28493
28493
|
|
|
28494
|
-
// ../../packages/schema/dist/yjs-helpers-
|
|
28494
|
+
// ../../packages/schema/dist/yjs-helpers-DzEyLz-f.mjs
|
|
28495
28495
|
init_cjs_shims();
|
|
28496
28496
|
|
|
28497
28497
|
// ../../packages/schema/dist/plan.mjs
|
|
@@ -42388,7 +42388,10 @@ var CursorOriginMetadataSchema = external_exports.object({
|
|
|
42388
42388
|
conversationId: external_exports.string(),
|
|
42389
42389
|
generationId: external_exports.string().optional()
|
|
42390
42390
|
});
|
|
42391
|
-
var UnknownOriginMetadataSchema = external_exports.object({
|
|
42391
|
+
var UnknownOriginMetadataSchema = external_exports.object({
|
|
42392
|
+
platform: external_exports.literal("unknown"),
|
|
42393
|
+
cwd: external_exports.string()
|
|
42394
|
+
});
|
|
42392
42395
|
var OriginMetadataSchema = external_exports.discriminatedUnion("platform", [
|
|
42393
42396
|
ClaudeCodeOriginMetadataSchema,
|
|
42394
42397
|
DevinOriginMetadataSchema,
|
|
@@ -42547,7 +42550,19 @@ var PlanEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
42547
42550
|
data: external_exports.object({
|
|
42548
42551
|
requestId: external_exports.string(),
|
|
42549
42552
|
response: external_exports.unknown(),
|
|
42550
|
-
answeredBy: external_exports.string()
|
|
42553
|
+
answeredBy: external_exports.string(),
|
|
42554
|
+
requestMessage: external_exports.string().optional(),
|
|
42555
|
+
requestType: external_exports.enum([
|
|
42556
|
+
"text",
|
|
42557
|
+
"multiline",
|
|
42558
|
+
"choice",
|
|
42559
|
+
"confirm",
|
|
42560
|
+
"number",
|
|
42561
|
+
"email",
|
|
42562
|
+
"date",
|
|
42563
|
+
"rating",
|
|
42564
|
+
"multi"
|
|
42565
|
+
]).optional()
|
|
42551
42566
|
})
|
|
42552
42567
|
}),
|
|
42553
42568
|
PlanEventBaseSchema.extend({
|
|
@@ -42669,6 +42684,18 @@ var PRReviewCommentSchema = external_exports.object({
|
|
|
42669
42684
|
createdAt: external_exports.number(),
|
|
42670
42685
|
resolved: external_exports.boolean().optional()
|
|
42671
42686
|
});
|
|
42687
|
+
var LocalDiffCommentSchema = external_exports.object({
|
|
42688
|
+
id: external_exports.string(),
|
|
42689
|
+
type: external_exports.literal("local"),
|
|
42690
|
+
path: external_exports.string(),
|
|
42691
|
+
line: external_exports.number(),
|
|
42692
|
+
body: external_exports.string(),
|
|
42693
|
+
author: external_exports.string(),
|
|
42694
|
+
createdAt: external_exports.number(),
|
|
42695
|
+
baseRef: external_exports.string(),
|
|
42696
|
+
resolved: external_exports.boolean().optional(),
|
|
42697
|
+
lineContentHash: external_exports.string().optional()
|
|
42698
|
+
});
|
|
42672
42699
|
var GitHubArtifactParseSchema = external_exports.object({
|
|
42673
42700
|
id: external_exports.string(),
|
|
42674
42701
|
type: external_exports.enum([
|
|
@@ -42696,7 +42723,7 @@ var LocalArtifactParseSchema = external_exports.object({
|
|
|
42696
42723
|
localArtifactId: external_exports.string()
|
|
42697
42724
|
});
|
|
42698
42725
|
|
|
42699
|
-
// ../../packages/schema/dist/yjs-helpers-
|
|
42726
|
+
// ../../packages/schema/dist/yjs-helpers-DzEyLz-f.mjs
|
|
42700
42727
|
function assertNever2(value) {
|
|
42701
42728
|
throw new Error(`Unhandled discriminated union member: ${JSON.stringify(value)}`);
|
|
42702
42729
|
}
|
|
@@ -42902,7 +42929,7 @@ var ChoiceQuestionSchema = QuestionBaseSchema.extend({
|
|
|
42902
42929
|
placeholder: external_exports.string().optional()
|
|
42903
42930
|
});
|
|
42904
42931
|
var ConfirmQuestionSchema = QuestionBaseSchema.extend({ type: external_exports.literal("confirm") });
|
|
42905
|
-
var
|
|
42932
|
+
var NumberQuestionBaseSchema = QuestionBaseSchema.extend({
|
|
42906
42933
|
type: external_exports.literal("number"),
|
|
42907
42934
|
min: external_exports.number().optional(),
|
|
42908
42935
|
max: external_exports.number().optional(),
|
|
@@ -42912,17 +42939,17 @@ var NumberQuestionSchema = QuestionBaseSchema.extend({
|
|
|
42912
42939
|
"currency",
|
|
42913
42940
|
"percentage"
|
|
42914
42941
|
]).optional()
|
|
42915
|
-
})
|
|
42942
|
+
});
|
|
42916
42943
|
var EmailQuestionSchema = QuestionBaseSchema.extend({
|
|
42917
42944
|
type: external_exports.literal("email"),
|
|
42918
42945
|
domain: external_exports.string().optional()
|
|
42919
42946
|
});
|
|
42920
|
-
var
|
|
42947
|
+
var DateQuestionBaseSchema = QuestionBaseSchema.extend({
|
|
42921
42948
|
type: external_exports.literal("date"),
|
|
42922
42949
|
min: external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/, "Date must be in YYYY-MM-DD format").optional(),
|
|
42923
42950
|
max: external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/, "Date must be in YYYY-MM-DD format").optional()
|
|
42924
|
-
})
|
|
42925
|
-
var
|
|
42951
|
+
});
|
|
42952
|
+
var RatingQuestionBaseSchema = QuestionBaseSchema.extend({
|
|
42926
42953
|
type: external_exports.literal("rating"),
|
|
42927
42954
|
min: external_exports.number().int().optional(),
|
|
42928
42955
|
max: external_exports.number().int().optional(),
|
|
@@ -42935,20 +42962,58 @@ var RatingQuestionSchema = QuestionBaseSchema.extend({
|
|
|
42935
42962
|
low: external_exports.string().optional(),
|
|
42936
42963
|
high: external_exports.string().optional()
|
|
42937
42964
|
}).optional()
|
|
42938
|
-
})
|
|
42939
|
-
if (data.min === void 0 || data.max === void 0) return true;
|
|
42940
|
-
return data.min <= data.max && data.max - data.min <= 20;
|
|
42941
|
-
}, { message: "Rating scale must have min <= max and at most 20 items" });
|
|
42965
|
+
});
|
|
42942
42966
|
var QuestionSchema = external_exports.discriminatedUnion("type", [
|
|
42943
42967
|
TextQuestionSchema,
|
|
42944
42968
|
MultilineQuestionSchema,
|
|
42945
42969
|
ChoiceQuestionSchema,
|
|
42946
42970
|
ConfirmQuestionSchema,
|
|
42947
|
-
|
|
42971
|
+
NumberQuestionBaseSchema,
|
|
42948
42972
|
EmailQuestionSchema,
|
|
42949
|
-
|
|
42950
|
-
|
|
42973
|
+
DateQuestionBaseSchema,
|
|
42974
|
+
RatingQuestionBaseSchema
|
|
42951
42975
|
]);
|
|
42976
|
+
function validateNumberQuestion(q, index, ctx) {
|
|
42977
|
+
if (q.min !== void 0 && q.max !== void 0 && q.min > q.max) ctx.addIssue({
|
|
42978
|
+
code: external_exports.ZodIssueCode.custom,
|
|
42979
|
+
message: "min must be <= max",
|
|
42980
|
+
path: ["questions", index]
|
|
42981
|
+
});
|
|
42982
|
+
}
|
|
42983
|
+
function validateDateQuestion(q, index, ctx) {
|
|
42984
|
+
if (q.min !== void 0 && q.max !== void 0 && new Date(q.min) > new Date(q.max)) ctx.addIssue({
|
|
42985
|
+
code: external_exports.ZodIssueCode.custom,
|
|
42986
|
+
message: "min date must be before or equal to max date",
|
|
42987
|
+
path: ["questions", index]
|
|
42988
|
+
});
|
|
42989
|
+
}
|
|
42990
|
+
function validateRatingQuestion(q, index, ctx) {
|
|
42991
|
+
if (q.min === void 0 || q.max === void 0) return;
|
|
42992
|
+
if (q.min > q.max || q.max - q.min > 20) ctx.addIssue({
|
|
42993
|
+
code: external_exports.ZodIssueCode.custom,
|
|
42994
|
+
message: "Rating scale must have min <= max and at most 20 items",
|
|
42995
|
+
path: ["questions", index]
|
|
42996
|
+
});
|
|
42997
|
+
}
|
|
42998
|
+
function validateQuestionConstraints(questions, ctx) {
|
|
42999
|
+
for (let i = 0; i < questions.length; i++) {
|
|
43000
|
+
const q = questions[i];
|
|
43001
|
+
if (!q) continue;
|
|
43002
|
+
switch (q.type) {
|
|
43003
|
+
case "number":
|
|
43004
|
+
validateNumberQuestion(q, i, ctx);
|
|
43005
|
+
break;
|
|
43006
|
+
case "date":
|
|
43007
|
+
validateDateQuestion(q, i, ctx);
|
|
43008
|
+
break;
|
|
43009
|
+
case "rating":
|
|
43010
|
+
validateRatingQuestion(q, i, ctx);
|
|
43011
|
+
break;
|
|
43012
|
+
default:
|
|
43013
|
+
break;
|
|
43014
|
+
}
|
|
43015
|
+
}
|
|
43016
|
+
}
|
|
42952
43017
|
var MultiQuestionInputRequestSchema = external_exports.object({
|
|
42953
43018
|
id: external_exports.string(),
|
|
42954
43019
|
createdAt: external_exports.number(),
|
|
@@ -42961,6 +43026,8 @@ var MultiQuestionInputRequestSchema = external_exports.object({
|
|
|
42961
43026
|
answeredAt: external_exports.number().optional(),
|
|
42962
43027
|
answeredBy: external_exports.string().optional(),
|
|
42963
43028
|
isBlocker: external_exports.boolean().optional()
|
|
43029
|
+
}).superRefine((data, ctx) => {
|
|
43030
|
+
validateQuestionConstraints(data.questions, ctx);
|
|
42964
43031
|
});
|
|
42965
43032
|
var AnyInputRequestSchema = external_exports.union([InputRequestSchema, MultiQuestionInputRequestSchema]);
|
|
42966
43033
|
var YDOC_KEYS = {
|
|
@@ -42976,7 +43043,8 @@ var YDOC_KEYS = {
|
|
|
42976
43043
|
PR_REVIEW_COMMENTS: "prReviewComments",
|
|
42977
43044
|
EVENTS: "events",
|
|
42978
43045
|
SNAPSHOTS: "snapshots",
|
|
42979
|
-
INPUT_REQUESTS: "inputRequests"
|
|
43046
|
+
INPUT_REQUESTS: "inputRequests",
|
|
43047
|
+
LOCAL_DIFF_COMMENTS: "localDiffComments"
|
|
42980
43048
|
};
|
|
42981
43049
|
var validKeys = new Set(Object.values(YDOC_KEYS));
|
|
42982
43050
|
var CommentBodySchema = external_exports.union([external_exports.string(), external_exports.array(external_exports.unknown())]);
|
|
@@ -44136,6 +44204,7 @@ var LocalChangesResponseSchema = external_exports.object({
|
|
|
44136
44204
|
available: external_exports.literal(true),
|
|
44137
44205
|
branch: external_exports.string(),
|
|
44138
44206
|
baseBranch: external_exports.string(),
|
|
44207
|
+
headSha: external_exports.string().optional(),
|
|
44139
44208
|
staged: external_exports.array(LocalFileChangeSchema),
|
|
44140
44209
|
unstaged: external_exports.array(LocalFileChangeSchema),
|
|
44141
44210
|
untracked: external_exports.array(external_exports.string()),
|
|
@@ -44233,6 +44302,7 @@ var TOOL_NAMES = {
|
|
|
44233
44302
|
CREATE_PLAN: "create_plan",
|
|
44234
44303
|
EXECUTE_CODE: "execute_code",
|
|
44235
44304
|
LINK_PR: "link_pr",
|
|
44305
|
+
READ_DIFF_COMMENTS: "read_diff_comments",
|
|
44236
44306
|
READ_PLAN: "read_plan",
|
|
44237
44307
|
REGENERATE_SESSION_TOKEN: "regenerate_session_token",
|
|
44238
44308
|
REQUEST_USER_INPUT: "request_user_input",
|
|
@@ -44363,7 +44433,7 @@ var planRouter = router({
|
|
|
44363
44433
|
message: "Plan not found"
|
|
44364
44434
|
});
|
|
44365
44435
|
const origin = metadata.origin;
|
|
44366
|
-
const cwd = origin?.platform === "claude-code" ? origin.cwd : void 0;
|
|
44436
|
+
const cwd = origin?.platform === "claude-code" || origin?.platform === "unknown" ? origin.cwd : void 0;
|
|
44367
44437
|
if (!cwd) return {
|
|
44368
44438
|
available: false,
|
|
44369
44439
|
reason: "no_cwd",
|
|
@@ -44384,7 +44454,7 @@ var planRouter = router({
|
|
|
44384
44454
|
message: "Plan not found"
|
|
44385
44455
|
});
|
|
44386
44456
|
const origin = metadata.origin;
|
|
44387
|
-
const cwd = origin?.platform === "claude-code" ? origin.cwd : void 0;
|
|
44457
|
+
const cwd = origin?.platform === "claude-code" || origin?.platform === "unknown" ? origin.cwd : void 0;
|
|
44388
44458
|
if (!cwd) return {
|
|
44389
44459
|
content: null,
|
|
44390
44460
|
error: "No working directory available"
|
|
@@ -44516,11 +44586,31 @@ Skip Shipyard for:
|
|
|
44516
44586
|
- Pure documentation without implementation`;
|
|
44517
44587
|
var USER_INPUT_SECTION = `## Human-Agent Communication
|
|
44518
44588
|
|
|
44519
|
-
|
|
44589
|
+
**\`requestUserInput()\` inside \`${TOOL_NAMES2.EXECUTE_CODE}\` is THE primary way to communicate with humans during active work.**
|
|
44590
|
+
|
|
44591
|
+
Shipyard is the central hub where humans manage AI agents. When you need to ask a question, get clarification, or request a decision - use \`requestUserInput()\`. The human is already in the browser viewing your plan. That's where conversations should happen.
|
|
44520
44592
|
|
|
44521
|
-
|
|
44593
|
+
### Best Practice: Return the Response Value
|
|
44522
44594
|
|
|
44523
|
-
|
|
44595
|
+
**Always RETURN the response in your execute_code result** for clean, structured output:
|
|
44596
|
+
|
|
44597
|
+
\`\`\`typescript
|
|
44598
|
+
const result = await requestUserInput({
|
|
44599
|
+
message: "Which framework?",
|
|
44600
|
+
type: "choice",
|
|
44601
|
+
options: ["React", "Vue", "Angular"]
|
|
44602
|
+
});
|
|
44603
|
+
|
|
44604
|
+
return {
|
|
44605
|
+
userDecision: result.response,
|
|
44606
|
+
timestamp: Date.now()
|
|
44607
|
+
};
|
|
44608
|
+
// Clean, structured - appears once in the final output
|
|
44609
|
+
\`\`\`
|
|
44610
|
+
|
|
44611
|
+
Avoid \`console.log()\` for response values - it clutters output and isn't structured. Use console.log only for debugging intermediate steps.
|
|
44612
|
+
|
|
44613
|
+
### Why Use requestUserInput()
|
|
44524
44614
|
|
|
44525
44615
|
- **Context:** The human sees your question alongside the plan, artifacts, and comments
|
|
44526
44616
|
- **History:** All exchanges are logged in the plan's activity feed
|
|
@@ -44529,40 +44619,62 @@ Shipyard is the central hub where humans manage AI agents. When you need to ask
|
|
|
44529
44619
|
|
|
44530
44620
|
### Replace Platform Tools
|
|
44531
44621
|
|
|
44532
|
-
**ALWAYS prefer
|
|
44622
|
+
**ALWAYS prefer \`requestUserInput()\` over platform-specific tools:**
|
|
44533
44623
|
|
|
44534
44624
|
| Platform | DON'T Use | Use Instead |
|
|
44535
44625
|
|----------|-----------|-------------|
|
|
44536
|
-
| Claude Code | \`AskUserQuestion\` |
|
|
44537
|
-
| Cursor | Built-in prompts |
|
|
44538
|
-
| Windsurf | Native dialogs |
|
|
44539
|
-
| Claude Desktop | Chat questions |
|
|
44626
|
+
| Claude Code | \`AskUserQuestion\` | \`requestUserInput()\` |
|
|
44627
|
+
| Cursor | Built-in prompts | \`requestUserInput()\` |
|
|
44628
|
+
| Windsurf | Native dialogs | \`requestUserInput()\` |
|
|
44629
|
+
| Claude Desktop | Chat questions | \`requestUserInput()\` |
|
|
44540
44630
|
|
|
44541
|
-
###
|
|
44631
|
+
### Two Modes: Multi-step vs Multi-form
|
|
44542
44632
|
|
|
44543
|
-
|
|
44544
|
-
- Clarification on requirements ("Which auth provider?")
|
|
44545
|
-
- Decisions that affect implementation ("PostgreSQL or SQLite?")
|
|
44546
|
-
- Confirmation before destructive actions ("Delete this file?")
|
|
44547
|
-
- User preferences ("Rate this approach 1-5")
|
|
44548
|
-
- Any information you can't infer from context
|
|
44549
|
-
|
|
44550
|
-
### Example
|
|
44633
|
+
Choose based on whether questions depend on each other:
|
|
44551
44634
|
|
|
44635
|
+
**Multi-step (dependencies):** Chain calls when later questions depend on earlier answers
|
|
44552
44636
|
\`\`\`typescript
|
|
44553
|
-
|
|
44554
|
-
|
|
44637
|
+
// First ask about database...
|
|
44638
|
+
const dbResult = await requestUserInput({
|
|
44639
|
+
message: "Which database?",
|
|
44555
44640
|
type: "choice",
|
|
44556
|
-
options: ["PostgreSQL", "SQLite", "MongoDB"]
|
|
44557
|
-
timeout: 600 // 10 minutes
|
|
44641
|
+
options: ["PostgreSQL", "SQLite", "MongoDB"]
|
|
44558
44642
|
});
|
|
44559
44643
|
|
|
44560
|
-
|
|
44561
|
-
|
|
44562
|
-
}
|
|
44644
|
+
// ...then ask port based on the choice
|
|
44645
|
+
const portResult = await requestUserInput({
|
|
44646
|
+
message: \\\`Port for \\\${dbResult.response}?\\\`,
|
|
44647
|
+
type: "number",
|
|
44648
|
+
min: 1000,
|
|
44649
|
+
max: 65535
|
|
44650
|
+
});
|
|
44651
|
+
|
|
44652
|
+
// Return both responses in structured format
|
|
44653
|
+
return { database: dbResult.response, port: portResult.response };
|
|
44563
44654
|
\`\`\`
|
|
44564
44655
|
|
|
44565
|
-
**
|
|
44656
|
+
**Multi-form (independent):** Single call for unrelated questions
|
|
44657
|
+
\`\`\`typescript
|
|
44658
|
+
const config = await requestUserInput({
|
|
44659
|
+
questions: [
|
|
44660
|
+
{ message: "Project name?", type: "text" },
|
|
44661
|
+
{ message: "Use TypeScript?", type: "confirm" },
|
|
44662
|
+
{ message: "License?", type: "choice", options: ["MIT", "Apache-2.0"] }
|
|
44663
|
+
],
|
|
44664
|
+
timeout: 600
|
|
44665
|
+
});
|
|
44666
|
+
// Return responses in structured format
|
|
44667
|
+
return { config: config.response };
|
|
44668
|
+
\`\`\`
|
|
44669
|
+
|
|
44670
|
+
### When to Ask
|
|
44671
|
+
|
|
44672
|
+
Use \`requestUserInput()\` when you need:
|
|
44673
|
+
- Clarification on requirements ("Which auth provider?")
|
|
44674
|
+
- Decisions that affect implementation ("PostgreSQL or SQLite?")
|
|
44675
|
+
- Confirmation before destructive actions ("Delete this file?")
|
|
44676
|
+
- User preferences ("Rate this approach 1-5")
|
|
44677
|
+
- Any information you can't infer from context`;
|
|
44566
44678
|
var TROUBLESHOOTING_SECTION = `## Troubleshooting
|
|
44567
44679
|
|
|
44568
44680
|
**Browser doesn't open:** Check MCP server is running and accessible.
|
|
@@ -44635,7 +44747,7 @@ var IMPORTANT_NOTES = `## Important Notes for Claude Code
|
|
|
44635
44747
|
- **DO NOT use the Shipyard skill** - The hook provides everything you need
|
|
44636
44748
|
- **DO NOT poll for approval** - The hook blocks automatically until human decides
|
|
44637
44749
|
- **DO use plan mode** for ANY work that needs tracking, verification, or human review
|
|
44638
|
-
- **DO use \`${TOOL_NAMES2.
|
|
44750
|
+
- **DO use \`requestUserInput()\`** inside \`${TOOL_NAMES2.EXECUTE_CODE}\` instead of \`AskUserQuestion\` - The human is in the browser viewing your plan, questions should appear there`;
|
|
44639
44751
|
var CLAUDE_CODE_INSTRUCTIONS = [
|
|
44640
44752
|
CLAUDE_CODE_HEADER,
|
|
44641
44753
|
"",
|
|
@@ -44663,19 +44775,18 @@ var MCP_DIRECT_HEADER = `# Shipyard: Your Agent Management Hub
|
|
|
44663
44775
|
|
|
44664
44776
|
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.
|
|
44665
44777
|
|
|
44666
|
-
**Key principle:** When you're working in Shipyard, ALL human-agent communication should happen through
|
|
44778
|
+
**Key principle:** When you're working in Shipyard, ALL human-agent communication should happen through \`requestUserInput()\` inside \`${TOOL_NAMES2.EXECUTE_CODE}\`. The human is already in the browser viewing your plan - that's where they expect to interact with you.`;
|
|
44667
44779
|
var MCP_TOOLS_OVERVIEW = `## Available MCP Tools
|
|
44668
44780
|
|
|
44669
44781
|
| Tool | Purpose |
|
|
44670
44782
|
|------|---------|
|
|
44671
|
-
| \`${TOOL_NAMES2.
|
|
44672
|
-
| \`${TOOL_NAMES2.EXECUTE_CODE}\` | Run TypeScript that calls Shipyard APIs (recommended for multi-step operations) |
|
|
44783
|
+
| \`${TOOL_NAMES2.EXECUTE_CODE}\` | Run TypeScript that calls ALL Shipyard APIs including \`requestUserInput()\` |
|
|
44673
44784
|
|
|
44674
|
-
###
|
|
44785
|
+
### requestUserInput(): Your Direct Line to the Human
|
|
44675
44786
|
|
|
44676
|
-
This is how you talk to humans during active work. Don't use your platform's built-in question tools (AskUserQuestion, etc.) - use
|
|
44787
|
+
This is how you talk to humans during active work. Don't use your platform's built-in question tools (AskUserQuestion, etc.) - use \`requestUserInput()\` inside \`${TOOL_NAMES2.EXECUTE_CODE}\` instead. The human is in the browser viewing your plan, and that's where they expect to see your questions.
|
|
44677
44788
|
|
|
44678
|
-
|
|
44789
|
+
All Shipyard operations (createPlan, addArtifact, requestUserInput, etc.) are available inside \`${TOOL_NAMES2.EXECUTE_CODE}\`.`;
|
|
44679
44790
|
var MCP_WORKFLOW = `## Workflow (MCP Direct)
|
|
44680
44791
|
|
|
44681
44792
|
### Step 1: Create Plan
|
|
@@ -44753,7 +44864,7 @@ if (result.allDeliverablesComplete) {
|
|
|
44753
44864
|
console.log('Done!', result.snapshotUrl);
|
|
44754
44865
|
}
|
|
44755
44866
|
\`\`\``;
|
|
44756
|
-
var API_REFERENCE = `## API Reference
|
|
44867
|
+
var API_REFERENCE = `## API Reference (inside execute_code)
|
|
44757
44868
|
|
|
44758
44869
|
### createPlan(options)
|
|
44759
44870
|
|
|
@@ -44795,44 +44906,65 @@ Uploads proof-of-work artifact.
|
|
|
44795
44906
|
|
|
44796
44907
|
### requestUserInput(options)
|
|
44797
44908
|
|
|
44798
|
-
Asks user a question via browser modal.
|
|
44909
|
+
**THE primary human-agent communication channel.** Asks user a question via browser modal.
|
|
44799
44910
|
|
|
44800
|
-
**
|
|
44911
|
+
**IMPORTANT: Always RETURN the response value in your execute_code result.**
|
|
44912
|
+
|
|
44913
|
+
\u2705 **RECOMMENDED (primary pattern):**
|
|
44914
|
+
\`\`\`typescript
|
|
44915
|
+
const result = await requestUserInput({ message: "Which database?", type: "choice", options: ["PostgreSQL", "SQLite"] });
|
|
44916
|
+
return { userChoice: result.response, status: result.status };
|
|
44917
|
+
// Clean, structured output appears once in the final result
|
|
44918
|
+
\`\`\`
|
|
44919
|
+
|
|
44920
|
+
\u26A0\uFE0F **AVOID (use only for debugging):**
|
|
44921
|
+
\`\`\`typescript
|
|
44922
|
+
console.log(\\\`User chose: \\\${result.response}\\\`);
|
|
44923
|
+
// Clutters output, not structured
|
|
44924
|
+
\`\`\`
|
|
44925
|
+
|
|
44926
|
+
**Two modes - choose based on dependencies:**
|
|
44927
|
+
|
|
44928
|
+
**Multi-step (dependencies):** Chain calls when later questions depend on earlier answers
|
|
44929
|
+
\`\`\`typescript
|
|
44930
|
+
const db = await requestUserInput({ message: "Database?", type: "choice", options: ["PostgreSQL", "SQLite"] });
|
|
44931
|
+
const port = await requestUserInput({ message: \\\`Port for \\\${db.response}?\\\`, type: "number" });
|
|
44932
|
+
return { database: db.response, port: port.response };
|
|
44933
|
+
\`\`\`
|
|
44934
|
+
|
|
44935
|
+
**Multi-form (independent):** Single call for unrelated questions
|
|
44936
|
+
\`\`\`typescript
|
|
44937
|
+
const config = await requestUserInput({
|
|
44938
|
+
questions: [
|
|
44939
|
+
{ message: "Project name?", type: "text" },
|
|
44940
|
+
{ message: "Use TypeScript?", type: "confirm" }
|
|
44941
|
+
]
|
|
44942
|
+
});
|
|
44943
|
+
return { config: config.response };
|
|
44944
|
+
\`\`\`
|
|
44945
|
+
|
|
44946
|
+
**Parameters (single-question mode):**
|
|
44801
44947
|
- \`message\` (string) - Question to ask
|
|
44802
44948
|
- \`type\` (string) - Input type (see below)
|
|
44803
44949
|
- \`options\` (string[], for 'choice') - Available choices
|
|
44804
44950
|
- \`timeout\` (number, optional) - Timeout in seconds
|
|
44805
44951
|
- Type-specific parameters (min, max, format, etc.)
|
|
44806
44952
|
|
|
44953
|
+
**Parameters (multi-question mode):**
|
|
44954
|
+
- \`questions\` (array) - Array of 1-10 questions (8 recommended)
|
|
44955
|
+
- \`timeout\` (number, optional) - Timeout in seconds
|
|
44956
|
+
|
|
44807
44957
|
**Returns:** \`{ success, response?, status }\`
|
|
44808
44958
|
|
|
44809
44959
|
**Supported types (8 total):**
|
|
44810
44960
|
1. \`text\` - Single-line text
|
|
44811
44961
|
2. \`multiline\` - Multi-line text area
|
|
44812
44962
|
3. \`choice\` - Radio/checkbox/dropdown (auto-adds "Other" option)
|
|
44813
|
-
- Auto-switches: 1-8 options = radio/checkbox, 9+ = dropdown
|
|
44814
|
-
- \`multiSelect: true\` for checkboxes
|
|
44815
|
-
- \`displayAs: 'dropdown'\` to force dropdown UI
|
|
44816
44963
|
4. \`confirm\` - Yes/No buttons
|
|
44817
44964
|
5. \`number\` - Numeric input with validation
|
|
44818
|
-
- \`min\`, \`max\`, \`format\` ('integer' | 'decimal' | 'currency' | 'percentage')
|
|
44819
44965
|
6. \`email\` - Email validation
|
|
44820
|
-
- \`domain\` for restriction
|
|
44821
44966
|
7. \`date\` - Date picker with range
|
|
44822
|
-
|
|
44823
|
-
8. \`rating\` - Scale rating (auto-selects stars/numbers)
|
|
44824
|
-
- \`min\`, \`max\`, \`style\` ('stars' | 'numbers' | 'emoji'), \`labels\`
|
|
44825
|
-
|
|
44826
|
-
**Response format:**
|
|
44827
|
-
- All responses are strings
|
|
44828
|
-
- choice (single): \`"PostgreSQL"\` or custom text from "Other"
|
|
44829
|
-
- choice (multi): \`"option1, option2"\` (comma-space separated)
|
|
44830
|
-
- confirm: \`"yes"\` or \`"no"\` (lowercase)
|
|
44831
|
-
- number: \`"42"\` or \`"3.14"\`
|
|
44832
|
-
- email: \`"user@example.com"\`
|
|
44833
|
-
- date: \`"2026-01-24"\` (ISO 8601)
|
|
44834
|
-
- rating: \`"4"\` (integer as string)
|
|
44835
|
-
- See docs/INPUT-RESPONSE-FORMATS.md for complete specification`;
|
|
44967
|
+
8. \`rating\` - Scale rating`;
|
|
44836
44968
|
var HANDLING_FEEDBACK = `## Handling Reviewer Feedback
|
|
44837
44969
|
|
|
44838
44970
|
\`\`\`typescript
|
|
@@ -44980,11 +45112,11 @@ function handlePreToolUse(input) {
|
|
|
44980
45112
|
if (toolName === CLAUDE_TOOL_NAMES.ASK_USER_QUESTION) {
|
|
44981
45113
|
logger.info(
|
|
44982
45114
|
{ toolName },
|
|
44983
|
-
"Blocking AskUserQuestion - redirecting to
|
|
45115
|
+
"Blocking AskUserQuestion - redirecting to requestUserInput() in execute_code"
|
|
44984
45116
|
);
|
|
44985
45117
|
return {
|
|
44986
45118
|
type: "tool_deny",
|
|
44987
|
-
reason: `BLOCKED: Use
|
|
45119
|
+
reason: `BLOCKED: Use requestUserInput() inside ${TOOL_NAMES.EXECUTE_CODE} instead. The human is in the browser viewing your plan - that's where they expect to interact with you. See the execute_code tool description for input types and parameters.`
|
|
44988
45120
|
};
|
|
44989
45121
|
}
|
|
44990
45122
|
return { type: "passthrough" };
|