@gobing-ai/knowledge-kit 0.0.23 → 0.0.25

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 (67) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/index.js +137 -59
  3. package/package.json +4 -4
  4. package/plugins/generations/content-gen/dist/index.js +97 -45
  5. package/plugins/generations/core-facts-gen/dist/index.js +106 -57
  6. package/plugins/generations/daily-article-gen/dist/index.js +105 -56
  7. package/plugins/generations/dailynews-gen/dist/index.js +235 -57
  8. package/plugins/generations/dailynews-gen/src/index.ts +67 -2
  9. package/plugins/generations/dailynews-gen/src/script-builder.ts +36 -15
  10. package/plugins/generations/dailynews-gen/src/script-plan.ts +142 -0
  11. package/plugins/generations/episode-plan-gen/dist/index.js +115 -66
  12. package/plugins/generations/gemini-tts/README.md +24 -0
  13. package/plugins/generations/gemini-tts/dist/index.js +326 -260
  14. package/plugins/generations/gemini-tts/src/gemini-client.ts +41 -11
  15. package/plugins/generations/image-gen/dist/index.js +338 -117
  16. package/plugins/generations/image-gen/presets/formats/daily-news-cover.yaml +19 -0
  17. package/plugins/generations/image-gen/presets/formats/xhs-card.yaml +55 -0
  18. package/plugins/generations/image-gen/presets/styles/daily-news.yaml +9 -0
  19. package/plugins/generations/image-gen/presets/styles/xhs-knowledge.yaml +7 -0
  20. package/plugins/generations/image-gen/src/index.ts +148 -14
  21. package/plugins/generations/image-gen/src/job.ts +30 -0
  22. package/plugins/generations/image-gen/src/providers/errors.ts +91 -0
  23. package/plugins/generations/image-gen/src/providers/types.ts +79 -0
  24. package/plugins/generations/news-report-gen/dist/index.js +136 -55
  25. package/plugins/generations/news-report-gen/src/index.ts +57 -1
  26. package/plugins/generations/voice-gen/dist/index.js +119 -67
  27. package/plugins/ingestions/aihot-ingest/dist/index.js +103 -53
  28. package/plugins/ingestions/horizon-ingest/dist/index.js +102 -53
  29. package/plugins/ingestions/karakeep-local/dist/index.js +273 -224
  30. package/plugins/ingestions/last30days-ingest/dist/index.js +97 -48
  31. package/plugins/ingestions/web-search/dist/index.js +121 -72
  32. package/plugins/kk/config.example.yaml +13 -0
  33. package/plugins/kk/plugin.json +1 -1
  34. package/plugins/kk/scripts/daily-voice-style.zh.md +52 -0
  35. package/plugins/kk/scripts/kk-workflow-stages.ts +433 -16
  36. package/plugins/kk/skills/publish/SKILL.md +24 -1
  37. package/plugins/kk/skills/xhs-images/SKILL.md +89 -0
  38. package/plugins/kk/skills/xhs-images/references/card-layouts.md +35 -0
  39. package/plugins/kk/workflows/kk-daily-ai-voice.yaml +162 -11
  40. package/plugins/publishings/emdash-pub/dist/index.js +94 -45
  41. package/plugins/publishings/infoq-pub/dist/index.js +94 -45
  42. package/plugins/publishings/juejin-pub/dist/index.js +94 -45
  43. package/plugins/publishings/medium-pub/dist/index.js +94 -45
  44. package/plugins/publishings/podcast-pub/dist/index.js +115 -55
  45. package/plugins/publishings/podcast-pub/src/map.ts +30 -10
  46. package/plugins/publishings/podcast-pub/src/show-notes.ts +6 -1
  47. package/plugins/publishings/qiita-pub/dist/index.js +94 -45
  48. package/plugins/publishings/substack-pub/dist/index.js +94 -45
  49. package/plugins/publishings/surfdash-pub/dist/index.js +99 -63
  50. package/plugins/publishings/surfdash-pub/src/index.ts +10 -1
  51. package/plugins/publishings/wechatmp-pub/dist/index.js +94 -45
  52. package/plugins/publishings/x-pub/dist/index.js +94 -45
  53. package/plugins/publishings/xhs-pub/dist/index.js +8908 -229
  54. package/plugins/publishings/xhs-pub/package.json +1 -0
  55. package/plugins/publishings/xhs-pub/plugin.json +1 -1
  56. package/plugins/publishings/xhs-pub/src/automation-guard.ts +128 -0
  57. package/plugins/publishings/xhs-pub/src/index.ts +753 -24
  58. package/plugins/publishings/xhs-pub/src/profile-check.ts +133 -0
  59. package/plugins/publishings/zenn-pub/dist/index.js +94 -45
  60. package/plugins/sp/lib/env.ts +46 -0
  61. package/plugins/sp/lib/inline-run.generated.mjs +1489 -0
  62. package/plugins/sp/scripts/feature-verification-steps.ts +275 -0
  63. package/plugins/sp/scripts/inline-run-setup.ts +571 -47
  64. package/plugins/sp/scripts/wrapup-drift-probe.mjs +190 -0
  65. package/plugins/sp/scripts/wrapup-drift-probe.ts +258 -0
  66. package/plugins/sp/scripts/wrapup-steps.mjs +77 -6
  67. package/plugins/sp/scripts/wrapup-steps.ts +91 -5
