@semiont/make-meaning 0.5.12 → 0.5.13
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/smelter-main.js +29 -15
- package/dist/smelter-main.js.map +1 -1
- package/dist/weaver-main.js +29 -15
- package/dist/weaver-main.js.map +1 -1
- package/package.json +12 -12
package/dist/smelter-main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createTomlConfigLoader, accessToken, baseUrl as baseUrl$1, burstBuffer, errField, resourceId, textExtractionOf, decodeRepresentation, busRequest, getResourceEntityTypes, getTargetSelector, getExactText, annotationId, getPrimaryMediaType, getPrimaryRepresentation } from '@semiont/core';
|
|
1
|
+
import { createTomlConfigLoader, accessToken, baseUrl as baseUrl$1, retryWithBackoff, isTransientFetchError, STARTUP_FETCH_RETRY, burstBuffer, errField, resourceId, textExtractionOf, decodeRepresentation, busRequest, getResourceEntityTypes, getTargetSelector, getExactText, annotationId, getPrimaryMediaType, getPrimaryRepresentation } from '@semiont/core';
|
|
2
2
|
import { calculateChecksum } from '@semiont/content';
|
|
3
3
|
import { createEmbeddingProvider, createVectorStore, chunkText } from '@semiont/vectors';
|
|
4
4
|
import { registerVectorIndexSizeProvider, withActorSpan } from '@semiont/observability';
|
|
@@ -10406,20 +10406,34 @@ async function authenticate() {
|
|
|
10406
10406
|
logger.warn("No SEMIONT_WORKER_SECRET set \u2014 using empty token");
|
|
10407
10407
|
return "";
|
|
10408
10408
|
}
|
|
10409
|
-
|
|
10410
|
-
|
|
10411
|
-
|
|
10412
|
-
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
|
|
10419
|
-
|
|
10420
|
-
|
|
10421
|
-
|
|
10422
|
-
|
|
10409
|
+
return retryWithBackoff(
|
|
10410
|
+
async () => {
|
|
10411
|
+
const response = await fetch(`${baseUrl}/api/tokens/agent`, {
|
|
10412
|
+
method: "POST",
|
|
10413
|
+
headers: { "Content-Type": "application/json" },
|
|
10414
|
+
body: JSON.stringify({
|
|
10415
|
+
secret: workerSecret,
|
|
10416
|
+
provider: embeddingType,
|
|
10417
|
+
model: embeddingModel
|
|
10418
|
+
})
|
|
10419
|
+
});
|
|
10420
|
+
if (!response.ok) {
|
|
10421
|
+
throw new Error(`Authentication failed: ${response.status} ${response.statusText}`);
|
|
10422
|
+
}
|
|
10423
|
+
const { token } = await response.json();
|
|
10424
|
+
return token;
|
|
10425
|
+
},
|
|
10426
|
+
isTransientFetchError,
|
|
10427
|
+
STARTUP_FETCH_RETRY,
|
|
10428
|
+
({ attempt, attempts, delayMs, error }) => {
|
|
10429
|
+
logger.warn("Backend unreachable, retrying authentication", {
|
|
10430
|
+
attempt,
|
|
10431
|
+
attempts,
|
|
10432
|
+
retryInMs: delayMs,
|
|
10433
|
+
error: error instanceof Error ? error.message : String(error)
|
|
10434
|
+
});
|
|
10435
|
+
}
|
|
10436
|
+
);
|
|
10423
10437
|
}
|
|
10424
10438
|
async function main() {
|
|
10425
10439
|
const { initObservabilityNode } = await import('@semiont/observability/node');
|