@gobing-ai/knowledge-kit 0.0.17 → 0.0.18

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 (74) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/README.md +74 -0
  3. package/dist/index.js +46 -100
  4. package/package.json +19 -1
  5. package/plugins/generations/content-gen/dist/index.js +42 -94
  6. package/plugins/generations/core-facts-gen/dist/index.js +51 -100
  7. package/plugins/generations/daily-article-gen/dist/index.js +57 -99
  8. package/plugins/generations/daily-article-gen/src/index.ts +12 -4
  9. package/plugins/generations/dailynews-gen/dist/index.js +57 -102
  10. package/plugins/generations/dailynews-gen/src/script-builder.ts +9 -1
  11. package/plugins/generations/episode-plan-gen/dist/index.js +120 -113
  12. package/plugins/generations/episode-plan-gen/src/index.ts +102 -22
  13. package/plugins/generations/image-gen/dist/index.js +63 -115
  14. package/plugins/generations/news-report-gen/dist/index.js +117 -99
  15. package/plugins/generations/news-report-gen/src/index.ts +117 -1
  16. package/plugins/generations/omni-voice-gen/src/omni_voice_gen/pipeline.py +1 -1
  17. package/plugins/generations/omni-voice-gen/src/omni_voice_gen/voicescript.py +8 -0
  18. package/plugins/generations/voice-gen/dist/index.js +101 -117
  19. package/plugins/generations/voice-gen/src/concat.ts +34 -0
  20. package/plugins/generations/voice-gen/src/index.ts +6 -4
  21. package/plugins/generations/voice-gen/src/voicescript.ts +8 -0
  22. package/plugins/ingestions/aihot-ingest/dist/index.js +47 -97
  23. package/plugins/ingestions/horizon-ingest/dist/index.js +47 -96
  24. package/plugins/ingestions/karakeep-local/dist/index.js +217 -266
  25. package/plugins/ingestions/last30days-ingest/dist/index.js +42 -91
  26. package/plugins/ingestions/web-search/dist/index.js +68 -117
  27. package/plugins/kk/plugin.json +1 -1
  28. package/plugins/kk/scripts/kk-workflow-stages.ts +320 -62
  29. package/plugins/kk/skills/publish/SKILL.md +80 -0
  30. package/plugins/kk/workflows/kk-daily-ai-voice.yaml +107 -107
  31. package/plugins/kk/workflows/leftover-publish-fanout-example.yaml +53 -0
  32. package/plugins/publishings/emdash-pub/dist/index.js +42 -91
  33. package/plugins/publishings/infoq-pub/dist/index.js +21994 -0
  34. package/plugins/publishings/infoq-pub/package.json +17 -0
  35. package/plugins/publishings/infoq-pub/plugin.json +7 -0
  36. package/plugins/publishings/infoq-pub/src/index.ts +123 -0
  37. package/plugins/publishings/infoq-pub/tsconfig.json +4 -0
  38. package/plugins/publishings/juejin-pub/dist/index.js +21994 -0
  39. package/plugins/publishings/juejin-pub/package.json +17 -0
  40. package/plugins/publishings/juejin-pub/plugin.json +7 -0
  41. package/plugins/publishings/juejin-pub/src/index.ts +123 -0
  42. package/plugins/publishings/juejin-pub/tsconfig.json +4 -0
  43. package/plugins/publishings/medium-pub/dist/index.js +22041 -0
  44. package/plugins/publishings/medium-pub/package.json +17 -0
  45. package/plugins/publishings/medium-pub/plugin.json +7 -0
  46. package/plugins/publishings/medium-pub/src/index.ts +215 -0
  47. package/plugins/publishings/medium-pub/tsconfig.json +4 -0
  48. package/plugins/publishings/podcast-pub/dist/index.js +183 -123
  49. package/plugins/publishings/podcast-pub/src/index.ts +47 -3
  50. package/plugins/publishings/podcast-pub/src/show-notes.ts +153 -34
  51. package/plugins/publishings/qiita-pub/dist/index.js +42 -91
  52. package/plugins/publishings/substack-pub/dist/index.js +21994 -0
  53. package/plugins/publishings/substack-pub/package.json +17 -0
  54. package/plugins/publishings/substack-pub/plugin.json +7 -0
  55. package/plugins/publishings/substack-pub/src/index.ts +123 -0
  56. package/plugins/publishings/substack-pub/tsconfig.json +4 -0
  57. package/plugins/publishings/surfdash-pub/dist/index.js +172 -103
  58. package/plugins/publishings/surfdash-pub/src/index.ts +32 -2
  59. package/plugins/publishings/wechatmp-pub/dist/index.js +22119 -0
  60. package/plugins/publishings/wechatmp-pub/package.json +17 -0
  61. package/plugins/publishings/wechatmp-pub/plugin.json +7 -0
  62. package/plugins/publishings/wechatmp-pub/src/index.ts +304 -0
  63. package/plugins/publishings/wechatmp-pub/tsconfig.json +4 -0
  64. package/plugins/publishings/x-pub/dist/index.js +22110 -0
  65. package/plugins/publishings/x-pub/package.json +17 -0
  66. package/plugins/publishings/x-pub/plugin.json +7 -0
  67. package/plugins/publishings/x-pub/src/index.ts +222 -0
  68. package/plugins/publishings/x-pub/tsconfig.json +4 -0
  69. package/plugins/publishings/xhs-pub/dist/index.js +21994 -0
  70. package/plugins/publishings/xhs-pub/package.json +17 -0
  71. package/plugins/publishings/xhs-pub/plugin.json +7 -0
  72. package/plugins/publishings/xhs-pub/src/index.ts +123 -0
  73. package/plugins/publishings/xhs-pub/tsconfig.json +4 -0
  74. package/plugins/publishings/zenn-pub/dist/index.js +42 -91
