@mengine/medeo-tool 1.0.1-alpha.0 → 1.2.1-alpha.0

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.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { JournalEntry, MengineDocSession, PartIdFactory, SemanticOpName, VideoDocument, fromVideoDocument } from "@mengine/medeo-client";
2
- import { AddSpeechesInput, AddVideoClipsInput, AdjustBgmVolumeInput, AdjustSpeechVolumeInput, AdjustVideoClipDurationInput, AdjustVideoClipVolumeInput, ChangeSpeechScriptInput, ChangeSpeechVoiceInput, DeleteBgmInput, DeleteSpeechesInput, DeleteVideoClipsInput, MoveSpeechesInput, MoveVideoClipsInput, ReplaceVideoClipContentInput, SetBgmInput, SetCaptionStyleInput, SetCaptionVisibilityInput, SetVideoClipSpeedShiftInput } from "@mengine/medeo-client/schemas";
1
+ import { JournalEntry, MengineDocSession, PartIdFactory, SemanticOpName, VideoDocument, VideoDraft, fromVideoDocument } from "@mengine/medeo-client";
2
+ import { AddSpeechesInput, AddVideoClipsInput, AdjustBgmVolumeInput, AdjustSpeechVolumeInput, AdjustVideoClipDurationInput, AdjustVideoClipVolumeInput, ChangeSpeechScriptInput, ChangeSpeechVoiceInput, DeleteBgmInput, DeleteSpeechesInput, DeleteVideoClipsInput, MoveSpeechesInput, MoveVideoClipsByAnchorInput, MoveVideoClipsInput, ReplaceVideoClipContentInput, ReplaceVideoClipSequenceInput, SetBgmInput, SetCaptionStyleInput, SetCaptionVisibilityInput, SetVideoClipSpeedShiftInput } from "@mengine/medeo-client/schemas";
3
3
 
4
4
  //#region src/document/compact-projection.d.ts
5
5
  /**
@@ -123,8 +123,10 @@ interface EditFacade {
123
123
  deleteSpeeches: (input: DeleteSpeechesInput) => Promise<void>;
124
124
  deleteVideoClips: (input: DeleteVideoClipsInput) => Promise<void>;
125
125
  moveSpeeches: (input: MoveSpeechesInput) => Promise<void>;
126
+ moveVideoClipsByAnchor: (input: MoveVideoClipsByAnchorInput) => Promise<void>;
126
127
  moveVideoClips: (input: MoveVideoClipsInput) => Promise<void>;
127
128
  replaceVideoClipContent: (input: ReplaceVideoClipContentInput) => Promise<void>;
129
+ replaceVideoClipSequence: (input: ReplaceVideoClipSequenceInput) => Promise<void>;
128
130
  setBgm: (input: SetBgmInput) => Promise<void>;
129
131
  setCaptionStyle: (input: SetCaptionStyleInput) => Promise<void>;
130
132
  setCaptionVisibility: (input: SetCaptionVisibilityInput) => Promise<void>;
@@ -365,6 +367,13 @@ interface CreateMedeoToolOptions {
365
367
  userId?: ContextualValue<string>;
366
368
  /** Stable agent peer id. Supply a host-scoped value so audit provenance is durable. */
367
369
  peerId?: ContextualValue<string>;
370
+ /**
371
+ * Load the authoritative legacy draft used to create a missing Mengine
372
+ * document. The tool owns the get-or-create flow: it first probes Mengine,
373
+ * converts this draft into a VideoDocument only on a 404, bootstraps the
374
+ * snapshot, and tolerates a concurrent creator winning the race.
375
+ */
376
+ loadInitialDraft?: (docId: string) => Promise<VideoDraft>;
368
377
  fetchImpl?: typeof fetch;
369
378
  sseReconnectDelayMs?: number;
370
379
  /** Defaults passed to runEditScript; each call may override them. */
