replicas-cli 0.3.407 → 0.3.409

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 +29 -7
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -23309,7 +23309,7 @@ var init_workspace_attention = __esm({
23309
23309
  });
23310
23310
 
23311
23311
  // ../shared/src/routes/push.ts
23312
- var registerPushDeviceRequestSchema, PUSH_HOLD_MINUTES, recordPushActivityRequestSchema, PUSH_NOTIFICATION_KINDS, PUSH_OPTION_LABEL_MAX, PUSH_OPTIONS_MAX, pushQuestionSchema, pushNotificationDataSchema, workspaceSharedPushDataSchema, registerLiveActivityRequestSchema, setLiveActivityStartTokenRequestSchema;
23312
+ var registerPushDeviceRequestSchema, PUSH_HOLD_MINUTES, chatRefSchema, recordPushActivityRequestSchema, PUSH_NOTIFICATION_KINDS, PUSH_OPTION_LABEL_MAX, PUSH_OPTIONS_MAX, pushQuestionSchema, pushNotificationDataSchema, workspaceSharedPushDataSchema, registerLiveActivityRequestSchema, syncLiveActivitiesRequestSchema, setLiveActivityStartTokenRequestSchema;
23313
23313
  var init_push = __esm({
23314
23314
  "../shared/src/routes/push.ts"() {
23315
23315
  "use strict";
@@ -23329,12 +23329,13 @@ var init_push = __esm({
23329
23329
  })
23330
23330
  ]);
23331
23331
  PUSH_HOLD_MINUTES = 5;
23332
+ chatRefSchema = external_exports.object({ workspaceId: external_exports.string().uuid(), chatId: external_exports.string().min(1).max(100) });
23332
23333
  recordPushActivityRequestSchema = external_exports.object({
23333
23334
  organizationId: external_exports.string().uuid(),
23334
23335
  /** Seconds since the last keyboard or mouse input on this computer. A phone leaves it out: it only reports what it has open. */
23335
23336
  idleSeconds: external_exports.number().min(0).optional(),
23336
23337
  seenWorkspaceIds: external_exports.array(external_exports.string().uuid()).max(20),
23337
- seenChats: external_exports.array(external_exports.object({ workspaceId: external_exports.string().uuid(), chatId: external_exports.string().min(1).max(100) })).max(20).optional()
23338
+ seenChats: external_exports.array(chatRefSchema).max(20).optional()
23338
23339
  });
23339
23340
  PUSH_NOTIFICATION_KINDS = [...WORKSPACE_ATTENTION_REASONS, "finished"];
23340
23341
  PUSH_OPTION_LABEL_MAX = 60;
@@ -23350,15 +23351,16 @@ var init_push = __esm({
23350
23351
  question: pushQuestionSchema.optional()
23351
23352
  });
23352
23353
  workspaceSharedPushDataSchema = pushNotificationDataSchema.pick({ organizationId: true, workspaceId: true, chatId: true, completedAt: true }).extend({ kind: external_exports.literal("shared") });
23353
- registerLiveActivityRequestSchema = external_exports.object({
23354
+ registerLiveActivityRequestSchema = chatRefSchema.extend({
23354
23355
  deviceId: external_exports.string().uuid(),
23355
- workspaceId: external_exports.string().uuid(),
23356
- chatId: external_exports.string().min(1).max(100),
23357
23356
  /** The iOS activity's push token. Android leaves it out and gets FCM data messages on the device token. */
23358
23357
  pushToken: external_exports.string().regex(/^[0-9a-f]{64,400}$/i).optional(),
23359
23358
  /** iOS only: when the card's turn started, in seconds. Cards keep their order by it. */
23360
23359
  startedAt: external_exports.number().positive().optional()
23361
23360
  });
23361
+ syncLiveActivitiesRequestSchema = external_exports.object({
23362
+ activities: external_exports.array(chatRefSchema).max(100)
23363
+ });
23362
23364
  setLiveActivityStartTokenRequestSchema = external_exports.object({ token: external_exports.string().regex(/^[0-9a-f]{64,400}$/i) });
23363
23365
  }
23364
23366
  });
@@ -26583,7 +26585,23 @@ Check every mutation and tool call succeeded. Never put routing metadata in visi
26583
26585
  });
26584
26586
 
26585
26587
  // ../shared/src/message-origin.ts