@@ -30,6 +30,106 @@ function renderInline(escaped: string): string {
30
30
  return (out + rest).replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>');
31
31
  }
32
32
 
33
+ /**
34
+ * Normalizes text for title↔transcription matching: lowercase, strip everything
35
+ * that is not a CJK char, letter, or digit. ASR drops punctuation and case, and the
36
+ * intro segment enumerates every title, so matching must be punctuation-blind and
37
+ * monotonic (each item searches forward from the previous match).
38
+ */
39
+ function normalizeForMatch(text: string): string {
40
+ return text.toLowerCase().replace(/[^\p{Script=Han}\p{L}\p{N}]+/gu, '');
41
+ }
42
+
43
+ /** `m:ss` audio offset, or `--:--` when unknown. */
44
+ function formatOffset(seconds: number): string {
45
+ if (!Number.isFinite(seconds) || seconds < 0) return '--:--';
46
+ const m = Math.floor(seconds / 60);
47
+ const s = Math.round(seconds % 60);
48
+ return s === 60 ? `${m + 1}:00` : `${m}:${String(s).padStart(2, '0')}`;
49
+ }
50
+
51
+ /**
52
+ * Per-item audio offsets (seconds) from the generated segments. Exact mode: walk
53
+ * segments after the intro (index 0), matching each item title inside a segment
54
+ * transcription, monotonic forward. Proportional fallback (any title unmatched or no
55
+ * segments): distribute total duration by body length — monotonic and close enough
56
+ * for jump navigation. `ponytail`: no word-level alignment; segment starts are
57
+ * accurate to one segment (~10–30s), fine for chapter jumps.
58
+ */
59
+ export function computeAudioOffsets(
60
+ docs: Doc[],
61
+ segments: Array<{ duration?: number; transcription?: string }> | undefined,
62
+ ): number[] {
63
+ const fallback = (): number[] => {
64
+ const chars = docs.map((d) => Math.max((d.body ?? '').trim().length, 1));
65
+ const total = chars.reduce((a, b) => a + b, 0);
66
+ const sumDuration = (segments ?? []).reduce((a, s) => a + (s.duration ?? 0), 0);
67
+ let acc = 0;
68
+ return chars.map((c) => {
69
+ const at = acc;
70
+ acc += (c / total) * sumDuration;
71
+ return at;
72
+ });
73
+ };
74
+ if (!segments || segments.length < 2) return fallback();
75
+ const starts: number[] = [];
76
+ let elapsed = 0;
77
+ const marks = segments.map((s) => {
78
+ const at = elapsed;
79
+ elapsed += s.duration ?? 0;
80
+ return { at, text: normalizeForMatch(s.transcription ?? '') };
81
+ });
82
+ let cursor = 1; // segment 0 is the intro, which recites every title
83
+ for (const d of docs) {
84
+ const title = normalizeForMatch(d.title ?? '');
85
+ const needle = title.slice(0, 12);
86
+ const hit = needle.length >= 4 ? marks.findIndex((m, i) => i >= cursor && m.text.includes(needle)) : -1;
87
+ if (hit >= 0) {
88
+ starts.push(marks[hit]?.at ?? 0);
89
+ cursor = hit + 1;
90
+ } else {
91
+ starts.push(Number.NaN); // any miss degrades the whole run to proportional
92
+ }
93
+ }
94
+ if (starts.some((v) => !Number.isFinite(v))) return fallback();
95
+ return starts;
96
+ }
97
+
98
+ /**
99
+ * Brief-mode timeline block: two-column HTML (offset left, title + briefing right),
100
+ * marked `<!--kk:timeline-->` so {@link renderShowNotesHtml} passes it through
101
+ * verbatim — everything inside is built here from escaped doc values, never user
102
+ * input. `ponytail`: no JS — timestamp deep-linking depends on the theme's player
103
+ * API; add when microfeed exposes one.
104
+ */
105
+ function renderTimelineHtml(docs: Doc[], offsets: number[], articleUrl: string): string {
106
+ const rows = docs
107
+ .map((d, i) => {
108
+ const title = escapeHtml(d.title ?? `条目 ${i + 1}`);
109
+ const brief = escapeHtml(itemBrief(d));
110
+ const at = formatOffset(offsets[i] ?? Number.NaN);
111
+ const link = d.sourceUri
112
+ ? ` <a href="${escapeHtml(d.sourceUri)}" target="_blank" rel="noopener">来源</a>`
113
+ : '';
114
+ return `
115
+ <div class="kk-tl-row"><div class="kk-tl-t">${at}</div><div class="kk-tl-body"><div class="kk-tl-title">${i + 1}. ${title}${link}</div><p class="kk-tl-brief">${brief}</p></div></div>`;
116
+ })
117
+ .join('');
118
+ return `<!--kk:timeline-->
119
+ <style>
120
+ .kk-tl{margin:1em 0}
121
+ .kk-tl-row{display:flex;gap:12px;padding:10px 0;border-bottom:1px solid rgba(128,128,128,.25)}
122
+ .kk-tl-t{flex:0 0 56px;font-variant-numeric:tabular-nums;font-weight:700;color:#0969da}
123
+ .kk-tl-body{flex:1;min-width:0}
124
+ .kk-tl-title{font-weight:600}
125
+ .kk-tl-brief{margin:4px 0 0;color:#666;font-size:.95em}
126
+ </style>
127
+ <div class="kk-tl">${rows}
128
+ </div>
129
+ <p>完整图文版:<a href="${escapeHtml(articleUrl)}" target="_blank" rel="noopener">${escapeHtml('本期完整文章')}</a></p>
130
+ <!--/kk:timeline-->`;
131
+ }
132
+
33
133
  /**
34
134
  * Renders show-notes markdown to sanitized HTML.
35
135
  * The leading `# ` heading is dropped: the episode `title` is rendered
@@ -39,6 +139,8 @@ function renderInline(escaped: string): string {
39
139
  */
