replicas-cli 0.3.415 → 0.3.416

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/dist/index.cjs +15 -16
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -21467,7 +21467,7 @@ function workspaceConfigWithCapabilities(config3, capabilities = {}) {
21467
21467
  function workspaceConfigWithPrFollowups(config3, prFollowups = config3?.capabilities?.pr_followups === true) {
21468
21468
  return workspaceConfigWithCapabilities(config3, { pr_followups: prFollowups });
21469
21469
  }
21470
- var WORKSPACE_STATUSES, SUPPORT_EMAIL, WORKSPACE_SANDBOX_LOST_MESSAGE, STALE_PREPARING_MS, WORKSPACE_PAUSED_COPY, WORKSPACE_SIDEBAR_VIEWS, WORKSPACE_STATUS_FILTERS, DEFAULT_STATUS_FILTERS, DEFAULT_WORKSPACE_FILTERS, ONE_DAY_MS, workspaceExecRequestSchema, terminalRtcCandidateSchema, terminalSocketServerMessageSchema;
21470
+ var WORKSPACE_STATUSES, SUPPORT_EMAIL, WORKSPACE_SANDBOX_LOST_MESSAGE, STALE_PREPARING_MS, WORKSPACE_PAUSED_COPY, WORKSPACE_SIDEBAR_VIEWS, WORKSPACE_STATUS_FILTERS, DEFAULT_STATUS_FILTERS, DEFAULT_WORKSPACE_FILTERS, ONE_DAY_MS, describeWorkspaceAccess, workspaceExecRequestSchema, terminalRtcCandidateSchema, terminalSocketServerMessageSchema;
21471
21471
  var init_workspaces = __esm({
21472
21472
  "../shared/src/routes/workspaces.ts"() {
21473
21473
  "use strict";
@@ -21500,6 +21500,10 @@ var init_workspaces = __esm({
21500
21500
  activity: "any"
21501
21501
  };
21502
21502
  ONE_DAY_MS = 24 * 60 * 60 * 1e3;
21503
+ describeWorkspaceAccess = (access) => {
21504
+ const how = access.shared_by_user_id === null ? "Sent a message here" : access.shared_by_user_id === access.shared_with_user_id ? "Added it themselves" : `Shared by ${access.shared_by_name ?? "a teammate"}`;
21505
+ return `${how} \xB7 ${new Date(access.created_at).toLocaleDateString("en-US", { month: "short", day: "numeric" })}`;
21506
+ };
21503
21507
  workspaceExecRequestSchema = external_exports.object({
21504
21508
  command: external_exports.string().regex(/\S/, "command is required"),
21505
21509
  timeout_seconds: external_exports.number().int().min(1).max(50).optional().describe("Default: 30")
@@ -24880,7 +24884,7 @@ If none of these apply, don't upload.
24880
24884
  | Slack | \`files.getUploadURLExternal\` \u2192 raw-byte POST \u2192 \`files.completeUploadExternal\` | Uploaded file in the channel or thread |
24881
24885
  | Linear | \`fileUpload\` mutation \u2192 presigned upload \u2192 issue/comment mutation | Returned \`assetUrl\` in Markdown |
24882
24886
  | GitLab | Project \`/uploads\` endpoint with the original bytes | Returned GitLab Markdown |
24883
- | GitHub | Printed public embed for an image, GIF, or recording poster | Printed embed, linked to the recording when needed |
24887
+ | GitHub | \`gh pr create --attach <image>\` (also \`edit\` and \`comment\`), or the printed public embed | Inline image, linked to the recording when needed |
24884
24888
 
24885
24889
  The dashboard link is the subtitle and jump-back path. It is never a substitute for the destination embed.
24886
24890
 
@@ -25089,22 +25093,17 @@ Never paste the \`api.replicas.dev/v1/media/<id>\` URL into a Linear body or com
25089
25093
 
25090
25094
  ### GitHub: inline images and recording previews
25091
25095
 
25092
- Replicas authenticates GitHub with GitHub App tokens, which GitHub's attachment upload rejects, so \`gh --attach\` does not work. Use the public link every image upload prints, in public and private repositories alike, for PR descriptions, issues, and comments.
25093
-
25094
- 1. Upload the image:
25096
+ Attach images with \`gh --attach\`, in public and private repositories alike. GitHub's own attachment upload rejects the workspace's GitHub App token, so in Replicas workspaces \`gh\` uploads each image with \`replicas media upload\` and puts its public link in the body instead. It prints each image's \`![\u2026](\u2026)\` line, so paste those in your chat reply too:
25095
25097
 
25096
25098
  \`\`\`bash
25097
- replicas media upload /tmp/screenshot.png --name "PR screenshot"
25099
+ gh pr create --title "Describe the change" --body-file /tmp/pr-body.md --attach './after.png#Settings page after the fix'
25100
+ gh pr edit 456 --attach ./before.png --attach ./after.png
25101
+ gh pr comment 456 --body-file /tmp/comment.md --attach ./after.png
25098
25102
  \`\`\`
25099
25103
 
25100
- 2. Copy the printed \`![filename](<public-url>)\` line verbatim into the body file. Never use a local file path, a \`/v1/media/<id>\` URL, a Linear \`assetUrl\`, or an expiring storage URL.
25101
- 3. Create or update the PR using the body file:
25104
+ \`gh issue create|edit|comment\` take \`--attach\` too. Alt text follows \`#\`. A reference to the file in the body, such as \`![Before](./before.png)\`, is replaced with the image; other images are appended. Without a body flag, \`gh pr edit\` appends to the current description. \`--attach\` takes png, jpg, gif and webp only, and needs \`--body\` or \`--body-file\` rather than \`--fill\` or \`--template\`.
25102
25105
 
25103
- \`\`\`bash
25104
- gh pr create --title "Describe the change" --body-file /tmp/pr-body.md
25105
- gh pr edit 456 --body-file /tmp/pr-body.md
25106
- gh pr comment 456 --body-file /tmp/comment.md
25107
- \`\`\`
25106
+ When you already uploaded an image, paste its printed \`![\u2026](<public-url>)\` line into the body instead. Never use a local file path, a \`/v1/media/<id>\` URL, a Linear \`assetUrl\`, or an expiring storage URL.
25108
25107
 
25109
25108
  GitHub does not play external videos inline, so show motion with a GIF (see *Make a GIF from a recording* above); its printed embed animates inline like any image. Videos stay private. When the full recording is also worth watching, upload the MP4 too and paste the PR line it prints, with your GIF's link filled in. The GIF links to the recording's **View in Replicas** URL, or to its public link when you passed \`--access public\`. When a still is enough, use a poster instead (\`ffmpeg -i /tmp/demo.mp4 -frames:v 1 /tmp/demo-poster.png\`), uploaded like any image:
25110
25109
 
@@ -38350,7 +38349,7 @@ var CLI_VERSION;
38350
38349
  var init_cli_version = __esm({
38351
38350
  "../shared/src/cli-version.ts"() {
38352
38351
  "use strict";
38353
- CLI_VERSION = "0.3.415";
38352
+ CLI_VERSION = "0.3.416";
38354
38353
  }
38355
38354
  });
38356
38355
 
@@ -53317,7 +53316,7 @@ async function shareListCommand(id) {
53317
53316
  output2(await orgAuthenticatedFetch(`/v1/replica/${id}/shares`), ({ shares }) => {
53318
53317
  if (shares.length === 0) console.log("Not shared with anyone.");
53319
53318
  for (const share2 of shares) {
53320
- console.log(`${share2.shared_with_user_id} ${share2.shared_with_email ?? ""} shared ${formatDate(share2.created_at)}`);
53319
+ console.log(`${share2.shared_with_user_id} ${share2.shared_with.display_name} ${share2.shared_with_email ?? ""} ${describeWorkspaceAccess(share2)}`);
53321
53320
  }
53322
53321
  });
53323
53322
  }
@@ -56296,7 +56295,7 @@ var init_src2 = __esm({
56296
56295
  share = program.command("share").description("Share a replica with organization members");
56297
56296
  share.command("list <id>").description("List members a replica is shared with").action(run(shareListCommand));
56298
56297
  share.command("add <id> <userId>").description("Share a replica with a member").action(run(shareAddCommand));
56299
- share.command("remove <id> <userId>").description("Stop sharing a replica with a member").action(run(shareRemoveCommand));
56298
+ share.command("remove <id> <userId>").description("Stop sharing a replica with a member, or pass your own user ID to leave it").action(run(shareRemoveCommand));
56300
56299
  pr = program.command("pr").description("Inspect and act on pull requests linked to a replica");
56301
56300
  pr.command("view <id> [prUrls...]").description("Show state, CI, and mergeability (defaults to every linked pull request)").action(run(prViewCommand));
56302
56301
  pr.command("merge <id> <prUrl>").description("Merge a pull request").action(run(prMergeCommand));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.415",
3
+ "version": "0.3.416",
4
4
  "description": "CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {