@semiont/jobs 0.5.8 → 0.5.10

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 CHANGED
@@ -1,4 +1,4 @@
1
- import { JobId, UserId, ResourceId, EntityType, AnnotationId, Annotation, GatheredContext, TagSchema, Logger, EventBus, components, SupportedMediaType } from '@semiont/core';
1
+ import { JobId, UserId, ResourceId, EntityType, AnnotationId, GatheredContext, SupportedMediaType, TagSchema, Logger, EventBus, components } from '@semiont/core';
2
2
  import { SemiontProject } from '@semiont/core/node';
3
3
  import { InferenceClient } from '@semiont/inference';
4
4
 
@@ -74,10 +74,13 @@ interface DetectionParams {
74
74
  * Generation job parameters
75
75
  */
76
76
  interface GenerationParams {
77
- referenceId: AnnotationId;
78
- sourceResourceId: ResourceId;
79
- sourceResourceName: string;
80
- annotation: Annotation;
77
+ /**
78
+ * The unresolved reference an annotation-focus generation was triggered from.
79
+ * Absent for resource-focus generation (`yield.fromResource`). When present, the
80
+ * worker auto-binds the new resource to it; when absent, provenance is a minted
81
+ * source→derived reference annotation (Fork 2b).
82
+ */
83
+ referenceId?: AnnotationId;
81
84
  prompt?: string;
82
85
  title?: string;
83
86
  entityTypes?: EntityType[];
@@ -93,6 +96,13 @@ interface GenerationParams {
93
96
  temperature?: number;
94
97
  maxTokens?: number;
95
98
  storageUri?: string;
99
+ /**
100
+ * Requested media type of the generated resource's content. Default `text/markdown`.
101
+ * The generation worker produces `text/markdown` and `text/plain`; any other value
102
+ * fails the job (no silent fallback) — Semiont is multi-modal at the core, but
103
+ * generation coverage is text-only for now and the gap is surfaced, not hidden.
104
+ */
105
+ outputMediaType?: SupportedMediaType;
96
106
  }
97
107
  /**
98
108
  * Highlight detection job parameters
@@ -503,6 +513,16 @@ declare function processGenerationJob(inferenceClient: InferenceClient, params:
503
513
  result: GenerationResult;
504
514
  }>;
505
515
 
516
+ /**
517
+ * Response parsers for annotation detection motivations
518
+ *
519
+ * Provides static methods to parse and validate AI responses for each motivation type.
520
+ * Includes offset validation and correction logic.
521
+ * Extracted from worker implementations to centralize parsing logic.
522
+ *
523
+ * NOTE: These are static utility methods without logger access.
524
+ * Console statements kept for debugging - consider adding logger parameter in future.
525
+ */
506
526
  /**
507
527
  * Represents a detected comment with validated position
508
528
  */
@@ -617,7 +637,7 @@ declare class AnnotationDetection {
617
637
  * generate German content from an English source resource. See
618
638
  * `types.ts` "Locale conventions" for the full discussion.
619
639
  */
620
- declare function generateResourceFromTopic(topic: string, entityTypes: string[], client: InferenceClient, logger: Logger, userPrompt?: string, locale?: string, context?: GatheredContext, temperature?: number, maxTokens?: number, sourceLanguage?: string): Promise<{
640
+ declare function generateResourceFromTopic(topic: string, entityTypes: string[], client: InferenceClient, logger: Logger, userPrompt?: string, locale?: string, context?: GatheredContext, temperature?: number, maxTokens?: number, sourceLanguage?: string, outputMediaType?: SupportedMediaType): Promise<{
621
641
  title: string;
622
642
  content: string;
623
643
  }>;