@telepat/ideon 0.1.28 → 0.1.30

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/dist/ideon.js CHANGED
@@ -1424,7 +1424,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
1424
1424
  // package.json
1425
1425
  var package_default = {
1426
1426
  name: "@telepat/ideon",
1427
- version: "0.1.28",
1427
+ version: "0.1.30",
1428
1428
  description: "CLI for generating rich articles and images from ideas.",
1429
1429
  type: "module",
1430
1430
  repository: {
@@ -1461,6 +1461,7 @@ var package_default = {
1461
1461
  test: "NODE_OPTIONS=--experimental-vm-modules jest",
1462
1462
  "test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch",
1463
1463
  "test:coverage": "NODE_OPTIONS=--experimental-vm-modules jest --coverage",
1464
+ "guides:sync": "node scripts/sync-writing-guides.mjs",
1464
1465
  "pricing:refresh": "node scripts/refresh-openrouter-pricing.mjs",
1465
1466
  "docs:start": "npm --prefix docs-site run start",
1466
1467
  "docs:start:en": "npm --prefix docs-site run start -- --locale en",
@@ -3691,7 +3692,9 @@ var OpenRouterClient = class {
3691
3692
  responseBodyRaw = rawBody;
3692
3693
  const json = parseOpenRouterResponse(rawBody);
3693
3694
  if (!response.ok) {
3694
- const message = json?.error?.message ?? `OpenRouter request failed with status ${response.status}`;
3695
+ const providerMessage = json?.error?.message ?? `OpenRouter request failed with status ${response.status}`;
3696
+ const raw = json?.error?.metadata?.raw;
3697
+ const message = raw ? `${raw} (OpenRouter: ${providerMessage})` : providerMessage;
3695
3698
  if (shouldRetryStatus(response.status) && attempt < 2) {
3696
3699
  const backoff = backoffMs(attempt);
3697
3700
  retries += 1;
@@ -6177,8 +6180,7 @@ async function loadLinksFromSidecar(markdownPath) {
6177
6180
  const record = parsed;
6178
6181
  const links = Array.isArray(record.links) ? record.links : [];
6179
6182
  const customLinks = Array.isArray(record.customLinks) ? record.customLinks : [];
6180
- const combined = [...customLinks, ...links];
6181
- return combined.filter((entry) => {
6183
+ const filterAndMap = (entries, isCustom) => entries.filter((entry) => {
6182
6184
  if (typeof entry !== "object" || entry === null) {
6183
6185
  return false;
6184
6186
  }
@@ -6187,8 +6189,10 @@ async function loadLinksFromSidecar(markdownPath) {
6187
6189
  }).map((entry) => ({
6188
6190
  expression: entry.expression.trim(),
6189
6191
  url: entry.url.trim(),
6190
- title: entry.title
6192
+ title: entry.title,
6193
+ isCustom
6191
6194
  })).filter((entry) => entry.expression.length > 0 && entry.url.length > 0);
6195
+ return [...filterAndMap(customLinks, true), ...filterAndMap(links, false)];
6192
6196
  }
6193
6197
  function enrichMarkdownWithLinks(markdown, links) {
6194
6198
  if (links.length === 0) {
@@ -6208,8 +6212,13 @@ function enrichMarkdownWithLinks(markdown, links) {
6208
6212
  if (isInProtectedSpan(updated, start, end)) {
6209
6213
  continue;
6210
6214
  }
6211
- updated = `${updated.slice(0, start)}[${match[0]}](${link.url})${updated.slice(end)}`;
6212
- break;
6215
+ const replacement = `[${match[0]}](${link.url})`;
6216
+ updated = `${updated.slice(0, start)}${replacement}${updated.slice(end)}`;
6217
+ if (link.isCustom) {
6218
+ expressionRegex.lastIndex = start + replacement.length;
6219
+ } else {
6220
+ break;
6221
+ }
6213
6222
  }
6214
6223
  }
6215
6224
  return updated;
@@ -9195,6 +9204,10 @@ function renderShell({
9195
9204
  \`<code class="slug-text">\${escapeHtml(output.slug)}</code>\`,
9196
9205
  \`<button class="copy-btn" data-copy-slug="\${escapeHtml(output.slug)}" type="button">Copy slug</button>\`,
9197
9206
  '</div>',
9207
+ '<div class="slug-row">',
9208
+ \`<code class="slug-text">\${escapeHtml(currentGeneration.generationId)}</code>\`,
9209
+ \`<button class="copy-btn" data-copy-generation-id="\${escapeHtml(currentGeneration.generationId)}" type="button">Copy generation ID</button>\`,
9210
+ '</div>',
9198
9211
  \`<div class="channel-meta">\${escapeHtml(output.contentTypeLabel)} \u2022 Variant \${output.index}</div>\`,
9199
9212
  '</div>',
9200
9213
  '</div>',
@@ -9306,6 +9319,12 @@ function renderShell({
9306
9319
  const copyButton = target.closest('[data-copy-slug]');
9307
9320
  if (copyButton instanceof HTMLElement && copyButton.dataset.copySlug) {
9308
9321
  copySlug(copyButton, copyButton.dataset.copySlug);
9322
+ return;
9323
+ }
9324
+
9325
+ const copyGenerationIdButton = target.closest('[data-copy-generation-id]');
9326
+ if (copyGenerationIdButton instanceof HTMLElement && copyGenerationIdButton.dataset.copyGenerationId) {
9327
+ copySlug(copyGenerationIdButton, copyGenerationIdButton.dataset.copyGenerationId);
9309
9328
  }
9310
9329
  });
9311
9330