@semiont/jobs 0.5.28 → 0.5.29

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/README.md CHANGED
@@ -10,7 +10,7 @@ Job queue, worker infrastructure, and annotation workers for [Semiont](https://g
10
10
 
11
11
  ## Architecture Context
12
12
 
13
- Workers run in a separate process and connect to the Knowledge System (KS) over HTTP/SSE using a `SemiontSession` (from `@semiont/sdk`) driven by a `JobClaimAdapter`. Workers receive job assignments via an SSE `job:queued` subscription, claim jobs atomically, and emit domain events back to the KS via `session.client.transport.emit(...)`. The KS ingests these events onto its EventBus for SSE delivery to the frontend.
13
+ Workers run in a separate process and connect to the Knowledge System (KS) over HTTP/SSE using a `SemiontSession` (from `@semiont/sdk`) driven by a `JobClaimAdapter`. Workers receive job assignments via an SSE `job:queued` subscription, claim jobs atomically, and emit domain events back to the KS via `session.client.transport.emit(...)`. The KS ingests these events onto its EventBus for SSE delivery to the Browser.
14
14
 
15
15
  ## Installation
16
16
 
@@ -36,7 +36,9 @@ import { SemiontProject } from '@semiont/core/node';
36
36
 
37
37
  // Initialize — jobs are stored under project.jobsDir
38
38
  const eventBus = new EventBus();
39
- const project = new SemiontProject('/path/to/project');
39
+ const project = new SemiontProject('/path/to/project', {
40
+ anchoredTextDir: process.env.SEMIONT_ANCHORED_TEXT_DIR!,
41
+ });
40
42
  const jobQueue = new FsJobQueue(project, logger, eventBus);
41
43
  await jobQueue.initialize();
42
44
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { JobId, UserId, ResourceId, EntityType, GenerationJobParams, TagSchema, Logger, EventBus, components, Annotation, SupportedMediaType, GatheredContext } from '@semiont/core';
2
- import { SemiontProject } from '@semiont/core/node';
2
+ import { SemiontState } from '@semiont/core/node';
3
3
  import { InferenceClient } from '@semiont/inference';
4
4
 
5
5
  /**
@@ -353,7 +353,10 @@ declare class FsJobQueue implements JobQueue {
353
353
  private cleanupTimer;
354
354
  /** Per-job timestamp of the last progress write, for throttling. */
355
355
  private lastProgressWrite;
356
- constructor(project: SemiontProject, logger: Logger, eventBus?: EventBus | undefined);
356
+ constructor(
357
+ /** `SemiontState` and not `SemiontProject`: the queue reads ONE path,
358
+ * and the gateway that owns it mounts no KB tree (SINGLE-KB-MOUNT P5). */
359
+ state: SemiontState, logger: Logger, eventBus?: EventBus | undefined);
357
360
  /**
358
361
  * Initialize job queue directories, announce any pending backlog,
359
362
  * and start the re-announce interval. Idempotent.
@@ -692,7 +695,7 @@ declare function generateResourceFromTopic(topic: string, entityTypes: string[],
692
695
  *
693
696
  * Thresholds are fixed by design (no env knobs) and deliberately
694
697
  * layered: inference timeout (10 min, P2) fires first; this watchdog
695
- * (15 min) catches the failure modes nobody predicted; the backend's
698
+ * (15 min) catches the failure modes nobody predicted; the gateway's
696
699
  * dead-worker janitor (30 min) re-queues the job regardless.
697
700
  */
698
701
  declare const STALL_THRESHOLD_MS: number;
package/dist/index.js CHANGED
@@ -17,9 +17,9 @@ var PROGRESS_WRITE_MIN_INTERVAL_MS = 5e3;
17
17
  var RETENTION_HOURS = 24;
18
18
  var CLEANUP_INTERVAL_MS = 36e5;
19
19
  var FsJobQueue = class {
20
- constructor(project, logger, eventBus) {
20
+ constructor(state, logger, eventBus) {
21
21
  this.eventBus = eventBus;
22
- this.jobsDir = project.jobsDir;
22
+ this.jobsDir = state.jobsDir;
23
23
  this.logger = logger;
24
24
  }
25
25
  eventBus;