@@ -14642,6 +14642,72 @@ var init_zod = __esm(() => {
14642
14642
  init_external();
14643
14643
  });
14644
14644
 
14645
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.11/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.5.11/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.5.11/node_modules/@gobing-ai/ts-utils/dist/cursor.js
14680
+ var init_cursor = () => {};
14681
+
14682
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.11/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.5.11/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.5.11/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
+
14645
14711
  // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/identity.js
14646
14712
  var require_identity = __commonJS((exports) => {
14647
14713
  var ALIAS = Symbol.for("yaml.alias");
@@ -17546,15 +17612,15 @@ var require_timestamp = __commonJS((exports) => {
17546
17612
  throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
17547
17613
  const [, year, month, day, hour, minute, second] = match.map(Number);
17548
17614
  const millisec = match[7] ? Number((match[7] + "00").substr(1, 3)) : 0;
17549
- let date5 = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec);
17615
+ let date6 = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec);
17550
17616
  const tz = match[8];
17551
17617
  if (tz && tz !== "Z") {
17552
17618
  let d = parseSexagesimal(tz, false);
17553
17619
  if (Math.abs(d) < 30)
17554
17620
  d *= 60;
17555
- date5 -= 60000 * d;
17621
+ date6 -= 60000 * d;
17556
17622
  }
17557
- return new Date(date5);
17623
+ return new Date(date6);
17558
17624
  },
17559
17625
  stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? ""
17560
17626
  };
