@letterstory/cli 0.131.1 → 0.132.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/lib/cli.mjs CHANGED
@@ -62,7 +62,7 @@ import {
62
62
  } from "./commands.mjs";
63
63
 
64
64
  // Keep in sync with cli/package.json.
65
- export const VERSION = "0.131.1";
65
+ export const VERSION = "0.132.0";
66
66
 
67
67
  // Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
68
68
  // can't accidentally swallow the id as --json's value. Every `type: "bool"` flag (and its
@@ -1364,8 +1364,10 @@ Repo changes (Claude Code edits your repo in a sandbox; the Letterstory GitHub A
1364
1364
  repo slack-test Post a test into the Send to Slack channel
1365
1365
  repo start --repo <owner/name> --instructions <text>|--instructions-file <path|->
1366
1366
  [--branch <base>] [--attach <path>]... [--attach-url <name>=<https url>]...
1367
+ [--attach-ref <path>]... [--attach-url-ref <name>=<https url>]...
1367
1368
  [--action build|build_pr|build_merge|slack|linear] [--with-preview] [--wait]
1368
- Start a change (attached files go to the sandbox);
1369
+ Start a change (attached files go to the sandbox;
1370
+ -ref ones are context, never put in the repo);
1369
1371
  --with-preview keeps a preview up next to the PR;
1370
1372
  --wait follows it to the PR
1371
1373
  repo fix-audit --issue <issue-type>... [--audit <id>] [--branch <base>] [--action build|build_pr|build_merge|slack|linear] [--wait]
@@ -59,7 +59,8 @@ const ARGS = {
59
59
  base_branch: "branch",
60
60
  // --instructions, or a longer brief from --instructions-file <path> / - (stdin).
61
61
  instructions: { value: (flags) => readTextInput(flags, "instructions", "instructions-file") },
62
- // --attach <path> (uploaded first) and --attach-url <name>=<https url>, both repeatable.
62
+ // --attach <path> (uploaded first) and --attach-url <name>=<https url>, both repeatable;
63
+ // --attach-ref / --attach-url-ref the same for context the agent reads, never puts in the repo.
63
64
  files: { value: (_flags, _positionals, extra) => (extra.files?.length ? extra.files : undefined) },
64
65
  action: { flag: "action", enum: ["build", "build_pr", "build_merge", "slack", "linear"] },
65
66
  preview: { flag: "preview", type: "bool" },
@@ -300,7 +301,7 @@ async function uploadAttachments(ctx, paths) {
300
301
  .replace(/[^A-Za-z0-9._ -]/g, "-")
301
302
  .replace(/^[^A-Za-z0-9]+/, "")
302
303
  );
303
- if (new Set(names).size !== names.length) throw new CliError("Two --attach files share a name; rename one.");
304
+ if (new Set(names).size !== names.length) throw new CliError("Two attached files share a name; rename one.");
304
305
  const bytes = paths.map((p) => {
305
306
  try {
306
307
  return readFileSync(p);
@@ -332,14 +333,20 @@ async function repoStart(ctx) {
332
333
  "instructions-file",
333
334
  "attach",
334
335
  "attach-url",
336
+ "attach-ref",
337
+ "attach-url-ref",
335
338
  "action",
336
339
  "preview",
337
340
  "with-preview",
338
341
  "wait",
339
342
  ]);
343
+ // One upload for every file (names must be unique across both), then the references marked.
344
+ const place = flagList(flags.attach);
345
+ const uploaded = await uploadAttachments(ctx, [...place, ...flagList(flags["attach-ref"])]);
340
346
  const files = [
341
- ...(await uploadAttachments(ctx, flagList(flags.attach))),
347
+ ...uploaded.map((f, i) => (i < place.length ? f : { ...f, reference: true })),
342
348
  ...attachmentUrls(flagList(flags["attach-url"])),
349
+ ...attachmentUrls(flagList(flags["attach-url-ref"])).map((f) => ({ ...f, reference: true })),
343
350
  ];
344
351
  const args = argsFromFlags(ARGS.start_repo_change, flags, ctx.positionals, { files });
345
352
  if (!args.repo_owner || !args.repo_name) throw new CliError("Missing --repo owner/name");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.131.1",
3
+ "version": "0.132.0",
4
4
  "description": "Spin up and manage Letterstory phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",