@labelbox/recursion-cli 0.0.41 → 0.0.43

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.
@@ -192,6 +192,10 @@ export declare const ManifestRecipeSchema: z.ZodObject<{
192
192
  setup: z.ZodString;
193
193
  main: z.ZodString;
194
194
  }, z.core.$strip>;
195
+ python: z.ZodOptional<z.ZodObject<{
196
+ setup: z.ZodString;
197
+ main: z.ZodString;
198
+ }, z.core.$strip>>;
195
199
  cli: z.ZodObject<{
196
200
  setup: z.ZodString;
197
201
  main: z.ZodString;
@@ -326,6 +330,10 @@ export declare const ManifestSchema: z.ZodObject<{
326
330
  setup: z.ZodString;
327
331
  main: z.ZodString;
328
332
  }, z.core.$strip>;
333
+ python: z.ZodOptional<z.ZodObject<{
334
+ setup: z.ZodString;
335
+ main: z.ZodString;
336
+ }, z.core.$strip>>;
329
337
  cli: z.ZodObject<{
330
338
  setup: z.ZodString;
331
339
  main: z.ZodString;
package/dist/manifest.js CHANGED
@@ -210,6 +210,15 @@ export const ManifestRecipeSchema = z.object({
210
210
  category: z.string(),
211
211
  steps: z.array(ManifestRecipeStepSchema),
212
212
  sdk: RecipeSnippetSchema,
213
+ // Optional on the WIRE, though the producer always emits it. The
214
+ // version-mismatch check is a strict `!==` in both directions, so making this
215
+ // required would abort the whole command tree of every already-installed CLI
216
+ // the moment a newer server deployed — for a docs-only field an older CLI
217
+ // would otherwise just strip. `manifest.test.ts` asserts the producer emits
218
+ // every key this schema declares, so the field is still guaranteed present in
219
+ // practice without a required-field bump. See `.claude/rules/packages-cli.md`:
220
+ // a backend change must need no CLI release.
221
+ python: RecipeSnippetSchema.optional(),
213
222
  cli: RecipeSnippetSchema,
214
223
  curl: RecipeSnippetSchema,
215
224
  // The recipe's relationship links (optional — absent for an island recipe).
package/dist/program.d.ts CHANGED
@@ -90,6 +90,7 @@ export declare function addOptions(command: Command, entry: ManifestOperation, f
90
90
  declare const RECIPE_FORMATS: {
91
91
  readonly cli: "cli";
92
92
  readonly ts: "sdk";
93
+ readonly py: "python";
93
94
  readonly curl: "curl";
94
95
  };
95
96
  export type RecipeFormat = keyof typeof RECIPE_FORMATS;
package/dist/program.js CHANGED
@@ -395,7 +395,7 @@ export function addOptions(command, entry, fileFlags = true) {
395
395
  // The Labelbox app host (not the recursion API base) — recipes/docs render in-app.
396
396
  const RECIPE_DOCS_BASE_URL = 'https://app.labelbox.com';
397
397
  /** Output formats `rl recipes <id>` can render, mapped to the composed snippet field. */
398
- const RECIPE_FORMATS = { cli: 'cli', ts: 'sdk', curl: 'curl' };
398
+ const RECIPE_FORMATS = { cli: 'cli', ts: 'sdk', py: 'python', curl: 'curl' };
399
399
  function isRecipeFormat(value) {
400
400
  return Object.hasOwn(RECIPE_FORMATS, value);
401
401
  }
@@ -651,8 +651,12 @@ export function renderRelatedBlock(entry, allRecipes) {
651
651
  }
652
652
  /** One recipe rendered for `rl recipes <id>`: goal + composed code + related links + a docs link. */
653
653
  export function renderRecipeShow(entry, format, allRecipes) {
654
- const { setup, main } = entry[RECIPE_FORMATS[format]];
655
- const snippet = [setup, main].filter(Boolean).join('\n\n');
654
+ // Optional on the wire: an older server predates the Python surface, so
655
+ // `--format py` renders the note rather than crashing on a missing snippet.
656
+ const composed = entry[RECIPE_FORMATS[format]];
657
+ const snippet = composed
658
+ ? [composed.setup, composed.main].filter(Boolean).join('\n\n')
659
+ : `(no ${format} example — the server that served this manifest does not compose one)`;
656
660
  const relatedBlock = renderRelatedBlock(entry, allRecipes);
657
661
  return [
658
662
  entry.title,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbox/recursion-cli",
3
- "version": "0.0.41",
3
+ "version": "0.0.43",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",