26588
+ function parseAutomationRun(raw) {
26589
+ const match = raw.match(AUTOMATION_RUN);
26590
+ if (!match) return null;
26591
+ let run2;
26592
+ try {
26593
+ run2 = JSON.parse(match[1]);
26594
+ } catch {
26595
+ return null;
26596
+ }
26597
+ if (!isRecord(run2) || typeof run2.id !== "string" || typeof run2.name !== "string") return null;
26598
+ const rest = raw.slice(match[0].length);
26599
+ const body = stripReplicasInstructionBlock(rest.replace(SCHEDULED_FOLLOW_UP, ""));
26600
+ return { kind: "automation", id: run2.id, name: run2.name, body, ...typeof run2.firedAt === "string" ? { firedAt: run2.firedAt } : {} };
26601
+ }
26586
26602
  function parseMessageOrigin(raw) {
26603
+ const run2 = parseAutomationRun(raw);
26604
+ if (run2) return run2;
26587
26605
  const workspace = raw.match(WORKSPACE_SENDER);
26588
26606
  if (workspace) {
26589
26607
  let name;
@@ -26599,15 +26617,18 @@ function parseMessageOrigin(raw) {
26599
26617
  const automation2 = raw.match(SCHEDULED_FOLLOW_UP);
26600
26618
  return automation2 ? { kind: "automation", id: automation2[2], name: automation2[1].trim(), body: stripReplicasInstructionBlock(raw.slice(automation2[0].length)) } : null;
26601
26619
  }
26602
- var UUID, WORKSPACE_SENDER, BOARD_ANSWER, SCHEDULED_NOTE, SCHEDULED_FOLLOW_UP;
26620
+ var UUID, WORKSPACE_SENDER, BOARD_ANSWER, AUTOMATION_RUN_PREFIX, AUTOMATION_RUN, SCHEDULED_NOTE, SCHEDULED_FOLLOW_UP;
26603
26621
  var init_message_origin = __esm({
26604
26622
  "../shared/src/message-origin.ts"() {
26605
26623
  "use strict";
26606
26624
  init_prompts();
26625
+ init_type_guards();
26607
26626
  init_uuid();
26608
26627
  UUID = UUID_RE.source.slice(1, -1);
26609
26628
  WORKSPACE_SENDER = new RegExp(String.raw`^\s*<${REPLICAS_INSTRUCTIONS_TAG}>\nFrom the workspace ("(?:[^"\\\n]|\\.)*") \((${UUID})\)\.\n</${REPLICAS_INSTRUCTIONS_TAG}>`);
26610
26629
  BOARD_ANSWER = new RegExp(String.raw`^\s*(?:<${REPLICAS_INSTRUCTIONS_TAG}>\nFrom [^\n]*\n</${REPLICAS_INSTRUCTIONS_TAG}>\s*)?<${REPLICAS_INSTRUCTIONS_TAG}>\n${BOARD_ANSWER_NOTE.replace(/\./g, "\\.")}\n</${REPLICAS_INSTRUCTIONS_TAG}>`);
26630
+ AUTOMATION_RUN_PREFIX = "Automation run: ";
26631
+ AUTOMATION_RUN = new RegExp(String.raw`^\s*(?:<${REPLICAS_INSTRUCTIONS_TAG}>\n[^\n]*\n</${REPLICAS_INSTRUCTIONS_TAG}>\s*)*?<${REPLICAS_INSTRUCTIONS_TAG}>\n${AUTOMATION_RUN_PREFIX}(\{[^\n]*\})\n</${REPLICAS_INSTRUCTIONS_TAG}>`);
26611
26632
  SCHEDULED_NOTE = "This is a message you or a teammate scheduled earlier, delivered into this workspace.";
26612
26633
  SCHEDULED_FOLLOW_UP = new RegExp(String.raw`^\s*\*\*Scheduled follow-up: ([^\n]+)\*\*\n\nThe automation "[^\n]*" \((${UUID})\) fired at \S+\. ${SCHEDULED_NOTE.replace(/\./g, "\\.")}`);
26613
26634
  }
@@ -37937,7 +37958,7 @@ var CLI_VERSION;
37937
37958
  var init_cli_version = __esm({
37938
37959
  "../shared/src/cli-version.ts"() {
37939
37960
  "use strict";
37940
- CLI_VERSION = "0.3.407";
37961
+ CLI_VERSION = "0.3.409";
37941
37962
  }
37942
37963
  });
37943
37964
 
@@ -38798,6 +38819,7 @@ var init_workspace_events = __esm({
38798
38819
  type: external_exports.literal("workspace.changed"),
38799
38820
  workspaceId: external_exports.string(),
38800
38821
  accessChangedFor: external_exports.string().optional(),
38822
+ accessChangedForOrg: external_exports.literal(true).optional(),
38801
38823
  workspace: external_exports.object({ status: external_exports.enum(WORKSPACE_STATUSES), last_activity_at: external_exports.string().nullable() }).optional(),
38802
38824
  name: external_exports.string().optional(),
38803
38825
  completion: workspaceTurnCompletionSchema.optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.407",
3
+ "version": "0.3.409",
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": {