wiki-graph-sdk 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,12 +8,12 @@ import {
8
8
  getChapterDetails,
9
9
  openWikimediaResolver,
10
10
  recordBuildJobInputRevision,
11
- WikiGraphArchiveFile,
11
+ WikiGraphArchiveFile as WikiGraphArchiveFile2,
12
12
  WikiGraphScope,
13
13
  withLoggingContext
14
14
  } from "wiki-graph-core";
15
15
  import {
16
- applyChapterJobArtifactFile as applyChapterJobArtifactFile2,
16
+ applyChapterJobArtifactFile as applyChapterJobArtifactFile3,
17
17
  createLocalChapterJobFileExecutor as createLocalChapterJobFileExecutor2,
18
18
  writeChapterJobInputFile as writeChapterJobInputFile2
19
19
  } from "wiki-graph-core/worker";
@@ -1435,10 +1435,12 @@ function abortError(signal) {
1435
1435
 
1436
1436
  // src/worker.ts
1437
1437
  import {
1438
+ applyChapterJobArtifactFile,
1438
1439
  runBuildJobWorker as runCoreBuildJobWorker
1439
1440
  } from "wiki-graph-core/worker";
1441
+ import { WikiGraphArchiveFile } from "wiki-graph-core";
1440
1442
  import {
1441
- applyChapterJobArtifactFile,
1443
+ applyChapterJobArtifactFile as applyChapterJobArtifactFile2,
1442
1444
  createLocalChapterJobFileExecutor,
1443
1445
  writeChapterJobInputFile
1444
1446
  } from "wiki-graph-core/worker";
@@ -1480,7 +1482,7 @@ async function executeBuildJob(job, reporter, context) {
1480
1482
  let stage = await readChapterStage(job);
1481
1483
  if (stage === "sourced") {
1482
1484
  await executeStep(job, "reading-graph", execution, reporter, context, {
1483
- ...execution.extractionPrompt === void 0 ? {} : { extractionPrompt: execution.extractionPrompt }
1485
+ ...execution.extractionPrompt === void 0 ? {} : { prompt: execution.extractionPrompt }
1484
1486
  });
1485
1487
  stage = await readChapterStage(job);
1486
1488
  }
@@ -1513,8 +1515,8 @@ async function executeBuildJob(job, reporter, context) {
1513
1515
  }
1514
1516
  }
1515
1517
  await executeStep(job, job.target, execution, reporter, context, {
1516
- ...job.target === "reading-graph" ? { extractionPrompt: execution.extractionPrompt } : {},
1517
- ...job.target === "knowledge-graph" ? { policyPrompt: execution.knowledgeGraphPrompt } : {}
1518
+ ...job.target === "reading-graph" ? { prompt: execution.extractionPrompt } : {},
1519
+ ...job.target === "knowledge-graph" ? { prompt: execution.knowledgeGraphPrompt } : {}
1518
1520
  });
1519
1521
  } finally {
1520
1522
  await execution.close();
@@ -1529,7 +1531,7 @@ async function executeStep(job, kind, execution, reporter, context, inputOptions
1529
1531
  const stepWorkspace = await resetStepWorkspace(job.workspace, kind);
1530
1532
  const inputFile = await stepWorkspace.createFile("input.jsonl");
1531
1533
  const outputWorkspace = await stepWorkspace.createDirectory("output");
1532
- const revision = await new WikiGraphArchiveFile(job.archive).readDocument(
1534
+ const revision = await new WikiGraphArchiveFile2(job.archive).readDocument(
1533
1535
  async (document) => {
1534
1536
  await getChapterDetails(document, job.chapterId);
1535
1537
  return await writeChapterJobInputFile2(
@@ -1571,9 +1573,9 @@ async function executeStep(job, kind, execution, reporter, context, inputOptions
1571
1573
  total: 1,
1572
1574
  unit: "item"
1573
1575
  });
1574
- await new WikiGraphArchiveFile(job.archive).write(async (document) => {
1576
+ await new WikiGraphArchiveFile2(job.archive).write(async (document) => {
1575
1577
  assertJobStillRunning(await getBuildJob(job.jobId));
1576
- await applyChapterJobArtifactFile2(
1578
+ await applyChapterJobArtifactFile3(
1577
1579
  document,
1578
1580
  job.chapterId,
1579
1581
  kind,
@@ -1656,12 +1658,12 @@ async function resetStepWorkspace(workspace, kind) {
1656
1658
  return await workspace.createDirectory(name);
1657
1659
  }
1658
1660
  async function readChapterStage(job) {
1659
- return await new WikiGraphArchiveFile(job.archive).readDocument(
1661
+ return await new WikiGraphArchiveFile2(job.archive).readDocument(
1660
1662
  async (document) => (await getChapterDetails(document, job.chapterId)).stage
1661
1663
  );
1662
1664
  }
1663
1665
  async function assertCurrentFtsArtifact(job) {
1664
- await new WikiGraphArchiveFile(job.archive).readDocument(async (document) => {
1666
+ await new WikiGraphArchiveFile2(job.archive).readDocument(async (document) => {
1665
1667
  const revision = await document.serials.getRevision(job.chapterId);
1666
1668
  const artifact = await document.indexArtifacts.get(job.chapterId, "fts");
1667
1669
  if (artifact?.sourceRevision !== revision) {