tidee-mcp 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +61 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -207,6 +207,52 @@ var OAUTH_REGISTRATION_WINDOW_MS = 60 * 60 * 1e3;
207
207
  // ../tidee-life-config/dist/src/index.js
208
208
  var ALLOWED_PRIORITIZABLE_TYPES = [ITEM_TYPES.todoText.name];
209
209
 
210
+ // ../tidee-life-core/dist/src/paths/index.js
211
+ var paths = {
212
+ // Phase 4 slice F2b — the OAuth consent screen. Under /app because
213
+ // approving a grant needs a signed-in user; the signed request the
214
+ // authorize endpoint issues travels in `?request=`.
215
+ authorize: () => "/app/authorize",
216
+ activateAccount: (confirmHash) => confirmHash ? `/activate-account/${confirmHash}` : "/activate-account",
217
+ workspace: () => "/app/workspace",
218
+ forgot: () => "/forgot",
219
+ forgotSuccess: () => "/forgot/success",
220
+ // Phase 3 slice S — landing page for item-share invites. The hash
221
+ // is the ItemShareInvite.inviteHash carried in the recipient's
222
+ // email; the page decides which of the three branches to render
223
+ // (unauth signup CTAs / silent claim / add-and-verify) based on
224
+ // the caller's auth state and verifiedEmails set.
225
+ shareInvite: (inviteHash) => inviteHash ? `/invite/${inviteHash}` : "/invite",
226
+ loggedInRoot: () => "/app",
227
+ /**
228
+ * Phase 4 slice M — a link straight to one item.
229
+ *
230
+ * A query parameter on the workspace rather than a route of its own,
231
+ * because the destination IS the workspace: the item is opened in
232
+ * its box, in place, exactly as clicking it from the sidebar would.
233
+ * A dedicated route would have to reproduce that, and would leave
234
+ * the user somewhere the app has no other way of reaching.
235
+ *
236
+ * Used by the confirmations external surfaces send back — Slack and
237
+ * MCP — where the thing captured is otherwise out of sight.
238
+ */
239
+ workspaceItem: (itemShareId) => itemShareId ? `/app/workspace?item=${encodeURIComponent(itemShareId)}` : "/app/workspace",
240
+ login: () => "/login",
241
+ logout: () => "/app/logout",
242
+ notLoggedInRoot: () => "/",
243
+ organiser: () => "/app/organiser",
244
+ prioritized: () => "/app/prioritized",
245
+ backlog: () => "/app/backlog",
246
+ passwordReset: ({ passwordResetHash = null } = {}) => passwordResetHash ? `/password-reset/${passwordResetHash}` : "/password-reset",
247
+ passwordResetSuccess: () => "/password-reset-success",
248
+ resendActivationLink: () => "/resend-activation-link",
249
+ resendActivationLinkSuccess: () => "/resend-activation-link-success",
250
+ shares: () => "/app/shares",
251
+ signup: (organisationInviteHash) => organisationInviteHash ? `/signup/${organisationInviteHash}` : "/signup",
252
+ signupSuccess: () => "/signup/success",
253
+ verifyEmail: (token) => token ? `/app/verify-email/${token}` : "/app/verify-email"
254
+ };
255
+
210
256
  // ../tidee-life-core/dist/src/mcp/tools.js
211
257
  var describeToolError = (failure) => {
212
258
  const { code, status, message } = failure ?? {};
@@ -225,6 +271,11 @@ var describeToolError = (failure) => {
225
271
  return `tidee returned ${status}.`;
226
272
  return message || "The request to tidee failed.";
227
273
  };
274
+ var itemUrl = (api2, itemShareId) => {
275
+ if (!api2.appBaseUrl || !itemShareId)
276
+ return null;
277
+ return `${api2.appBaseUrl.replace(/\/+$/, "")}${paths.workspaceItem(itemShareId)}`;
278
+ };
228
279
  var tool = (spec) => spec;
229
280
  var TIDEE_TOOLS = [
230
281
  tool({
@@ -241,10 +292,14 @@ var TIDEE_TOOLS = [
241
292
  },
242
293
  async run(api2, { text, parentId }) {
243
294
  const data = await api2.capture({ text, parentId });
244
- const titles = (data.created ?? []).map((c) => c.title);
245
- if (titles.length === 0)
295
+ const created = data.created ?? [];
296
+ if (created.length === 0)
246
297
  return "Nothing was created.";
247
- const quoted = titles.map((t) => `"${t}"`).join(", ");
298
+ const titles = created.map((c) => c.title);
299
+ const quoted = created.map((c) => {
300
+ const url = itemUrl(api2, c.itemShareId);
301
+ return url ? `"${c.title}" (${url})` : `"${c.title}"`;
302
+ }).join(", ");
248
303
  if (data.usedFallback) {
249
304
  return `Saved as one item: ${quoted}. tidee could not split that into separate items, so it kept the text as given.`;
250
305
  }
@@ -372,6 +427,9 @@ var call = async (path, init) => {
372
427
  return body;
373
428
  };
374
429
  var api = {
430
+ // The API host and the app host are the same deployment, so the
431
+ // token's server is also where its items can be looked at.
432
+ appBaseUrl: API_URL,
375
433
  capture: ({ text, parentId }) => call("/api/v1/capture", {
376
434
  method: "POST",
377
435
  body: { text, parentId }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tidee-mcp",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "mcpName": "com.tidee/tidee",
5
5
  "description": "MCP server for tidee — let an assistant add items to your workspace, read what is there, and mark things done.",
6
6
  "keywords": [