replicas-engine 0.1.732 → 0.1.733

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.
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  HOOK_EXEC_MAX_BUFFER_BYTES,
4
4
  isVersionBelow
5
- } from "./chunk-4WSQK4KO.js";
5
+ } from "./chunk-YBI3HWHT.js";
6
6
 
7
7
  // src/utils/presigned-upload.ts
8
8
  import { createReadStream } from "fs";
@@ -272,7 +272,7 @@ var DEFAULT_CODEX_ARGS = [
272
272
  var MIN_CODEX_CLI_VERSION = "0.144.6";
273
273
  var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
274
274
  var codexCliVersionEnsured = null;
275
- var ENGINE_PACKAGE_VERSION = "0.1.732";
275
+ var ENGINE_PACKAGE_VERSION = "0.1.733";
276
276
  var INITIALIZE_METHOD = "initialize";
277
277
  var INITIALIZED_NOTIFICATION = "initialized";
278
278
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -12,7 +12,7 @@ import {
12
12
  isValidAgentProvider,
13
13
  parsePosixEnvFile,
14
14
  readReplicasRuntimeEnv
15
- } from "./chunk-4WSQK4KO.js";
15
+ } from "./chunk-YBI3HWHT.js";
16
16
 
17
17
  // src/engine-env.ts
18
18
  import { readFileSync as readFileSync2 } from "fs";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  mayCreatePullRequest
4
- } from "./chunk-4WSQK4KO.js";
4
+ } from "./chunk-YBI3HWHT.js";
5
5
 
6
6
  // src/services/post-tool-pr-notifier.ts
