@anvpx/motion-cli 0.1.15 → 0.1.16

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.
@@ -100,6 +100,7 @@ export const splitCueWords = (words) => {
100
100
  return word !== undefined && CLAUSE_END.test(word.w);
101
101
  };
102
102
  let start = 0;
103
+ const MIN_PIECE = 4;
103
104
  while (sentence.length - start > CUE_MAX_WORDS) {
104
105
  let cut = start + size;
105
106
  for (let shift = 0; shift <= 2; shift += 1) {
@@ -115,6 +116,11 @@ export const splitCueWords = (words) => {
115
116
  }
116
117
  }
117
118
  cut = Math.min(cut, start + CUE_MAX_WORDS);
119
+ // A cut that leaves a stub ("bridge.") is worse than an even split.
120
+ if (sentence.length - cut < MIN_PIECE)
121
+ cut = sentence.length;
122
+ if (cut - start < MIN_PIECE)
123
+ cut = Math.min(sentence.length, start + CUE_MAX_WORDS);
118
124
  if (cut <= start)
119
125
  cut = start + 1;
120
126
  cues.push(sentence.slice(start, cut));
@@ -12,8 +12,8 @@ import type { Command } from "../types.ts";
12
12
  * at real versions) or choiceB (bundle into one tarball); either lands with
13
13
  * a version bump of core manifest + this pin + plugin.json together.
14
14
  */
15
- export declare const PINNED_CORE_VERSION = "0.1.15";
16
- export declare const PINNED_NPX = "npx -y @anvpx/motion@0.1.15";
15
+ export declare const PINNED_CORE_VERSION = "0.1.16";
16
+ export declare const PINNED_NPX = "npx -y @anvpx/motion@0.1.16";
17
17
  /** Skill file whose sha256 must survive `plugin install` byte for byte. */
18
18
  export declare const PLUGIN_SKILL: string;
19
19
  export interface PluginEnv {
@@ -17,7 +17,7 @@ import { EXIT } from "../exit-codes.js";
17
17
  * at real versions) or choiceB (bundle into one tarball); either lands with
18
18
  * a version bump of core manifest + this pin + plugin.json together.
19
19
  */
20
- export const PINNED_CORE_VERSION = "0.1.15";
20
+ export const PINNED_CORE_VERSION = "0.1.16";
21
21
  export const PINNED_NPX = `npx -y @anvpx/motion@${PINNED_CORE_VERSION}`;
22
22
  /** Skill file whose sha256 must survive `plugin install` byte for byte. */
23
23
  export const PLUGIN_SKILL = join("skills", "motion-kit", "SKILL.md");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anvpx/motion-cli",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "The mk CLI for @anvpx/motion: validate, preview, approve and render storyboards.",
5
5
  "license": "MIT",
6
6
  "author": "anvpx",
@@ -30,10 +30,10 @@
30
30
  "dist/**/*.d.ts"
31
31
  ],
32
32
  "dependencies": {
33
- "@anvpx/motion-audio": "0.1.15",
34
- "@anvpx/motion-build": "0.1.15",
35
- "@anvpx/motion-schema": "0.1.15",
36
- "@anvpx/motion-templates": "0.1.15"
33
+ "@anvpx/motion-audio": "0.1.16",
34
+ "@anvpx/motion-build": "0.1.16",
35
+ "@anvpx/motion-schema": "0.1.16",
36
+ "@anvpx/motion-templates": "0.1.16"
37
37
  },
38
38
  "scripts": {
39
39
  "test:integration": "vitest run --config vitest.integration.config.ts"