opencode-quick-links 0.1.1 → 1.0.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.
package/README.md CHANGED
@@ -2,14 +2,16 @@
2
2
 
3
3
  OpenCode TUI plugin for searching and opening links from the active conversation.
4
4
 
5
+ Requires OpenCode V2 (beta).
6
+
5
7
  ## Install
6
8
 
7
- Add the package to your OpenCode TUI config:
9
+ Add the package to your global `~/.config/opencode/cli.json`:
8
10
 
9
11
  ```json
10
12
  {
11
- "$schema": "https://opencode.ai/tui.json",
12
- "plugin": ["opencode-quick-links"]
13
+ "$schema": "https://opencode.ai/v2/cli.json",
14
+ "plugins": ["opencode-quick-links"]
13
15
  }
14
16
  ```
15
17
 
@@ -23,29 +25,30 @@ The plugin scans the active conversation when you open the dialog. It includes H
23
25
 
24
26
  ## Configure
25
27
 
26
- The plugin does not register a default shortcut. Add one through your OpenCode TUI config if wanted:
28
+ The plugin does not register a default shortcut. Add one through `cli.json` if wanted:
27
29
 
28
30
  ```json
29
31
  {
30
- "$schema": "https://opencode.ai/tui.json",
31
- "plugin": ["opencode-quick-links"],
32
+ "$schema": "https://opencode.ai/v2/cli.json",
33
+ "plugins": ["opencode-quick-links"],
32
34
  "keybinds": {
33
- "quick-links.open": "<leader>l"
35
+ "quick-links.open": "<leader>o"
34
36
  }
35
37
  }
36
38
  ```
37
39
 
38
40
  ## Local Development
39
41
 
40
- This package includes `.opencode/tui.json`, so OpenCode loads the local source when you run it from the package directory.
42
+ OpenCode auto-loads the local source from `.opencode/plugins/quick-links/` when run from the package directory.
41
43
 
42
44
  From the monorepo root:
43
45
 
44
46
  ```sh
45
- npm install
46
- npm run typecheck -w opencode-quick-links
47
- npm run build -w opencode-quick-links
48
- npm run smoke -w opencode-quick-links
47
+ bun install
48
+ bun run --filter opencode-quick-links build
49
+ bun run --filter opencode-quick-links typecheck
50
+ bun run --filter opencode-quick-links test
51
+ bun run --filter opencode-quick-links smoke
49
52
  ```
50
53
 
51
54
  Restart OpenCode after changing plugin files or config.
package/dist/tui.d.ts CHANGED
@@ -1,6 +1,4 @@
1
- declare const _default: {
2
- id: string;
3
- tui: (api: import("@opencode-ai/plugin/tui").TuiPluginApi) => Promise<void>;
4
- };
1
+ import { Plugin } from "@opencode/plugin/tui";
2
+ declare const _default: Plugin.Definition;
5
3
  export default _default;
6
4
  //# sourceMappingURL=tui.d.ts.map
package/dist/tui.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tui.d.ts","sourceRoot":"","sources":["../plugin/src/tui.ts"],"names":[],"mappings":";;;;AA+DA,wBA4D2B"}
1
+ {"version":3,"file":"tui.d.ts","sourceRoot":"","sources":["../plugin/src/tui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;;AAyD7C,wBAmDE"}
package/dist/tui.js CHANGED
@@ -1,32 +1,32 @@
1
+ import { Plugin } from "@opencode/plugin/tui";
1
2
  import open from "open";
2
3
  const URL_PATTERN = /https?:\/\/[^\s<>"'`]+/gi;
3
- const TRAILING_PUNCTUATION = /[\],.;:!?}]+$/;
4
- function currentSessionID(route) {
5
- if (route.name !== "session")
6
- return;
7
- const sessionID = route.params?.sessionID;
8
- return typeof sessionID === "string" ? sessionID : undefined;
9
- }
10
- function trimTrailingParentheses(url) {
11
- let result = url;
12
- while (result.endsWith(")")) {
13
- const opening = (result.match(/\(/g) ?? []).length;
14
- const closing = (result.match(/\)/g) ?? []).length;
15
- if (closing <= opening)
16
- break;
17
- result = result.slice(0, -1);
4
+ const TRAILING_PUNCTUATION = /[\],.;:!?}*]+$/;
5
+ function trimLink(url) {
6
+ let depth = 0;
7
+ for (let index = 0; index < url.length; index++) {
8
+ if (url[index] === "(")
9
+ depth++;
10
+ if (url[index] !== ")")
11
+ continue;
12
+ if (depth === 0)
13
+ return url.slice(0, index).replace(TRAILING_PUNCTUATION, "");
14
+ depth--;
18
15
  }
19
- return result;
16
+ return url.replace(TRAILING_PUNCTUATION, "");
20
17
  }
