replicas-cli 0.2.789 → 0.2.790

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 +24 -12
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -24163,7 +24163,7 @@ replicas computer record stop
24163
24163
  replicas media upload /tmp/walkthrough.mp4 --name "<Project> walkthrough"
24164
24164
  \`\`\`
24165
24165
 
24166
- Keep the recording short (one to three minutes) and focused on the flow that proves the environment works. \`replicas media upload\` prints a chat embed line and a \`View in Replicas\` link ending in \`?media=<media-id>\`; keep both. The media id goes into the proposal, and the embed line goes into your final message. Follow \`MEDIA.md\` for anything shared outside the dashboard.
24166
+ Keep the recording short (one to three minutes) and focused on the flow that proves the environment works. \`replicas media upload\` prints a chat embed line and a \`View in Replicas\` link ending in \`?mode=media&media=<media-id>\`; keep both. The media id goes into the proposal, and the embed line goes into your final message. Follow \`MEDIA.md\` for anything shared outside the dashboard.
24167
24167
 
24168
24168
  Add screenshots of important states (a passing test run, the running app) with \`replicas computer screenshot\` and upload them the same way when they help the user trust the result.
24169
24169
 
@@ -24687,7 +24687,7 @@ For each media file, the CLI prints an embed line and a dashboard link:
24687
24687
 
24688
24688
  1. Images always print \`![filename](<public-url>)\`. This public, stable link works in Replicas chat, GitHub, and anywhere else Markdown images render. No flag is needed.
24689
24689
  2. Video and audio print \`Replicas chat embed: ![filename](<api-url>)\` by default; this authenticated URL renders inline in Replicas chat **only** \u2014 see below. \`--access public\` prints a public embed instead.
24690
- 3. \`View in Replicas: <deep-link>\` is a per-file dashboard URL of the form \`https://app.replicas.dev/workspaces/<workspace-id>?media=<media-id>\` that opens directly to that specific file.
24690
+ 3. \`View in Replicas: <deep-link>\` is a per-file dashboard URL of the form \`https://app.replicas.dev/workspaces/<workspace-id>?mode=media&media=<media-id>\` that opens directly to that specific file.
24691
24691
 
24692
24692
  Match each "View in Replicas" line to the embed line directly above it \u2014 that's the deep link for that file.
24693
24693
 
@@ -24718,7 +24718,7 @@ Permanently delete an upload with \`replicas media delete <media-id>\`. The back
24718
24718
  | \`https://api.replicas.dev/v1/media/<id>\` (inside \`![\u2026](\u2026)\`) | Authenticated API redirect printed for private video, audio, and HTML \u2014 requires the Replicas chat session | **Only** in the Replicas chat reply. Nowhere else. |
24719
24719
  | \`https://replicas.dev/organizations/<organization-id>/media/<media-id>\` | Organization-only page printed by \`--access organization\` | Pull requests and other places where every viewer belongs to the Replicas organization. |
24720
24720
  | \`https://api.replicas.dev/v1/media/public/<id>/<token>\` | Public bearer URL printed for every image, and for video or audio with \`--access public\` | The Replicas chat reply and GitHub embeds. |
24721
- | \`https://app.replicas.dev/workspaces/<workspace-id>?media=<media-id>\` | Authenticated dashboard deep link that opens the media file in the workspace | Everywhere external: Slack, GitHub, GitLab, Linear, PR bodies, comments, emails. |
24721
+ | \`https://app.replicas.dev/workspaces/<workspace-id>?mode=media&media=<media-id>\` | Authenticated dashboard deep link that opens the media file in the workspace | Everywhere external: Slack, GitHub, GitLab, Linear, PR bodies, comments, emails. |
24722
24722
 
24723
24723
  ### NEVER link the API redirect URL outside the Replicas chat reply
24724
24724
 
@@ -24737,10 +24737,10 @@ This rule has no exceptions:
24737
24737
  For an organization-only HTML page, use the \`Forge link\` printed by \`--access organization\`. For other authenticated media references, use the dashboard form:
24738
24738
 
24739
24739
  \`\`\`
24740
- https://app.replicas.dev/workspaces/<workspace-id>?media=<media-id>
24740
+ https://app.replicas.dev/workspaces/<workspace-id>?mode=media&media=<media-id>
24741
24741
  \`\`\`
24742
24742
 
24743
- The \`media=<media-id>\` query param opens that specific file in the workspace.
24743
+ The \`mode=media&media=<media-id>\` query params open that specific file in the workspace.
24744
24744
 
24745
24745
  When you have a specific file in mind, never link the bare workspace URL without the \`media=<id>\` param.
24746
24746
 
@@ -24750,6 +24750,8 @@ Always render as a markdown / mrkdwn hyperlink labeled **View in Replicas** \u20
24750
24750
 
24751
24751
  Include each markdown embed line **verbatim** where you want that file to render inline. The chat substitutes each one with an embedded image, video, or audio player. For HTML, use the printed \`HTML page\` link. Multiple embeds can appear in a single reply.
24752
24752
 
24753
+ Never reply with only dashboard links (for example a "Links:" list of \`?mode=media&media=\` URLs) in place of the embeds: a dashboard link renders as plain text, so the user sees nothing inline. This applies even when the task came from Slack, Linear, GitHub, or GitLab; the chat reply still gets the embeds.
24754
+
24753
24755
  After (or alongside) the embeds, include a \`[View in Canvas](<deep-link>)\` hyperlink for each file using the per-file dashboard URL printed by the CLI as **View in Replicas**. Keep that URL unchanged so it opens the specific media item in the workspace's Canvas. External messages still label this dashboard link **View in Replicas**.
24754
24756
 
24755
24757
  ## On external platforms: embed the file AND link the dashboard
@@ -24757,7 +24759,7 @@ After (or alongside) the embeds, include a \`[View in Canvas](<deep-link>)\` hyp
24757
24759
  After \`replicas media upload\` succeeds, external delivery has two required follow-up steps for every file:
24758
24760
 
24759
24761
  1. **Use the destination's inline representation:** upload the raw bytes to Slack, Linear, or GitLab; embed the image's printed public link on GitHub.
24760
- 2. **Link the Replicas dashboard deep link** (\`?media=<id>\` form) so the user can jump straight to the file in the workspace.
24762
+ 2. **Link the Replicas dashboard deep link** (\`?mode=media&media=<id>\` form) so the user can jump straight to the file in the workspace.
24761
24763
 
24762
24764
  A dashboard link alone is not enough. An embed without the dashboard link is not enough. Do both.
24763
24765
 
@@ -24786,7 +24788,7 @@ await replicas.slack.call('files.completeUploadExternal', {
24786
24788
  files: [{ id: reservation.file_id, title: 'Screenshot' }],
24787
24789
  channel_id: 'CHANNEL_ID',
24788
24790
  thread_ts: 'THREAD_TS',
24789
- initial_comment: '<https://app.replicas.dev/workspaces/<workspace-id>?media=<media-id>|View in Replicas>',
24791
+ initial_comment: '<https://app.replicas.dev/workspaces/<workspace-id>?mode=media&media=<media-id>|View in Replicas>',
24790
24792
  });
24791
24793
  \`\`\`
24792
24794
 
@@ -24809,7 +24811,7 @@ Use \`jq\` to build the JSON bodies \u2014 the GraphQL variables (\`size\`, \`fi
24809
24811
  FILE=/abs/path/to/screenshot.png
24810
24812
  FILENAME=$(basename "$FILE")
24811
24813
  SIZE=$(stat -c%s "$FILE" 2>/dev/null || stat -f%z "$FILE")
24812
- CONTENT_TYPE=image/png
24814
+ CONTENT_TYPE=image/png # the file's real MIME type, e.g. video/mp4 for a recording
24813
24815
  ISSUE_UUID=... # the Linear issue's UUID
24814
24816
  MEDIA_ID=... # the media ID printed by \`replicas media upload\`
24815
24817
 
@@ -24846,7 +24848,7 @@ curl -s -X PUT "$UPLOAD_URL" \\
24846
24848
  --data-binary @"$FILE"
24847
24849
 
24848
24850
  # 3. Reference assetUrl inline in the comment body, alongside the dashboard link.
24849
- BODY=$(printf '![screenshot](%s)\\n\\n[View in Replicas](https://app.replicas.dev/workspaces/%s?media=%s)' \\
24851
+ BODY=$(printf '![screenshot](%s)\\n\\n[View in Replicas](https://app.replicas.dev/workspaces/%s?mode=media&media=%s)' \\
24850
24852
  "$ASSET_URL" "$REPLICAS_WORKSPACE_ID" "$MEDIA_ID")
24851
24853
 
24852
24854
  jq -n \\
@@ -24858,6 +24860,8 @@ jq -n \\
24858
24860
  }' | linear_graphql
24859
24861
  \`\`\`
24860
24862
 
24863
+ For a recording, upload the MP4 with its own MIME type, then upload a poster frame (\`ffmpeg -i /tmp/demo.mp4 -frames:v 1 /tmp/demo-poster.png\`) the same way as \`image/png\` and link it: \`[![Demo recording](<poster-asset-url>)](<recording-asset-url>)\`.
24864
+
24861
24865
  The same flow works for issue bodies (use \`issueCreate\` / \`issueUpdate\` with the same markdown body).
24862
24866
 
24863
24867
  Never paste the \`api.replicas.dev/v1/media/<id>\` URL into a Linear body or comment \u2014 it will render as a broken image to anyone outside your Replicas chat.
@@ -24897,7 +24901,7 @@ Do **not** commit screenshots to the repo, use placeholder URLs, expose the auth
24897
24901
 
24898
24902
  GitLab supports native project Markdown uploads. For a GitLab destination, always upload the media to Replicas first, then POST the same original file to the repository's \`/projects/:id/uploads\` API using the workspace GitLab credential. Insert the returned \`markdown\` value into the merge request body or comment and include the Replicas dashboard link. Image uploads render inline; MP4, MOV, and WebM uploads render as inline video players.
24899
24903
 
24900
- Do not use a Replicas public link for GitLab when the native project upload succeeds; native uploads preserve project access controls.
24904
+ Do not use a Replicas public link for GitLab when the native project upload succeeds; native uploads preserve project access controls. \`replicas.gitlab.request\` only sends JSON and cannot POST multipart file bytes, so without another supported upload path use the GitHub flow above instead: the image's printed public embed, and a poster linked to the recording's **View in Replicas** URL.
24901
24905
 
24902
24906
  ## Recording defaults
24903
24907
 
@@ -24945,7 +24949,7 @@ replicas media upload chart-a.svg chart-b.svg --name "Latency chart" --name "Err
24945
24949
  var MEDIA_ABILITY = {
24946
24950
  label: "Media",
24947
24951
  description: "Deliver media to Replicas and destination workflows with inline uploads.",
24948
- bullet: "- Producing or showing the user any media \u2014 screenshots, screen recordings, generated images or diagrams, audio clips, or HTML recap pages \u2014 including in your Replicas chat reply, PR descriptions/comments, and other external platforms",
24952
+ bullet: "- Producing or showing the user any media \u2014 screenshots, screen recordings, generated images or diagrams, audio clips, or HTML recap pages \u2014 including in your Replicas chat reply, PR descriptions/comments, and other external platforms. Paste the printed `![\u2026](\u2026)` embeds in your chat reply, never only dashboard links, and upload the file itself to Slack, Linear, or GitLab",
24949
24953
  section: SECTION7,
24950
24954
  referenceFile: { name: "MEDIA.md", content: REFERENCE7 }
24951
24955
  };
@@ -27986,7 +27990,7 @@ var headlessAgentRequestSchema = external_exports.object({
27986
27990
  });
27987
27991
 
27988
27992
  // ../shared/src/cli-version.ts
27989
- var CLI_VERSION = "0.2.789";
27993
+ var CLI_VERSION = "0.2.790";
27990
27994
 
27991
27995
  // ../shared/src/version.ts
27992
27996
  function compareVersions(v1, v2) {
@@ -32390,6 +32394,7 @@ var MEDIA_ACCESS_VALUES = ["organization", "public"];
32390
32394
  function publicMediaUrl(mediaId, token) {
32391
32395
  return `${MONOLITH_URL}/v1/media/public/${mediaId}/${token}`;
32392
32396
  }
32397
+ var MEDIA_DELIVERY_HINT = "Next: paste each ![\u2026](\u2026) or HTML page line above verbatim into your Replicas chat reply so it renders inline; View in Replicas links are secondary and never replace it. Slack, Linear, and GitLab also need a native upload of the file bytes; see the replicas-agent skill's references/MEDIA.md.";
32393
32398
  function formatMediaEmbed(fileName, mediaId, publicUrl) {
32394
32399
  if (publicUrl) return `![${fileName}](${publicUrl})`;
32395
32400
  return `Replicas chat embed: ![${fileName}](${MONOLITH_URL}/v1/media/${mediaId})`;
@@ -32491,6 +32496,7 @@ async function mediaUploadCommand(filePaths, options) {
32491
32496
  );
32492
32497
  const config3 = readAgentConfig();
32493
32498
  const failures = [];
32499
+ let printedEmbed = false;
32494
32500
  for (let i = 0; i < results.length; i++) {
32495
32501
  const result = results[i];
32496
32502
  if (result.status === "fulfilled") {
@@ -32511,8 +32517,10 @@ async function mediaUploadCommand(filePaths, options) {
32511
32517
  }
32512
32518
  if (media.kind === MEDIA_KIND.HTML) {
32513
32519
  console.log(`HTML page: [${fileName}](${MONOLITH_URL}/v1/media/${media.id})`);
32520
+ printedEmbed = true;
32514
32521
  } else if (!shared[i] || publicUrl) {
32515
32522
  console.log(formatMediaEmbed(fileName, media.id, publicUrl));
32523
+ printedEmbed = true;
32516
32524
  }
32517
32525
  if (options.access === "organization" && !shared[i]) {
32518
32526
  console.log(
@@ -32531,6 +32539,10 @@ async function mediaUploadCommand(filePaths, options) {
32531
32539
  failures.push({ filePath: filePaths[i], operation: "upload", error: error51 });
32532
32540
  }
32533
32541
  }
32542
+ if (printedEmbed) {
32543
+ console.log(`
32544
+ ${MEDIA_DELIVERY_HINT}`);
32545
+ }
32534
32546
  if (failures.length > 0) {
32535
32547
  const detail = failures.map((f) => `${f.filePath} ${f.operation}: ${f.error.message}`).join("; ");
32536
32548
  throw new Error(`${failures.length} media operation(s) failed \u2014 ${detail}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.2.789",
3
+ "version": "0.2.790",
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": {