@levitating/tensor-mcp 6.1.0 → 6.3.0

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/README.md CHANGED
@@ -187,11 +187,12 @@ immediate and unrecoverable.
187
187
  The work surfaces are deliberately softer. `delete_file`, `delete_idea`,
188
188
  `delete_todo`, `delete_bookmark` and `delete_tab_group` move a row to a
189
189
  restorable Trash, every permanent purge is UI-only, and every Trash empties
190
- itself 60 days after deletion on one shared window and one sweeper. Still
191
- immediate on those surfaces: `delete_todo_state`, `delete_todo_tag`,
192
- `delete_file_folder` and `delete_tab` (one tab out of a live group; the group
193
- is the recoverable unit, so a tab has no soft state of its own). The first
194
- three refuse while in use; once through, there is no undo.
190
+ itself 60 days after deletion on one shared window and one sweeper. Not soft
191
+ on those surfaces: `delete_todo_tag` and `delete_tab` (one tab out of a live
192
+ group; the group is the recoverable unit, so a tab has no soft state of its
193
+ own) are permanent and take two calls, and `delete_todo_state` and
194
+ `delete_file_folder` are one call that refuses while anything uses the record.
195
+ Once through, there is no undo for any of the four.
195
196
 
196
197
  ### What a client can tell before it calls
197
198
 
@@ -247,8 +248,9 @@ connection's scopes.
247
248
  **A permanent delete takes two calls** (since 5.8.0). `delete_position`,
248
249
  `delete_entity`, `delete_account`, `delete_asset`, `delete_institution`,
249
250
  `delete_entity_type`, `delete_role_type`, `delete_account_type`,
250
- `delete_asset_class`, `delete_bookmark_folder`, `delete_todo_tag` and
251
- `delete_entity_group` (since 5.10.0) destroy
251
+ `delete_asset_class`, `delete_bookmark_folder`, `delete_todo_tag`,
252
+ `delete_entity_group` (since 5.10.0) and `delete_entity_relationship`,
253
+ `delete_position_relation` and `delete_tab` (since 6.2.0) destroy
252
254
  rows no Trash brings back. The first call deletes nothing: it answers
253
255
  `NOT DELETED.` with a preview of what would go (the record, the rows deleted
254
256
  with it, the rows unhooked from it) and a one-time `confirmToken`. Show the
@@ -256,7 +258,10 @@ person the preview; only after they agree, call the same tool again with the
256
258
  same `id` and that `confirmToken` (good for ten minutes, once). A record other
257
259
  records still use is refused outright with what is using it. The soft deletes
258
260
  (`delete_todo`, `delete_idea`, `delete_file`, `delete_bookmark`,
259
- `delete_tab_group`, …) are one call, because Trash can undo them.
261
+ `delete_tab_group`, …) are one call, because Trash can undo them. So are
262
+ `delete_file_folder` and `delete_todo_state` (refused unless nothing uses the
263
+ record) and the `detach_*` tools (one edge between two records that both
264
+ stay).
260
265
 
261
266
  **A list answers a page** (since 6.0.0). The paged `list_*` tools and
262
267
  `browse_files` return `{ items, hasMore, nextOffset }`: 100 rows unless you pass
@@ -290,7 +295,7 @@ Changing any of these stays in Tensor's web app.
290
295
 
291
296
  | Tool | Description |
292
297
  |------|-------------|
293
- | `list_fund_performance` | Every fund LP position's paid-in, distributions, unfunded commitment, DPI/RVPI/TVPI, IRR or TWR and NAV freshness, with its terms; the same fold as the Portfolio page's fund card |
298
+ | `list_fund_performance` | Every fund LP position's paid-in, distributions, unfunded commitment, DPI/RVPI/TVPI, IRR or TWR and NAV freshness, with its terms; the same fold as the Wealth page's fund card |
294
299
  | `get_fund_performance` | One fund position's performance and terms |
295
300
  | `list_fund_terms` | Every fund position's descriptive terms, without figures |
296
301
  | `get_fund_terms` | One fund position's terms |
@@ -311,7 +316,7 @@ Changing any of these stays in Tensor's web app.
311
316
  | `list_entity_relationships` | List entity relationships |
312
317
  | `create_entity_relationship` | Link two entities |
313
318
  | `update_entity_relationship` | Update a relationship |
314
- | `delete_entity_relationship` | Remove a relationship |
319
+ | `delete_entity_relationship` | Remove a relationship; both entities stay. Permanent, two calls |
315
320
  | `list_entity_groups` | Named sets of entities, with their member ids |
316
321
  | `create_entity_group` | Create a group |
317
322
  | `update_entity_group` | Rename it, or replace its members (`entityIds` is the whole list) |
@@ -337,7 +342,7 @@ Changing any of these stays in Tensor's web app.
337
342
  | `sell_all_position` | Close/sell a position, keeping its history |
338
343
  | `list_position_relations` | List position relations |
339
344
  | `create_position_relation` | Link positions |
340
- | `delete_position_relation` | Remove a relation |
345
+ | `delete_position_relation` | Remove a relation; both positions stay. Permanent, two calls |
341
346
  | `list_position_events` | Valuation-event history for one position |
342
347
  | `list_events` | Valuation-event history across all positions |
343
348
  | `list_transactions` | List all transactions |
@@ -449,6 +454,7 @@ The capture inbox. An idea's body is a TipTap document since 4.2.0 — plain tex
449
454
  | `restore_idea` | `tensor:ideas:write` | Restore from Trash, on the side of the archive it was deleted from |
450
455
  | `archive_idea` | `tensor:ideas:write` | Archive: off the active stream, kept for good (5.6.0). Idempotent; an idea in Trash is a `409` |
451
456
  | `unarchive_idea` | `tensor:ideas:write` | Back into the active stream (5.6.0). Idempotent; an idea in Trash is a `409` |