@@ -19414,7 +19480,7 @@ var require_composer = __commonJS((exports) => {
19414
19480
  var node_process = __require("process");
19415
19481
  var directives = require_directives();
19416
19482
  var Document = require_Document();
19417
- var errors3 = require_errors();
19483
+ var errors4 = require_errors();
19418
19484
  var identity = require_identity();
19419
19485
  var composeDoc = require_compose_doc();
19420
19486
  var resolveEnd = require_resolve_end();
@@ -19465,9 +19531,9 @@ var require_composer = __commonJS((exports) => {
19465
19531
  this.onError = (source, code, message, warning) => {
19466
19532
  const pos = getErrorPos(source);
19467
19533
  if (warning)
19468
- this.warnings.push(new errors3.YAMLWarning(pos, code, message));
19534
+ this.warnings.push(new errors4.YAMLWarning(pos, code, message));
19469
19535
  else
19470
- this.errors.push(new errors3.YAMLParseError(pos, code, message));
19536
+ this.errors.push(new errors4.YAMLParseError(pos, code, message));
19471
19537
  };
19472
19538
  this.directives = new directives.Directives({ version: options.version || "1.2" });
19473
19539
  this.options = options;
@@ -19553,7 +19619,7 @@ ${cb}` : comment;
19553
19619
  break;
19554
19620
  case "error": {
19555
19621
  const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message;
19556
- const error51 = new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg);
19622
+ const error51 = new errors4.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg);
19557
19623
  if (this.atDirectives || !this.doc)
19558
19624
  this.errors.push(error51);
19559
19625
  else
@@ -19563,7 +19629,7 @@ ${cb}` : comment;
19563
19629
  case "doc-end": {
19564
19630
  if (!this.doc) {
19565
19631
  const msg = "Unexpected doc-end without preceding document";
19566
- this.errors.push(new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg));
19632
+ this.errors.push(new errors4.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg));
19567
19633
  break;
19568
19634
  }
19569
19635
  this.doc.directives.docEnd = true;
@@ -19578,7 +19644,7 @@ ${end.comment}` : end.comment;
19578
19644
  break;
19579
19645
  }
19580
19646
  default:
19581
- this.errors.push(new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`));
19647
+ this.errors.push(new errors4.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`));
19582
19648
  }
19583
19649
  }
19584
19650
  *end(forceDoc = false, endOffset = -1) {
@@ -19604,7 +19670,7 @@ ${end.comment}` : end.comment;
19604
19670
  var require_cst_scalar = __commonJS((exports) => {
19605
19671
  var resolveBlockScalar = require_resolve_block_scalar();
19606
19672
  var resolveFlowScalar = require_resolve_flow_scalar();
19607
- var errors3 = require_errors();
19673
+ var errors4 = require_errors();
19608
19674
  var stringifyString = require_stringifyString();
19609
19675
  function resolveAsScalar(token, strict = true, onError) {
19610
19676
  if (token) {
@@ -19613,7 +19679,7 @@ var require_cst_scalar = __commonJS((exports) => {
19613
19679
  if (onError)
19614
19680
  onError(offset, code, message);
19615
19681
  else
19616
- throw new errors3.YAMLParseError([offset, offset + 1], code, message);
19682
+ throw new errors4.YAMLParseError([offset, offset + 1], code, message);
19617
19683
  };
19618
19684
  switch (token.type) {
19619
19685
  case "scalar":
@@ -21493,7 +21559,7 @@ var require_parser = __commonJS((exports) => {
21493
21559
  var require_public_api = __commonJS((exports) => {
21494
21560
  var composer = require_composer();
21495
21561
  var Document = require_Document();
21496
- var errors3 = require_errors();
21562
+ var errors4 = require_errors();
21497
21563
  var log = require_log();
21498
21564
  var identity = require_identity();
21499
21565
  var lineCounter = require_line_counter();
@@ -21510,8 +21576,8 @@ var require_public_api = __commonJS((exports) => {
21510
21576
  const docs = Array.from(composer$1.compose(parser$1.parse(source)));
21511
21577
  if (prettyErrors && lineCounter2)
21512
21578
  for (const doc2 of docs) {
21513
- doc2.errors.forEach(errors3.prettifyError(source, lineCounter2));
21514
- doc2.warnings.forEach(errors3.prettifyError(source, lineCounter2));
21579
+ doc2.errors.forEach(errors4.prettifyError(source, lineCounter2));
21580
+ doc2.warnings.forEach(errors4.prettifyError(source, lineCounter2));
21515
21581
  }
21516
21582
  if (docs.length > 0)
21517
21583
  return docs;
@@ -21526,13 +21592,13 @@ var require_public_api = __commonJS((exports) => {
21526
21592
  if (!doc2)
21527
21593
  doc2 = _doc;
21528
21594
  else if (doc2.options.logLevel !== "silent") {
21529
- doc2.errors.push(new errors3.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
21595
+ doc2.errors.push(new errors4.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
21530
21596
  break;
21531
21597
  }
21532
21598
  }
21533
21599
  if (prettyErrors && lineCounter2) {
21534
- doc2.errors.forEach(errors3.prettifyError(source, lineCounter2));
21535
- doc2.warnings.forEach(errors3.prettifyError(source, lineCounter2));
21600
+ doc2.errors.forEach(errors4.prettifyError(source, lineCounter2));
21601
+ doc2.warnings.forEach(errors4.prettifyError(source, lineCounter2));
21536
21602
  }
21537
21603
  return doc2;
21538
21604
  }
@@ -21584,12 +21650,12 @@ var require_public_api = __commonJS((exports) => {
21584
21650
  });
21585
21651
 
21586
21652
  // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/index.js
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(() => {
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(() => {
21589
21655
  composer = require_composer();
21590
21656
  Document = require_Document();
21591
21657
  Schema = require_Schema();
21592
- errors3 = require_errors();
21658
+ errors4 = require_errors();
21593
21659
  Alias = require_Alias();
21594
21660
  identity = require_identity();
21595
21661
  Pair = require_Pair();
@@ -21605,9 +21671,9 @@ var init_dist = __esm(() => {
21605
21671
  $Composer = composer.Composer;
21606
21672
  $Document = Document.Document;
21607
21673
  $Schema = Schema.Schema;
21608
- $YAMLError = errors3.YAMLError;
21609
- $YAMLParseError = errors3.YAMLParseError;
21610
- $YAMLWarning = errors3.YAMLWarning;
21674
+ $YAMLError = errors4.YAMLError;
21675
+ $YAMLParseError = errors4.YAMLParseError;
21676
+ $YAMLWarning = errors4.YAMLWarning;
21611
21677
  $Alias = Alias.Alias;
21612
21678
  $isAlias = identity.isAlias;
21613
21679
  $isCollection = identity.isCollection;
@@ -21632,10 +21698,10 @@ var init_dist = __esm(() => {
21632
21698
  $visitAsync = visit.visitAsync;
21633
21699
  });
21634
21700
 
21635
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.39/node_modules/@gobing-ai/ts-runtime/dist/config.js
21701
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11/node_modules/@gobing-ai/ts-runtime/dist/config.js
21636
21702
  var configSchema;
21637
21703
  var init_config = __esm(() => {
21638
- init_dist();
21704
+ init_dist2();
21639
21705
  init_zod();
21640
21706
  configSchema = exports_external.object({
21641
21707
  app: exports_external.object({
@@ -21656,7 +21722,7 @@ var init_config = __esm(() => {
21656
21722
  });
21657
21723
  });
21658
21724
 
21659
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.39/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
21725
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
21660
21726
  import { appendFileSync, cpSync, createReadStream, createWriteStream, existsSync, mkdirSync, readdirSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "fs";
21661
21727
  import { dirname, resolve as resolvePath } from "path";
21662
21728
  function createNodeFileSystem(root, paths) {
@@ -21833,31 +21899,17 @@ var PluginManifestSchema = exports_external.looseObject({
21833
21899
  description: exports_external.string().optional(),
21834
21900
  operations: exports_external.record(exports_external.string(), PluginOperationSchema).optional()
21835
21901
  });
21836
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.39/node_modules/@gobing-ai/ts-runtime/dist/index.js
21902
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11/node_modules/@gobing-ai/ts-runtime/dist/index.js
21837
21903
  init_file_system_node();
21838
21904
  init_config();
21839
21905
 
21840
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.67/node_modules/@gobing-ai/ts-utils/dist/output.js
21841
- var defaultStderrTarget;
21842
- function processStream(name) {
21843
- const proc = globalThis.process;
21844
- const stream = proc?.[name];
21845
- if (stream === undefined) {
21846
- throw new Error(`No ${name} target available: set one via setDefaultOutputTargets or pass an explicit target`);
21847
- }
21848
- return stream;
21849
- }
21850
- function writeLine(message, target) {
21851
- target.write(`${message}
21852
- `);
21853
- }
21854
- function echoError(message, target = defaultStderrTarget ?? processStream("stderr")) {
21855
- writeLine(message, target);
21856
- }
21857
-
21858
21906
  // ../../packages/kk-core/src/render-md.ts
21859
21907
  if (false) {}
21908
+ // ../../plugins/generations/content-gen/src/index.ts
21909
+ init_dist();
21910
+
21860
21911
  // ../../plugins/generations/content-gen/src/storm.ts
21912
+ init_dist();
21861
21913
  init_zod();
21862
21914
 
21863
21915
  // ../../plugins/generations/content-gen/src/agent-json.ts
@@ -14642,6 +14642,72 @@ var init_zod = __esm(() => {
14642
14642
  init_external();
14643
14643
  });
14644
14644
 
14645
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.11/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.5.11/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.5.11/node_modules/@gobing-ai/ts-utils/dist/cursor.js
14680
+ var init_cursor = () => {};
14681
+
14682
+ // ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.11/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.5.11/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.5.11/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
+
14645
14711
  // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/identity.js
14646
14712
  var require_identity = __commonJS((exports) => {
14647
14713
  var ALIAS = Symbol.for("yaml.alias");
@@ -17546,15 +17612,15 @@ var require_timestamp = __commonJS((exports) => {
17546
17612
  throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
17547
17613
  const [, year, month, day, hour, minute, second] = match.map(Number);
17548
17614
  const millisec = match[7] ? Number((match[7] + "00").substr(1, 3)) : 0;
17549
- let date5 = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec);
17615
+ let date6 = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec);
17550
17616
  const tz = match[8];
17551
17617
  if (tz && tz !== "Z") {
17552
17618
  let d = parseSexagesimal(tz, false);
17553
17619
  if (Math.abs(d) < 30)
17554
17620
  d *= 60;
17555
- date5 -= 60000 * d;
17621
+ date6 -= 60000 * d;
17556
17622
  }
17557
- return new Date(date5);
17623
+ return new Date(date6);
17558
17624
  },
17559
17625
  stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? ""
17560
17626
  };
@@ -19414,7 +19480,7 @@ var require_composer = __commonJS((exports) => {
19414
19480
  var node_process = __require("process");
19415
19481
  var directives = require_directives();
19416
19482
  var Document = require_Document();
19417
- var errors3 = require_errors();
19483
+ var errors4 = require_errors();
19418
19484
  var identity = require_identity();
19419
19485
  var composeDoc = require_compose_doc();
19420
19486
  var resolveEnd = require_resolve_end();
@@ -19465,9 +19531,9 @@ var require_composer = __commonJS((exports) => {
19465
19531
  this.onError = (source, code, message, warning) => {
19466
19532
  const pos = getErrorPos(source);
19467
19533
  if (warning)
19468
- this.warnings.push(new errors3.YAMLWarning(pos, code, message));
19534
+ this.warnings.push(new errors4.YAMLWarning(pos, code, message));
19469
19535
  else
19470
- this.errors.push(new errors3.YAMLParseError(pos, code, message));
19536
+ this.errors.push(new errors4.YAMLParseError(pos, code, message));
19471
19537
  };
19472
19538
  this.directives = new directives.Directives({ version: options.version || "1.2" });
19473
19539
  this.options = options;
@@ -19553,7 +19619,7 @@ ${cb}` : comment;
19553
19619
  break;
19554
19620
  case "error": {
19555
19621
  const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message;
19556
- const error51 = new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg);
19622
+ const error51 = new errors4.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg);
19557
19623
  if (this.atDirectives || !this.doc)
19558
19624
  this.errors.push(error51);
19559
19625
  else
@@ -19563,7 +19629,7 @@ ${cb}` : comment;
19563
19629
  case "doc-end": {
19564
19630
  if (!this.doc) {
19565
19631
  const msg = "Unexpected doc-end without preceding document";
19566
- this.errors.push(new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg));
19632
+ this.errors.push(new errors4.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg));
19567
19633
  break;
19568
19634
  }
19569
19635
  this.doc.directives.docEnd = true;
@@ -19578,7 +19644,7 @@ ${end.comment}` : end.comment;
19578
19644
  break;
19579
19645
  }
19580
19646
  default:
19581
- this.errors.push(new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`));
19647
+ this.errors.push(new errors4.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`));
19582
19648
  }
19583
19649
  }
19584
19650
  *end(forceDoc = false, endOffset = -1) {
@@ -19604,7 +19670,7 @@ ${end.comment}` : end.comment;
19604
19670
  var require_cst_scalar = __commonJS((exports) => {
19605
19671
  var resolveBlockScalar = require_resolve_block_scalar();
19606
19672
  var resolveFlowScalar = require_resolve_flow_scalar();
19607
- var errors3 = require_errors();
19673
+ var errors4 = require_errors();
19608
19674
  var stringifyString = require_stringifyString();
19609
19675
  function resolveAsScalar(token, strict = true, onError) {
19610
19676
  if (token) {
@@ -19613,7 +19679,7 @@ var require_cst_scalar = __commonJS((exports) => {
19613
19679
  if (onError)
19614
19680
  onError(offset, code, message);
19615
19681
  else
19616
- throw new errors3.YAMLParseError([offset, offset + 1], code, message);
19682
+ throw new errors4.YAMLParseError([offset, offset + 1], code, message);
19617
19683
  };
19618
19684
  switch (token.type) {
19619
19685
  case "scalar":
@@ -21493,7 +21559,7 @@ var require_parser = __commonJS((exports) => {
21493
21559
  var require_public_api = __commonJS((exports) => {
21494
21560
  var composer = require_composer();
21495
21561
  var Document = require_Document();
21496
- var errors3 = require_errors();
21562
+ var errors4 = require_errors();
21497
21563
  var log = require_log();
21498
21564
  var identity = require_identity();
21499
21565
  var lineCounter = require_line_counter();
@@ -21510,8 +21576,8 @@ var require_public_api = __commonJS((exports) => {
21510
21576
  const docs = Array.from(composer$1.compose(parser$1.parse(source)));
21511
21577
  if (prettyErrors && lineCounter2)
21512
21578
  for (const doc2 of docs) {
21513
- doc2.errors.forEach(errors3.prettifyError(source, lineCounter2));
21514
- doc2.warnings.forEach(errors3.prettifyError(source, lineCounter2));
21579
+ doc2.errors.forEach(errors4.prettifyError(source, lineCounter2));
21580
+ doc2.warnings.forEach(errors4.prettifyError(source, lineCounter2));
21515
21581
  }
21516
21582
  if (docs.length > 0)
21517
21583
  return docs;
@@ -21526,13 +21592,13 @@ var require_public_api = __commonJS((exports) => {
21526
21592
  if (!doc2)
21527
21593
  doc2 = _doc;
21528
21594
  else if (doc2.options.logLevel !== "silent") {
21529
- doc2.errors.push(new errors3.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
21595
+ doc2.errors.push(new errors4.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
21530
21596
  break;
21531
21597
  }
21532
21598
  }
21533
21599
  if (prettyErrors && lineCounter2) {
21534
- doc2.errors.forEach(errors3.prettifyError(source, lineCounter2));
21535
- doc2.warnings.forEach(errors3.prettifyError(source, lineCounter2));
21600
+ doc2.errors.forEach(errors4.prettifyError(source, lineCounter2));
21601
+ doc2.warnings.forEach(errors4.prettifyError(source, lineCounter2));
21536
21602
  }
21537
21603
  return doc2;
21538
21604
  }
@@ -21584,12 +21650,12 @@ var require_public_api = __commonJS((exports) => {
21584
21650
  });
21585
21651
 
21586
21652
  // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/index.js
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(() => {
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(() => {
21589
21655
  composer = require_composer();
21590
21656
  Document = require_Document();
21591
21657
  Schema = require_Schema();
21592
- errors3 = require_errors();
21658
+ errors4 = require_errors();
21593
21659
  Alias = require_Alias();
21594
21660
  identity = require_identity();
21595
21661
  Pair = require_Pair();
@@ -21605,9 +21671,9 @@ var init_dist = __esm(() => {
21605
21671
  $Composer = composer.Composer;
21606
21672
  $Document = Document.Document;
21607
21673
  $Schema = Schema.Schema;
21608
- $YAMLError = errors3.YAMLError;
21609
- $YAMLParseError = errors3.YAMLParseError;
21610
- $YAMLWarning = errors3.YAMLWarning;
21674
+ $YAMLError = errors4.YAMLError;
21675
+ $YAMLParseError = errors4.YAMLParseError;
21676
+ $YAMLWarning = errors4.YAMLWarning;
21611
21677
  $Alias = Alias.Alias;
21612
21678
  $isAlias = identity.isAlias;
21613
21679
  $isCollection = identity.isCollection;
@@ -21632,10 +21698,10 @@ var init_dist = __esm(() => {
21632
21698
  $visitAsync = visit.visitAsync;
21633
21699
  });
21634
21700
 
21635
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.39/node_modules/@gobing-ai/ts-runtime/dist/config.js
21701
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11/node_modules/@gobing-ai/ts-runtime/dist/config.js
21636
21702
  var configSchema;
21637
21703
  var init_config = __esm(() => {
21638
- init_dist();
21704
+ init_dist2();
21639
21705
  init_zod();
21640
21706
  configSchema = exports_external.object({
21641
21707
  app: exports_external.object({
@@ -21656,7 +21722,7 @@ var init_config = __esm(() => {
21656
21722
  });
21657
21723
  });
21658
21724
 
21659
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.39/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
21725
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
21660
21726
  import { appendFileSync, cpSync, createReadStream, createWriteStream, existsSync, mkdirSync, readdirSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "fs";
21661
21727
  import { dirname, resolve as resolvePath } from "path";
21662
21728
  function createNodeFileSystem(root, paths) {
@@ -21834,14 +21900,14 @@ var PluginManifestSchema = exports_external.looseObject({
21834
21900
  description: exports_external.string().optional(),
21835
21901
  operations: exports_external.record(exports_external.string(), PluginOperationSchema).optional()
21836
21902
  });
21837
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.39/node_modules/@gobing-ai/ts-runtime/dist/index.js
21903
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11/node_modules/@gobing-ai/ts-runtime/dist/index.js
21838
21904
  init_file_system_node();
21839
21905
  init_config();
21840
21906
 
21841
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.39/node_modules/@gobing-ai/ts-runtime/dist/fs.js
21907
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11/node_modules/@gobing-ai/ts-runtime/dist/fs.js
21842
21908
  init_file_system_node();
21843
21909
 
21844
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.39/node_modules/@gobing-ai/ts-runtime/dist/path.js
21910
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11/node_modules/@gobing-ai/ts-runtime/dist/path.js
21845
21911
  function normalizeSeparators(path) {
21846
21912
  return path.replaceAll("\\", "/");
21847
21913
  }
@@ -21875,7 +21941,7 @@ function dirnamePath(path) {
21875
21941
  return normalized.slice(0, index);
21876
21942
  }
21877
21943
 
21878
- // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.39/node_modules/@gobing-ai/ts-runtime/dist/fs.js
21944
+ // ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.11/node_modules/@gobing-ai/ts-runtime/dist/fs.js
21879
21945
  async function ensureDirForFile(path, fs = createNodeFileSystem()) {
21880
21946
  await fs.ensureDir(dirnamePath(path));
21881
21947
  }
@@ -21903,27 +21969,10 @@ function getProcessPid() {
21903
21969
  function uniqueToken() {
21904
21970
  return `${Date.now()}.${crypto.randomUUID()}`;
21905
21971
  }
21906
- // ../../node_modules/.bun/@gobing-ai+ts-utils@0.4.67/node_modules/@gobing-ai/ts-utils/dist/output.js
21907
- var defaultStderrTarget;
21908
- function processStream(name) {
21909
- const proc = globalThis.process;
21910
- const stream = proc?.[name];
21911
- if (stream === undefined) {
21912
- throw new Error(`No ${name} target available: set one via setDefaultOutputTargets or pass an explicit target`);
21913
- }
21914
- return stream;
21915
- }
21916
- function writeLine(message, target) {
21917
- target.write(`${message}
21918
- `);
21919
- }
21920
- function echoError(message, target = defaultStderrTarget ?? processStream("stderr")) {
21921
- writeLine(message, target);
21922
- }
21923
-
21924
21972
  // ../../packages/kk-core/src/render-md.ts
21925
21973
  if (false) {}
21926
21974
  // ../../plugins/generations/core-facts-gen/src/index.ts
21975
+ init_dist();
21927
21976
  function sourceFileOf(entry) {
21928
21977
  if (entry && typeof entry === "object" && "file" in entry) {
21929
21978
  const file2 = entry.file;
@@ -21931,7 +21980,7 @@ function sourceFileOf(entry) {
21931
21980
  }
21932
21981
  return null;
21933
21982
  }
21934
- function renderCoreFacts(docs, date5) {
21983
+ function renderCoreFacts(docs, date6) {
21935
21984
  const sources = new Set;
21936
21985
  for (const doc2 of docs) {
21937
21986
  const entries = doc2.metadata?.sources;
@@ -21969,14 +22018,14 @@ function renderCoreFacts(docs, date5) {
21969
22018
 
21970
22019
  `);
21971
22020
  return `---
21972
- date: ${date5}
22021
+ date: ${date6}
21973
22022
  sources:
21974
22023
  ${roster}
21975
22024
  dedup_rule: id
21976
22025
  doc_count: ${docs.length}
21977
22026
  ---
21978
22027
 
21979
- ` + `# Core Facts \u2014 ${date5}
22028
+ ` + `# Core Facts \u2014 ${date6}
21980
22029
 
21981
22030
  ` + "> Daily AI news core-facts digest. Merge: `kk executor fan-in` (id dedupe, first-seen wins).\n" + `> Render: core-facts-gen generator (mechanical; no LLM).
21982
22031
 
@@ -21985,19 +22034,19 @@ doc_count: ${docs.length}
21985
22034
  ${headlines}
21986
22035
  `;
21987
22036
  }
21988
- function docsToContent(docs, date5) {
22037
+ function docsToContent(docs, date6) {
21989
22038
  return ContentSchema.parse({
21990
- title: `Core Facts \u2014 ${date5}`,
21991
- body: renderCoreFacts(docs, date5),
22039
+ title: `Core Facts \u2014 ${date6}`,
22040
+ body: renderCoreFacts(docs, date6),
21992
22041
  format: "markdown",
21993
22042
  references: docs.filter((d) => d.sourceUri).map((d) => ({ url: d.sourceUri, title: d.title, cite: d.id })),
21994
- metadata: { generator: "kk:core-facts", date: date5, doc_count: docs.length }
22043
+ metadata: { generator: "kk:core-facts", date: date6, doc_count: docs.length }
21995
22044
  });
21996
22045
  }
21997
22046
  async function processGeneratorIO(inputPath, outputPath) {
21998
22047
  const docs = DocListSchema.parse(await readJsonFile(inputPath));
21999
- const date5 = process.env.CORE_FACTS_DATE ?? new Date().toISOString().slice(0, 10);
22000
- const content = docsToContent(docs, date5);
22048
+ const date6 = process.env.CORE_FACTS_DATE ?? new Date().toISOString().slice(0, 10);
22049
+ const content = docsToContent(docs, date6);
22001
22050
  const fs = createNodeFileSystem();
22002
22051
  const outDir = dirname2(outputPath);
22003
22052
  if (outDir && outDir !== ".")