replicas-cli 0.2.617 → 0.2.619

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 +60 -34
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -23575,18 +23575,24 @@ var GITLAB_ABILITY = {
23575
23575
 
23576
23576
  // ../shared/src/default-skills/replicas-agent/abilities/linear.ts
23577
23577
  var SECTION5 = `### Linear
23578
- Fetch issues, update state, add comments, and search through the workspace-scoped TypeScript SDK.
23578
+ Create tickets, fetch issues, update state, add comments, and search through \`replicas.linear.graphql\` in \`@replicas/sdk\`. This works without a Linear MCP server and refreshes authentication automatically.
23579
23579
 
23580
23580
  **Reference:** \`references/LINEAR.md\`
23581
23581
 
23582
23582
  Use this when:
23583
+ - You need to create a Linear ticket or issue
23583
23584
  - You encounter a Linear issue link and need to understand the task
23584
23585
  - You need to update an issue's state or add a comment
23585
- - You need to search Linear issues`;
23586
+ - You need to search Linear issues
23587
+ - A Linear request failed with an authentication error`;
23586
23588
  var REFERENCE5 = `# Linear Integration
23587
23589
 
23588
23590
  Use \`@replicas/sdk\`; never request or handle a Linear OAuth token. Replicas refreshes the organization credential behind the gateway.
23589
23591
 
23592
+ In gateway-enabled workspaces, Linear credentials stay on the Replicas server and the workspace receives only connection metadata. Older workspaces can still carry a legacy token snapshot, but should use the gateway when the SDK is available. A missing Linear MCP server does not prevent SDK access.
23593
+
23594
+ Download protected attachments with \`await replicas.linear.download(url)\`; this returns a \`Response\` without exposing the provider token.
23595
+
23590
23596
  ## Check access
23591
23597
 
23592
23598
  \`\`\`ts
@@ -23596,6 +23602,25 @@ const { native } = await replicas.integrations.list();
23596
23602
  if (!native.linear) throw new Error('Connect Linear in Replicas organization integrations first.');
23597
23603
  \`\`\`
23598
23604
 
23605
+ \`native.linear\` checks whether an organization credential exists. To diagnose authentication, make a read-only request through \`replicas.linear.graphql({ query: 'query { viewer { id } }' })\`; the gateway refreshes expired credentials and retries authentication failures once.
23606
+
23607
+ Personal \u2192 Connections links a person's Linear identity for agent defaults and attribution. Its disconnected state does not mean the organization's Linear integration is disconnected, and connecting it does not refresh the organization's token. Only recommend reconnecting under Organization \u2192 Integrations when the gateway reports missing credentials or an unrecoverable OAuth failure. Report transient failures without asking the user to disconnect.
23608
+
23609
+ ## Create a ticket
23610
+
23611
+ Fetch \`query { teams { nodes { id name key } } }\` and choose the requested team's ID. Look up IDs for any requested assignee, state, cycle, or labels rather than inventing them.
23612
+
23613
+ \`\`\`ts
23614
+ const created = await replicas.linear.graphql({
23615
+ query: \`mutation($input: IssueCreateInput!) {
23616
+ issueCreate(input: $input) { success issue { id identifier title url } }
23617
+ }\`,
23618
+ variables: { input: { teamId, title, description } },
23619
+ });
23620
+ \`\`\`
23621
+
23622
+ Responses retain Linear's GraphQL \`data\` and \`errors\` fields. Check \`errors\` and \`data.issueCreate.success\` before reporting creation, then return the issue URL. After an ambiguous timeout, search for the issue before retrying creation to avoid duplicates.
23623
+
23599
23624
  ## Fetch an issue
23600
23625
 
23601
23626
  \`\`\`ts
@@ -23629,12 +23654,24 @@ await replicas.linear.graphql({
23629
23654
 
23630
23655
  Search with \`containsIgnoreCase: $query\` filters, for example on both \`title\` and \`description\`. Batch independent queries with \`Promise.all\` to save round trips.
23631
23656
 
23657
+ ## Older workspaces without the SDK
23658
+
23659
+ If \`@replicas/sdk\` cannot be imported, use the same refresh-capable gateway with workspace authentication. Send the GraphQL JSON request on stdin:
23660
+
23661
+ \`\`\`bash
23662
+ curl -sS --fail-with-body -X POST "$REPLICAS_MONOLITH_URL/v1/engine/linear/graphql" \\
23663
+ -H "Authorization: Bearer $REPLICAS_ENGINE_SECRET" \\
23664
+ -H "X-Workspace-Id: $REPLICAS_WORKSPACE_ID" \\
23665
+ -H "Content-Type: application/json" \\
23666
+ --data-binary @-
23667
+ \`\`\`
23668
+
23632
23669
  For screenshots, recordings, diagrams, or other media, read \`references/MEDIA.md\` before adding it to an issue or comment. It is the single source of truth for uploading the Replicas copy and the raw file to Linear; a dashboard link alone is not an inline attachment.
23633
23670
  `;
23634
23671
  var LINEAR_ABILITY = {
23635
23672
  label: "Linear",
23636
- description: "Fetch issues, comment, and update state through @replicas/sdk.",
23637
- bullet: "- Interacting with Linear (fetching issues, updating state, commenting, etc.)",
23673
+ description: "Create tickets, fetch issues, comment, and update state through @replicas/sdk.",
23674
+ bullet: "- Interacting with Linear (creating tickets, fetching issues, updating state, commenting, or troubleshooting authentication): use replicas.linear.graphql from @replicas/sdk, which refreshes tokens automatically and needs no Linear MCP server. Read references/LINEAR.md before treating a rejected workspace token as a disconnected integration.",
23638
23675
  section: SECTION5,
23639
23676
  referenceFile: { name: "LINEAR.md", content: REFERENCE5 }
23640
23677
  };
@@ -23797,36 +23834,25 @@ A Slack message that just contains a \`replicas.dev\` link is not acceptable whe
23797
23834
 
23798
23835
  Slack deprecated the single-shot \`files.upload\` endpoint. The raw HTTP replacement is a 3-step flow: reserve an upload URL with \`files.getUploadURLExternal\`, POST the bytes to it, then share into the channel/thread with \`files.completeUploadExternal\`. (\`files.uploadV2\` is **only** an SDK convenience wrapper \u2014 it is NOT a real Web API HTTP endpoint and \`POST https://slack.com/api/files.uploadV2\` will return \`unknown_method\`.)
23799
23836
 
23800
- \`\`\`bash
23801
- FILE=/abs/path/to/screenshot.png
23802
- FILENAME=$(basename "$FILE")
23803
- LENGTH=$(stat -c%s "$FILE" 2>/dev/null || stat -f%z "$FILE")
23804
-
23805
- # 1. Reserve an upload URL + file ID.
23806
- RESERVE=$(curl -s -G "https://slack.com/api/files.getUploadURLExternal" \\
23807
- -H "Authorization: Bearer \${REPLICAS_SLACK_BOT_TOKEN:-$SLACK_BOT_TOKEN}" \\
23808
- --data-urlencode "filename=$FILENAME" \\
23809
- --data-urlencode "length=$LENGTH")
23810
- UPLOAD_URL=$(echo "$RESERVE" | jq -r '.upload_url')
23811
- FILE_ID=$(echo "$RESERVE" | jq -r '.file_id')
23812
-
23813
- # 2. POST the raw bytes to the reserved URL.
23814
- # Do not use -F / multipart here \u2014 the presigned URL expects the bytes
23815
- # directly in the request body.
23816
- curl -s -X POST "$UPLOAD_URL" \\
23817
- -H "Content-Type: application/octet-stream" \\
23818
- --data-binary @"$FILE"
23837
+ \`\`\`ts
23838
+ import { replicas } from '@replicas/sdk';
23819
23839
 
23820
- # 3. Complete the upload, sharing it into the channel/thread with the dashboard link.
23821
- curl -s -X POST "https://slack.com/api/files.completeUploadExternal" \\
23822
- -H "Authorization: Bearer \${REPLICAS_SLACK_BOT_TOKEN:-$SLACK_BOT_TOKEN}" \\
23823
- -H "Content-Type: application/json; charset=utf-8" \\
23824
- -d "{
23825
- \\"files\\": [{\\"id\\": \\"$FILE_ID\\", \\"title\\": \\"Screenshot\\"}],
23826
- \\"channel_id\\": \\"CHANNEL_ID\\",
23827
- \\"thread_ts\\": \\"THREAD_TS\\",
23828
- \\"initial_comment\\": \\"<https://replicas.dev/workspaces/<workspace-id>?media=<media-id>|View in Replicas>\\"
23829
- }"
23840
+ const file = Bun.file('/abs/path/to/screenshot.png');
23841
+ const reservation = await replicas.slack.call<{ upload_url: string; file_id: string }>(
23842
+ 'files.getUploadURLExternal', { filename: 'screenshot.png', length: file.size },
23843
+ );
23844
+ const uploaded = await fetch(reservation.upload_url, {
23845
+ method: 'POST',
23846
+ headers: { 'Content-Type': 'application/octet-stream' },
23847
+ body: file,
23848
+ });
23849
+ if (!uploaded.ok) throw new Error('Slack file upload failed');
23850
+ await replicas.slack.call('files.completeUploadExternal', {
23851
+ files: [{ id: reservation.file_id, title: 'Screenshot' }],
23852
+ channel_id: 'CHANNEL_ID',
23853
+ thread_ts: 'THREAD_TS',
23854
+ initial_comment: '<https://replicas.dev/workspaces/<workspace-id>?media=<media-id>|View in Replicas>',
23855
+ });
23830
23856
  \`\`\`
23831
23857
 
23832
23858
  Notes:
@@ -27174,7 +27200,7 @@ var headlessFilesystemAgentResultSchema = external_exports.object({
27174
27200
  });
27175
27201
 
27176
27202
  // ../shared/src/cli-version.ts
27177
- var CLI_VERSION = "0.2.617";
27203
+ var CLI_VERSION = "0.2.619";
27178
27204
 
27179
27205
  // ../shared/src/version.ts
27180
27206
  function compareVersions(v1, v2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.2.617",
3
+ "version": "0.2.619",
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": {