@thothdev/pink 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.
package/CHANGELOG.md CHANGED
@@ -3,12 +3,21 @@
3
3
  O Pink é um fork do Pi (MIT, veja `LICENSE-PI.txt` e `NOTICE.md`). Aqui só entra o que mudou no Pink; a base de cada
4
4
  versão está no campo `upstream` do `rebrand.json` do repositório.
5
5
 
6
+ ## [1.0.2] - 2026-11-24
7
+
8
+ - `/agente`: a conversa fica igual à do Pink: "> oi", "+ Pensou", "→ Rodou: ...", "→ Leu ...", "●" e o rodapé
9
+ "opencode · big-pickle · 7s · ↓ 49 tokens"; "Trabalhando · 2s · ↓ 0 tokens" acima da caixa, como o do Pink.
10
+ - `/agente` + espaço lista `off` e os agentes instalados; `/agente codex ` lista os modelos dele.
11
+ - Agentes ACP (opencode e outros): o comando e o arquivo de cada ferramenta, o pensamento e o modelo de verdade aparecem.
12
+
6
13
  ## [1.0.1] - 2026-11-23
7
14
 
8
15
  - `/agente`: aparece "<agente> trabalhando · Ns" embaixo da caixa enquanto o agente responde; com um agente ligado, o
9
16
  primeiro item do menu é "Voltar ao Pink" (o mesmo que `/agente off`); as mensagens aparecem como "Você → opencode" e
10
17
  "opencode · modelo", em vez dos tipos crus `[pink-agente-pedido]` e `[pink-agente]`.
11
18
  - README em inglês, com o logo e a tela.
19
+ - `/sugestao [texto]` abre a página de ideias do Pink (GitHub Discussions), com o texto como título. Doação pelo Ko-fi
20
+ (`npm fund @thothdev/pink` e o botão Sponsor do GitHub).
12
21
 
13
22
  ## [1.0.0] - 2026-11-23
14
23
 
package/README.md CHANGED
@@ -14,6 +14,12 @@
14
14
  <a href="https://pink.thothdev.ia.br"><img src="https://img.shields.io/badge/site-pink.thothdev.ia.br-ff6eb4" alt="website"></a>
15
15
  </p>
16
16
 
17
+ <p align="center">
18
+ <a href="https://ko-fi.com/thothdev">♥ Support Pink on Ko-fi</a>
19
+ &nbsp;·&nbsp;
20
+ <a href="https://github.com/ricardopiresqa/pink/discussions/new?category=ideas">💡 Suggest an idea</a>
21
+ </p>
22
+
17
23
  <p align="center">
18
24
  <img src="https://raw.githubusercontent.com/ricardopiresqa/pink/main/docs/images/pink-screen.png" alt="Pink in the terminal: sessions on the left, the conversation in the middle, context, plan and changed files on the right" width="900">
19
25
  </p>
@@ -66,6 +72,12 @@ pink --help
66
72
  | `/undo` / `/redo` | Undo / redo the last message and its file changes |
67
73
  | `/sessions`, `/themes`, `/mcp` | Switch session, pick a theme, manage MCP servers |
68
74
  | `/lateral` | Hide or show the side columns |