21
18
  function extractLinks(messages) {
22
19
  const seen = new Set();
23
20
  const links = [];
24
21
  for (const message of messages) {
25
- for (const part of message.parts) {
26
- if (part.type !== "text" || typeof part.text !== "string")
27
- continue;
28
- for (const match of part.text.matchAll(URL_PATTERN)) {
29
- const candidate = trimTrailingParentheses(match[0].replace(TRAILING_PUNCTUATION, ""));
22
+ const texts = message.type === "user"
23
+ ? [message.text]
24
+ : message.type === "assistant"
25
+ ? message.content.flatMap((part) => part.type === "text" ? [part.text] : [])
26
+ : [];
27
+ for (const text of texts) {
28
+ for (const match of text.matchAll(URL_PATTERN)) {
29
+ const candidate = trimLink(match[0]);
30
30
  let url;
31
31
  try {
32
32
  const parsed = new URL(candidate);
@@ -46,57 +46,54 @@ function extractLinks(messages) {
46
46
  }
47
47
  return links;
48
48
  }
49
- export default {
49
+ export default Plugin.define({
50
50
  id: "opencode-quick-links",
51
- tui: async (api) => {
51
+ setup(ctx) {
52
52
  async function showQuickLinks() {
53
- const sessionID = currentSessionID(api.route.current);
54
- if (!sessionID) {
55
- api.ui.toast({ variant: "warning", message: "Start a session." });
56
- return;
57
- }
58
- const result = await api.client.session.messages({ sessionID });
59
- if (result.error) {
60
- api.ui.toast({ variant: "error", message: "Could not load session links." });
53
+ const route = ctx.ui.router.current();
54
+ if (route.type !== "session") {
55
+ ctx.ui.toast.show({ variant: "warning", message: "Start a session." });
61
56
  return;
62
57
  }
63
- const links = extractLinks(result.data);
58
+ await ctx.data.session.message.sync(route.sessionID);
59
+ const links = extractLinks(ctx.data.session.message.list(route.sessionID));
64
60
  if (links.length === 0) {
65
- api.ui.toast({ variant: "info", message: "No links found in this session." });
61
+ ctx.ui.toast.show({ variant: "info", message: "No links found in this session." });
66
62
  return;
67
63
  }
68
- api.ui.dialog.replace(() => api.ui.DialogSelect({
64
+ const url = await ctx.ui.dialog.select({
69
65
  title: "Quick Links",
70
- placeholder: "Search links",
71
- options: links.map((link) => ({
72
- title: link.url,
73
- value: link.url,
74
- })),
75
- onSelect: (option) => {
76
- api.ui.dialog.clear();
77
- void open(option.value).catch(() => {
78
- api.ui.toast({ variant: "warning", title: "Could not open browser", message: option.value });
79
- });
80
- },
81
- }));
82
- }
83
- function runQuickLinks() {
84
- void showQuickLinks().catch(() => {
85
- api.ui.toast({ variant: "error", message: "Could not load session links." });
66
+ placeholder: "Search links in the conversation",
67
+ options: links.map((link) => ({ title: link.url.replace(/^https?:\/\//, ""), value: link.url })),
68
+ });
69
+ if (!url)
70
+ return;
71
+ await open(url).catch(() => {
72
+ ctx.ui.toast.show({ variant: "warning", title: "Could not open browser", message: url });
86
73
  });
87
74
  }
88
- if (!api.command)
89
- throw new Error("opencode-quick-links requires the TUI command API");
90
- const dispose = api.command.register(() => [
91
- {
92
- title: "Open session links",
93
- value: "quick-links.open",
94
- category: "Plugin",
95
- slash: { name: "links" },
96
- onSelect: runQuickLinks,
75
+ return ctx.ui.slot({
76
+ append: "app",
77
+ render() {
78
+ ctx.keymap.layer(() => ({
79
+ mode: "global",
80
+ commands: [
81
+ {
82
+ id: "quick-links.open",
83
+ title: "Open session links",
84
+ group: "Plugin",
85
+ palette: true,
86
+ slash: { name: "links" },
87
+ run: () => showQuickLinks().catch(() => {
88
+ ctx.ui.toast.show({ variant: "error", message: "Could not load session links." });
89
+ }),
90
+ },
91
+ ],
92
+ bindings: ["quick-links.open"],
93
+ }));
94
+ return null;
97
95
  },
98
- ]);
99
- api.lifecycle.onDispose(dispose);
96
+ });
100
97
  },
101
- };
98
+ });
102
99
  //# sourceMappingURL=tui.js.map
package/dist/tui.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tui.js","sourceRoot":"","sources":["../plugin/src/tui.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,MAAM,WAAW,GAAG,0BAA0B,CAAA;AAC9C,MAAM,oBAAoB,GAAG,eAAe,CAAA;AAM5C,SAAS,gBAAgB,CAAC,KAAyD;IACjF,IA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YACF,IAAI,CAAC,GAAG;gBAAE,OAAM;YAChB,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;gBACzB,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,wBAAwB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAA;YAC1F,CAAC,CAAC,CAAA;QACJ,CAAC;QAED,OAAO,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC;YACjB,MAAM,EAAE,KAAK;YACb,MAAM;gBACJ,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;oBACtB,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE;wBACR;4BACE,EAAE,EAAE,kBAAkB;4BACtB,KAAK,EAAE,oBAAoB;4BAC3B,KAAK,EAAE,QAAQ;4BACf,OAAO,EAAE,IAAI;4BACb,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;4BACxB,GAAG,EAAE,GAAG,EAAE,CAAC,cAAc,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE;gCACrC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,+BAA+B,EAAE,CAAC,CAAA;4BACnF,CAAC,CAAC;yBACH;qBACF;oBACD,QAAQ,EAAE,CAAC,kBAAkB,CAAC;iBAC/B,CAAC,CAAC,CAAA;gBACH,OAAO,IAAI,CAAA;YACb,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "opencode-quick-links",
4
- "version": "0.1.1",
4
+ "version": "1.0.1",
5
5
  "description": "OpenCode TUI plugin for searching and opening links from the active conversation.",
6
6
  "type": "module",
7
7
  "exports": {
@@ -13,16 +13,18 @@
13
13
  },
14
14
  "files": [
15
15
  "dist",
16
+ "tui.js",
16
17
  "README.md",
17
18
  "LICENSE"
18
19
  ],
19
20
  "scripts": {
20
21
  "build": "tsc -p tsconfig.build.json",
21
22
  "typecheck": "tsc --noEmit",
22
- "smoke": "node -e \"import('./dist/tui.js').then((m) => { if (!m.default?.tui) throw new Error('missing tui plugin export') })\"",
23
- "pack:dry-run": "npm pack --dry-run",
24
- "prepack": "npm run build && npm run smoke",
25
- "prepublishOnly": "npm run typecheck && npm run prepack"
23
+ "test": "bun test",
24
+ "smoke": "bun -e \"import('./dist/tui.js').then((m) => { if (!m.default?.id || typeof m.default.setup !== 'function') throw new Error('missing V2 CLI plugin export') })\"",
25
+ "pack:dry-run": "bun pm pack --dry-run",
26
+ "prepack": "bun run build && bun run smoke",
27
+ "prepublishOnly": "bun run prepack && bun run typecheck"
26
28
  },
27
29
  "keywords": [
28
30
  "opencode",
@@ -48,17 +50,14 @@
48
50
  "access": "public",
49
51
  "provenance": true
50
52
  },
51
- "engines": {
52
- "opencode": ">=1.15.0"
53
- },
54
53
  "dependencies": {
54
+ "@opencode/plugin": "0.0.0-beta-19296",
55
55
  "open": "^10.1.2"
56
56
  },
57
57
  "peerDependencies": {
58
- "@opencode-ai/plugin": ">=1.15.0"
58
+ "solid-js": ">=1.9.0"
59
59
  },
60
60
  "devDependencies": {
61
- "@opencode-ai/plugin": "^1.15.1",
62
61
  "typescript": "^5.9.3"
63
62
  }
64
63
  }
package/tui.js ADDED
@@ -0,0 +1 @@
1
+ export { default } from "./dist/tui.js"