457
+ | `convert_idea` | `tensor:ideas:write` + `tensor:ideas:read` + the new record's scopes | The web app's Convert (6.3.0): make a todo (`tensor:todos:read` + `tensor:todos:write`; titled after the idea, in the first not-started state, linked back to it) or a bookmark (`tensor:bookmarks:write`; only for an idea with a url), then archive the idea. A memo is not offered: Memos is session-only. Undo is `unarchive_idea`; the new record stays |
452
458
  | `get_idea_activity` | `tensor:ideas:read` | Activity feed, folded from the mutation audit log — who changed the idea, through which client and why; a rolling one-year window (past 90 days an entry says what changed, not to what), not permanent history |
453
459
  | `list_idea_comments` | `tensor:ideas:read` | The comment thread |
454
460
  | `create_idea_comment` | `tensor:ideas:write` | Comment (plain text, stored as TipTap JSON) |
@@ -464,20 +470,22 @@ The capture inbox. An idea's body is a TipTap document since 4.2.0 — plain tex
464
470
 
465
471
  ### Bookmarks
466
472
 
467
- The filed half of Web: pages somebody decided to keep, in a folder tree. `/api/bookmark-folders` is a SIBLING resource rather than a sub-path — one scope opens both. Delete is a restorable Trash; the purge is session-only. A duplicate URL is flagged (`duplicateOf`), never refused.
473
+ The filed half of Web: pages somebody decided to keep, in a folder tree. `/api/bookmark-folders` is a SIBLING resource rather than a sub-path — one scope opens both. Delete is a restorable Trash; the purge is session-only. A duplicate URL is flagged (`duplicateOf`), never refused. Since 6.3.0 a bookmark can be **archived** on Ideas' terms — off the active library, kept for good, still readable and searchable, keeping its folder and place — and a folder can be **pinned**, a shortcut drawn first that never changes its place in the tree.
468
474
 
469
475
  | Tool | Scope | Description |
470
476
  |------|-------|-------------|
471
- | `list_bookmarks` | `tensor:bookmarks:read` | The library in the order the owner arranged it: Unfiled first, then folder by folder down the tree. `folderId` is three-valued — an id, `'none'` for the unfiled, or omitted for everything — and `trash` gives the deleted rows |
477
+ | `list_bookmarks` | `tensor:bookmarks:read` | The library in the order the owner arranged it: Unfiled first, then folder by folder down the tree. `folderId` is three-valued — an id, `'none'` for the unfiled, or omitted for everything — `archived` (6.3.0) gives the archived bookmarks, and `trash` the deleted rows. Archived bookmarks and the Read later queue are left out by default |
472
478
  | `get_bookmark` | `tensor:bookmarks:read` | One bookmark, with the `normalizedUrl` duplicate detection compares |
473
479
  | `create_bookmark` | `tensor:bookmarks:write` | File a page. Only `url` is required; no folder means unfiled, which is a resting state |
474
- | `update_bookmark` | `tensor:bookmarks:write` | Partial update — title, url, folder, excerpt, favicon. `folderId: null` unfiles |
480
+ | `update_bookmark` | `tensor:bookmarks:write` | Partial update — title, url, folder, excerpt, favicon. `folderId: null` unfiles. Never archives: that is `archive_bookmark` |
475
481
  | `move_bookmark` | `tensor:bookmarks:write` | Move into another folder and/or to a place in the order, next to a named neighbour (`beforeId` / `afterId`), or to the end |
476
482
  | `delete_bookmark` | `tensor:bookmarks:write` | Move to Trash. Soft — restorable; the purge is UI-only |
477
483
  | `restore_bookmark` | `tensor:bookmarks:write` | Restore, back into the folder it was filed in |
484
+ | `archive_bookmark` | `tensor:bookmarks:write` | Archive: off the active library, kept for good, folder and place kept (6.3.0). Idempotent; a bookmark in Trash is a `409` |
485
+ | `unarchive_bookmark` | `tensor:bookmarks:write` | Back into the active library, where it was (6.3.0). Idempotent; a bookmark in Trash is a `409` |
478
486
  | `list_bookmark_folders` | `tensor:bookmarks:read` | The folder tree, parents before children and siblings in the owner's order — keep it rather than sorting by name |
479
- | `create_bookmark_folder` | `tensor:bookmarks:write` | Create a folder, optionally nested |
480
- | `update_bookmark_folder` | `tensor:bookmarks:write` | Rename or re-parent. A cycle or a depth ceiling refuses with `409` saying which |
487
+ | `create_bookmark_folder` | `tensor:bookmarks:write` | Create a folder, optionally nested and optionally `pinned` (6.3.0) |
488
+ | `update_bookmark_folder` | `tensor:bookmarks:write` | Rename, re-parent, or pin / unpin (`pinned`, 6.3.0 — a shortcut, not a rank). A cycle or a depth ceiling refuses with `409` saying which |
481
489
  | `move_bookmark_folder` | `tensor:bookmarks:write` | Move under another folder and/or to a place among its siblings; the same `409`s |
482
490
  | `delete_bookmark_folder` | `tensor:bookmarks:write` | Destroy the folder and nothing else: its bookmarks are unfiled, its sub-folders promoted. No undo — a folder is a filing decision, not a Trash surface |
483
491
 
@@ -492,7 +500,7 @@ Tabs parked from the browser extension, kept together and in order. Scoped SEPAR
492
500
  | `create_tab_group` | `tensor:tabs:write` | Park 1–500 tabs as one group. One call carries the whole group — the rate limit makes per-tab posting unworkable |
493
501
  | `update_tab_group` | `tensor:tabs:write` | `name`, `locked`, `starred`; tabs arrive through `add_tabs_to_group` |
494
502
  | `add_tabs_to_group` | `tensor:tabs:write` | Append 1–500 tabs to an existing group in one call. A trashed group is a `404` until restored |
