replicas-cli 0.2.789 → 0.2.791

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 -13
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -22950,7 +22950,6 @@ var sendChatMessageRequestSchema = external_exports.object({
22950
22950
  idempotencyKey: external_exports.string().min(1).max(128).optional(),
22951
22951
  automationId: external_exports.string().optional(),
22952
22952
  environmentId: external_exports.string().min(1).optional(),
22953
- chatCredentials: external_exports.boolean().optional(),
22954
22953
  senderUserId: external_exports.string().optional(),
22955
22954
  senderEmail: external_exports.string().optional(),
22956
22955
  senderDisplayName: external_exports.string().optional(),
@@ -24163,7 +24162,7 @@ replicas computer record stop
24163
24162
  replicas media upload /tmp/walkthrough.mp4 --name "<Project> walkthrough"
24164
24163
  \`\`\`
24165
24164
 
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.
24165
+ 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
24166
 
24168
24167
  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
24168
 
@@ -24687,7 +24686,7 @@ For each media file, the CLI prints an embed line and a dashboard link:
24687
24686
 
24688
24687
  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
24688
  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.
24689
+ 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
24690
 
24692
24691
  Match each "View in Replicas" line to the embed line directly above it \u2014 that's the deep link for that file.
24693
24692
 
@@ -24718,7 +24717,7 @@ Permanently delete an upload with \`replicas media delete <media-id>\`. The back
24718
24717
  | \`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
24718
  | \`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
24719
  | \`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. |
24720
+ | \`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
24721
 
24723
24722
  ### NEVER link the API redirect URL outside the Replicas chat reply
24724
24723
 
@@ -24737,10 +24736,10 @@ This rule has no exceptions:
24737
24736
  For an organization-only HTML page, use the \`Forge link\` printed by \`--access organization\`. For other authenticated media references, use the dashboard form:
24738
24737
 
24739
24738
  \`\`\`
24740
- https://app.replicas.dev/workspaces/<workspace-id>?media=<media-id>
24739
+ https://app.replicas.dev/workspaces/<workspace-id>?mode=media&media=<media-id>
24741
24740
  \`\`\`
24742
24741
 
24743
- The \`media=<media-id>\` query param opens that specific file in the workspace.
24742
+ The \`mode=media&media=<media-id>\` query params open that specific file in the workspace.
24744
24743
 
24745
24744
  When you have a specific file in mind, never link the bare workspace URL without the \`media=<id>\` param.
24746
24745
 
@@ -24750,6 +24749,8 @@ Always render as a markdown / mrkdwn hyperlink labeled **View in Replicas** \u20
24750
24749
 
24751
24750
  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
24751
 
24752
+ 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.
24753
+
24753
24754
  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
24755
 
24755
24756
  ## On external platforms: embed the file AND link the dashboard
@@ -24757,7 +24758,7 @@ After (or alongside) the embeds, include a \`[View in Canvas](<deep-link>)\` hyp
24757
24758
  After \`replicas media upload\` succeeds, external delivery has two required follow-up steps for every file:
24758
24759
 
24759
24760
  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.
24761
+ 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
24762
 
24762
24763
  A dashboard link alone is not enough. An embed without the dashboard link is not enough. Do both.
24763
24764
 
@@ -24786,7 +24787,7 @@ await replicas.slack.call('files.completeUploadExternal', {
24786
24787
  files: [{ id: reservation.file_id, title: 'Screenshot' }],
24787
24788
  channel_id: 'CHANNEL_ID',
24788
24789
  thread_ts: 'THREAD_TS',
24789
- initial_comment: '<https://app.replicas.dev/workspaces/<workspace-id>?media=<media-id>|View in Replicas>',
24790
+ initial_comment: '<https://app.replicas.dev/workspaces/<workspace-id>?mode=media&media=<media-id>|View in Replicas>',
24790
24791
  });
24791
24792
  \`\`\`
24792
24793
 
@@ -24809,7 +24810,7 @@ Use \`jq\` to build the JSON bodies \u2014 the GraphQL variables (\`size\`, \`fi
24809
24810
  FILE=/abs/path/to/screenshot.png
24810
24811
  FILENAME=$(basename "$FILE")
24811
24812
  SIZE=$(stat -c%s "$FILE" 2>/dev/null || stat -f%z "$FILE")
24812
- CONTENT_TYPE=image/png
24813
+ CONTENT_TYPE=image/png # the file's real MIME type, e.g. video/mp4 for a recording
24813
24814
  ISSUE_UUID=... # the Linear issue's UUID
24814
24815
  MEDIA_ID=... # the media ID printed by \`replicas media upload\`
24815
24816
 
@@ -24846,7 +24847,7 @@ curl -s -X PUT "$UPLOAD_URL" \\
24846
24847
  --data-binary @"$FILE"
24847
24848
 
24848
24849
  # 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)' \\
24850
+ BODY=$(printf '![screenshot](%s)\\n\\n[View in Replicas](https://app.replicas.dev/workspaces/%s?mode=media&media=%s)' \\
24850
24851
  "$ASSET_URL" "$REPLICAS_WORKSPACE_ID" "$MEDIA_ID")
24851
24852
 
24852
24853
  jq -n \\
@@ -24858,6 +24859,8 @@ jq -n \\
24858
24859
  }' | linear_graphql
24859
24860
  \`\`\`
24860
24861
 
24862
+ 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>)\`.
24863
+
24861
24864
  The same flow works for issue bodies (use \`issueCreate\` / \`issueUpdate\` with the same markdown body).
24862
24865
 
24863
24866
  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 +24900,7 @@ Do **not** commit screenshots to the repo, use placeholder URLs, expose the auth
24897
24900
 
24898
24901
  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
24902
 
24900
- Do not use a Replicas public link for GitLab when the native project upload succeeds; native uploads preserve project access controls.
24903
+ 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
24904
 
24902
24905
  ## Recording defaults
24903
24906
 
@@ -24945,7 +24948,7 @@ replicas media upload chart-a.svg chart-b.svg --name "Latency chart" --name "Err
24945
24948
  var MEDIA_ABILITY = {
24946
24949
  label: "Media",
24947
24950
  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",
24951
+ 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
24952
  section: SECTION7,
24950
24953
  referenceFile: { name: "MEDIA.md", content: REFERENCE7 }
24951
24954
  };
@@ -27986,7 +27989,7 @@ var headlessAgentRequestSchema = external_exports.object({
27986
27989
  });
27987
27990
 
27988
27991
  // ../shared/src/cli-version.ts
27989
- var CLI_VERSION = "0.2.789";
27992
+ var CLI_VERSION = "0.2.791";
27990
27993
 
27991
27994
  // ../shared/src/version.ts
27992
27995
  function compareVersions(v1, v2) {
@@ -32390,6 +32393,7 @@ var MEDIA_ACCESS_VALUES = ["organization", "public"];
32390
32393
  function publicMediaUrl(mediaId, token) {
32391
32394
  return `${MONOLITH_URL}/v1/media/public/${mediaId}/${token}`;
32392
32395
  }
32396
+ 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
32397
  function formatMediaEmbed(fileName, mediaId, publicUrl) {
32394
32398
  if (publicUrl) return `![${fileName}](${publicUrl})`;
32395
32399
  return `Replicas chat embed: ![${fileName}](${MONOLITH_URL}/v1/media/${mediaId})`;
@@ -32491,6 +32495,7 @@ async function mediaUploadCommand(filePaths, options) {
32491
32495
  );
32492
32496
  const config3 = readAgentConfig();
32493
32497
  const failures = [];
32498
+ let printedEmbed = false;
32494
32499
  for (let i = 0; i < results.length; i++) {
32495
32500
  const result = results[i];
32496
32501
  if (result.status === "fulfilled") {
@@ -32511,8 +32516,10 @@ async function mediaUploadCommand(filePaths, options) {
32511
32516
  }
32512
32517
  if (media.kind === MEDIA_KIND.HTML) {
32513
32518
  console.log(`HTML page: [${fileName}](${MONOLITH_URL}/v1/media/${media.id})`);
32519
+ printedEmbed = true;
32514
32520
  } else if (!shared[i] || publicUrl) {
32515
32521
  console.log(formatMediaEmbed(fileName, media.id, publicUrl));
32522
+ printedEmbed = true;
32516
32523
  }
32517
32524
  if (options.access === "organization" && !shared[i]) {
32518
32525
  console.log(
@@ -32531,6 +32538,10 @@ async function mediaUploadCommand(filePaths, options) {
32531
32538
  failures.push({ filePath: filePaths[i], operation: "upload", error: error51 });
32532
32539
  }
32533
32540
  }
32541
+ if (printedEmbed) {
32542
+ console.log(`
32543
+ ${MEDIA_DELIVERY_HINT}`);
32544
+ }
32534
32545
  if (failures.length > 0) {
32535
32546
  const detail = failures.map((f) => `${f.filePath} ${f.operation}: ${f.error.message}`).join("; ");
32536
32547
  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.791",
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": {