replicas-cli 0.2.618 → 0.2.620

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 +63 -34
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -7785,6 +7785,7 @@ var CREDENTIAL_SCOPE_PRIORITY = [CREDENTIAL_SCOPE.USER, CREDENTIAL_SCOPE.ORG];
7785
7785
  var CREDENTIAL_METHOD = {
7786
7786
  OAUTH: "oauth",
7787
7787
  API_KEY: "api_key",
7788
+ OPENAI_COMPATIBLE: "openai-compatible",
7788
7789
  FOUNDRY: "foundry",
7789
7790
  BEDROCK: "bedrock",
7790
7791
  OPENCODE_GO: "opencode-go",
@@ -7800,6 +7801,7 @@ var CREDENTIAL_TYPE = {
7800
7801
  CLAUDE_BEDROCK: "claude_bedrock",
7801
7802
  CODEX_OAUTH: "codex",
7802
7803
  OPENAI_API_KEY: "openai_api_key",
7804
+ OPENAI_COMPATIBLE: "openai_compatible",
7803
7805
  CODEX_FOUNDRY: "codex_foundry",
7804
7806
  CURSOR_API_KEY: "cursor_api_key",
7805
7807
  OPENCODE_GO_API_KEY: "opencode_go_api_key",
@@ -7823,6 +7825,7 @@ var AGENT_CREDENTIAL_METHODS_IN_ORDER = {
7823
7825
  [AGENT.CODEX]: [
7824
7826
  { method: CREDENTIAL_METHOD.OAUTH, credentialType: CREDENTIAL_TYPE.CODEX_OAUTH },
7825
7827
  { method: CREDENTIAL_METHOD.API_KEY, credentialType: CREDENTIAL_TYPE.OPENAI_API_KEY },
7828
+ { method: CREDENTIAL_METHOD.OPENAI_COMPATIBLE, credentialType: CREDENTIAL_TYPE.OPENAI_COMPATIBLE },
7826
7829
  { method: CREDENTIAL_METHOD.FOUNDRY, credentialType: CREDENTIAL_TYPE.CODEX_FOUNDRY }
7827
7830
  ],
7828
7831
  [AGENT.CURSOR]: [
@@ -23575,18 +23578,24 @@ var GITLAB_ABILITY = {
23575
23578
 
23576
23579
  // ../shared/src/default-skills/replicas-agent/abilities/linear.ts
23577
23580
  var SECTION5 = `### Linear
23578
- Fetch issues, update state, add comments, and search through the workspace-scoped TypeScript SDK.
23581
+ 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
23582
 
23580
23583
  **Reference:** \`references/LINEAR.md\`
23581
23584
 
23582
23585
  Use this when:
23586
+ - You need to create a Linear ticket or issue
23583
23587
  - You encounter a Linear issue link and need to understand the task
23584
23588
  - You need to update an issue's state or add a comment
23585
- - You need to search Linear issues`;
23589
+ - You need to search Linear issues
23590
+ - A Linear request failed with an authentication error`;
23586
23591
  var REFERENCE5 = `# Linear Integration
23587
23592
 
23588
23593
  Use \`@replicas/sdk\`; never request or handle a Linear OAuth token. Replicas refreshes the organization credential behind the gateway.
23589
23594
 
23595
+ 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.
23596
+
23597
+ Download protected attachments with \`await replicas.linear.download(url)\`; this returns a \`Response\` without exposing the provider token.
23598
+
23590
23599
  ## Check access
23591
23600
 
23592
23601
  \`\`\`ts
@@ -23596,6 +23605,25 @@ const { native } = await replicas.integrations.list();
23596
23605
  if (!native.linear) throw new Error('Connect Linear in Replicas organization integrations first.');
23597
23606
  \`\`\`
23598
23607
 
23608
+ \`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.
23609
+
23610
+ 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.
23611
+
23612
+ ## Create a ticket
23613
+
23614
+ 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.
23615
+
23616
+ \`\`\`ts
23617
+ const created = await replicas.linear.graphql({
23618
+ query: \`mutation($input: IssueCreateInput!) {
23619
+ issueCreate(input: $input) { success issue { id identifier title url } }
23620
+ }\`,
23621
+ variables: { input: { teamId, title, description } },
23622
+ });
23623
+ \`\`\`
23624
+
23625
+ 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.
23626
+
23599
23627
  ## Fetch an issue
23600
23628
 
23601
23629
  \`\`\`ts
@@ -23629,12 +23657,24 @@ await replicas.linear.graphql({
23629
23657
 
23630
23658
  Search with \`containsIgnoreCase: $query\` filters, for example on both \`title\` and \`description\`. Batch independent queries with \`Promise.all\` to save round trips.
23631
23659
 
23660
+ ## Older workspaces without the SDK
23661
+
23662
+ If \`@replicas/sdk\` cannot be imported, use the same refresh-capable gateway with workspace authentication. Send the GraphQL JSON request on stdin:
23663
+
23664
+ \`\`\`bash
23665
+ curl -sS --fail-with-body -X POST "$REPLICAS_MONOLITH_URL/v1/engine/linear/graphql" \\
23666
+ -H "Authorization: Bearer $REPLICAS_ENGINE_SECRET" \\
23667
+ -H "X-Workspace-Id: $REPLICAS_WORKSPACE_ID" \\
23668
+ -H "Content-Type: application/json" \\
23669
+ --data-binary @-
23670
+ \`\`\`
23671
+
23632
23672
  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
23673
  `;
23634
23674
  var LINEAR_ABILITY = {
23635
23675
  label: "Linear",
23636
- description: "Fetch issues, comment, and update state through @replicas/sdk.",
23637
- bullet: "- Interacting with Linear (fetching issues, updating state, commenting, etc.)",
23676
+ description: "Create tickets, fetch issues, comment, and update state through @replicas/sdk.",
23677
+ 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
23678
  section: SECTION5,
23639
23679
  referenceFile: { name: "LINEAR.md", content: REFERENCE5 }
23640
23680
  };
@@ -23797,36 +23837,25 @@ A Slack message that just contains a \`replicas.dev\` link is not acceptable whe
23797
23837
 
23798
23838
  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
23839
 
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"
23840
+ \`\`\`ts
23841
+ import { replicas } from '@replicas/sdk';
23819
23842
 
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
- }"
23843
+ const file = Bun.file('/abs/path/to/screenshot.png');
23844
+ const reservation = await replicas.slack.call<{ upload_url: string; file_id: string }>(
23845
+ 'files.getUploadURLExternal', { filename: 'screenshot.png', length: file.size },
23846
+ );
23847
+ const uploaded = await fetch(reservation.upload_url, {
23848
+ method: 'POST',
23849
+ headers: { 'Content-Type': 'application/octet-stream' },
23850
+ body: file,
23851
+ });
23852
+ if (!uploaded.ok) throw new Error('Slack file upload failed');
23853
+ await replicas.slack.call('files.completeUploadExternal', {
23854
+ files: [{ id: reservation.file_id, title: 'Screenshot' }],
23855
+ channel_id: 'CHANNEL_ID',
23856
+ thread_ts: 'THREAD_TS',
23857
+ initial_comment: '<https://replicas.dev/workspaces/<workspace-id>?media=<media-id>|View in Replicas>',
23858
+ });
23830
23859
  \`\`\`
23831
23860
 
23832
23861
  Notes:
@@ -27174,7 +27203,7 @@ var headlessFilesystemAgentResultSchema = external_exports.object({
27174
27203
  });
27175
27204
 
27176
27205
  // ../shared/src/cli-version.ts
27177
- var CLI_VERSION = "0.2.618";
27206
+ var CLI_VERSION = "0.2.620";
27178
27207
 
27179
27208
  // ../shared/src/version.ts
27180
27209
  function compareVersions(v1, v2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.2.618",
3
+ "version": "0.2.620",
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": {