@@ -374,6 +383,20 @@ interface CreateMedeoToolOptions {
374
383
  };
375
384
  /** Maximum cached plans; oldest plans are evicted (default 16). */
376
385
  maxPlans?: number;
386
+ /** Maximum model-call version baselines retained across host contexts (default 128). */
387
+ maxModelContexts?: number;
388
+ }
389
+ interface MedeoModelContextInput {
390
+ /** Internal MEngine document id. This is host-supplied and never model-facing. */
391
+ doc_id: string;
392
+ /** Stable host conversation/session key used to compare consecutive model calls. */
393
+ context_id: string;
394
+ }
395
+ interface MedeoModelContext {
396
+ /** Complete MEngine-owned prompt: workflow, runtime state, and sandbox TypeScript interface. */
397
+ prompt: string;
398
+ document_version: string;
399
+ updated_since_previous_model_call: boolean | null;
377
400
  }
378
401
  type MedeoToolInput = {
379
402
  op: 'snapshot';
@@ -441,17 +464,20 @@ interface MedeoTool {
441
464
  name: typeof MEDEO_TOOL_NAME;
442
465
  description: typeof MEDEO_TOOL_DESCRIPTION;
443
466
  parameters: typeof MEDEO_TOOL_PARAMETERS;
467
+ getModelContext(input: MedeoModelContextInput): Promise<MedeoModelContext>;
444
468
  handle(input: unknown): Promise<MedeoToolResult>;
445
469
  close(): Promise<void>;
446
470
  }
471
+ type MedeoInitialDraft = VideoDraft;
447
472
  /**
448
473
  * Create the self-contained Medeo LLM tool.
449
474
  *
450
475
  * The package owns session construction, compact projection, sandbox execution,
451
- * plan caching, commit, and shutdown. The host supplies only environment facts:
452
- * HTTP origin, credentials, fetch implementation, and a stable peer id.
476
+ * plan caching, commit, document get-or-create, and shutdown. The host supplies
477
+ * environment facts plus the authoritative legacy draft loader used only when
478
+ * Mengine has no document yet.
453
479
  */
454
480
  declare function createMedeoTool(options: CreateMedeoToolOptions): MedeoTool;
455
481
  //#endregion
456
- export { type ChangePlan, type CommitPlan, type CommitPlanOptions, type CommitPlanResult, type CompactProjectionOptions, type ConsoleShim, type CreateMedeoToolOptions, type EditFacade, EditSandboxSession, type EditSandboxSessionOptions, type EditScriptResult, MEDEO_TOOL_DESCRIPTION, MEDEO_TOOL_NAME, MEDEO_TOOL_PARAMETERS, type MedeoTool, type MedeoToolInput, type MedeoToolOp, type MedeoToolResult, type RunEditScriptOptions, type SandboxCheckpoint, type TimelineClipDescriptor, type TimelineFacade, type TimelinePartDescriptor, collectAffectedPartIds, commitPlan, createMedeoTool, renderCompactProjection, renderPreview, runEditScript };
482
+ export { type ChangePlan, type CommitPlan, type CommitPlanOptions, type CommitPlanResult, type CompactProjectionOptions, type ConsoleShim, type CreateMedeoToolOptions, type EditFacade, EditSandboxSession, type EditSandboxSessionOptions, type EditScriptResult, MEDEO_TOOL_DESCRIPTION, MEDEO_TOOL_NAME, MEDEO_TOOL_PARAMETERS, type MedeoInitialDraft, type MedeoModelContext, type MedeoModelContextInput, type MedeoTool, type MedeoToolInput, type MedeoToolOp, type MedeoToolResult, type RunEditScriptOptions, type SandboxCheckpoint, type TimelineClipDescriptor, type TimelineFacade, type TimelinePartDescriptor, collectAffectedPartIds, commitPlan, createMedeoTool, renderCompactProjection, renderPreview, runEditScript };
457
483
  //# sourceMappingURL=index.d.mts.map