@mindstudio-ai/agent 0.1.144 → 0.1.146

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
@@ -303,6 +303,13 @@ interface StepLogEvent {
303
303
  tag: string;
304
304
  /** Unix timestamp in milliseconds. */
305
305
  ts: number;
306
+ /**
307
+ * A passing status the next one replaces (how far a render or a model's
308
+ * queue is), rather than a line worth keeping.
309
+ */
310
+ ephemeral?: boolean;
311
+ /** How far the action is, 0 to 1, on a passing status, when it knows. */
312
+ progress?: number;
306
313
  }
307
314
  /** Options for a single step execution call. */
308
315
  interface StepExecutionOptions {
@@ -325,7 +332,9 @@ interface StepExecutionOptions {
325
332
  *
326
333
  * Log content and frequency varies by step type — image generation emits
327
334
  * 2-3 logs, scrape steps emit per-URL progress, LLM steps may emit model
328
- * selection and token info.
335
+ * selection and token info. A passing status is flagged `ephemeral`, and
336
+ * carries `progress` (0 to 1) when the action knows how far it is: a
337
+ * render's or a media job's.
329
338
  */
330
339
  onLog?: (event: StepLogEvent) => void;
331
340
  /**
@@ -10860,6 +10869,9 @@ interface StepMethods {
10860
10869
  /**
10861
10870
  * Resize a video file
10862
10871
  *
10872
+ * @remarks
10873
+ * - `mode` is required: `fit` scales the video down to fit within `maxWidth` x `maxHeight`, keeping its shape (a video already inside them is left that size); `exact` makes it `width` x `height`, padding (`strategy: 'pad'`, the default) or cropping (`'crop'`) where the shapes differ
10874
+ *
10863
10875
  * @example
10864
10876
  * ```typescript
10865
10877
  * const result = await agent.resizeVideo({
package/dist/index.js CHANGED
@@ -4863,7 +4863,7 @@ var stepMetadata = {
4863
4863
  "resizeVideo": {
4864
4864
  stepType: "resizeVideo",
4865
4865
  description: "Resize a video file",
4866
- usageNotes: "",
4866
+ usageNotes: "- `mode` is required: `fit` scales the video down to fit within `maxWidth` x `maxHeight`, keeping its shape (a video already inside them is left that size); `exact` makes it `width` x `height`, padding (`strategy: 'pad'`, the default) or cropping (`'crop'`) where the shapes differ",
4867
4867
  inputSchema: { "type": "object", "properties": { "videoUrl": { "type": "string", "description": "URL of the source video to resize" }, "mode": { "enum": ["fit", "exact"], "type": "string", "description": "Resize mode: 'fit' scales within max dimensions, 'exact' forces exact dimensions" }, "maxWidth": { "type": "number", "description": "Maximum width in pixels (used with 'fit' mode)" }, "maxHeight": { "type": "number", "description": "Maximum height in pixels (used with 'fit' mode)" }, "width": { "type": "number", "description": "Exact width in pixels (used with 'exact' mode)" }, "height": { "type": "number", "description": "Exact height in pixels (used with 'exact' mode)" }, "strategy": { "enum": ["pad", "crop"], "type": "string", "description": "Strategy for handling aspect ratio mismatch in 'exact' mode" }, "intermediateAsset": { "type": "boolean", "description": "When true, the asset is created but hidden from the user's gallery (tagged as intermediate)" } }, "required": ["videoUrl", "mode"] },
4868
4868
  outputSchema: { "type": "object", "properties": { "videoUrl": { "type": "string", "description": "URL of the resized video" } }, "required": ["videoUrl"] }
4869
4869
  },
@@ -6478,6 +6478,13 @@ function applyStepMethods(AgentClass) {
6478
6478
  // src/client.ts
6479
6479
  var DEFAULT_BASE_URL = "https://v1.mindstudio-api.com";
6480
6480
  var DEFAULT_MAX_RETRIES = 3;
6481
+ var toStepLogEvent = (event) => ({
6482
+ value: event.value,
6483
+ tag: event.tag,
6484
+ ts: event.ts,
6485
+ ...event.ephemeral === true ? { ephemeral: true } : {},
6486
+ ...typeof event.progress === "number" ? { progress: event.progress } : {}
6487
+ });
6481
6488
  var MindStudioAgent = class {
6482
6489
  /** @internal */
6483
6490
  _httpConfig;
@@ -6791,11 +6798,7 @@ var MindStudioAgent = class {
6791
6798
  try {
6792
6799
  const event = JSON.parse(line.slice(6));
6793
6800
  if (event.type === "log") {
6794
- options.onLog({
6795
- value: event.value,
6796
- tag: event.tag,
6797
- ts: event.ts
6798
- });
6801
+ options.onLog(toStepLogEvent(event));
6799
6802
  } else if (event.type === "done") {
6800
6803
  doneEvent = {
6801
6804
  output: event.output,
@@ -6834,11 +6837,7 @@ var MindStudioAgent = class {
6834
6837
  500
6835
6838
  );
6836
6839
  } else if (event.type === "log") {
6837
- options.onLog({
6838
- value: event.value,
6839
- tag: event.tag,
6840
- ts: event.ts
6841
- });
6840
+ options.onLog(toStepLogEvent(event));
6842
6841
  }
6843
6842
  } catch (err) {
6844
6843
  if (err instanceof MindStudioError) {