7
7
  async function notifyPostToolUse(toolName, toolInput) {
@@ -2299,7 +2299,7 @@ If none of these apply, don't upload.
2299
2299
  | Slack | \`files.getUploadURLExternal\` \u2192 raw-byte POST \u2192 \`files.completeUploadExternal\` | Uploaded file in the channel or thread |
2300
2300
  | Linear | \`fileUpload\` mutation \u2192 presigned upload \u2192 issue/comment mutation | Returned \`assetUrl\` in Markdown |
2301
2301
  | GitLab | Project \`/uploads\` endpoint with the original bytes | Returned GitLab Markdown |
2302
- | GitHub | No supported attachment API; use a Replicas public forge share for the inline image or video poster | Printed Forge embed, linked to the recording when needed |
2302
+ | GitHub | \`gh\` v2.99.0+ \`--attach\` for images and videos; use a Replicas public forge share as the fallback | Native GitHub attachment URL, or a Forge embed fallback |
2303
2303
 
2304
2304
  The dashboard link is the subtitle and jump-back path. It is never a substitute for the destination upload.
2305
2305
 
@@ -2330,7 +2330,7 @@ Names are normalized to hyphen-case (spaces become hyphens, e.g. \`Login page\`
2330
2330
  For each media file, the CLI prints an embed line and a dashboard link:
2331
2331
 
2332
2332
  1. Default and organization access print \`Replicas chat embed: ![filename](<api-url>)\`; this authenticated URL renders inline in Replicas chat **only** \u2014 see below.
2333
- 2. Public access (\`--access public\` or \`--share\`) prints \`![filename](<public-url>)\` as the Forge embed instead. This is the public, stable bearer URL to paste into GitHub.
2333
+ 2. Public access (\`--access public\` or \`--share\`) prints \`![filename](<public-url>)\` as the Forge embed instead. This is the public, stable bearer URL for GitHub fallback embeds when native \`--attach\` is unavailable and sharing is authorized.
2334
2334
  3. \`View in Replicas: <deep-link>\` is a per-file dashboard URL of the form \`https://replicas.dev/workspaces/<workspace-id>?media=<media-id>\` that opens directly to that specific file.
2335
2335
 
2336
2336
  Match each "View in Replicas" line to the embed line directly above it \u2014 that's the deep link for that file.
@@ -2359,7 +2359,7 @@ replicas media upload screenshot.png --name "Login page" --access public
2359
2359
  |---|---|---|
2360
2360
  | \`https://api.replicas.dev/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. |
2361
2361
  | \`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. |
2362
- | \`https://api.replicas.dev/v1/media/public/<id>/<token>\` | Opt-in public bearer URL printed by \`--access public\` or \`--share\` | The Replicas chat reply and GitHub embeds, for image, video, or audio media. |
2362
+ | \`https://api.replicas.dev/v1/media/public/<id>/<token>\` | Opt-in public bearer URL printed by \`--access public\` or \`--share\` | The Replicas chat reply and GitHub fallback embeds, for image, video, or audio media. |
2363
2363
  | \`https://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. |
2364
2364
 
2365
2365
  ### NEVER link the API redirect URL outside the Replicas chat reply
@@ -2403,7 +2403,7 @@ After \`replicas media upload\` succeeds, external delivery has two required fol
2403
2403
 
2404
2404
  A link alone is not enough. An upload without the dashboard link is not enough. Do both.
2405
2405
 
2406
- Slack, Linear, and GitLab receive the original bytes through their native upload APIs. GitHub has no supported attachment API, so use an explicit Replicas public share for screenshots and recording previews.
2406
+ Slack, Linear, and GitLab receive the original bytes through their native upload APIs. GitHub image and video attachments use \`gh --attach\` when the installed CLI and host support it; use an explicit Replicas public share only as the fallback.
2407
2407
 
2408
2408
  ### Slack \u2014 embed natively via the 3-step external file upload flow
2409
2409
 
@@ -2515,26 +2515,50 @@ The same flow works for issue bodies (use \`issueCreate\` / \`issueUpdate\` with
2515
2515
 
2516
2516
  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.
2517
2517
 
2518
- ### GitHub: inline screenshots and recording previews
2518
+ ### GitHub: native image and video attachments
2519
2519
 
2520
- 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:
2520
+ GitHub CLI v2.99.0+ supports a repeatable \`--attach\` flag on \`gh pr create\`, \`gh pr edit\`, and \`gh pr comment\` for GitHub.com and GitHub Enterprise Cloud. It uploads local images and videos to GitHub and writes the resulting attachment URL into the PR body or comment; it requires push access to the repository. GitHub Enterprise Server and unsupported media kinds are not covered by this path. See [GitHub's attachment guide](https://docs.github.com/en/github-cli/github-cli/attaching-files-with-github-cli).
2521
+
2522
+ Check \`gh --version\` before choosing the delivery path. On a supported host with v2.99.0 or later:
2523
+
2524
+ 1. Run \`replicas media upload\` with the original file first, without \`--share\`. Keep the matching **View in Replicas** dashboard link for the PR.
2525
+ 2. Put each local file path in the Markdown body where the attachment should appear, and place its dashboard link next to it.
2526
+ 3. Pass the same original path once with \`--attach\`. GitHub CLI rewrites a matching local reference in place, preserving its alt text; an unreferenced attachment is appended to the body.
2527
+
2528
+ \`\`\`markdown
2529
+ Before the change:
2530
+
2531
+ ![Before state](/tmp/before.png)
2532
+ [View in Replicas](https://replicas.dev/workspaces/<workspace-id>?media=<before-media-id>)
2533
+ \`\`\`
2521
2534
 
2522
2535
  \`\`\`bash
2523
- replicas media upload /tmp/screenshot.png --name "PR screenshot" --share
2536
+ gh pr create \\
2537
+ --title "Describe the change" \\
2538
+ --body-file /tmp/pr-body.md \\
2539
+ --attach /tmp/before.png
2540
+
2541
+ gh pr edit 456 --body-file /tmp/pr-body.md --attach /tmp/after.png
2542
+ gh pr comment 456 --body-file /tmp/comment.md --attach /tmp/result.mp4
2524
2543
  \`\`\`
2525
2544
 
2526
- GitHub does not reliably render arbitrary external videos as inline players. For a recording:
2545
+ Repeat \`--attach\` for multiple files, up to 50 per command. For an appended image, add alt text after the path with \`#\`, for example \`--attach './error.png#Error state'\`. To render a video as a player, its local Markdown reference must be the only content in its paragraph. Do not paste a Replicas authenticated API URL into the body, and do not emulate GitHub's undocumented browser upload endpoint.
2546
+
2547
+ ### GitHub attachment fallback
2548
+
2549
+ If \`--attach\` is unavailable, the target is GitHub Enterprise Server, the file is not an image or video, or the native upload fails, keep the Replicas dashboard link and report the limitation. For an inline screenshot or video poster, create a Replicas public forge share only for a public repository or after explicit consent to publish media from a private repository, then use the printed \`Forge embed\` Markdown:
2550
+
2551
+ \`\`\`bash
2552
+ replicas media upload /tmp/screenshot.png --name "PR screenshot" --share
2553
+ \`\`\`
2527
2554
 
2528
- 1. Upload the MP4 normally so it remains available in Replicas.
2529
- 2. Generate a poster image from the recording: \`ffmpeg -i /tmp/demo.mp4 -frames:v 1 /tmp/demo-poster.png\`.
2530
- 3. Upload the poster with \`--share\`.
2531
- 4. Wrap the poster embed in a link to the recording's **View in Replicas** URL.
2555
+ For a fallback recording preview, upload the MP4 normally, generate a poster with \`ffmpeg -i /tmp/demo.mp4 -frames:v 1 /tmp/demo-poster.png\`, share the poster, and link its embed to the recording's **View in Replicas** URL:
2532
2556
 
2533
2557
  \`\`\`markdown
2534
2558
  [![Demo recording](<public-poster-url>)](<recording-dashboard-url>)
2535
2559
  \`\`\`
2536
2560
 
2537
- Public forge shares are unauthenticated bearer capabilities. For private repositories, create one only when the user explicitly asked for inline PR media. Without that consent, keep the media private in Replicas and report that GitHub has no supported attachment API; do not publish a bearer share or pretend the dashboard link is an embed. Revoke with \`replicas media revoke <media-id>\` **only** when the user asks or the media should intentionally stop rendering; never as routine post-task cleanup, since revoking breaks every embed already posted on the PR.
2561
+ Public forge shares are unauthenticated bearer capabilities. Revoke with \`replicas media revoke <media-id>\` **only** when the user asks or the media should intentionally stop rendering; never as routine post-task cleanup, since revoking breaks every embed already posted on the PR.
2538
2562
 
2539
2563
  For a self-contained HTML report, upload it with \`--access organization\` and put the printed \`Forge link\` Markdown in the PR body or comment. GitHub cannot render the page inline, so use the normal link rather than image syntax. HTML pages cannot be shared publicly.
2540
2564
 
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  evaluateCommandProtection
4
- } from "./chunk-MSIRAEIY.js";
4
+ } from "./chunk-5U46EQRM.js";
5
5
  import {
6
6
  isRecord
7
7
  } from "./chunk-2RB7SIP3.js";
8
- import "./chunk-4WSQK4KO.js";
8
+ import "./chunk-YBI3HWHT.js";
9
9
 
10
10
  // src/command-protection-hook.ts
11
11
  var provider = process.argv[2];
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  evaluateCommandProtection
4
- } from "./chunk-MSIRAEIY.js";
4
+ } from "./chunk-5U46EQRM.js";
5
5
  import {
6
6
  notifyPostToolUse
7
- } from "./chunk-RN4NHKXF.js";
7
+ } from "./chunk-MWD54BEE.js";
8
8
  import "./chunk-2RB7SIP3.js";
9
- import "./chunk-4WSQK4KO.js";
9
+ import "./chunk-YBI3HWHT.js";
10
10
 
11
11
  // src/deepseek-command-protection-plugin.ts
12
12
  function replicasCommandProtection(context) {
@@ -4,12 +4,12 @@ import {
4
4
  buildCodexAgentEnv,
5
5
  putPresignedFile,
6
6
  recoverCompletedTurn
7
- } from "./chunk-6RLBLURM.js";
7
+ } from "./chunk-2ZP6PIHD.js";
8
8
  import {
9
9
  AGENT,
10
10
  getMemoryOutputSafetyViolation,
11
11
  headlessAgentRequestSchema
12
- } from "./chunk-4WSQK4KO.js";
12
+ } from "./chunk-YBI3HWHT.js";
13
13
 
14
14
  // src/headless-agent.ts
15
15
  import { createHash } from "crypto";
package/dist/src/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  monolithService,
9
9
  reportCommandProtectionBlock,
10
10
  setAgentCredentialSnapshot
11
- } from "./chunk-MSIRAEIY.js";
11
+ } from "./chunk-5U46EQRM.js";
12
12
  import {
13
13
  ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
14
14
  AGENT_MESSAGE_DELTA_METHOD,
@@ -36,7 +36,7 @@ import {
36
36
  execFileAsync,
37
37
  putPresignedFile,
38
38
  recoverCompletedTurn
39
- } from "./chunk-6RLBLURM.js";
39
+ } from "./chunk-2ZP6PIHD.js";
40
40
  import {
41
41
  isRecord as isRecord2
42
42
  } from "./chunk-2RB7SIP3.js";
@@ -220,7 +220,7 @@ import {
220
220
  shellQuotePosix,
221
221
  stripAgentDiagnosticErrors,
222
222
  withTimeout
223
- } from "./chunk-4WSQK4KO.js";
223
+ } from "./chunk-YBI3HWHT.js";
224
224
 
225
225
  // src/index.ts
226
226
  import { serve } from "@hono/node-server";
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  notifyPostToolUse
4
- } from "./chunk-RN4NHKXF.js";
4
+ } from "./chunk-MWD54BEE.js";
5
5
  import {
6
6
  isRecord
7
7
  } from "./chunk-2RB7SIP3.js";
8
- import "./chunk-4WSQK4KO.js";
8
+ import "./chunk-YBI3HWHT.js";
9
9
 
10
10
  // src/post-tool-pr-hook.ts
11
11
  async function main() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.732",
3
+ "version": "0.1.733",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",