@semiont/jobs 0.6.4 → 0.6.6
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.d.ts +1 -9
- package/dist/index.js +4 -5
- package/dist/index.js.map +1 -1
- package/dist/worker-main.js.map +1 -1
- package/package.json +10 -10
package/dist/index.d.ts
CHANGED
|
@@ -577,14 +577,6 @@ declare class FsJobQueue implements JobQueue {
|
|
|
577
577
|
* handle escapes this file.
|
|
578
578
|
*/
|
|
579
579
|
|
|
580
|
-
/**
|
|
581
|
-
* The JOBS stream's capture filter — exported as the ONE home of the fact.
|
|
582
|
-
* A JetStream stream is a server-side subscription: anything published under
|
|
583
|
-
* these subjects is persisted regardless of which client API produced it.
|
|
584
|
-
* The signal plane's disjointness gate derives from this export instead of
|
|
585
|
-
* restating it (SIGNAL-PLANE D3 gate 3).
|
|
586
|
-
*/
|
|
587
|
-
declare const JOBS_STREAM_SUBJECTS: readonly ["jobs.>"];
|
|
588
580
|
interface JetStreamJobQueueOptions {
|
|
589
581
|
/** NATS server address(es), e.g. "192.168.64.42:4222". */
|
|
590
582
|
servers: string | string[];
|
|
@@ -1133,5 +1125,5 @@ declare const WORKER_CONSUMED_BROADCASTS: readonly ["job:queued", "job:cancel-re
|
|
|
1133
1125
|
*/
|
|
1134
1126
|
declare const WORKER_CHANNELS: readonly (keyof EventMap)[];
|
|
1135
1127
|
|
|
1136
|
-
export { AnnotationDetection, FsJobQueue,
|
|
1128
|
+
export { AnnotationDetection, FsJobQueue, JOB_QUEUE_EMITS, JetStreamJobQueue, STALL_THRESHOLD_MS, TERMINAL_JOB_RETENTION_MS, TERMINAL_JOB_SWEEP_INTERVAL_MS, WORKER_CHANNELS, WORKER_CONSUMED_BROADCASTS, generateResourceFromTopic, isCancelledJob, isCompleteJob, isFailedJob, isPendingJob, isRunningJob, processAssessmentJob, processCommentJob, processGenerationJob, processHighlightJob, processReferenceJob, processTagJob };
|
|
1137
1129
|
export type { AnyJob, AssessmentDetectionJob, AssessmentDetectionParams, AssessmentDetectionProgress, CancelledJob, CommentDetectionJob, CommentDetectionParams, CommentDetectionProgress, CompleteJob, DetectionJob, DetectionParams, DetectionProgress, FailedJob, GenerationJob, GenerationResult, HighlightDetectionJob, HighlightDetectionParams, HighlightDetectionProgress, JetStreamJobQueueOptions, JobMetadata, JobQueryFilters, JobQueue, JobStatus, JobType, OnProgress, PendingJob, ProcessorResult, RunningJob, TagDetectionJob, TagDetectionParams, TagDetectionProgress, YieldProgress };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { promises, mkdtempSync, writeFileSync, readFileSync, rmSync } from 'fs';
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
import { join } from 'path';
|
|
4
|
-
import { replyChannelsFor, jobId, deriveViews, GENERATABLE_MEDIA_TYPES, estimateTokens, isObject, isString, reconcileSelector, getLocaleEnglishName, cutChunk, chunkText } from '@semiont/core';
|
|
4
|
+
import { replyChannelsFor, jobId, JOBS_STREAM_SUBJECTS, JOBS_SUBJECT_ROOT, deriveViews, GENERATABLE_MEDIA_TYPES, estimateTokens, isObject, isString, reconcileSelector, getLocaleEnglishName, cutChunk, chunkText } from '@semiont/core';
|
|
5
5
|
import { connect, RetentionPolicy, DeliverPolicy, AckPolicy, nanos, NatsError } from 'nats';
|
|
6
6
|
import { withSpan, recordAnchorOutcome, recordDetectionCall } from '@semiont/observability';
|
|
7
7
|
import { StructuredReadError } from '@semiont/inference';
|
|
@@ -523,12 +523,11 @@ var PROGRESS_WRITE_MIN_INTERVAL_MS2 = 5e3;
|
|
|
523
523
|
var MAX_CAS_ATTEMPTS = 20;
|
|
524
524
|
var enc = new TextEncoder();
|
|
525
525
|
var dec = new TextDecoder();
|
|
526
|
-
var JOBS_STREAM_SUBJECTS = ["jobs.>"];
|
|
527
526
|
function categoryOf(type) {
|
|
528
527
|
return type === "generation" ? "generation" : "annotation";
|
|
529
528
|
}
|
|
530
529
|
function subjectFor(job) {
|
|
531
|
-
return
|
|
530
|
+
return `${JOBS_SUBJECT_ROOT}.${categoryOf(job.metadata.type)}.${job.metadata.type}`;
|
|
532
531
|
}
|
|
533
532
|
var JetStreamJobQueue = class {
|
|
534
533
|
constructor(options, logger, eventBus) {
|
|
@@ -934,7 +933,7 @@ var JetStreamJobQueue = class {
|
|
|
934
933
|
this.settleLease(jobId(key), "term");
|
|
935
934
|
}
|
|
936
935
|
}
|
|
937
|
-
await this.jsm.streams.purge(STREAM, { filter:
|
|
936
|
+
await this.jsm.streams.purge(STREAM, { filter: `${JOBS_SUBJECT_ROOT}.${category}.>` });
|
|
938
937
|
return cancelled;
|
|
939
938
|
}
|
|
940
939
|
async cancelJob(jobIdArg) {
|
|
@@ -3040,6 +3039,6 @@ var WORKER_CHANNELS = [
|
|
|
3040
3039
|
...WORKER_CONSUMED_BROADCASTS
|
|
3041
3040
|
];
|
|
3042
3041
|
|
|
3043
|
-
export { AnnotationDetection, FsJobQueue,
|
|
3042
|
+
export { AnnotationDetection, FsJobQueue, JOB_QUEUE_EMITS, JetStreamJobQueue, STALL_THRESHOLD_MS, TERMINAL_JOB_RETENTION_MS, TERMINAL_JOB_SWEEP_INTERVAL_MS, WORKER_CHANNELS, WORKER_CONSUMED_BROADCASTS, generateResourceFromTopic, isCancelledJob, isCompleteJob, isFailedJob, isPendingJob, isRunningJob, processAssessmentJob, processCommentJob, processGenerationJob, processHighlightJob, processReferenceJob, processTagJob };
|
|
3044
3043
|
//# sourceMappingURL=index.js.map
|
|
3045
3044
|
//# sourceMappingURL=index.js.map
|