75
+ | `/sugestao [text]` | Open the ideas page on GitHub, with your text as the title |
76
+
77
+ ## Support and ideas
78
+
79
+ Pink is free and open source. If it saves you time, you can [buy us a coffee on Ko-fi](https://ko-fi.com/thothdev).
80
+ Ideas and requests go to [GitHub Discussions](https://github.com/ricardopiresqa/pink/discussions/categories/ideas), where others can vote on them; bugs go to [issues](https://github.com/ricardopiresqa/pink/issues).
69
81
 
70
82
  ## Configuration
71
83
 
@@ -188,17 +188,54 @@ export function codexUsage(tokenUsage: any, result: any): void {
188
188
  }
189
189
 
190
190
  // ---------- ACP: atualizações da sessão ----------
191
- export function applyAcpUpdate(update: any, result: any, state: { text: string }, emit: () => void): void {
191
+ // o tipo da ferramenta no ACP vira o nome da ferramenta do Pink, para a linha sair igual ("Rodou: ...", "Leu ...")
192
+ const ACP_TOOLS: Record<string, string> = { execute: "bash", read: "read", edit: "edit", search: "grep", fetch: "web_fetch", delete: "delete", move: "move" };
193
+ function acpArgs(update: any, before: Record<string, unknown> = {}): Record<string, unknown> {
194
+ const input = update.rawInput && typeof update.rawInput === "object" ? update.rawInput : {};
195
+ const where = Array.isArray(update.locations) ? update.locations[0]?.path : undefined;
196
+ const args: Record<string, unknown> = { ...before };
197
+ if (update.title) args.title = String(update.title);
198
+ const pathArg = input.path ?? input.filePath ?? input.file_path ?? where;
199
+ if (pathArg) args.path = String(pathArg);
200
+ if (input.command) args.command = String(input.command);
201
+ if (input.pattern ?? input.query) args.pattern = String(input.pattern ?? input.query);
202
+ return args;
203
+ }
204
+ const flushThinking = (result: any, state: any) => {
205
+ if (state.thinking) push(result, [{ type: "thinking", thinking: state.thinking, ms: Date.now() - state.thoughtAt }]);
206
+ state.thinking = "";
207
+ state.thoughtAt = undefined;
208
+ };
209
+ export function applyAcpUpdate(update: any, result: any, state: { text: string; thinking?: string; thoughtAt?: number }, emit: () => void): void {
192
210
  if (!update || typeof update !== "object") return;
211
+ if (update.sessionUpdate === "agent_thought_chunk" && update.content?.type === "text") {
212
+ state.thoughtAt ??= Date.now();
213
+ state.thinking = (state.thinking ?? "") + String(update.content.text ?? "");
214
+ return;
215
+ }
193
216
  if (update.sessionUpdate === "agent_message_chunk" && update.content?.type === "text") {
217
+ flushThinking(result, state);
194
218
  state.text += String(update.content.text ?? "");
195
219
  return;
196
220
  }
197
221
  if (update.sessionUpdate === "tool_call") {
222
+ flushThinking(result, state);
198
223
  if (state.text) push(result, [{ type: "text", text: state.text }]), (state.text = "");
199
- const name = typeof update.kind === "string" && update.kind !== "other" ? update.kind : "tool";
200
- push(result, [tool(name, { title: String(update.title ?? ""), ...(Array.isArray(update.locations) && update.locations[0]?.path ? { path: update.locations[0].path } : {}) }, String(update.toolCallId ?? ""))]);
224
+ const name = ACP_TOOLS[update.kind] ?? (typeof update.kind === "string" && update.kind !== "other" ? update.kind : "tool");
225
+ push(result, [tool(name, acpArgs(update), String(update.toolCallId ?? ""))]);
201
226
  emit();
227
+ return;
228
+ }
229
+ // o opencode manda o comando e o arquivo só na atualização (o tool_call chega com título "shell" e entrada vazia)
230
+ if (update.sessionUpdate === "tool_call_update" && update.toolCallId) {
231
+ for (const message of result.messages) {
232
+ const part = message.content?.find((item: any) => item.type === "toolCall" && item.id === String(update.toolCallId));
233
+ if (!part) continue;
234
+ part.arguments = acpArgs(update, part.arguments);
235
+ if (part.name === "bash" && !part.arguments.command && update.title) part.arguments.command = String(update.title);
236
+ emit();
237
+ return;
238
+ }
202
239
  }
203
240
  }
204
241
 
@@ -493,6 +530,9 @@ async function runAcp(child: any, name: string, task: string, cwd: string, resul
493
530
  config = session.result?.configOptions ?? [];
494
531
  }
495
532
  if (resume && sessionId) resume.id = sessionId;
533
+ // sem escolha, o rodapé mostra o modelo que o agente usa de fato (ex.: opencode/big-pickle), não o nome do agente
534
+ const current = config.find((item: any) => item?.category === "model")?.currentValue;
535
+ if (!model && typeof current === "string" && current) result.model = current;
496
536
  if (model && sessionId) {
497
537
  const option = config.find((item: any) => item?.category === "model");
498
538
  const set = option ? await client.request("session/set_config_option", { sessionId, configId: option.id, value: model }) : await client.request("session/set_model", { sessionId, modelId: model });
@@ -9,6 +9,7 @@ import os from "node:os";
9
9
  import path from "node:path";
10
10
  import { fileURLToPath } from "node:url";
11
11
  import { externalAgents, listModels, pinkExtras, runExternal } from "../examples/extensions/subagent/external.ts";
12
+ import { bulleted, runLabel, shortModel, streamedTokens, thinkingLabel, toolSummary, userLines } from "./pink-ui.ts";
12
13
 
13
14
  // o Pink junto (card 1dfwh7kgfjx): MCPs do mcp.json, AGENTS.md e skills do Pink, mais o próprio Pink como MCP
14
15
  const readJson = (file: string) => {
@@ -41,24 +42,42 @@ const FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "
41
42
 
42
43
  const fresh = () => ({ messages: [] as any[], stderr: "", exitCode: 0, usage: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, cost: 0, contextTokens: 0, turns: 0 } });
43
44
 
44
- // as ferramentas que o agente usou, uma por linha, e depois a resposta
45
- export function render(result: any): string {
46
- const lines: string[] = [];
47
- let answer = "";
45
+ // nomes e argumentos de cada agente (Claude: Read/file_path, Glob...) viram os do Pink, para a linha sair igual à nativa
46
+ const NAMES: Record<string, string> = { multiedit: "edit", glob: "find", notebookedit: "edit" };
47
+ export function pinkTool(part: any, cwd = "") {
48
+ const raw = String(part?.name ?? "tool");
49
+ const name = NAMES[raw.toLowerCase()] ?? raw.toLowerCase();
50
+ const args = { ...(part?.arguments ?? {}) };
51
+ const file = args.path ?? args.file_path ?? args.filePath ?? args.notebook_path;
52
+ if (file) args.path = cwd && path.isAbsolute(String(file)) ? path.relative(cwd, String(file)) || "." : String(file);
53
+ const line = toolSummary(name, args);
54
+ return line === name && args.title ? String(args.title) : line;
55
+ }
56
+
57
+ // os passos da resposta, na ordem: pensou, ferramentas e textos (o desenho usa; o modelo do Pink lê o texto puro)
58
+ export function steps(result: any, cwd = "") {
59
+ const out: any[] = [];
48
60
  for (const message of result.messages) {
49
61
  for (const part of message.content ?? []) {
50
- if (part.type === "text") answer = part.text;
51
- else if (part.type === "toolCall") {
52
- const arg = part.arguments?.command ?? part.arguments?.path ?? part.arguments?.file_path ?? part.arguments?.title ?? "";
53
- lines.push(`• ${part.name}${arg ? ` ${String(arg).split("\n")[0].slice(0, 120)}` : ""}`);
54
- }
62
+ if (part.type === "text" && part.text?.trim()) out.push({ kind: "text", text: part.text });
63
+ else if (part.type === "thinking") out.push({ kind: "thinking", ms: part.ms >= 100 ? part.ms : 0 }); // o pensamento chega de uma vez: tempo quase 0 não diz nada
64
+ else if (part.type === "toolCall") out.push({ kind: "tool", line: pinkTool(part, cwd) });
55
65
  }
56
66
  }
57
- const body = [lines.join("\n"), answer].filter(Boolean).join("\n\n");
67
+ return out;
68
+ }
69
+
70
+ export function render(result: any, cwd = ""): string {
71
+ const all = steps(result, cwd);
72
+ const tools = all.filter((step) => step.kind === "tool").map((step) => `→ ${step.line}`);
73
+ const answer = all.filter((step) => step.kind === "text").at(-1)?.text ?? "";
74
+ const body = [tools.join("\n"), answer].filter(Boolean).join("\n\n");
58
75
  if (result.stopReason === "error") return [body, `⚠ ${result.errorMessage}`].filter(Boolean).join("\n\n");
59
76
  return body || t("(sem resposta)", "(sin respuesta)", "(no answer)");
60
77
  }
61
78
 
79
+ const outputOf = (result: any) => result.usage?.output || result.messages.reduce((sum: number, message: any) => sum + streamedTokens(message), 0);
80
+
62
81
  const label = (agent: any) => (agent.model ? `${agent.name} · ${agent.model}` : agent.name);
63
82
 
64
83
  const loadTui = () => Promise.all([import("@earendil-works/pi-tui"), import("@earendil-works/pi-coding-agent")]);
@@ -68,25 +87,31 @@ export default function (pink: any, list: typeof externalAgents = externalAgents
68
87
  let ticker: ReturnType<typeof setInterval> | undefined;
69
88
  let lastUi: any;
70
89
 
71
- // "trabalhando" embaixo da caixa: o carregador do Pink só aparece quando o modelo dele está respondendo
90
+ // "⠴ Trabalhando · 2s · ↓ 0 tokens" acima da caixa, com o mesmo Loader do Pink: o dele só aparece quando o modelo do Pink
91
+ // responde, e este ocupa o mesmo lugar
92
+ let loader: any;
72
93
  const idle = () => {
73
94
  if (ticker) clearInterval(ticker);
74
95
  ticker = undefined;
96
+ loader?.stop?.();
97
+ loader = undefined;
75
98
  lastUi?.setWidget?.(WIDGET, undefined);
76
99
  };
77
- const busy = (ui: any, name: string, tool: () => string | undefined) => {
100
+ const busy = (ui: any, output: () => number) => {
78
101
  idle();
79
102
  lastUi = ui;
80
103
  if (!ui?.setWidget) return;
81
104
  const started = Date.now();
82
- let frame = 0;
83
- const draw = () => {
84
- const secs = Math.floor((Date.now() - started) / 1000);
85
- const what = tool();
86
- ui.setWidget(WIDGET, [`${FRAMES[frame++ % FRAMES.length]} ${name} ${t("trabalhando", "trabajando", "working")} · ${secs}s${what ? ` · ${what}` : ""} ${t("/agente off cancela", "/agente off cancela", "/agente off cancels")}`], { placement: "belowEditor" });
87
- };
88
- draw();
89
- ticker = setInterval(draw, 120);
105
+ const message = () => `${t("Trabalhando", "Trabajando", "Working")} · ${runLabel({ ms: Date.now() - started, output: output() })}`;
106
+ if (tui?.Loader) {
107
+ ui.setWidget(WIDGET, (screen: any, theme: any) => (loader = new tui.Loader(screen, (s: string) => theme.fg("accent", s), (s: string) => theme.fg("muted", s), message())), { placement: "aboveEditor" });
108
+ ticker = setInterval(() => loader?.setMessage?.(message()), 1000);
109
+ } else {
110
+ let frame = 0;
111
+ const draw = () => ui.setWidget(WIDGET, ["", ` ${FRAMES[frame++ % FRAMES.length]} ${message()}`], { placement: "aboveEditor" });
112
+ draw();
113
+ ticker = setInterval(draw, 120);
114
+ }
90
115
  ticker.unref?.();
91
116
  };
92
117
 
@@ -98,7 +123,8 @@ export default function (pink: any, list: typeof externalAgents = externalAgents
98
123
  ctx?.ui?.setStatus?.(STATUS, undefined);
99
124
  };
100
125
 
101
- // mensagens desenhadas como as da conversa ("Você → opencode" e "opencode · modelo"), não com o tipo cru
126
+ // mensagens desenhadas como as do Pink: "> oi", "+ Pensou · 0.4s", "→ Rodou: ...", "● resposta" e o rodapé
127
+ // "opencode · big-pickle · 7s · ↓ 49 tokens" (mesmas funções do pink-ui)
102
128
  let tui: any;
103
129
  let coding: any;
104
130
  void load().then(([a, b]) => {
@@ -106,19 +132,30 @@ export default function (pink: any, list: typeof externalAgents = externalAgents
106
132
  coding = b;
107
133
  }).catch(() => undefined);
108
134
  const textOf = (message: any) => (typeof message.content === "string" ? message.content : (message.content ?? []).map((part: any) => part.text ?? "").join(""));
135
+ const bold = (theme: any, text: string) => (theme.bold ? theme.bold(text) : text);
109
136
  pink.registerMessageRenderer?.("pink-agente-pedido", (message: any, options: any, theme: any) => {
110
- if (!tui) return undefined;
111
- const details = message.details ?? {};
112
- const box = new tui.Box(options.outputPad, 1, (line: string) => theme.bg("userMessageBg", line));
113
- box.addChild(new tui.Text(`${theme.fg("accent", theme.bold(`${t("Você", "Tú", "You")} → ${details.agent ?? ""}`))}\n${details.text ?? textOf(message)}`, 0, 0));
114
- return box;
137
+ if (!tui || !coding?.getMarkdownTheme) return undefined;
138
+ const md = new tui.Markdown(String(message.details?.text ?? textOf(message)), options.outputPad, 1, coding.getMarkdownTheme(), { color: (s: string) => theme.fg("userMessageText", s), bgColor: (s: string) => theme.bg("userMessageBg", s) });
139
+ return { render: (width: number) => userLines(md.render(Math.max(1, width - 1)), theme.fg("muted", ">")), invalidate: () => md.invalidate?.() };
115
140
  });
116
141
  pink.registerMessageRenderer?.("pink-agente", (message: any, options: any, theme: any) => {
117
142
  if (!tui || !coding?.getMarkdownTheme) return undefined;
118
143
  const details = message.details ?? {};
119
- const box = new tui.Box(options.outputPad, 0);
120
- box.addChild(new tui.Text(theme.fg(details.error ? "error" : "accent", theme.bold(details.model ? `${details.agent} · ${details.model}` : details.agent ?? t("agente", "agente", "agent"))), 0, 0));
121
- box.addChild(new tui.Markdown(textOf(message), 0, 0, coding.getMarkdownTheme()));
144
+ const pad = options.outputPad ?? 1;
145
+ const box = new tui.Container();
146
+ const list = Array.isArray(details.steps) ? details.steps : [{ kind: "text", text: textOf(message) }];
147
+ for (const step of list) {
148
+ box.addChild(new tui.Spacer(1));
149
+ if (step.kind === "thinking") box.addChild(new tui.Text(theme.fg("thinkingText", thinkingLabel(step.ms)), pad, 0));
150
+ else if (step.kind === "tool") box.addChild(new tui.Text(theme.fg("muted", `→ ${step.line}`), pad, 0));
151
+ else box.addChild(bulleted(new tui.Markdown(String(step.text).trim(), pad, 0, coding.getMarkdownTheme())));
152
+ }
153
+ if (details.error) box.addChild(new tui.Spacer(1)), box.addChild(new tui.Text(theme.fg("error", `⚠ ${details.error}`), pad, 0));
154
+ const footer = [bold(theme, theme.fg("accent", details.agent ?? t("agente", "agente", "agent")))];
155
+ if (details.model) footer.push(theme.fg("text", shortModel(details.model)));
156
+ if (details.ms !== undefined) footer.push(theme.fg("muted", runLabel({ ms: details.ms, output: details.output ?? 0 })));
157
+ box.addChild(new tui.Spacer(1));
158
+ box.addChild(new tui.Text(footer.join(theme.fg("dim", " · ")), pad, 0));
122
159
  return box;
123
160
  });
124
161
 
@@ -129,13 +166,14 @@ export default function (pink: any, list: typeof externalAgents = externalAgents
129
166
  const name = current.agent.name;
130
167
  pink.sendMessage({ customType: "pink-agente-pedido", display: true, content: `› ${name}: ${text}`, details: { agent: name, text } });
131
168
  const result = fresh();
169
+ const started = Date.now();
132
170
  const lastTool = () => result.messages.at(-1)?.content?.find((part: any) => part.type === "toolCall")?.name;
133
171
  const status = () => {
134
172
  const last = lastTool();
135
173
  ctx.ui?.setStatus?.(STATUS, `${name} ${t("trabalhando", "trabajando", "working")}${last ? `: ${last}` : "…"}`);
136
174
  };
137
175
  status();
138
- if (ctx.hasUI) busy(ctx.ui, name, lastTool);
176
+ if (ctx.hasUI) busy(ctx.ui, () => outputOf(result));
139
177
  (globalThis as any).__pinkExternalAsk = ctx.hasUI ? (title: string, body: string) => ctx.ui.confirm(title, body) : undefined;
140
178
  try {
141
179
  await run(current.agent, text, ctx.cwd, controller.signal, result, status, undefined, undefined, current.resume);
@@ -145,12 +183,41 @@ export default function (pink: any, list: typeof externalAgents = externalAgents
145
183
  }
146
184
  if (current.controller === controller) current.controller = undefined;
147
185
  if (active === current || !active) idle();
148
- if (active === current) ctx.ui?.setStatus?.(STATUS, `${t("agente", "agente", "agent")}: ${label(current.agent)}`);
149
- pink.sendMessage({ customType: "pink-agente", display: true, content: render(result), details: { agent: name, model: result.model, usage: result.usage, error: result.stopReason === "error" } });
186
+ if (active === current) {
187
+ ctx.ui?.setStatus?.(STATUS, `${t("agente", "agente", "agent")}: ${label(current.agent)}`);
188
+ // a caixa passa a mostrar o modelo que o agente usou de fato, em vez de "modelo padrão"
189
+ if (!current.agent.model && result.model && result.model !== name) (globalThis as any).__pinkExternalAgent = { name, model: result.model };
190
+ }
191
+ const error = result.stopReason === "error" ? String(result.errorMessage ?? t("erro", "error", "error")) : undefined;
192
+ pink.sendMessage({ customType: "pink-agente", display: true, content: render(result, ctx.cwd), details: { agent: name, model: result.model, usage: result.usage, error, steps: steps(result, ctx.cwd), ms: Date.now() - started, output: outputOf(result) } });
193
+ };
194
+
195
+ // "/agente " lista as opções, como os outros comandos: off e os agentes; "/agente codex " lista os modelos dele
196
+ const modelCache = new Map<string, Promise<any[]>>();
197
+ const completions = async (prefix: string) => {
198
+ const text = String(prefix ?? "").replace(/^\s+/, "");
199
+ const space = text.indexOf(" ");
200
+ const agents = list();
201
+ if (space < 0) {
202
+ const items = [
203
+ ...(active ? [{ value: "off", label: "off", description: t(`volta ao Pink (desliga o ${active.agent.name})`, `vuelve a Pink (apaga ${active.agent.name})`, `back to Pink (turns ${active.agent.name} off)`) }] : []),
204
+ ...agents.map((agent) => ({ value: agent.name, label: agent.name, description: t(`conversar com o ${agent.name}, com o login dele`, `conversar con ${agent.name}, con su login`, `talk to ${agent.name}, with its own login`) })),
205
+ ];
206
+ const hits = items.filter((item) => item.value.startsWith(text.toLowerCase()));
207
+ return hits.length ? hits : null;
208
+ }
209
+ const agent = agents.find((item) => item.name === text.slice(0, space).toLowerCase());
210
+ if (!agent) return null;
211
+ const wanted = text.slice(space + 1).trim();
212
+ if (!modelCache.has(agent.name)) modelCache.set(agent.name, models(agent, process.cwd()).catch(() => (modelCache.delete(agent.name), [])));
213
+ const choices = await modelCache.get(agent.name)!;
214
+ const hits = choices.filter((choice) => choice.id.startsWith(wanted) || String(choice.label).toLowerCase().startsWith(wanted.toLowerCase())).map((choice) => ({ value: `${agent.name} ${choice.id}`, label: choice.id, description: `${choice.label !== choice.id ? choice.label : ""}${choice.current ? ` (${t("padrão", "predeterminado", "default")})` : ""}`.trim() || undefined }));
215
+ return hits.length ? hits : null;
150
216
  };
151
217
 
152
218
  pink.registerCommand("agente", {
153
219
  description: t("Conversa direto com um agente instalado (claude, codex, opencode...) com o login dele; /agente off volta ao Pink", "Conversa directo con un agente instalado (claude, codex, opencode...) con su login; /agente off vuelve a Pink", "Talk straight to an installed agent (claude, codex, opencode...) with its own login; /agente off returns to Pink"),
220
+ getArgumentCompletions: completions,
154
221
  handler: async (args: string, ctx: any) => {
155
222
  const [first = "", ...rest] = String(args ?? "").trim().split(/\s+/);
156
223
  const wanted = first.toLowerCase();
@@ -99,9 +99,26 @@ export function notifyExtension(pink, deps = {}) {
99
99
  ctx.ui.notify?.(on ? t("Notificações ligadas", "Notificaciones activadas", "Notifications on") : t("Notificações desligadas", "Notificaciones desactivadas", "Notifications off"), "info");
100
100
  },
101
101
  });
102
+ // /sugestao [texto]: abre a página de ideias do Pink no navegador, com o texto como título (owner 2026-11-23)
103
+ pink.registerCommand?.("sugestao", {
104
+ description: t("Abre a página de sugestões do Pink no GitHub; o texto depois do comando vira o título", "Abre la página de sugerencias de Pink en GitHub; el texto después del comando se vuelve el título", "Opens Pink's suggestions page on GitHub; the text after the command becomes the title"),
105
+ handler: async (args, ctx) => {
106
+ const url = ideaUrl(args);
107
+ const opener = platform === "win32" ? "explorer" : platform === "darwin" ? "open" : "xdg-open";
108
+ try { run(opener, [url], { windowsHide: true }, () => {}); } catch { /* sem navegador: o endereço fica na mensagem */ }
109
+ ctx.ui.notify?.(t(`Abrindo as sugestões do Pink: ${url}`, `Abriendo las sugerencias de Pink: ${url}`, `Opening Pink's suggestions: ${url}`), "info");
110
+ },
111
+ });
102
112
  return { state, send, isOn: () => on };
103
113
  }
104
114
 
115
+ export const IDEAS_URL = "https://github.com/ricardopiresqa/pink/discussions/new?category=ideas";
116
+ // o texto vai codificado na URL e como argumento (sem shell): não vira comando
117
+ export const ideaUrl = (text = "") => {
118
+ const title = String(text ?? "").trim().slice(0, 200);
119
+ return title ? `${IDEAS_URL}&title=${encodeURIComponent(title)}` : IDEAS_URL;
120
+ };
121
+
105
122
  export default function (pink) {
106
123
  notifyExtension(pink);
107
124
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thothdev/pink",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Pink: coding agent of the Thoth project, with a pink theme",
5
5
  "type": "module",
6
6
  "piConfig": {
@@ -104,6 +104,10 @@
104
104
  "bugs": {
105
105
  "url": "https://github.com/ricardopiresqa/pink/issues"
106
106
  },
107
+ "funding": {
108
+ "type": "ko-fi",
109
+ "url": "https://ko-fi.com/thothdev"
110
+ },
107
111
  "publishConfig": {
108
112
  "access": "public",
109
113
  "tag": "latest"