@thedeck/mcp 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/cli.js +12 -2
  2. package/dist/index.js +22 -12
  3. package/package.json +38 -38
package/dist/cli.js CHANGED
@@ -52,6 +52,13 @@ var tagLabel = z.object({
52
52
  label: z.string().min(1)
53
53
  }).strict();
54
54
  z.discriminatedUnion("kind", [usernameLabel, tagLabel]);
55
+ // ../shared/src/time.ts
56
+ var zones = null;
57
+ function isTimeZone(value) {
58
+ if (!value) return false;
59
+ zones ??= new Set(Intl.supportedValuesOf("timeZone"));
60
+ return value === "UTC" || zones.has(value);
61
+ }
55
62
  var deliverableSchema = z.enum([
56
63
  "code",
57
64
  "setup_notes",
@@ -161,6 +168,8 @@ var scenario = z.object({
161
168
  expected: z.string().trim().min(1).max(2e3)
162
169
  });
163
170
  var scenarios = z.array(scenario).min(1).max(10);
171
+ var ASK_END_DATE = "Give the last day builders can enter as YYYY-MM-DD, the date the person stated. Ask the person for the end date.";
172
+ var ASK_TIME_ZONE = "Give the person’s IANA time zone, such as America/New_York. Ask the person which time zone they are in, or confirm the one you know; never guess it.";
164
173
  var postDraftInput = z.object({
165
174
  quest_id: questId.optional(),
166
175
  title: z.string().trim().min(1).max(BRIEF_LIMITS.title),
@@ -170,7 +179,8 @@ var postDraftInput = z.object({
170
179
  handover: section,
171
180
  judging_notes: section,
172
181
  deliverables: z.array(deliverableSchema).min(1),
173
- deadline_days: z.number().int().positive().optional(),
182
+ ends_on: z.iso.date({ error: ASK_END_DATE }).describe("The last day builders can enter (YYYY-MM-DD), as the person stated it, 5 to 60 days from their today. Entries close at 23:59 that day in time_zone."),
183
+ time_zone: z.string({ error: ASK_TIME_ZONE }).refine(isTimeZone, { error: ASK_TIME_ZONE }).describe("The person’s IANA time zone, such as America/New_York, as they confirmed it. The deadline is 23:59 on ends_on in this zone."),
174
184
  scenarios: scenarios.describe("The scenarios the person confirmed: each situation that comes in and what should happen then, as you described them back and they agreed.")
175
185
  });
176
186
  var postPart = z.enum([
@@ -250,7 +260,7 @@ var getTaskStatusInput = z.object({ quest_id: questId });
250
260
  var getTaskStatusOutput = z.object({
251
261
  entries: z.number().int().nonnegative(),
252
262
  passed: z.number().int().nonnegative(),
253
- days_left: z.number().int().nullable(),
263
+ days_left: z.number().int().nullable().describe("Whole days to the deadline’s day: 0 on the last day, below 0 once it has passed."),
254
264
  discussion: z.object({
255
265
  ends_at: z.string(),
256
266
  revisions_used: z.number().int().nonnegative(),
package/dist/index.js CHANGED
@@ -65,6 +65,19 @@ function formatMoney(cents, currency = "USD") {
65
65
  maximumFractionDigits: 2
66
66
  }).format(cents / 100);
67
67
  }
68
+ // ../shared/src/time.ts
69
+ var zones = null;
70
+ function isTimeZone(value) {
71
+ if (!value) return false;
72
+ zones ??= new Set(Intl.supportedValuesOf("timeZone"));
73
+ return value === "UTC" || zones.has(value);
74
+ }
75
+ function daysLeftText(days) {
76
+ if (days === null) return "No deadline";
77
+ if (days < 0) return "Deadline passed";
78
+ if (days === 0) return "Last day";
79
+ return `${days} ${days === 1 ? "day" : "days"} left`;
80
+ }
68
81
  var deliverableSchema = z.enum([
69
82
  "code",
70
83
  "setup_notes",
@@ -174,6 +187,8 @@ var scenario = z.object({
174
187
  expected: z.string().trim().min(1).max(2e3)
175
188
  });
176
189
  var scenarios = z.array(scenario).min(1).max(10);
190
+ var ASK_END_DATE = "Give the last day builders can enter as YYYY-MM-DD, the date the person stated. Ask the person for the end date.";
191
+ var ASK_TIME_ZONE = "Give the person’s IANA time zone, such as America/New_York. Ask the person which time zone they are in, or confirm the one you know; never guess it.";
177
192
  var postDraftInput = z.object({
178
193
  quest_id: questId.optional(),
179
194
  title: z.string().trim().min(1).max(BRIEF_LIMITS.title),
@@ -183,7 +198,8 @@ var postDraftInput = z.object({
183
198
  handover: section,
184
199
  judging_notes: section,
185
200
  deliverables: z.array(deliverableSchema).min(1),
186
- deadline_days: z.number().int().positive().optional(),
201
+ ends_on: z.iso.date({ error: ASK_END_DATE }).describe("The last day builders can enter (YYYY-MM-DD), as the person stated it, 5 to 60 days from their today. Entries close at 23:59 that day in time_zone."),
202
+ time_zone: z.string({ error: ASK_TIME_ZONE }).refine(isTimeZone, { error: ASK_TIME_ZONE }).describe("The person’s IANA time zone, such as America/New_York, as they confirmed it. The deadline is 23:59 on ends_on in this zone."),
187
203
  scenarios: scenarios.describe("The scenarios the person confirmed: each situation that comes in and what should happen then, as you described them back and they agreed.")
188
204
  });
189
205
  var postPart = z.enum([
@@ -263,7 +279,7 @@ var getTaskStatusInput = z.object({ quest_id: questId });
263
279
  var getTaskStatusOutput = z.object({
264
280
  entries: z.number().int().nonnegative(),
265
281
  passed: z.number().int().nonnegative(),
266
- days_left: z.number().int().nullable(),
282
+ days_left: z.number().int().nullable().describe("Whole days to the deadline’s day: 0 on the last day, below 0 once it has passed."),
267
283
  discussion: z.object({
268
284
  ends_at: z.string(),
269
285
  revisions_used: z.number().int().nonnegative(),
@@ -830,7 +846,6 @@ var SCRIPT = String.raw`
830
846
  const em = (t) => el('span', 'em', t);
831
847
  const mute = (t) => el('span', 'mute', t);
832
848
  const join = (parts) => parts.reduce((acc, x, n) => (n ? acc.concat(' · ', x) : acc.concat(x)), []);
833
- const plural = (n, one, many) => n + ' ' + (n === 1 ? one : many);
834
849
  const safeUrl = (u) => typeof u === 'string' && /^https?:\/\//i.test(u);
835
850
 
836
851
  function openLink(label, url) {
@@ -851,7 +866,7 @@ var SCRIPT = String.raw`
851
866
  const CARDS = {
852
867
  draft(b, o, i) {
853
868
  if (i.title) b.append(p('ttl', i.title));
854
- b.append(p('', join([em('Draft saved'), i.deadline_days ? 'runs ' + plural(i.deadline_days, 'day', 'days') + ' once posted' : 'no deadline yet', mute('nothing charged')])));
869
+ b.append(p('', join([em('Draft saved'), i.ends_on ? 'ends ' + i.ends_on + ', 23:59 (' + i.time_zone + ')' : 'no deadline yet', mute('nothing charged')])));
855
870
  const scenarios = Array.isArray(o.scenarios) ? o.scenarios : Array.isArray(i.scenarios) ? i.scenarios : [];
856
871
  if (scenarios.length) b.append(el('p', 'lbl', 'Scenarios'), scenarioList(scenarios));
857
872
  const missing = o.missing || [];
@@ -1000,7 +1015,7 @@ var POSTING_STEPS = [
1000
1015
  "To help a person post a task, go through these steps in order, one at a time:",
1001
1016
  "1. Ask what they need. If they don’t know what to build, suggest ideas from what you already know of them, from this conversation and earlier ones. This brainstorming stays between you and them: nothing goes to The Deck except the post they approve.",
1002
1017
  "2. Describe concrete scenarios back to them (\"when X comes in, it should do Y\") and ask whether that is what they want. Revise until they confirm.",
1003
- "3. Work out the technical details the post needs: inputs, outputs, formats, what counts as right, and constraints.",
1018
+ "3. Work out the technical details the post needs: inputs, outputs, formats, what counts as right, and constraints. Ask for the end date: the last day builders can enter, 5 to 60 days from today. Confirm the person’s time zone with them; never assume it. Entries close at 23:59 on that date in their time zone.",
1004
1019
  "4. Ask for real example data. Blank names, numbers and anything sensitive in a copy on their computer before anything is sent. The confirmed scenarios are the basis for the examples and tests. Suggest which one or two examples builders should see; the person decides, and the rest stay hidden for judging.",
1005
1020
  "5. Save the draft with deck.post_draft, with the confirmed scenarios. Send each blanked copy with deck.add_example_copy, marking the ones the person chose to show builders (without that tool, the person adds the copies on The Deck), then propose tests with deck.propose_tests.",
1006
1021
  "6. The person sets the reward and who can see the task, then confirms and pays on The Deck."
@@ -1092,11 +1107,6 @@ var getPassingEntries = {
1092
1107
  summary: (out) => [out.entries.length === 1 ? "1 passing, scan-clear entry at its latest version. The link expires in 60 seconds." : `${out.entries.length} passing, scan-clear entries at their latest versions. Links expire in 60 seconds.`, ...out.entries.map(line$1)].join("\n")
1093
1108
  };
1094
1109
  // src/tools/getTaskStatus.ts
1095
- function daysText(days) {
1096
- if (days === null) return "No deadline";
1097
- if (days === 0) return "Deadline passed";
1098
- return `${plural(days, "day", "days")} left`;
1099
- }
1100
1110
  function discussionText(d) {
1101
1111
  return `Discussion open until ${utc(d.ends_at)}, ${plural(d.revisions_used, "revision", "revisions")} used, deposit ${d.deposit_held ? "held" : "not held"}`;
1102
1112
  }
@@ -1109,7 +1119,7 @@ var getTaskStatus = {
1109
1119
  summary: (out) => [
1110
1120
  plural(out.entries, "entry", "entries"),
1111
1121
  `${out.passed} passed`,
1112
- daysText(out.days_left),
1122
+ daysLeftText(out.days_left),
1113
1123
  ...out.discussion ? [discussionText(out.discussion)] : []
1114
1124
  ].join(" · ")
1115
1125
  };
@@ -1140,7 +1150,7 @@ var listQuests = {
1140
1150
  var postDraft = {
1141
1151
  name: "deck.post_draft",
1142
1152
  title: "Draft a task",
1143
- description: "For posters. Saves a task brief on The Deck as a draft, or updates the draft named by quest_id. The poster sets the reward and who can see it, then confirms and pays on The Deck: an agent never posts a task live and never spends money.",
1153
+ description: "For posters. Saves a task brief on The Deck as a draft, or updates the draft named by quest_id. The deadline is the person’s: send the end date they gave you and the time zone they confirmed, never ones you chose. The poster sets the reward and who can see it, then confirms and pays on The Deck: an agent never posts a task live and never spends money.",
1144
1154
  run: (backend, args) => backend.postDraft(args),
1145
1155
  summary: (out) => {
1146
1156
  const saved = `Draft saved as quest ${out.quest_id}. The poster checks it at ${out.review_url}; the reward, who can see it and posting stay theirs.`;
package/package.json CHANGED
@@ -1,38 +1,38 @@
1
- {
2
- "name": "@thedeck/mcp",
3
- "version": "0.1.0",
4
- "type": "module",
5
- "bin": {
6
- "mcp": "dist/index.js",
7
- "thedeck-mcp": "dist/index.js",
8
- "thedeck": "dist/cli.js"
9
- },
10
- "exports": {
11
- ".": "./src/server.ts",
12
- "./backend": "./src/backend.ts"
13
- },
14
- "files": [
15
- "dist"
16
- ],
17
- "scripts": {
18
- "build": "vite build --ssr src/index.ts --outDir dist && vite build --ssr src/cli.ts --outDir dist --emptyOutDir false",
19
- "typecheck": "tsc --noEmit",
20
- "lint": "eslint .",
21
- "test": "vitest run"
22
- },
23
- "dependencies": {
24
- "@modelcontextprotocol/sdk": "1.32.1",
25
- "zod": "4.6.7"
26
- },
27
- "devDependencies": {
28
- "@modelcontextprotocol/ext-apps": "1.7.5",
29
- "@thedeck/runner": "workspace:*",
30
- "@thedeck/shared": "workspace:*",
31
- "@types/node": "26.6.5",
32
- "@vitest/coverage-v8": "5.0.5",
33
- "happy-dom": "21.0.4",
34
- "typescript": "6.0.3",
35
- "vite": "8.3.5",
36
- "vitest": "5.0.5"
37
- }
38
- }
1
+ {
2
+ "name": "@thedeck/mcp",
3
+ "version": "0.1.1",
4
+ "type": "module",
5
+ "bin": {
6
+ "mcp": "dist/index.js",
7
+ "thedeck-mcp": "dist/index.js",
8
+ "thedeck": "dist/cli.js"
9
+ },
10
+ "exports": {
11
+ ".": "./src/server.ts",
12
+ "./backend": "./src/backend.ts"
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "scripts": {
18
+ "build": "vite build --ssr src/index.ts --outDir dist && vite build --ssr src/cli.ts --outDir dist --emptyOutDir false",
19
+ "typecheck": "tsc --noEmit",
20
+ "lint": "eslint .",
21
+ "test": "vitest run"
22
+ },
23
+ "dependencies": {
24
+ "@modelcontextprotocol/sdk": "1.32.1",
25
+ "zod": "4.6.7"
26
+ },
27
+ "devDependencies": {
28
+ "@modelcontextprotocol/ext-apps": "1.7.5",
29
+ "@thedeck/runner": "workspace:*",
30
+ "@thedeck/shared": "workspace:*",
31
+ "@types/node": "26.6.5",
32
+ "@vitest/coverage-v8": "5.0.5",
33
+ "happy-dom": "21.0.4",
34
+ "typescript": "6.0.3",
35
+ "vite": "8.3.5",
36
+ "vitest": "5.0.5"
37
+ }
38
+ }