replicas-cli 0.2.109 → 0.2.112

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.
@@ -7595,6 +7595,9 @@ function removeReplicasInstructions(text) {
7595
7595
  return removeTag(text, REPLICAS_INSTRUCTIONS_TAG);
7596
7596
  }
7597
7597
 
7598
+ // ../shared/src/event.ts
7599
+ var CODEX_QUOTA_STATUS_EVENT_TYPE = "codex-quota-status";
7600
+
7598
7601
  // ../shared/src/display-message/parsers/codex-parser.ts
7599
7602
  function safeJsonParse(str, fallback) {
7600
7603
  try {
@@ -7671,6 +7674,22 @@ function parseCodexEvents(events) {
7671
7674
  const pendingCommands = /* @__PURE__ */ new Map();
7672
7675
  const pendingPatches = /* @__PURE__ */ new Map();
7673
7676
  events.forEach((event, eventIndex) => {
7677
+ if (event.type === CODEX_QUOTA_STATUS_EVENT_TYPE) {
7678
+ const state = event.payload?.state;
7679
+ if (state) {
7680
+ messages.push({
7681
+ id: `codex-quota-${event.timestamp}-${eventIndex}`,
7682
+ type: "quota_status",
7683
+ provider: "codex",
7684
+ state,
7685
+ balance: event.payload?.balance ?? null,
7686
+ rateLimitResetType: event.payload?.rateLimitResetType ?? null,
7687
+ planType: event.payload?.planType ?? null,
7688
+ timestamp: event.timestamp
7689
+ });
7690
+ }
7691
+ return;
7692
+ }
7674
7693
  if (event.type === "event_msg" && event.payload?.type === "user_message") {
7675
7694
  messages.push({
7676
7695
  id: `user-${event.timestamp}-${eventIndex}`,
@@ -8353,6 +8372,75 @@ var ENTERPRISE_PLAN = PLANS.enterprise;
8353
8372
  var WORKSPACE_FILE_UPLOAD_MAX_SIZE_BYTES = 20 * 1024 * 1024;
8354
8373
  var WORKSPACE_FILE_CONTENT_MAX_SIZE_BYTES = 1 * 1024 * 1024;
8355
8374
 
8375
+ // ../shared/src/user-message-parser/plan-quote.ts
8376
+ var MARKER_PREFIX = "> _Quoting from plan_";
8377
+ var MARKER_LINE_REGEX = /^> _Quoting from plan_ `([^`\n]+)`\s*$/;
8378
+ function hasPlanQuoteMarker(content) {
8379
+ return content.includes(MARKER_PREFIX);
8380
+ }
8381
+ function parsePlanQuote(content) {
8382
+ if (!hasPlanQuoteMarker(content)) return null;
8383
+ const lines = content.split("\n");
8384
+ const blocks = [];
8385
+ const leadingBuffer = [];
8386
+ let currentFilename = null;
8387
+ let quoteBuffer = [];
8388
+ let replyBuffer = [];
8389
+ let inQuoteBody = false;
8390
+ const flushCurrentBlock = () => {
8391
+ if (currentFilename !== null) {
8392
+ blocks.push({
8393
+ planFilename: currentFilename,
8394
+ quotedText: trimBlankEdges(quoteBuffer).join("\n"),
8395
+ replyText: trimBlankEdges(replyBuffer).join("\n")
8396
+ });
8397
+ }
8398
+ currentFilename = null;
8399
+ quoteBuffer = [];
8400
+ replyBuffer = [];
8401
+ inQuoteBody = false;
8402
+ };
8403
+ for (const line of lines) {
8404
+ const markerMatch = line.match(MARKER_LINE_REGEX);
8405
+ if (markerMatch) {
8406
+ flushCurrentBlock();
8407
+ currentFilename = markerMatch[1].trim();
8408
+ inQuoteBody = true;
8409
+ continue;
8410
+ }
8411
+ if (currentFilename !== null) {
8412
+ if (inQuoteBody && isBlockquoteLine(line)) {
8413
+ quoteBuffer.push(stripBlockquotePrefix(line));
8414
+ continue;
8415
+ }
8416
+ inQuoteBody = false;
8417
+ replyBuffer.push(line);
8418
+ continue;
8419
+ }
8420
+ leadingBuffer.push(line);
8421
+ }
8422
+ flushCurrentBlock();
8423
+ if (blocks.length === 0) return null;
8424
+ return {
8425
+ source: "plan_quote",
8426
+ blocks,
8427
+ leadingText: trimBlankEdges(leadingBuffer).join("\n")
8428
+ };
8429
+ }
8430
+ function isBlockquoteLine(line) {
8431
+ return line.startsWith(">");
8432
+ }
8433
+ function stripBlockquotePrefix(line) {
8434
+ return line.replace(/^>\s?/, "");
8435
+ }
8436
+ function trimBlankEdges(lines) {
8437
+ let start = 0;
8438
+ let end = lines.length;
8439
+ while (start < end && lines[start].trim() === "") start++;
8440
+ while (end > start && lines[end - 1].trim() === "") end--;
8441
+ return lines.slice(start, end);
8442
+ }
8443
+
8356
8444
  // ../shared/src/user-message-parser/parsers.ts
8357
8445
  function parseCIFailure(content) {
8358
8446
  if (!content.startsWith("# CI/CD Workflow Failed")) return null;
@@ -8616,7 +8704,7 @@ function parseAutomationTriggered(content) {
8616
8704
  }
8617
8705
  function parseUserMessage(rawContent) {
8618
8706
  const content = removeReplicasInstructions(rawContent).trim();
8619
- return parseCIFailure(content) ?? parseGitHubIssueNew(content) ?? parseGitHubIssueExisting(content) ?? parseGitHubPRNew(content) ?? parseGitHubPRExistingPRReview(content) ?? parseGitHubPRExistingReview(content) ?? parseGitHubPRExistingGeneral(content) ?? parseSlackTask(content) ?? parseLinearIssue(content) ?? parseAutomationTriggered(content) ?? { source: "raw", content };
8707
+ return parseCIFailure(content) ?? parseGitHubIssueNew(content) ?? parseGitHubIssueExisting(content) ?? parseGitHubPRNew(content) ?? parseGitHubPRExistingPRReview(content) ?? parseGitHubPRExistingReview(content) ?? parseGitHubPRExistingGeneral(content) ?? parseSlackTask(content) ?? parseLinearIssue(content) ?? parseAutomationTriggered(content) ?? parsePlanQuote(content) ?? { source: "raw", content };
8620
8708
  }
8621
8709
 
8622
8710
  // ../shared/src/user-message-parser/source-config.ts
@@ -8630,7 +8718,8 @@ var SOURCE_CONFIG = {
8630
8718
  github_pr_existing_pr_review: { label: "PR Review", color: "#8b949e" },
8631
8719
  github_pr_existing_general: { label: "GitHub PR", color: "#8b949e" },
8632
8720
  slack_task: { label: "Slack", color: "#BF6CC2" },
8633
- automation_triggered: { label: "Automation", color: "#f59e0b" }
8721
+ automation_triggered: { label: "Automation", color: "#f59e0b" },
8722
+ plan_quote: { label: "Plan", color: "#66bb6a" }
8634
8723
  };
8635
8724
 
8636
8725
  export {
package/dist/index.mjs CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  setIdeCommand,
17
17
  setOrganizationId,
18
18
  writeConfig
19
- } from "./chunk-2MBBSXEG.mjs";
19
+ } from "./chunk-RQNT5UE5.mjs";
20
20
 
21
21
  // src/index.ts
22
22
  import "dotenv/config";
@@ -2505,12 +2505,12 @@ async function interactiveCommand() {
2505
2505
  );
2506
2506
  }
2507
2507
  console.log(chalk18.gray("Starting interactive mode..."));
2508
- const { launchInteractive } = await import("./interactive-QL3HHCQS.mjs");
2508
+ const { launchInteractive } = await import("./interactive-QMXFBQSH.mjs");
2509
2509
  await launchInteractive();
2510
2510
  }
2511
2511
 
2512
2512
  // src/index.ts
2513
- var CLI_VERSION = "0.2.109";
2513
+ var CLI_VERSION = "0.2.112";
2514
2514
  var program = new Command();
2515
2515
  program.name("replicas").description("CLI for managing Replicas workspaces").version(CLI_VERSION);
2516
2516
  program.command("login").description("Authenticate with your Replicas account").action(async () => {
@@ -12,7 +12,7 @@ import {
12
12
  isAgentBackendEvent,
13
13
  parseAgentEvents,
14
14
  parseUserMessage
15
- } from "./chunk-2MBBSXEG.mjs";
15
+ } from "./chunk-RQNT5UE5.mjs";
16
16
 
17
17
  // src/interactive/index.tsx
18
18
  import { createCliRenderer } from "@opentui/core";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.2.109",
3
+ "version": "0.2.112",
4
4
  "description": "CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding",
5
5
  "main": "dist/index.mjs",
6
6
  "bin": {