replicas-engine 0.1.437 → 0.1.439

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/src/index.js +55 -12
  2. package/package.json +1 -1
package/dist/src/index.js CHANGED
@@ -506,7 +506,7 @@ var WORKSPACE_SIZES = ["small", "large"];
506
506
  var INVALID_WORKSPACE_SIZE_ERROR = `Invalid size: must be one of ${WORKSPACE_SIZES.join(", ")}`;
507
507
 
508
508
  // ../shared/src/e2b.ts
509
- var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-07-15-v2";
509
+ var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-07-15-v4";
510
510
 
511
511
  // ../shared/src/runtime-env.ts
512
512
  function shellQuotePosix(value) {
@@ -1113,7 +1113,9 @@ gh pr review 123 --request-changes --body "Changes needed"
1113
1113
  GitHub does NOT have a public API for uploading images to PRs/issues. When you need to include images:
1114
1114
  - Do NOT use placeholder image URLs
1115
1115
  - Do NOT commit screenshots as files to the repository
1116
- - Use the \`replicas-agent\` skill to share the image
1116
+ - Run \`replicas media upload <image> --share\` and put the printed \`Forge embed\` Markdown in the PR body or comment
1117
+ - For video, embed a shared poster image linked to the recording's **View in Replicas** URL; GitHub does not reliably render externally hosted video inline
1118
+ - Treat the public URL as an opt-in bearer capability and revoke it with \`replicas media revoke <media-id>\` when appropriate
1117
1119
  - If you were triggered from Slack, also upload the image to the Slack thread so the user can see it directly
1118
1120
  `;
1119
1121
  var GITHUB_ABILITY = {
@@ -1173,6 +1175,23 @@ curl -s -H "Authorization: Bearer $TOKEN" "https://gitlab.com/api/v4/projects/<u
1173
1175
  \`\`\`
1174
1176
 
1175
1177
  Use the repo's own host in the API base URL for self-managed instances.
1178
+
1179
+ ## Inline media in merge requests
1180
+
1181
+ GitLab provides a supported project Markdown uploads API. Upload media to Replicas first, then upload the same bytes natively so repository permissions protect the asset:
1182
+
1183
+ \`\`\`bash
1184
+ FILE=/abs/path/to/screenshot.png
1185
+ PROJECT=$(python3 -c 'import urllib.parse; print(urllib.parse.quote("group/project", safe=""))')
1186
+ TOKEN=$(grep -m1 '://oauth2:' ~/.git-credentials | sed -E 's#https://oauth2:([^@]+)@.*#\\1#')
1187
+ UPLOAD=$(curl -sS --request POST \\
1188
+ --header "Authorization: Bearer $TOKEN" \\
1189
+ --form "file=@$FILE" \\
1190
+ "https://gitlab.com/api/v4/projects/$PROJECT/uploads")
1191
+ echo "$UPLOAD" | jq -r .markdown
1192
+ \`\`\`
1193
+
1194
+ Use the repository's own host for self-managed GitLab. Insert the returned \`markdown\` into the merge request description or comment and add the media's **View in Replicas** dashboard link. Images render inline; MP4, MOV, and WebM render as inline video players. Do not create a public Replicas forge share when this native upload succeeds.
1176
1195
  `;
1177
1196
  var GITLAB_ABILITY = {
1178
1197
  label: "GitLab",
@@ -1686,11 +1705,20 @@ For each file, the CLI prints two lines:
1686
1705
 
1687
1706
  Match each "View in Replicas" line to the embed line directly above it \u2014 that's the deep link for that file.
1688
1707
 
1708
+ Pass \`--share\` only when the media must render on an external forge:
1709
+
1710
+ \`\`\`bash
1711
+ replicas media upload screenshot.png --share
1712
+ \`\`\`
1713
+
1714
+ This prints an additional \`Forge embed\` Markdown line backed by an opt-in public bearer URL. Anyone with that unguessable URL can view the asset until it is rotated or revoked. Use \`replicas media share <media-id>\` to rotate it and \`replicas media revoke <media-id>\` to revoke it.
1715
+
1689
1716
  ## The two URLs the CLI gives you \u2014 and where each one is allowed
1690
1717
 
1691
1718
  | URL | What it is | Where it's allowed |
1692
1719
  |---|---|---|
1693
1720
  | \`https://api.tryreplicas.com/v1/media/<id>\` (inside \`![\u2026](\u2026)\`) | Authenticated API redirect to a presigned blob \u2014 requires the Replicas chat session | **Only** in the Replicas chat reply. Nowhere else. |
1721
+ | \`https://api.tryreplicas.com/v1/media/public/<id>/<token>\` | Opt-in public bearer URL printed by \`--share\` | GitHub image embeds only. |
1694
1722
  | \`https://tryreplicas.com/workspaces/<workspace-id>?mode=media&media=<media-id>\` | Public dashboard deep link to the media tab, scrolled to that specific file | Everywhere external \u2014 Slack, GitHub, Linear, PR bodies, comments, emails. |
1695
1723
 
1696
1724
  ### NEVER link the API redirect URL outside the Replicas chat reply
@@ -1735,7 +1763,7 @@ Sharing media externally is a **two-step requirement** for every file:
1735
1763
 
1736
1764
  A link alone is not enough. A native upload alone is not enough. Do both.
1737
1765
 
1738
- The one exception is GitHub, which has no public image upload API \u2014 there, the dashboard link is the only option (see below).
1766
+ GitHub has no native upload API, so use an explicit Replicas public share for screenshots and recording previews. GitLab has a native upload API and should receive the original bytes.
1739
1767
 
1740
1768
  ### Slack \u2014 embed natively via the 3-step external file upload flow
1741
1769
 
@@ -1847,20 +1875,34 @@ The same flow works for issue bodies (use \`issueCreate\` / \`issueUpdate\` with
1847
1875
 
1848
1876
  Never paste the \`api.tryreplicas.com/v1/media/<id>\` URL into a Linear body or comment \u2014 it will render as a broken image to anyone outside your Replicas chat.
1849
1877
 
1850
- ### GitHub \u2014 link the dashboard deep link (no public upload API exists)
1878
+ ### GitHub: inline screenshots and recording previews
1879
+
1880
+ GitHub has **no public API** for uploading attachments to PRs or issues. Its web UI uses an undocumented internal endpoint that API clients must not emulate. For screenshots, explicitly create a forge share and put the printed \`Forge embed\` Markdown directly in the PR body or comment, followed by the dashboard link:
1881
+
1882
+ \`\`\`bash
1883
+ replicas media upload /tmp/screenshot.png --share
1884
+ \`\`\`
1885
+
1886
+ GitHub does not reliably render arbitrary external videos as inline players. For a recording:
1851
1887
 
1852
- GitHub has **no public API** for uploading images to PRs or issues. Their web UI uses an undocumented internal endpoint that's not available to API clients. So for GitHub specifically, the only correct way to share media is the dashboard deep link, rendered as a markdown hyperlink:
1888
+ 1. Upload the MP4 normally so it remains available in Replicas.
1889
+ 2. Generate a poster image from the recording: \`ffmpeg -i /tmp/demo.mp4 -frames:v 1 /tmp/demo-poster.png\`.
1890
+ 3. Upload the poster with \`--share\`.
1891
+ 4. Wrap the poster embed in a link to the recording's **View in Replicas** URL.
1853
1892
 
1854
1893
  \`\`\`markdown
1855
- [View in Replicas](https://tryreplicas.com/workspaces/<workspace-id>?mode=media&media=<media-id>)
1894
+ [![Demo recording](<public-poster-url>)](<recording-dashboard-url>)
1856
1895
  \`\`\`
1857
1896
 
1858
- Do **not**:
1859
- - Commit screenshots as files to the repo as a workaround.
1860
- - Use placeholder image URLs.
1861
- - Embed the \`api.tryreplicas.com/v1/media/<id>\` URL in markdown \u2014 it renders as a broken image for every viewer.
1897
+ Public forge shares are bearer capabilities. For private repositories, create one only when the user asked for inline PR media, and revoke it with \`replicas media revoke <media-id>\` when it should stop resolving.
1898
+
1899
+ Do **not** commit screenshots to the repo, use placeholder URLs, expose the authenticated \`/v1/media/<id>\` URL, or automate GitHub's undocumented browser upload flow.
1900
+
1901
+ ### GitLab: native inline screenshots and videos
1902
+
1903
+ GitLab supports native project Markdown uploads. 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.
1862
1904
 
1863
- This applies to PR descriptions, PR review comments, issue bodies, issue comments, and commit messages.
1905
+ Do not use a Replicas public forge share for GitLab when the native project upload succeeds; native uploads preserve project access controls.
1864
1906
 
1865
1907
  ## Recording defaults
1866
1908
 
@@ -1900,6 +1942,7 @@ replicas media upload chart-a.svg chart-b.svg --kind image
1900
1942
 
1901
1943
  - \`--kind <image|video|audio>\` \u2014 override auto-detection
1902
1944
  - \`--session-id <id>\` \u2014 associate the upload with a specific session
1945
+ - \`--share\`: create a revocable public bearer URL for a forge image embed
1903
1946
  `;
1904
1947
  var MEDIA_ABILITY = {
1905
1948
  label: "Media",
@@ -8520,7 +8563,7 @@ var DEFAULT_CODEX_ARGS = ["app-server", "--listen", "stdio://"];
8520
8563
  var MIN_CODEX_CLI_VERSION = "0.144.0";
8521
8564
  var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
8522
8565
  var codexCliVersionEnsured = null;
8523
- var ENGINE_PACKAGE_VERSION = "0.1.437";
8566
+ var ENGINE_PACKAGE_VERSION = "0.1.439";
8524
8567
  var INITIALIZE_METHOD = "initialize";
8525
8568
  var INITIALIZED_NOTIFICATION = "initialized";
8526
8569
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.437",
3
+ "version": "0.1.439",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",