replicas-cli 0.2.561 → 0.2.563
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.
- package/dist/index.cjs +39 -23
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -23396,7 +23396,7 @@ If none of these apply, don't upload.
|
|
|
23396
23396
|
|
|
23397
23397
|
\`replicas media upload\` is always the first delivery action. When the current task has an external destination, every other delivery step follows only after that command succeeds. For every file:
|
|
23398
23398
|
|
|
23399
|
-
1. First, run \`replicas media upload\` with the original file. Do not begin any destination upload until the command succeeds. This creates the canonical dashboard copy and prints
|
|
23399
|
+
1. First, run \`replicas media upload\` with the original file. Do not begin any destination upload until the command succeeds. This creates the canonical dashboard copy and prints a chat embed plus a per-file dashboard link. With public access, the printed Forge embed is the chat embed and is also safe to use on GitHub.
|
|
23400
23400
|
2. Include the printed embed line in the Replicas chat reply, followed by the matching **View in Replicas** link. HTML uses its printed page link instead of an image embed.
|
|
23401
23401
|
3. Identify every destination in the task and attempt to upload the same original bytes there. Use the destination's inline representation from the table below; do not replace the file with a Replicas link.
|
|
23402
23402
|
4. Put the **View in Replicas** dashboard link next to the destination embed as a secondary link.
|
|
@@ -23436,10 +23436,11 @@ replicas media upload /tmp/before.png /tmp/after.png --name "Before fix" --name
|
|
|
23436
23436
|
|
|
23437
23437
|
Names are normalized to hyphen-case (spaces become hyphens, e.g. \`Login page\` is stored as \`login-page\`). Give every asset a **distinct** name \u2014 duplicates are not rejected, but Replicas keeps the first as-is and adds a \`-1\`, \`-2\` suffix to later collisions, which produces confusing lists, so pick unique names yourself.
|
|
23438
23438
|
|
|
23439
|
-
For each media file, the CLI prints
|
|
23439
|
+
For each media file, the CLI prints an embed line and a dashboard link:
|
|
23440
23440
|
|
|
23441
|
-
1.
|
|
23442
|
-
2. \`
|
|
23441
|
+
1. Default and organization access print \`Replicas chat embed: \`; this authenticated URL renders inline in Replicas chat **only** \u2014 see below.
|
|
23442
|
+
2. Public access (\`--access public\` or \`--share\`) prints \`\` as the Forge embed instead. This is the public, stable bearer URL to paste into GitHub.
|
|
23443
|
+
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.
|
|
23443
23444
|
|
|
23444
23445
|
Match each "View in Replicas" line to the embed line directly above it \u2014 that's the deep link for that file.
|
|
23445
23446
|
|
|
@@ -23459,7 +23460,7 @@ Use public access only when the media must render without Replicas authenticatio
|
|
|
23459
23460
|
replicas media upload screenshot.png --name "Login page" --access public
|
|
23460
23461
|
\`\`\`
|
|
23461
23462
|
|
|
23462
|
-
\`--share\` remains an alias for \`--access public\`. Public access prints
|
|
23463
|
+
\`--share\` remains an alias for \`--access public\`. Public access prints the raw \`Forge embed\` Markdown instead of the authenticated chat-only embed for image, video, or audio media, backed by an opt-in bearer URL. Anyone with that unguessable URL can view the asset until it is rotated or revoked. HTML pages only support organization access. Use \`replicas media share <media-id>\` to rotate a public media URL and \`replicas media revoke <media-id>\` to revoke it.
|
|
23463
23464
|
|
|
23464
23465
|
## The URLs the CLI gives you \u2014 and where each one is allowed
|
|
23465
23466
|
|
|
@@ -23467,7 +23468,7 @@ replicas media upload screenshot.png --name "Login page" --access public
|
|
|
23467
23468
|
|---|---|---|
|
|
23468
23469
|
| \`https://api.replicas.dev/v1/media/<id>\` (inside \`\`) | Authenticated API redirect to a presigned blob \u2014 requires the Replicas chat session | **Only** in the Replicas chat reply. Nowhere else. |
|
|
23469
23470
|
| \`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. |
|
|
23470
|
-
| \`https://api.replicas.dev/v1/media/public/<id>/<token>\` | Opt-in public bearer URL printed by \`--access public\` or \`--share\` | GitHub embeds for image, video, or audio media. |
|
|
23471
|
+
| \`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. |
|
|
23471
23472
|
| \`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. |
|
|
23472
23473
|
|
|
23473
23474
|
### NEVER link the API redirect URL outside the Replicas chat reply
|
|
@@ -23806,6 +23807,7 @@ Use this when:
|
|
|
23806
23807
|
- The user asks to discover which external services are connected
|
|
23807
23808
|
- The user asks to create or control an E2B sandbox
|
|
23808
23809
|
- The user asks to invoke a connected Modal function
|
|
23810
|
+
- The user asks to access Vercel projects, deployments, domains, logs, or infrastructure
|
|
23809
23811
|
- The user asks to query or update a connected turbopuffer namespace
|
|
23810
23812
|
- The user asks for PlanetScale organizations, databases, branches, or Insights data
|
|
23811
23813
|
- The user asks to analyze text with Pangram`;
|
|
@@ -23873,6 +23875,17 @@ const databases = await replicas.planetscale.request('/organizations/acme/databa
|
|
|
23873
23875
|
|
|
23874
23876
|
OAuth scopes control permitted operations. Confirm mutations before using POST, PUT, PATCH, or DELETE.
|
|
23875
23877
|
|
|
23878
|
+
## Vercel
|
|
23879
|
+
|
|
23880
|
+
Vercel is a native access-token integration. Pass a relative path from the Vercel REST API, including a \`teamId\` query parameter for team-owned resources:
|
|
23881
|
+
|
|
23882
|
+
\`\`\`ts
|
|
23883
|
+
const projects = await replicas.vercel.request('/v9/projects?teamId=team_123');
|
|
23884
|
+
const deployments = await replicas.vercel.request('/v6/deployments?teamId=team_123');
|
|
23885
|
+
\`\`\`
|
|
23886
|
+
|
|
23887
|
+
Confirm mutations before using POST, PUT, PATCH, or DELETE.
|
|
23888
|
+
|
|
23876
23889
|
## Modal
|
|
23877
23890
|
|
|
23878
23891
|
Modal is a native integration and uses its official JavaScript SDK behind the Replicas gateway. Invoke a deployed function by name:
|
|
@@ -24430,7 +24443,7 @@ var headlessFilesystemAgentResultSchema = external_exports.object({
|
|
|
24430
24443
|
});
|
|
24431
24444
|
|
|
24432
24445
|
// ../shared/src/cli-version.ts
|
|
24433
|
-
var CLI_VERSION = "0.2.
|
|
24446
|
+
var CLI_VERSION = "0.2.563";
|
|
24434
24447
|
|
|
24435
24448
|
// ../shared/src/version.ts
|
|
24436
24449
|
function compareVersions(v1, v2) {
|
|
@@ -24661,7 +24674,7 @@ var EXPLICIT_PLUGIN_CATALOG = [
|
|
|
24661
24674
|
},
|
|
24662
24675
|
{
|
|
24663
24676
|
id: "vercel",
|
|
24664
|
-
backend: "
|
|
24677
|
+
backend: "native",
|
|
24665
24678
|
toolkit: "vercel",
|
|
24666
24679
|
authType: "api_key",
|
|
24667
24680
|
category: "data",
|
|
@@ -30337,6 +30350,10 @@ var MEDIA_ACCESS_VALUES = ["organization", "public"];
|
|
|
30337
30350
|
function publicMediaUrl(mediaId, token) {
|
|
30338
30351
|
return `${MONOLITH_URL}/v1/media/public/${mediaId}/${token}`;
|
|
30339
30352
|
}
|
|
30353
|
+
function formatMediaEmbed(fileName, mediaId, publicUrl) {
|
|
30354
|
+
if (publicUrl) return ``;
|
|
30355
|
+
return `Replicas chat embed: `;
|
|
30356
|
+
}
|
|
30340
30357
|
async function shareMedia(mediaId) {
|
|
30341
30358
|
const { token } = await agentFetch(`/v1/engine/media/${mediaId}/share`, {
|
|
30342
30359
|
method: "POST"
|
|
@@ -30437,22 +30454,11 @@ async function mediaUploadCommand(filePaths, options) {
|
|
|
30437
30454
|
const result = results[i];
|
|
30438
30455
|
if (result.status === "fulfilled") {
|
|
30439
30456
|
const { fileName, media } = result.value;
|
|
30440
|
-
|
|
30441
|
-
|
|
30442
|
-
} else {
|
|
30443
|
-
console.log(``);
|
|
30444
|
-
}
|
|
30445
|
-
if (options.access === "organization") {
|
|
30446
|
-
console.log(
|
|
30447
|
-
`Forge link (organization only): [View ${options.name?.[i] ?? fileName}](${getOrganizationMediaUrl(media.organization_id, media.id)})`
|
|
30448
|
-
);
|
|
30449
|
-
}
|
|
30457
|
+
const shareResult = publicAccess ? shareResults[i] : void 0;
|
|
30458
|
+
const publicUrl = shareResult?.status === "fulfilled" ? shareResult.value ?? void 0 : void 0;
|
|
30450
30459
|
if (publicAccess) {
|
|
30451
|
-
|
|
30452
|
-
|
|
30453
|
-
console.log(`Forge embed: `);
|
|
30454
|
-
} else {
|
|
30455
|
-
const error51 = shareResult.status === "rejected" ? shareResult.reason : new Error("Missing public share URL");
|
|
30460
|
+
if (!publicUrl) {
|
|
30461
|
+
const error51 = shareResult?.status === "rejected" ? shareResult.reason : new Error("Missing public share URL");
|
|
30456
30462
|
failures.push({
|
|
30457
30463
|
filePath: filePaths[i],
|
|
30458
30464
|
operation: "share",
|
|
@@ -30460,6 +30466,16 @@ async function mediaUploadCommand(filePaths, options) {
|
|
|
30460
30466
|
});
|
|
30461
30467
|
}
|
|
30462
30468
|
}
|
|
30469
|
+
if (media.kind === MEDIA_KIND.HTML) {
|
|
30470
|
+
console.log(`HTML page: [${fileName}](${MONOLITH_URL}/v1/media/${media.id})`);
|
|
30471
|
+
} else if (!publicAccess || publicUrl) {
|
|
30472
|
+
console.log(formatMediaEmbed(fileName, media.id, publicUrl));
|
|
30473
|
+
}
|
|
30474
|
+
if (options.access === "organization") {
|
|
30475
|
+
console.log(
|
|
30476
|
+
`Forge link (organization only): [View ${options.name?.[i] ?? fileName}](${getOrganizationMediaUrl(media.organization_id, media.id)})`
|
|
30477
|
+
);
|
|
30478
|
+
}
|
|
30463
30479
|
if (config3?.workspace_id) {
|
|
30464
30480
|
const deepLink = getWorkspaceDashboardUrl(config3.workspace_id, {
|
|
30465
30481
|
mode: "media",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "replicas-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.563",
|
|
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": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"dev": "bun run src/index.ts",
|
|
19
19
|
"dev-pack": "bun run build && node scripts/pack-dev-tarball.mjs",
|
|
20
20
|
"start": "node dist/index.cjs",
|
|
21
|
+
"test": "bun test",
|
|
21
22
|
"prepublishOnly": "bun run build"
|
|
22
23
|
},
|
|
23
24
|
"keywords": [
|