495
- | `delete_tab` | `tensor:tabs:write` | Remove one tab from a live group. Immediate; the group is the recoverable unit |
503
+ | `delete_tab` | `tensor:tabs:write` | Remove one tab from a live group. Permanent, two calls; the group is the recoverable unit |
496
504
  | `delete_tab_group` | `tensor:tabs:write` | Move the whole group to Trash. Soft — restorable; the purge is UI-only |
497
505
  | `restore_tab_group` | `tensor:tabs:write` | Restore the group, tabs and all |
498
506
 
@@ -529,6 +537,56 @@ The Tensor user who issued the key is the ceiling: a key can never do more than
529
537
 
530
538
  Newest first. A tool rename or removal is a MAJOR bump; new tools and new optional inputs are MINOR (`docs/contract/MCP.md` §6).
531
539
 
540
+ ### 6.3.0 — Bookmark Archive, folder pins, and Convert
541
+ New tools and new optional inputs; no tool is renamed or removed and no scope
542
+ changes.
543
+
544
+ - **`archive_bookmark` and `unarchive_bookmark`** (`tensor:bookmarks:write`),
545
+ Ideas' archive on bookmarks: an archived bookmark leaves the active library,
546
+ never expires, is not in Trash, keeps its folder and its place in the order,
547
+ and is still readable by id and found by search (its subtitle reads
548
+ `Archived`). Both are idempotent; a bookmark in Trash is a `409`.
549
+ `update_bookmark` does not take an archive field, because
550
+ `PATCH /api/bookmarks/:id` refuses one.
551
+ - **`archived` on `list_bookmarks`.** **What changes for an existing caller:**
552
+ Tensor now leaves archived bookmarks out of `list_bookmarks` by default,
553
+ whatever the package version, because the server's default changed. Pass
554
+ `archived: true` for the archived ones. Rows carry `archivedAt`.
555
+ - **`pinned` on `create_bookmark_folder` and `update_bookmark_folder`,** and on
556
+ every folder `list_bookmark_folders` returns. A pinned folder is a shortcut
557
+ drawn first on the Web page; it never changes `position` or the tree, so it
558
+ is not a way to reorder (that is `move_bookmark_folder`).
559
+ - **`convert_idea`** (`tensor:ideas:write`, plus `tensor:ideas:read` and the
560
+ new record's scopes): the web app's Convert. `to: "todo"` makes a todo
561
+ titled after the idea, in the first not-started state, born linked to the
562
+ idea; `to: "bookmark"` (only for an idea with a url) files it as a
563
+ bookmark, optionally into `folderId`. Either way the idea is archived after
564
+ the record exists, so a failed create changes nothing; a failed archive is
565
+ reported with the new record, and the fix is `archive_idea`, not a second
566
+ conversion. Pass an `idempotencyKey` and a retry replays the create instead
567
+ of making a second record. A memo cannot be made with a key, because Memos is
568
+ session-only.
569
+
570
+ ### 6.2.0 — Three more permanent deletes ask the person first
571
+ No tool is renamed or removed and no scope changes. Three tools gain an
572
+ optional input.
573
+
574
+ - **`confirmToken` on `delete_entity_relationship`, `delete_position_relation`
575
+ and `delete_tab`.** Each destroys a row no Trash brings back, and each was a
576
+ single call because no list had it. Tensor now holds them for a key or a
577
+ third-party connection like the other permanent deletes (DEVELOPER_API.md
578
+ §5.5): the first call returns `NOT DELETED.`, a preview naming the record
579
+ (the two entities and the role, the two positions, the tab's title) and a
580
+ `confirmToken`; the second call, with that token, deletes.
581
+ - **What changes for an existing caller:** an older stdio package cannot pass a
582
+ `confirmToken`, so against a Tensor that holds these three deletes it cannot
583
+ complete one: update to 6.2.0. The hosted endpoint is always current.
584
+ - **A link is an http or https address.** `create_bookmark`,
585
+ `update_bookmark`, `create_idea`, `update_idea`, `create_tab_group` and
586
+ `add_tabs_to_group` are refused with 400 for any other scheme
587
+ (`javascript:`, `data:`, `file:`), which Tensor used to store. No input
588
+ changes.
589
+
532
590
  ### 6.1.0 — Saying why, and working beside other agents
533
591
  New optional inputs only; no tool is renamed or removed and no scope changes.
534
592
 
@@ -617,7 +675,7 @@ renamed or removed and no scope changes.
617
675
  performance (paid-in, distributions, unfunded commitment, DPI/RVPI/TVPI, IRR
618
676
  for a closed-end fund or time-weighted return for an open-end one, NAV and its
619
677
  staleness) and its terms, folded on the server by the same code as the fund
620
- card in Tensor's Portfolio page. Figures are in the position's currency.
678
+ card in Tensor's Wealth page. Figures are in the position's currency.
621
679
  - **`list_fund_terms` / `get_fund_terms`**, **`list_loan_terms` /
622
680
  `get_loan_terms`**, **`list_fx_rates`**: the terms and rates behind them.
623
681
  Changing any of them stays in the web app.
package/dist/index.js CHANGED
@@ -106,13 +106,13 @@ A few entries can go straight through create_transaction, oldest first, each wit
106
106
 
107
107
  ## Ideas
108
108
  The capture inbox: links, notes and media. create_idea needs at least one of url, body or media. A URL saved before is still created and the answer names the earlier capture in duplicateOf; offer that to the user. Pictures go in the gallery through create_idea_upload_url and the media field, never as an image link typed into body. Sending body on update_idea replaces the whole document.
109
- An idea that has been handled but is worth keeping is archived with archive_idea, not moved to Trash: it leaves list_ideas (and the tag and site counts), stays readable with get_idea and findable with search_records, keeps its tags, links and media, and never expires. list_ideas with archived true reads the archived ones; unarchive_idea puts one back. Both are idempotent, and an idea in Trash must be restored first. Archiving is its own tool, never an update_idea field.
109
+ An idea that has been handled but is worth keeping is archived with archive_idea, not moved to Trash: it leaves list_ideas (and the tag and site counts), stays readable with get_idea and findable with search_records, keeps its tags, links and media, and never expires. list_ideas with archived true reads the archived ones; unarchive_idea puts one back. Both are idempotent, and an idea in Trash must be restored first. Archiving is its own tool, never an update_idea field. To turn an idea into a todo or a bookmark, use convert_idea: it makes the record the way the web app's Convert does (a todo linked back to the idea; a bookmark only for an idea with a url), then archives the idea. If it reports the idea was not archived, call archive_idea; do not convert again. A memo cannot be made from here, because Memos is not reachable by any connection: say so rather than make something else.
110
110
 
111
111
  ## Bookmarks
112
- Leaving folderId off files a bookmark as Unfiled, which is a normal resting place; do not invent a folder for it. Keep the order list_bookmarks and list_bookmark_folders return; the owner arranged it by hand. move_bookmark and move_bookmark_folder change a folder and a place in that order in one call. delete_bookmark is soft, delete_bookmark_folder is not (the bookmarks inside survive, the folder does not).
112
+ Leaving folderId off files a bookmark as Unfiled, which is a normal resting place; do not invent a folder for it. Keep the order list_bookmarks and list_bookmark_folders return; the owner arranged it by hand. move_bookmark and move_bookmark_folder change a folder and a place in that order in one call. delete_bookmark is soft, delete_bookmark_folder is not (the bookmarks inside survive, the folder does not). A bookmark the user is done with but wants kept is archived (archive_bookmark), on the same terms as an idea: it leaves list_bookmarks unless you pass archived true, keeps its folder and place, never expires, and search_records still finds it with the subtitle Archived. A pinned folder is a shortcut drawn first, not a rank; reorder with move_bookmark_folder.
113
113
 
114
114
  ## Tab groups
115
- Tab groups are personal: a connection sees only its own person's groups. Park a whole set of tabs in one create_tab_group call, and add more to the end with add_tabs_to_group. Only name, locked and starred are editable. delete_tab removes one tab for good; delete_tab_group is soft.
115
+ Tab groups are personal: a connection sees only its own person's groups. Park a whole set of tabs in one create_tab_group call, and add more to the end with add_tabs_to_group. Only name, locked and starred are editable. delete_tab removes one tab for good and takes two calls, a preview and then the confirmToken; delete_tab_group is soft.
116
116
 
117
117
  ## Links between records
118
118
  attach_todo_link, attach_idea_link and attach_file_link join a record to any ledger record or to another work record; each list_ call returns linkIds for the matching detach_. A link to a record type your connection cannot read is refused when you write it and left out when you read, so an empty list means "none you can see". Links of kind "mention" come from @mentions in prose; remove the mention from the text rather than detaching the link.
@@ -154,10 +154,10 @@ delete_file moves a file to Trash; restore_file brings it back for 60 days. Fold
154
154
  ## Ask the user before
155
155
  - any create_transaction or sell_all_position (the ledger cannot be edited afterwards);
156
156
  - data_apply (show the dry-run preview first);
157
- - every permanent delete: delete_position (takes its whole ledger), delete_entity, delete_account, delete_asset, delete_institution and the other catalog deletes, delete_entity_group, delete_bookmark_folder, delete_tab, delete_todo_tag, delete_todo_state;
157
+ - every permanent delete: delete_position (takes its whole ledger), delete_entity, delete_account, delete_asset, delete_institution and the other catalog deletes, delete_entity_group, delete_entity_relationship, delete_position_relation, delete_bookmark_folder, delete_tab, delete_todo_tag, delete_todo_state;
158
158
  - sync_prices over the whole catalog;
159
159
  - minting download links for more than the file the user asked about.
160
- Tensor enforces the first list's deletes itself: the call answers NOT DELETED with what would go and a confirmToken. Show the user that preview in plain words and pass the token back only after they say yes; never confirm on your own. A refused delete names what still uses the record: tell the user, do not work around it.
160
+ Tensor enforces those deletes itself (all but delete_todo_state, which it refuses while a todo is in the state): the call answers NOT DELETED with what would go and a confirmToken. Show the user that preview in plain words and pass the token back only after they say yes; never confirm on your own. A refused delete names what still uses the record: tell the user, do not work around it.
161
161
  Soft deletes (todos, ideas, files, bookmarks, tab groups) are recoverable for 60 days with the restore_ tools (list_trash finds them), but still say what you are moving to Trash, including a todo's sub-tasks. Trash empties itself after those 60 days; for an idea the user wants to keep but no longer see, archive_idea is the right verb, because Archive never expires.
162
162
 
163
163
  ## Retrying
@@ -239,7 +239,7 @@ Work in this order and do not skip the confirmation:
239
239
  text: ({ limit }) => `Triage the user's inbox. Propose first and change nothing until the user agrees.
240
240
 
241
241
  1. list_ideas with limit ${limit && /^\d+$/.test(limit) ? limit : "20"} for the newest captures, then list_todos once with category "unstarted" and once with "started" for open work.
242
- 2. For each idea, suggest one of: keep as is, add tags, link it to a record (search_records to find the record), turn it into a todo (create_todo, then attach_todo_link to the idea, then offer to archive the idea), archive it (archive_idea) when it has been handled but is worth keeping, or move it to Trash (delete_idea) only when nobody wants it: Trash is destroyed after 60 days, Archive never expires.
242
+ 2. For each idea, suggest one of: keep as is, add tags, link it to a record (search_records to find the record), turn it into a todo or a bookmark (convert_idea, which archives the idea once the record exists), archive it (archive_idea) when it has been handled but is worth keeping, or move it to Trash (delete_idea) only when nobody wants it: Trash is destroyed after 60 days, Archive never expires.
243
243
  3. Point out open todos that look done, duplicated or stale, and todos that should be linked to a ledger record.
244
244
  4. Present the proposals as one list the user can answer item by item, then carry out only what they approve.`
245
245
  }
@@ -316,6 +316,33 @@ var TODO_STATE_CATEGORIES = [
316
316
  ];
317
317
  var TODO_LIST_SORTS = ["manual", "created", "updated", "due", "priority"];
318
318
  var IDEA_SORT_MODES = ["newest", "oldest", "updated", "title"];
319
+ var IDEA_SPINOFF_TITLE_MAX = 200;
320
+ function ideaSpinoffTitleMirror(idea) {
321
+ const firstLine = (idea.body ?? "").split("\n").map((line) => line.trim()).find(Boolean) ?? null;
322
+ let host = null;
323
+ if (idea.url) {
324
+ try {
325
+ host = new URL(idea.url).hostname.replace(/^www\./, "") || null;
326
+ } catch {
327
+ host = null;
328
+ }
329
+ }
330
+ const name = idea.title?.trim() || firstLine || idea.siteName?.trim() || host || `IDEA-${idea.id}`;
331
+ const points = Array.from(name);
332
+ return points.length > IDEA_SPINOFF_TITLE_MAX ? `${points.slice(0, IDEA_SPINOFF_TITLE_MAX - 1).join("").trimEnd()}\u2026` : name;
333
+ }
334
+ function quickAddStateOfMirror(states) {
335
+ return states.find((s) => s.category === "unstarted") ?? states[0] ?? null;
336
+ }
337
+ function isWebAddressMirror(raw) {
338
+ if (!raw) return false;
339
+ try {
340
+ const { protocol } = new URL(raw);
341
+ return protocol === "http:" || protocol === "https:";
342
+ } catch {
343
+ return false;
344
+ }
345
+ }
319
346
  var FILE_LIST_SORTS = [
320
347
  "modified_desc",
321
348
  "modified_asc",
@@ -383,9 +410,9 @@ var TOOL_SCOPE_LISTS = {
383
410
  "tensor:todos:read": "list_todos get_todo get_todo_subtree get_todo_activity list_todo_comments list_todo_states list_todo_tags list_todo_files list_todo_links",
384
411
  "tensor:todos:write": "create_todo update_todo delete_todo restore_todo set_todo_parent reorder_todo set_todo_tags create_todo_comment update_todo_comment create_todo_state update_todo_state delete_todo_state create_todo_tag update_todo_tag delete_todo_tag attach_todo_file detach_todo_file attach_todo_link detach_todo_link",
385
412
  "tensor:ideas:read": "list_ideas get_idea get_idea_activity list_idea_comments list_idea_tags list_idea_sites get_idea_media_url list_idea_links list_idea_kinds",
386
- "tensor:ideas:write": "create_idea update_idea delete_idea restore_idea archive_idea unarchive_idea create_idea_comment update_idea_comment create_idea_upload_url attach_idea_link detach_idea_link",
413
+ "tensor:ideas:write": "create_idea update_idea delete_idea restore_idea archive_idea unarchive_idea convert_idea create_idea_comment update_idea_comment create_idea_upload_url attach_idea_link detach_idea_link",
387
414
  "tensor:bookmarks:read": "list_bookmarks get_bookmark list_bookmark_folders",
388
- "tensor:bookmarks:write": "create_bookmark update_bookmark delete_bookmark restore_bookmark create_bookmark_folder update_bookmark_folder delete_bookmark_folder move_bookmark move_bookmark_folder",
415
+ "tensor:bookmarks:write": "create_bookmark update_bookmark delete_bookmark restore_bookmark archive_bookmark unarchive_bookmark create_bookmark_folder update_bookmark_folder delete_bookmark_folder move_bookmark move_bookmark_folder",
389
416
  "tensor:tabs:read": "list_tab_groups get_tab_group",
390
417
  "tensor:tabs:write": "create_tab_group update_tab_group delete_tab delete_tab_group restore_tab_group add_tabs_to_group"
391
418
  };
@@ -784,12 +811,9 @@ function defineTools(server2, api2) {
784
811
  );
785
812
  server2.tool(
786
813
  "delete_entity_relationship",
787
- "Delete an entity relationship.",
788
- { id: z2.number().describe("Relationship ID to delete") },
789
- async ({ id }) => {
790
- const data = await api2("DELETE", `/api/entity-relationships/${id}`);
791
- return { content: [{ type: "text", text: JSON.stringify(data) }] };
792
- }
814
+ "Delete a relationship between two entities, with its role, ownership percent, dates and notes. Both entities stay. Permanent. Two calls: the first deletes nothing and returns a preview and a confirmToken; repeat with it only after the user agrees.",
815
+ { id: z2.number().describe("Relationship ID to delete"), confirmToken: CONFIRM_TOKEN_INPUT },
816
+ async ({ id, confirmToken }) => confirmable(() => api2("DELETE", `/api/entity-relationships/${id}`, void 0, { confirmToken }))
793
817
  );
794
818
  server2.tool(
795
819
  "list_entity_groups",
@@ -1178,12 +1202,9 @@ function defineTools(server2, api2) {
1178
1202
  );
1179
1203
  server2.tool(
1180
1204
  "delete_position_relation",
1181
- "Remove a link between positions.",
1182
- { id: z2.number().describe("Position relation ID to delete") },
1183
- async ({ id }) => {
1184
- const data = await api2("DELETE", `/api/position-relations/${id}`);
1185
- return { content: [{ type: "text", text: JSON.stringify(data) }] };
1186
- }
1205
+ "Remove a relation between two positions. Both positions stay. Permanent. Two calls: the first deletes nothing and returns a preview and a confirmToken; repeat with it only after the user agrees.",
1206
+ { id: z2.number().describe("Position relation ID to delete"), confirmToken: CONFIRM_TOKEN_INPUT },
1207
+ async ({ id, confirmToken }) => confirmable(() => api2("DELETE", `/api/position-relations/${id}`, void 0, { confirmToken }))
1187
1208
  );
1188
1209
  server2.tool(
1189
1210
  "list_transactions",
@@ -2452,6 +2473,56 @@ function defineTools(server2, api2) {
2452
2473
  return { content: [{ type: "text", text: JSON.stringify(data) }] };
2453
2474
  }
2454
2475
  );
2476
+ server2.tool(
2477
+ "convert_idea",
2478
+ "Turn an idea into a todo or a bookmark, then archive the idea (the web app's Convert). Any idea can become a todo (titled after the idea, in the first not-started state, linked back to the idea); only an idea with a url can become a bookmark (optionally into folderId). A memo cannot be made with a key: say so rather than pick another kind. Undo is unarchive_idea; the new record stays.",
2479
+ {
2480
+ id: z2.number().describe("Idea ID"),
2481
+ to: z2.enum(["todo", "bookmark"]).describe("What to make: todo or bookmark"),
2482
+ folderId: z2.number().optional().describe("Bookmark only: file it into this folder. Omit for Unfiled.")
2483
+ },
2484
+ async ({ id, to, folderId }) => {
2485
+ const idea = await api2("GET", `/api/ideas/${id}`);
2486
+ if (idea.deletedAt != null) {
2487
+ throw new Error(`IDEA-${id} is in Trash. Restore it first (restore_idea), then convert.`);
2488
+ }
2489
+ let made;
2490
+ if (to === "bookmark") {
2491
+ if (!idea.url) throw new Error(`IDEA-${id} has no url, so it cannot become a bookmark. It can become a todo.`);
2492
+ made = await api2("POST", "/api/bookmarks", {
2493
+ url: idea.url,
2494
+ title: idea.title?.trim() || null,
2495
+ excerpt: idea.excerpt ?? null,
2496
+ siteName: idea.siteName ?? null,
2497
+ thumbnailUrl: isWebAddressMirror(idea.thumbnailUrl) ? idea.thumbnailUrl : null,
2498
+ folderId: folderId ?? null
2499
+ });
2500
+ } else {
2501
+ const states = await api2("GET", "/api/todo-states");
2502
+ const state = quickAddStateOfMirror(states);
2503
+ if (!state) throw new Error("There are no todo states yet, so there is nothing to file the todo under (create_todo_state).");
2504
+ made = await api2("POST", "/api/todos", {
2505
+ title: ideaSpinoffTitleMirror(idea),
2506
+ stateId: state.id,
2507
+ links: [{ targetType: "idea", targetId: id }]
2508
+ });
2509
+ }
2510
+ let archived = idea.archivedAt != null;
2511
+ let archiveError = null;
2512
+ if (!archived) {
2513
+ try {
2514
+ await api2("POST", `/api/ideas/${id}/archive`);
2515
+ archived = true;
2516
+ } catch (e) {
2517
+ archiveError = e instanceof Error ? e.message : String(e);
2518
+ }
2519
+ }
2520
+ const result = { converted: to, idea: { id, archived }, [to]: made };
2521
+ const note = archiveError ? `The ${to} was created, but IDEA-${id} was NOT archived (${archiveError}). Do not convert again: call archive_idea with id ${id}.
2522
+ ` : "";
2523
+ return { content: [{ type: "text", text: note + JSON.stringify(result) }] };
2524
+ }
2525
+ );
2455
2526
  server2.tool(
2456
2527
  "get_idea_activity",
2457
2528
  "An idea's latest 50 activity entries: who changed it, through which client, and why. Kept a year; past 90 days an entry says what changed, not to what.",
@@ -2591,18 +2662,20 @@ function defineTools(server2, api2) {
2591
2662
  );
2592
2663
  server2.tool(
2593
2664
  "list_bookmarks",
2594
- "List filed bookmarks in the order the owner arranged them: Unfiled first, then folder by folder as list_bookmark_folders orders them. Keep that order rather than sorting by name or date. The Trash (trash: true) is newest first. Rows are flat; join folderId to list_bookmark_folders.",
2665
+ "List filed bookmarks in the order the owner arranged them: Unfiled first, then folder by folder as list_bookmark_folders orders them. Keep that order rather than sorting by name or date. Default: the active library, leaving out archived bookmarks and the Read later queue; `archived: true` lists the archived, `trash: true` the Trash (newest first). Rows are flat; join folderId to list_bookmark_folders.",
2595
2666
  {
2596
2667
  limit: LIMIT_INPUT,
2597
2668
  offset: OFFSET_INPUT,
2598
2669
  folderId: z2.union([z2.number(), z2.literal("none")]).optional().describe("One folder by id, or 'none' for the unfiled. Omit for every bookmark."),
2599
2670
  q: z2.string().optional().describe("Case-insensitive substring over title, url and site name"),
2671
+ archived: z2.boolean().optional().describe("true = the archived bookmarks. Ignored with trash."),
2600
2672
  trash: z2.boolean().optional().describe("true = the Trash instead of the live library")
2601
2673
  },
2602
- async ({ limit, offset, folderId, q, trash }) => {
2674
+ async ({ limit, offset, folderId, q, archived, trash }) => {
2603
2675
  const params = new URLSearchParams();
2604
2676
  if (folderId !== void 0) params.set("folderId", String(folderId));
2605
2677
  if (q) params.set("q", q);
2678
+ if (archived) params.set("archived", "1");
2606
2679
  if (trash) params.set("trash", "1");
2607
2680
  return listPage(params, limit, offset, (qs) => api2("GET", `/api/bookmarks?${qs}`));
2608
2681
  }
@@ -2635,7 +2708,7 @@ function defineTools(server2, api2) {
2635
2708
  );
2636
2709
  server2.tool(
2637
2710
  "update_bookmark",
2638
- "Edit a bookmark. folderId null unfiles it; omitted leaves it.",
2711
+ "Edit a bookmark. folderId null unfiles it; omitted leaves it. To archive, use archive_bookmark.",
2639
2712
  {
2640
2713
  id: z2.number().describe("Bookmark ID"),
2641
2714
  url: z2.string().optional().describe("Replacement URL"),
@@ -2683,9 +2756,27 @@ function defineTools(server2, api2) {
2683
2756
  return { content: [{ type: "text", text: JSON.stringify(data) }] };
2684
2757
  }
2685
2758
  );
2759
+ server2.tool(
2760
+ "archive_bookmark",
2761
+ "Archive a bookmark: kept on file, never expires, still readable and searchable, keeps its folder and place. Not a delete. Undo with unarchive_bookmark. 409 for a bookmark in Trash.",
2762
+ { id: z2.number().describe("Bookmark ID") },
2763
+ async ({ id }) => {
2764
+ const data = await api2("POST", `/api/bookmarks/${id}/archive`);
2765
+ return { content: [{ type: "text", text: JSON.stringify(data) }] };
2766
+ }
2767
+ );
2768
+ server2.tool(
2769
+ "unarchive_bookmark",
2770
+ "Return an archived bookmark to the active library, in its folder and place. 409 for a bookmark in Trash.",
2771
+ { id: z2.number().describe("Bookmark ID") },
2772
+ async ({ id }) => {
2773
+ const data = await api2("POST", `/api/bookmarks/${id}/unarchive`);
2774
+ return { content: [{ type: "text", text: JSON.stringify(data) }] };
2775
+ }
2776
+ );
2686
2777
  server2.tool(
2687
2778
  "list_bookmark_folders",
2688
- "The bookmark folder tree, each with parentId, in the owner's order (parents first, siblings as arranged). Keep that order rather than sorting by name.",
2779
+ "The bookmark folder tree, each with parentId and pinned, in the owner's order (parents first, siblings as arranged). Keep that order rather than sorting by name; pinned is a shortcut, not a rank.",
2689
2780
  {},
2690
2781
  async () => {
2691
2782
  const data = await api2("GET", "/api/bookmark-folders");
@@ -2697,7 +2788,8 @@ function defineTools(server2, api2) {
2697
2788
  "Create a bookmark folder, optionally inside another.",
2698
2789
  {
2699
2790
  name: z2.string().describe("Folder name (1-256 chars)"),
2700
- parentId: z2.number().optional().describe("Nest it inside this folder. Omit for a root folder.")
2791
+ parentId: z2.number().optional().describe("Nest it inside this folder. Omit for a root folder."),
2792
+ pinned: z2.boolean().optional().describe("Pin it: a shortcut drawn first, not a rank. Never changes its place in the tree.")
2701
2793
  },
2702
2794
  async (params) => {
2703
2795
  const data = await api2("POST", "/api/bookmark-folders", params);
@@ -2706,11 +2798,12 @@ function defineTools(server2, api2) {
2706
2798
  );
2707
2799
  server2.tool(
2708
2800
  "update_bookmark_folder",
2709
- "Rename a bookmark folder or change its parent (null for root). 409 for a cycle or past the depth cap.",
2801
+ "Rename, pin or unpin a bookmark folder, or change its parent (null for root). 409 for a cycle or past the depth cap. Pinning is a shortcut, not a rank: to reorder, use move_bookmark_folder.",
2710
2802
  {
2711
2803
  id: z2.number().describe("Folder ID"),
2712
2804
  name: z2.string().optional().describe("Replacement name"),
2713
- parentId: z2.number().nullable().optional().describe("New parent, or null for a root folder")
2805
+ parentId: z2.number().nullable().optional().describe("New parent, or null for a root folder"),
2806
+ pinned: z2.boolean().optional().describe("true pins it (drawn first as a shortcut), false unpins. Leaves position and parent alone.")
2714
2807
  },
2715
2808
  async ({ id, ...body }) => {
2716
2809
  const data = await api2("PATCH", `/api/bookmark-folders/${id}`, body);
@@ -2811,15 +2904,13 @@ function defineTools(server2, api2) {
2811
2904
  );
2812
2905
  server2.tool(
2813
2906
  "delete_tab",
2814
- "Remove one tab from a group, immediately and for good (only groups have Trash).",
2907
+ "Remove one tab from a group for good (only groups have Trash). Permanent. Two calls: the first deletes nothing and returns a preview and a confirmToken; repeat with the same id, itemId and that token only after the user agrees.",
2815
2908
  {
2816
2909
  id: z2.number().describe("Tab group ID"),
2817
- itemId: z2.number().describe("The tab's own id, from the group's items")
2910
+ itemId: z2.number().describe("The tab's own id, from the group's items"),
2911
+ confirmToken: CONFIRM_TOKEN_INPUT
2818
2912
  },
2819
- async ({ id, itemId }) => {
2820
- const data = await api2("DELETE", `/api/tabs/${id}/items/${itemId}`);
2821
- return { content: [{ type: "text", text: JSON.stringify(data) }] };
2822
- }
2913
+ async ({ id, itemId, confirmToken }) => confirmable(() => api2("DELETE", `/api/tabs/${id}/items/${itemId}`, void 0, { confirmToken }))
2823
2914
  );
2824
2915
  server2.tool(
2825
2916
  "delete_tab_group",
@@ -2926,7 +3017,7 @@ var SERVER_IDENTITY = {
2926
3017
  // package.json
2927
3018
  var package_default = {
2928
3019
  name: "@levitating/tensor-mcp",
2929
- version: "6.1.0",
3020
+ version: "6.3.0",
2930
3021
  description: "Tensor MCP \u2014 Model Context Protocol server for the Tensor wealth management API. Exposes the Tensor API as tools for Claude, Cursor, Codex, and any MCP-aware client.",
2931
3022
  type: "module",
2932
3023
  main: "./dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@levitating/tensor-mcp",
3
- "version": "6.1.0",
3
+ "version": "6.3.0",
4
4
  "description": "Tensor MCP — Model Context Protocol server for the Tensor wealth management API. Exposes the Tensor API as tools for Claude, Cursor, Codex, and any MCP-aware client.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -99,13 +99,13 @@ A few entries can go straight through create_transaction, oldest first, each wit
99
99
 
100
100
  ### Ideas
101
101
  The capture inbox: links, notes and media. create_idea needs at least one of url, body or media. A URL saved before is still created and the answer names the earlier capture in duplicateOf; offer that to the user. Pictures go in the gallery through create_idea_upload_url and the media field, never as an image link typed into body. Sending body on update_idea replaces the whole document.
102
- An idea that has been handled but is worth keeping is archived with archive_idea, not moved to Trash: it leaves list_ideas (and the tag and site counts), stays readable with get_idea and findable with search_records, keeps its tags, links and media, and never expires. list_ideas with archived true reads the archived ones; unarchive_idea puts one back. Both are idempotent, and an idea in Trash must be restored first. Archiving is its own tool, never an update_idea field.
102
+ An idea that has been handled but is worth keeping is archived with archive_idea, not moved to Trash: it leaves list_ideas (and the tag and site counts), stays readable with get_idea and findable with search_records, keeps its tags, links and media, and never expires. list_ideas with archived true reads the archived ones; unarchive_idea puts one back. Both are idempotent, and an idea in Trash must be restored first. Archiving is its own tool, never an update_idea field. To turn an idea into a todo or a bookmark, use convert_idea: it makes the record the way the web app's Convert does (a todo linked back to the idea; a bookmark only for an idea with a url), then archives the idea. If it reports the idea was not archived, call archive_idea; do not convert again. A memo cannot be made from here, because Memos is not reachable by any connection: say so rather than make something else.
103
103
 
104
104
  ### Bookmarks
105
- Leaving folderId off files a bookmark as Unfiled, which is a normal resting place; do not invent a folder for it. Keep the order list_bookmarks and list_bookmark_folders return; the owner arranged it by hand. move_bookmark and move_bookmark_folder change a folder and a place in that order in one call. delete_bookmark is soft, delete_bookmark_folder is not (the bookmarks inside survive, the folder does not).
105
+ Leaving folderId off files a bookmark as Unfiled, which is a normal resting place; do not invent a folder for it. Keep the order list_bookmarks and list_bookmark_folders return; the owner arranged it by hand. move_bookmark and move_bookmark_folder change a folder and a place in that order in one call. delete_bookmark is soft, delete_bookmark_folder is not (the bookmarks inside survive, the folder does not). A bookmark the user is done with but wants kept is archived (archive_bookmark), on the same terms as an idea: it leaves list_bookmarks unless you pass archived true, keeps its folder and place, never expires, and search_records still finds it with the subtitle Archived. A pinned folder is a shortcut drawn first, not a rank; reorder with move_bookmark_folder.
106
106
 
107
107
  ### Tab groups
108
- Tab groups are personal: a connection sees only its own person's groups. Park a whole set of tabs in one create_tab_group call, and add more to the end with add_tabs_to_group. Only name, locked and starred are editable. delete_tab removes one tab for good; delete_tab_group is soft.
108
+ Tab groups are personal: a connection sees only its own person's groups. Park a whole set of tabs in one create_tab_group call, and add more to the end with add_tabs_to_group. Only name, locked and starred are editable. delete_tab removes one tab for good and takes two calls, a preview and then the confirmToken; delete_tab_group is soft.
109
109
 
110
110
  ### Links between records
111
111
  attach_todo_link, attach_idea_link and attach_file_link join a record to any ledger record or to another work record; each list_ call returns linkIds for the matching detach_. A link to a record type your connection cannot read is refused when you write it and left out when you read, so an empty list means "none you can see". Links of kind "mention" come from @mentions in prose; remove the mention from the text rather than detaching the link.
@@ -141,10 +141,10 @@ delete_file moves a file to Trash; restore_file brings it back for 60 days. Fold
141
141
  ### Ask the user before
142
142
  - any create_transaction or sell_all_position (the ledger cannot be edited afterwards);
143
143
  - data_apply (show the dry-run preview first);
144
- - every permanent delete: delete_position (takes its whole ledger), delete_entity, delete_account, delete_asset, delete_institution and the other catalog deletes, delete_entity_group, delete_bookmark_folder, delete_tab, delete_todo_tag, delete_todo_state;
144
+ - every permanent delete: delete_position (takes its whole ledger), delete_entity, delete_account, delete_asset, delete_institution and the other catalog deletes, delete_entity_group, delete_entity_relationship, delete_position_relation, delete_bookmark_folder, delete_tab, delete_todo_tag, delete_todo_state;
145
145
  - sync_prices over the whole catalog;
146
146
  - minting download links for more than the file the user asked about.
147
- Tensor enforces the first list's deletes itself: the call answers NOT DELETED with what would go and a confirmToken. Show the user that preview in plain words and pass the token back only after they say yes; never confirm on your own. A refused delete names what still uses the record: tell the user, do not work around it.
147
+ Tensor enforces those deletes itself (all but delete_todo_state, which it refuses while a todo is in the state): the call answers NOT DELETED with what would go and a confirmToken. Show the user that preview in plain words and pass the token back only after they say yes; never confirm on your own. A refused delete names what still uses the record: tell the user, do not work around it.
148
148
  Soft deletes (todos, ideas, files, bookmarks, tab groups) are recoverable for 60 days with the restore_ tools (list_trash finds them), but still say what you are moving to Trash, including a todo's sub-tasks. Trash empties itself after those 60 days; for an idea the user wants to keep but no longer see, archive_idea is the right verb, because Archive never expires.
149
149
 
150
150
  ### Retrying