40
140
  export function renderShowNotesHtml(markdown: string): string {
41
141
  const blocks: string[] = [];
142
+ const timeline: string[] = [];
143
+ let inTimeline = false;
42
144
  let paragraph: string[] = [];
43
145
 
44
146
  const flush = () => {
@@ -50,6 +152,19 @@ export function renderShowNotesHtml(markdown: string): string {
50
152
 
51
153
  for (const rawLine of markdown.split('\n')) {
52
154
  const line = rawLine.trim();
155
+ if (line === '<!--kk:timeline-->') {
156
+ flush();
157
+ inTimeline = true;
158
+ continue;
159
+ }
160
+ if (inTimeline) {
161
+ if (line === '<!--/kk:timeline-->') {
162
+ inTimeline = false;
163
+ continue;
164
+ }
165
+ timeline.push(rawLine);
166
+ continue;
167
+ }
53
168
  if (line.length === 0) {
54
169
  flush();
55
170
  continue;
@@ -67,6 +182,7 @@ export function renderShowNotesHtml(markdown: string): string {
67
182
  paragraph.push(line);
68
183
  }
69
184
  flush();
185
+ if (timeline.length > 0) blocks.push(timeline.join('\n'));
70
186
  return blocks.join('\n');
71
187
  }
72
188
 
@@ -96,6 +212,24 @@ export interface ShowNotesRenderOptions {
96
212
  * slug construction, which stays the fallback.
97
213
  */
98
214
  articlePostPath?: string;
215
+ /**
216
+ * Audio segment metadata from the generated episode content
217
+ * (`metadata.segments[]`: per-segment `duration` seconds + ASR `transcription`).
218
+ * When present, per-item timestamps are real audio offsets (listener jump-to-item),
219
+ * matched monotonically against segment transcriptions; otherwise `--:--`.
220
+ */
221
+ audioSegments?: Array<{ duration?: number; transcription?: string }>;
222
+ }
223
+
224
+ /** Per-item 1–2-sentence briefing: `metadata.brief` first, body sentences as fallback. */
225
+ function itemBrief(d: Doc): string {
226
+ const meta = d.metadata ?? {};
227
+ if (typeof meta.brief === 'string' && meta.brief.trim().length > 0) return meta.brief.trim();
228
+ return (d.body ?? '')
229
+ .trim()
230
+ .split(/(?<=[。!?])\s*/)
231
+ .slice(0, 2)
232
+ .join('');
99
233
  }
100
234
 
101
235
  /**
@@ -136,44 +270,29 @@ export function renderShowNotesMarkdown(docs: Doc[], opts: ShowNotesRenderOption
136
270
  return '来源';
137
271
  }
138
272
  };
139
- const itemBrief = (d: Doc): string => {
140
- const meta = d.metadata ?? {};
141
- if (typeof meta.brief === 'string' && meta.brief.trim().length > 0) return meta.brief.trim();
142
- return (d.body ?? '')
143
- .trim()
144
- .split(/(?<=[。!?])\s*/)
145
- .slice(0, 2)
146
- .join('');
147
- };
148
- const itemTimestamp = (d: Doc): string => {
149
- const meta = d.metadata ?? {};
150
- const raw = meta.publishAt;
151
- const t = typeof raw === 'string' ? Date.parse(raw) : typeof raw === 'number' ? raw : Number.NaN;
152
- if (!Number.isFinite(t)) return '--:--';
153
- const at = new Date(t);
154
- return `${String(at.getHours()).padStart(2, '0')}:${String(at.getMinutes()).padStart(2, '0')}`;
155
- };
273
+ const offsets = computeAudioOffsets(docs, opts.audioSegments);
156
274
  const lines: string[] = [`# ${opts.title}`, ''];
157
- docs.forEach((d, i) => {
158
- const body = (d.body ?? '').trim();
159
- const sentences = body
160
- .split(/(?<=[。!?])\s*/)
161
- .slice(0, 2)
162
- .join('');
163
- lines.push(`## ${i + 1}. ${d.title ?? `条目 ${i + 1}`}`, '');
164
- if (briefMode) {
165
- // Timeline entry: HH:MM + 1–2-sentence briefing; the trailing link pair
166
- // ends with the surfdash article URL (task 0118 R2.1–R2.4).
275
+ if (briefMode) {
276
+ // Timeline layout (2026-09-16 feedback): real audio offsets left, title + briefing
277
+ // right, article link last — the whole brief body is one pre-built HTML block.
278
+ lines.push(renderTimelineHtml(docs, offsets, articleUrl), '');
279
+ } else {
280
+ docs.forEach((d, i) => {
281
+ const body = (d.body ?? '').trim();
282
+ const sentences = body
283
+ .split(/(?<=[。!?])\s*/)
284
+ .slice(0, 2)
285
+ .join('');
167
286
  lines.push(
168
- `${itemTimestamp(d)} · ${itemBrief(d)}`,
287
+ `## ${i + 1}. ${d.title ?? `条目 ${i + 1}`}`,
288
+ '',
289
+ sentences,
169
290
  '',
170
- `[来源:${sourceLabel(d)}](${d.sourceUri ?? ''}) · [文章](${articleUrl})`,
291
+ `[来源:${sourceLabel(d)}](${d.sourceUri ?? ''})`,
171
292
  '',
172
293
  );
173
- } else {
174
- lines.push(sentences, '', `[来源:${sourceLabel(d)}](${d.sourceUri ?? ''})`, '');
175
- }
176
- });
177
- lines.push(`详情见本期完整文章:[ ${opts.title} ](${articleUrl})`, '');
294
+ });
295
+ lines.push(`详情见本期完整文章:[ ${opts.title} ](${articleUrl})`, '');
296
+ }
178
297
  return lines.join('\n');
179
298
  }
@@ -14642,72 +14642,6 @@ var init_zod = __esm(() => {
14642
14642
  init_external();
14643
14643
  });
14644
14644
 
14645
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.39/node_modules/@gobing-ai/ts-utils/dist/errors.js
14646
- var ErrorCode;
14647
- var init_errors3 = __esm(() => {
14648
- ErrorCode = {
14649
- NotFound: "NOT_FOUND",
14650
- Validation: "VALIDATION",
14651
- Conflict: "CONFLICT",
14652
- Internal: "INTERNAL"
14653
- };
14654
- });
14655
-
14656
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.39/node_modules/@gobing-ai/ts-utils/dist/api-response.js
14657
- var API_ERROR_CODES, ERROR_CODE_TO_HTTP, CLIENT_SAFE_CODES;
14658
- var init_api_response = __esm(() => {
14659
- init_errors3();
14660
- API_ERROR_CODES = {
14661
- SUCCESS: 0,
14662
- NOT_FOUND: 404,
14663
- VALIDATION_ERROR: 422,
14664
- BAD_REQUEST: 400,
14665
- UNAUTHORIZED: 401,
14666
- FORBIDDEN: 403,
14667
- CONFLICT: 409,
14668
- INTERNAL_ERROR: 500
14669
- };
14670
- ERROR_CODE_TO_HTTP = {
14671
- [ErrorCode.NotFound]: API_ERROR_CODES.NOT_FOUND,
14672
- [ErrorCode.Validation]: API_ERROR_CODES.VALIDATION_ERROR,
14673
- [ErrorCode.Conflict]: API_ERROR_CODES.CONFLICT,
14674
- [ErrorCode.Internal]: API_ERROR_CODES.INTERNAL_ERROR
14675
- };
14676
- CLIENT_SAFE_CODES = new Set([ErrorCode.NotFound, ErrorCode.Validation, ErrorCode.Conflict]);
14677
- });
14678
-
14679
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.39/node_modules/@gobing-ai/ts-utils/dist/cursor.js
14680
- var init_cursor = () => {};
14681
-
14682
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.39/node_modules/@gobing-ai/ts-utils/dist/event-severity.js
14683
- var init_event_severity = () => {};
14684
-
14685
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.39/node_modules/@gobing-ai/ts-utils/dist/output.js
14686
- function processStream(name) {
14687
- const proc = globalThis.process;
14688
- const stream = proc?.[name];
14689
- if (stream === undefined) {
14690
- throw new Error(`No ${name} target available: set one via setDefaultOutputTargets or pass an explicit target`);
14691
- }
14692
- return stream;
14693
- }
14694
- function writeLine(message, target) {
14695
- target.write(`${message}
14696
- `);
14697
- }
14698
- function echoError(message, target = defaultStderrTarget ?? processStream("stderr")) {
14699
- writeLine(message, target);
14700
- }
14701
- var defaultStderrTarget;
14702
-
14703
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.39/node_modules/@gobing-ai/ts-utils/dist/index.js
14704
- var init_dist = __esm(() => {
14705
- init_api_response();
14706
- init_cursor();
14707
- init_errors3();
14708
- init_event_severity();
14709
- });
14710
-
14711
14645
  // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/identity.js
14712
14646
  var require_identity = __commonJS((exports) => {
14713
14647
  var ALIAS = Symbol.for("yaml.alias");
@@ -17612,15 +17546,15 @@ var require_timestamp = __commonJS((exports) => {
17612
17546
  throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
17613
17547
  const [, year, month, day, hour, minute, second] = match.map(Number);
17614
17548
  const millisec = match[7] ? Number((match[7] + "00").substr(1, 3)) : 0;
17615
- let date6 = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec);
17549
+ let date5 = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec);
17616
17550
  const tz = match[8];
17617
17551
  if (tz && tz !== "Z") {
17618
17552
  let d = parseSexagesimal(tz, false);
17619
17553
  if (Math.abs(d) < 30)
17620
17554
  d *= 60;
17621
- date6 -= 60000 * d;
17555
+ date5 -= 60000 * d;
17622
17556
  }
17623
- return new Date(date6);
17557
+ return new Date(date5);
17624
17558
  },
17625
17559
  stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? ""
17626
17560
  };
@@ -19480,7 +19414,7 @@ var require_composer = __commonJS((exports) => {
19480
19414
  var node_process = __require("process");
19481
19415
  var directives = require_directives();
19482
19416
  var Document = require_Document();
19483
- var errors4 = require_errors();
19417
+ var errors3 = require_errors();
19484
19418
  var identity = require_identity();
19485
19419
  var composeDoc = require_compose_doc();
19486
19420
  var resolveEnd = require_resolve_end();
@@ -19531,9 +19465,9 @@ var require_composer = __commonJS((exports) => {
19531
19465
  this.onError = (source, code, message, warning) => {
19532
19466
  const pos = getErrorPos(source);
19533
19467
  if (warning)
19534
- this.warnings.push(new errors4.YAMLWarning(pos, code, message));
19468
+ this.warnings.push(new errors3.YAMLWarning(pos, code, message));
19535
19469
  else
19536
- this.errors.push(new errors4.YAMLParseError(pos, code, message));
19470
+ this.errors.push(new errors3.YAMLParseError(pos, code, message));
19537
19471
  };
19538
19472
  this.directives = new directives.Directives({ version: options.version || "1.2" });
19539
19473
  this.options = options;
@@ -19619,7 +19553,7 @@ ${cb}` : comment;
19619
19553
  break;
19620
19554
  case "error": {
19621
19555
  const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message;
19622
- const error51 = new errors4.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg);
19556
+ const error51 = new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg);
19623
19557
  if (this.atDirectives || !this.doc)
19624
19558
  this.errors.push(error51);
19625
19559
  else
@@ -19629,7 +19563,7 @@ ${cb}` : comment;
19629
19563
  case "doc-end": {
19630
19564
  if (!this.doc) {
19631
19565
  const msg = "Unexpected doc-end without preceding document";
19632
- this.errors.push(new errors4.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg));
19566
+ this.errors.push(new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg));
19633
19567
  break;
19634
19568
  }
19635
19569
  this.doc.directives.docEnd = true;
@@ -19644,7 +19578,7 @@ ${end.comment}` : end.comment;
19644
19578
  break;
19645
19579
  }
19646
19580
  default:
19647
- this.errors.push(new errors4.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`));
19581
+ this.errors.push(new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`));
19648
19582
  }
19649
19583
  }
19650
19584
  *end(forceDoc = false, endOffset = -1) {
@@ -19670,7 +19604,7 @@ ${end.comment}` : end.comment;
19670
19604
  var require_cst_scalar = __commonJS((exports) => {
19671
19605
  var resolveBlockScalar = require_resolve_block_scalar();
19672
19606
  var resolveFlowScalar = require_resolve_flow_scalar();
19673
- var errors4 = require_errors();
19607
+ var errors3 = require_errors();
19674
19608
  var stringifyString = require_stringifyString();
19675
19609
  function resolveAsScalar(token, strict = true, onError) {
19676
19610
  if (token) {
@@ -19679,7 +19613,7 @@ var require_cst_scalar = __commonJS((exports) => {
19679
19613
  if (onError)
19680
19614
  onError(offset, code, message);
19681
19615
  else
19682
- throw new errors4.YAMLParseError([offset, offset + 1], code, message);
19616
+ throw new errors3.YAMLParseError([offset, offset + 1], code, message);
19683
19617
  };
19684
19618
  switch (token.type) {
19685
19619
  case "scalar":
@@ -21559,7 +21493,7 @@ var require_parser = __commonJS((exports) => {
21559
21493
  var require_public_api = __commonJS((exports) => {
21560
21494
  var composer = require_composer();
21561
21495
  var Document = require_Document();
21562
- var errors4 = require_errors();
21496
+ var errors3 = require_errors();
21563
21497
  var log = require_log();
21564
21498
  var identity = require_identity();
21565
21499
  var lineCounter = require_line_counter();
@@ -21576,8 +21510,8 @@ var require_public_api = __commonJS((exports) => {
21576
21510
  const docs = Array.from(composer$1.compose(parser$1.parse(source)));
21577
21511
  if (prettyErrors && lineCounter2)
21578
21512
  for (const doc2 of docs) {
21579
- doc2.errors.forEach(errors4.prettifyError(source, lineCounter2));
21580
- doc2.warnings.forEach(errors4.prettifyError(source, lineCounter2));
21513
+ doc2.errors.forEach(errors3.prettifyError(source, lineCounter2));
21514
+ doc2.warnings.forEach(errors3.prettifyError(source, lineCounter2));
21581
21515
  }
21582
21516
  if (docs.length > 0)
21583
21517
  return docs;
@@ -21592,13 +21526,13 @@ var require_public_api = __commonJS((exports) => {
21592
21526
  if (!doc2)
21593
21527
  doc2 = _doc;
21594
21528
  else if (doc2.options.logLevel !== "silent") {
21595
- doc2.errors.push(new errors4.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
21529
+ doc2.errors.push(new errors3.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
21596
21530
  break;
21597
21531
  }
21598
21532
  }
21599
21533
  if (prettyErrors && lineCounter2) {
21600
- doc2.errors.forEach(errors4.prettifyError(source, lineCounter2));
21601
- doc2.warnings.forEach(errors4.prettifyError(source, lineCounter2));
21534
+ doc2.errors.forEach(errors3.prettifyError(source, lineCounter2));
21535
+ doc2.warnings.forEach(errors3.prettifyError(source, lineCounter2));
21602
21536
  }
21603
21537
  return doc2;
21604
21538
  }
@@ -21650,12 +21584,12 @@ var require_public_api = __commonJS((exports) => {
21650
21584
  });
21651
21585
 
21652
21586
  // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/index.js
21653
- var composer, Document, Schema, errors4, Alias, identity, Pair, Scalar, YAMLMap, YAMLSeq, cst, lexer, lineCounter, parser, publicApi, visit, $Composer, $Document, $Schema, $YAMLError, $YAMLParseError, $YAMLWarning, $Alias, $isAlias, $isCollection, $isDocument, $isMap, $isNode, $isPair, $isScalar, $isSeq, $Pair, $Scalar, $YAMLMap, $YAMLSeq, $Lexer, $LineCounter, $Parser, $parse, $parseAllDocuments, $parseDocument, $stringify, $visit, $visitAsync;
21654
- var init_dist2 = __esm(() => {
21587
+ var composer, Document, Schema, errors3, Alias, identity, Pair, Scalar, YAMLMap, YAMLSeq, cst, lexer, lineCounter, parser, publicApi, visit, $Composer, $Document, $Schema, $YAMLError, $YAMLParseError, $YAMLWarning, $Alias, $isAlias, $isCollection, $isDocument, $isMap, $isNode, $isPair, $isScalar, $isSeq, $Pair, $Scalar, $YAMLMap, $YAMLSeq, $Lexer, $LineCounter, $Parser, $parse, $parseAllDocuments, $parseDocument, $stringify, $visit, $visitAsync;
21588
+ var init_dist = __esm(() => {
21655
21589
  composer = require_composer();
21656
21590
  Document = require_Document();
21657
21591
  Schema = require_Schema();
21658
- errors4 = require_errors();
21592
+ errors3 = require_errors();
21659
21593
  Alias = require_Alias();
21660
21594
  identity = require_identity();
21661
21595
  Pair = require_Pair();
@@ -21671,9 +21605,9 @@ var init_dist2 = __esm(() => {
21671
21605
  $Composer = composer.Composer;
21672
21606
  $Document = Document.Document;
21673
21607
  $Schema = Schema.Schema;
21674
- $YAMLError = errors4.YAMLError;
21675
- $YAMLParseError = errors4.YAMLParseError;
21676
- $YAMLWarning = errors4.YAMLWarning;
21608
+ $YAMLError = errors3.YAMLError;
21609
+ $YAMLParseError = errors3.YAMLParseError;
21610
+ $YAMLWarning = errors3.YAMLWarning;
21677
21611
  $Alias = Alias.Alias;
21678
21612
  $isAlias = identity.isAlias;
21679
21613
  $isCollection = identity.isCollection;
@@ -21701,7 +21635,7 @@ var init_dist2 = __esm(() => {
21701
21635
  // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.39/node_modules/@gobing-ai/ts-runtime/dist/config.js
21702
21636
  var configSchema;
21703
21637
  var init_config = __esm(() => {
21704
- init_dist2();
21638
+ init_dist();
21705
21639
  init_zod();
21706
21640
  configSchema = exports_external.object({
21707
21641
  app: exports_external.object({
@@ -21887,6 +21821,24 @@ var PluginManifestSchema = exports_external.object({
21887
21821
  init_file_system_node();
21888
21822
  init_config();
21889
21823
 
21824
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.67/node_modules/@gobing-ai/ts-utils/dist/output.js
21825
+ var defaultStderrTarget;
21826
+ function processStream(name) {
21827
+ const proc = globalThis.process;
21828
+ const stream = proc?.[name];
21829
+ if (stream === undefined) {
21830
+ throw new Error(`No ${name} target available: set one via setDefaultOutputTargets or pass an explicit target`);
21831
+ }
21832
+ return stream;
21833
+ }
21834
+ function writeLine(message, target) {
21835
+ target.write(`${message}
21836
+ `);
21837
+ }
21838
+ function echoError(message, target = defaultStderrTarget ?? processStream("stderr")) {
21839
+ writeLine(message, target);
21840
+ }
21841
+
21890
21842
  // ../../packages/kk-core/src/render-md.ts
21891
21843
  if (false) {}
21892
21844
  // ../../packages/publish-harness/src/index.ts
@@ -21926,7 +21878,6 @@ class FakeFileCliTransport {
21926
21878
  }
21927
21879
 
21928
21880
  // ../../plugins/publishings/qiita-pub/src/index.ts
21929
- init_dist();
21930
21881
  var QIITA_ITEMS_URL = "https://qiita.com/api/v2/items";
21931
21882
  function slugify2(str) {
21932
21883
  return str.toLowerCase().replace(/[^\w\s-]/g, "").trim().replace(/[\s_]+/g, "-");