@clipit-ai/cli 0.2.6 → 0.2.7

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.
Files changed (2) hide show
  1. package/bin/clipit.mjs +35 -2
  2. package/package.json +1 -1
package/bin/clipit.mjs CHANGED
@@ -9,7 +9,7 @@ import path from 'node:path';
9
9
  import process from 'node:process';
10
10
  import { fileURLToPath } from 'node:url';
11
11
 
12
- const VERSION = '0.2.6';
12
+ const VERSION = '0.2.7';
13
13
  const DEFAULT_BASE_URL = 'https://clipit.dev';
14
14
  const DEFAULT_SCOPES = [
15
15
  'clippy_agent',
@@ -466,7 +466,7 @@ function usage() {
466
466
  ' clipit mcp [stdio]',
467
467
  ' clipit run <functionName> [--params @file.json] [--clip-id id] [--video-id id] [--confirm] [--max-credits n]',
468
468
  ' clipit videos list|get|upload|abort-upload|import-url|transcribe|transcript|suggest-clips|delete ...',
469
- ' clipit clips list|get|delivery-state|create|update|render|download|delete ...',
469
+ ' clipit clips list|get|delivery-state|create|update|initialize-snapshot|render|download|delete ...',
470
470
  ' clipit jobs get|wait <jobId>',
471
471
  ' clipit credits balance|usage|estimate ...',
472
472
  ' clipit billing capabilities|catalog|create-attempt|attempt|receipt|subscription ...',
@@ -1251,6 +1251,13 @@ async function enforceRunMaxCredits(config, options, functionName, parameters =
1251
1251
  const isMetered = Boolean(tool?.costBand && tool.costBand !== 'free');
1252
1252
  const isMeteredExempt = RUN_METERED_CONFIRMATION_EXEMPTIONS.has(functionName);
1253
1253
 
1254
+ if (tool?.costBand === 'free') {
1255
+ if (tool?.confirmation?.required) {
1256
+ requireConfirm(options, `Running confirmation-gated tool ${functionName}`);
1257
+ }
1258
+ return null;
1259
+ }
1260
+
1254
1261
  let staticEstimates = null;
1255
1262
  if (!runEstimate && (limit !== null || needsConfirmationPreflight)) {
1256
1263
  staticEstimates = await buildStaticRunEstimates(config, options, functionName, parameters, payload);
@@ -2718,6 +2725,12 @@ async function clips(config, options, action, args) {
2718
2725
  }
2719
2726
  if (action === 'update') {
2720
2727
  if (!args[0]) throw Object.assign(new Error('Clip id is required.'), { exitCode: EXIT.USAGE });
2728
+ if (options.aspect !== undefined || options['aspect-ratio'] !== undefined) {
2729
+ throw Object.assign(
2730
+ new Error('clips update does not accept --aspect-ratio. Use clipit run setClipAspectRatio --clip-id <id> --params \'{"aspectRatio":"4:5"}\', then start an explicit render.'),
2731
+ { exitCode: EXIT.USAGE },
2732
+ );
2733
+ }
2721
2734
  const body = options.params
2722
2735
  ? await readJsonOption(String(options.params))
2723
2736
  : {
@@ -2732,6 +2745,26 @@ async function clips(config, options, action, args) {
2732
2745
  output(await apiFetch(config, options, 'PATCH', `/api/v1/clips/${encodeURIComponent(args[0])}`, body), options);
2733
2746
  return;
2734
2747
  }
2748
+ if (action === 'initialize-snapshot') {
2749
+ if (!args[0]) throw Object.assign(new Error('Clip id is required.'), { exitCode: EXIT.USAGE });
2750
+ const body = options.params
2751
+ ? await readJsonOption(String(options.params))
2752
+ : compactObject({
2753
+ aspectRatio: options.aspect || options['aspect-ratio'],
2754
+ fitBackground: options['fit-background'],
2755
+ quality: options.quality,
2756
+ includeCaptions: options.captions === undefined ? undefined : boolOption(options.captions),
2757
+ captionStyle: options['caption-style'],
2758
+ });
2759
+ output(await apiFetch(
2760
+ config,
2761
+ options,
2762
+ 'POST',
2763
+ `/api/v1/clips/${encodeURIComponent(args[0])}/editor-snapshot/initialize`,
2764
+ body,
2765
+ ), options);
2766
+ return;
2767
+ }
2735
2768
  if (action === 'render') {
2736
2769
  if (!args[0]) throw Object.assign(new Error('Clip id is required.'), { exitCode: EXIT.USAGE });
2737
2770
  const body = options.params
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clipit-ai/cli",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "ClipIt CLI for connecting shell-capable agents to ClipIt.",
5
5
  "type": "module",
6
6
  "bin": {