@semiont/backend 0.3.8 → 0.4.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.
package/dist/index.js CHANGED
@@ -13548,10 +13548,15 @@ var openapi_default = {
13548
13548
  minimum: 100,
13549
13549
  maximum: 4e3,
13550
13550
  description: "Maximum tokens to generate"
13551
+ },
13552
+ storageUri: {
13553
+ type: "string",
13554
+ description: "file://-relative URI where the generated resource will be saved (e.g. file://generated/overview.md)"
13551
13555
  }
13552
13556
  },
13553
13557
  required: [
13554
- "context"
13558
+ "context",
13559
+ "storageUri"
13555
13560
  ]
13556
13561
  },
13557
13562
  GetAnnotationHistoryResponse: {
@@ -14301,7 +14306,7 @@ var openapi_default = {
14301
14306
  },
14302
14307
  storageUri: {
14303
14308
  type: "string",
14304
- description: "Where the bytes live (s3://, file://, https://, ipfs://, etc.)."
14309
+ description: "Working-tree URI identifying where the bytes live. Only file:// is supported (e.g. file://docs/overview.md)."
14305
14310
  },
14306
14311
  filename: {
14307
14312
  type: "string"
@@ -14664,6 +14669,14 @@ var openapi_default = {
14664
14669
  type: "string",
14665
14670
  format: "uri",
14666
14671
  description: "Original URI from a source knowledge base when this resource was imported"
14672
+ },
14673
+ storageUri: {
14674
+ type: "string",
14675
+ description: "Working-tree URI for this resource (e.g. file://docs/overview.md). Stable across updates and moves."
14676
+ },
14677
+ currentChecksum: {
14678
+ type: "string",
14679
+ description: "SHA-256 hex hash of the current content. Updated on resource.created, resource.updated, resource.cloned events."
14667
14680
  }
14668
14681
  }
14669
14682
  },
@@ -16443,6 +16456,7 @@ function registerCreateResource(router) {
16443
16456
  const language = formData.get("language");
16444
16457
  const entityTypesStr = formData.get("entityTypes");
16445
16458
  const creationMethod = formData.get("creationMethod");
16459
+ const storageUri = formData.get("storageUri");
16446
16460
  if (!name || !file || !formatRaw) {
16447
16461
  throw new HTTPException(400, {
16448
16462
  message: "Missing required fields: name, file, format"
@@ -16459,7 +16473,8 @@ function registerCreateResource(router) {
16459
16473
  format,
16460
16474
  language: language || void 0,
16461
16475
  entityTypes,
16462
- creationMethod: creationMethod || void 0
16476
+ creationMethod: creationMethod || void 0,
16477
+ storageUri: storageUri || void 0
16463
16478
  }, userId(user.id), eventBus2);
16464
16479
  return c.json({
16465
16480
  resourceId: resourceId20
@@ -16796,13 +16811,12 @@ function registerGetResourceUri(router) {
16796
16811
  message: "Resource not found"
16797
16812
  });
16798
16813
  }
16799
- const primaryRep = getPrimaryRepresentation(resource);
16800
- if (!primaryRep || !primaryRep.checksum || !primaryRep.mediaType) {
16814
+ if (!resource.storageUri) {
16801
16815
  throw new HTTPException(404, {
16802
16816
  message: "Resource representation not found"
16803
16817
  });
16804
16818
  }
16805
- const content = await kb.content.retrieve(primaryRep.checksum, primaryRep.mediaType);
16819
+ const content = await kb.content.retrieve(resource.storageUri);
16806
16820
  if (!content) {
16807
16821
  throw new HTTPException(404, {
16808
16822
  message: "Resource representation not found"
@@ -18938,7 +18952,8 @@ function registerYieldResourceStream(router, jobQueue) {
18938
18952
  entityTypes: getEntityTypes(reference).map((et) => entityType(et)),
18939
18953
  context: body.context,
18940
18954
  temperature: body.temperature,
18941
- maxTokens: body.maxTokens
18955
+ maxTokens: body.maxTokens,
18956
+ storageUri: body.storageUri
18942
18957
  }
18943
18958
  };
18944
18959
  await jobQueue.createJob(job);