replicas-cli 0.3.418 → 0.3.420

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 +87 -72
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -21404,30 +21404,89 @@ var init_pull_requests = __esm({
21404
21404
  }
21405
21405
  });
21406
21406
 
21407
+ // ../shared/src/routes/linear.ts
21408
+ var linearSessionMetadataSchema, LINEAR_WORKFLOW_STATE_TYPES;
21409
+ var init_linear = __esm({
21410
+ "../shared/src/routes/linear.ts"() {
21411
+ "use strict";
21412
+ init_zod();
21413
+ init_agent();
21414
+ linearSessionMetadataSchema = external_exports.object({
21415
+ via_mothership: external_exports.boolean().optional(),
21416
+ attached: external_exports.boolean().optional(),
21417
+ routing_chat_id: external_exports.string().optional(),
21418
+ issue_id: external_exports.string(),
21419
+ issue_identifier: external_exports.string(),
21420
+ issue_title: external_exports.string(),
21421
+ issue_description: external_exports.string(),
21422
+ issue_url: external_exports.string(),
21423
+ comment_id: external_exports.string(),
21424
+ comment_body: external_exports.string(),
21425
+ triggered_by_id: external_exports.string().optional(),
21426
+ triggered_by_name: external_exports.string().optional(),
21427
+ triggered_by_email: external_exports.string().optional(),
21428
+ linear_workspace_id: external_exports.string().optional(),
21429
+ creator_id: external_exports.string().optional(),
21430
+ creator_name: external_exports.string().optional(),
21431
+ creator_email: external_exports.string().optional(),
21432
+ assignee_id: external_exports.string().optional(),
21433
+ assignee_name: external_exports.string().optional(),
21434
+ assignee_email: external_exports.string().optional(),
21435
+ issue_state: external_exports.string().optional(),
21436
+ parent_issue: external_exports.object({
21437
+ id: external_exports.string(),
21438
+ identifier: external_exports.string(),
21439
+ title: external_exports.string(),
21440
+ description: external_exports.string().nullable()
21441
+ }).optional(),
21442
+ workspace: external_exports.object({
21443
+ id: external_exports.string(),
21444
+ coding_agent: external_exports.custom((value) => typeof value === "string" && isValidAgentProvider(value)),
21445
+ task_description: external_exports.string(),
21446
+ created_at: external_exports.string()
21447
+ }).optional()
21448
+ });
21449
+ LINEAR_WORKFLOW_STATE_TYPES = ["triage", "backlog", "unstarted", "started", "completed", "canceled", "duplicate"];
21450
+ }
21451
+ });
21452
+
21453
+ // ../shared/src/automations/linear/index.ts
21454
+ var LINEAR_ISSUE_STATE_CHANGED_EVENT, LINEAR_ISSUE_MATCHED_EVENT, linearIssueFiltersSchema, LINEAR_STATE_TYPES;
21455
+ var init_linear2 = __esm({
21456
+ "../shared/src/automations/linear/index.ts"() {
21457
+ "use strict";
21458
+ init_zod();
21459
+ init_linear();
21460
+ LINEAR_ISSUE_STATE_CHANGED_EVENT = "issue.state_changed";
21461
+ LINEAR_ISSUE_MATCHED_EVENT = "issue.matched";
21462
+ linearIssueFiltersSchema = external_exports.object({
21463
+ current_cycle: external_exports.boolean().optional(),
21464
+ label_ids: external_exports.array(external_exports.string().min(1)).min(1).optional(),
21465
+ project_id: external_exports.string().min(1).optional(),
21466
+ assignee_id: external_exports.string().min(1).optional()
21467
+ });
21468
+ LINEAR_STATE_TYPES = LINEAR_WORKFLOW_STATE_TYPES.filter((type) => type !== "duplicate");
21469
+ }
21470
+ });
21471
+
21407
21472
  // ../shared/src/routes/mothership.ts
21408
- var linearRuleFields, withLabelIds, mothershipLinearRuleSchema, storedMothershipLinearRuleSchema, SUBAGENT_SERVICE_TIERS, mothershipSubagentSettingsSchema, QUEUE_SECTIONS, MOTHERSHIP_QUEUE_GROUPS, MOTHERSHIP_SHIPPING_LOOKBACK_MS;
21473
+ var linearRuleFields, withLabelIds, mothershipLinearRuleSchema, SUBAGENT_SERVICE_TIERS, mothershipSubagentSettingsSchema, QUEUE_SECTIONS, MOTHERSHIP_QUEUE_GROUPS, MOTHERSHIP_SHIPPING_LOOKBACK_MS;
21409
21474
  var init_mothership = __esm({
21410
21475
  "../shared/src/routes/mothership.ts"() {
21411
21476
  "use strict";
21412
21477
  init_zod();
21413
21478
  init_agent();
21414
21479
  init_pull_requests();
21480
+ init_linear2();
21415
21481
  init_type_guards();
21416
21482
  init_urls();
21417
- linearRuleFields = external_exports.object({
21418
- team_id: external_exports.string().min(1),
21419
- current_cycle: external_exports.boolean().optional(),
21420
- label_ids: external_exports.array(external_exports.string().min(1)).min(1).optional(),
21421
- project_id: external_exports.string().min(1).optional(),
21422
- assignee_id: external_exports.string().min(1).optional()
21423
- }).strict();
21483
+ linearRuleFields = linearIssueFiltersSchema.extend({ team_id: external_exports.string().min(1) }).strict();
21424
21484
  withLabelIds = (value) => {
21425
21485
  if (!isRecord(value) || typeof value.label_id !== "string") return value;
21426
21486
  const { label_id, ...rest } = value;
21427
21487
  return { ...rest, label_ids: [label_id] };
21428
21488
  };
21429
21489
  mothershipLinearRuleSchema = external_exports.preprocess(withLabelIds, linearRuleFields);
21430
- storedMothershipLinearRuleSchema = external_exports.preprocess(withLabelIds, linearRuleFields.extend({ linked_at: external_exports.string() }));
21431
21490
  SUBAGENT_SERVICE_TIERS = ["default", "fast", "ultrafast"];
21432
21491
  mothershipSubagentSettingsSchema = external_exports.object({
21433
21492
  coding_agent: external_exports.enum(VALID_AGENT_PROVIDERS),
@@ -22763,63 +22822,6 @@ var init_pr_footer = __esm({
22763
22822
  }
22764
22823
  });
22765
22824
 
22766
- // ../shared/src/routes/linear.ts
22767
- var linearSessionMetadataSchema, LINEAR_WORKFLOW_STATE_TYPES;
22768
- var init_linear = __esm({
22769
- "../shared/src/routes/linear.ts"() {
22770
- "use strict";
22771
- init_zod();
22772
- init_agent();
22773
- linearSessionMetadataSchema = external_exports.object({
22774
- via_mothership: external_exports.boolean().optional(),
22775
- attached: external_exports.boolean().optional(),
22776
- routing_chat_id: external_exports.string().optional(),
22777
- issue_id: external_exports.string(),
22778
- issue_identifier: external_exports.string(),
22779
- issue_title: external_exports.string(),
22780
- issue_description: external_exports.string(),
22781
- issue_url: external_exports.string(),
22782
- comment_id: external_exports.string(),
22783
- comment_body: external_exports.string(),
22784
- triggered_by_id: external_exports.string().optional(),
22785
- triggered_by_name: external_exports.string().optional(),
22786
- triggered_by_email: external_exports.string().optional(),
22787
- linear_workspace_id: external_exports.string().optional(),
22788
- creator_id: external_exports.string().optional(),
22789
- creator_name: external_exports.string().optional(),
22790
- creator_email: external_exports.string().optional(),
22791
- assignee_id: external_exports.string().optional(),
22792
- assignee_name: external_exports.string().optional(),
22793
- assignee_email: external_exports.string().optional(),
22794
- issue_state: external_exports.string().optional(),
22795
- parent_issue: external_exports.object({
22796
- id: external_exports.string(),
22797
- identifier: external_exports.string(),
22798
- title: external_exports.string(),
22799
- description: external_exports.string().nullable()
22800
- }).optional(),
22801
- workspace: external_exports.object({
22802
- id: external_exports.string(),
22803
- coding_agent: external_exports.custom((value) => typeof value === "string" && isValidAgentProvider(value)),
22804
- task_description: external_exports.string(),
22805
- created_at: external_exports.string()
22806
- }).optional()
22807
- });
22808
- LINEAR_WORKFLOW_STATE_TYPES = ["triage", "backlog", "unstarted", "started", "completed", "canceled", "duplicate"];
22809
- }
22810
- });
22811
-
22812
- // ../shared/src/automations/linear/index.ts
22813
- var LINEAR_ISSUE_STATE_CHANGED_EVENT, LINEAR_STATE_TYPES;
22814
- var init_linear2 = __esm({
22815
- "../shared/src/automations/linear/index.ts"() {
22816
- "use strict";
22817
- init_linear();
22818
- LINEAR_ISSUE_STATE_CHANGED_EVENT = "issue.state_changed";
22819
- LINEAR_STATE_TYPES = LINEAR_WORKFLOW_STATE_TYPES.filter((type) => type !== "duplicate");
22820
- }
22821
- });
22822
-
22823
22825
  // ../shared/src/uuid.ts
22824
22826
  var UUID_RE;
22825
22827
  var init_uuid = __esm({
@@ -22905,7 +22907,13 @@ var init_trigger_schemas = __esm({
22905
22907
  })
22906
22908
  });
22907
22909
  gitlabTriggerSchema = external_exports.object({ type: external_exports.literal("gitlab"), config: repositoryTriggerConfigSchema });
22908
- linearTriggerConfigSchema = external_exports.object({ event: external_exports.string(), team_ids: external_exports.array(external_exports.string()).optional(), state_types: external_exports.array(external_exports.enum(LINEAR_STATE_TYPES)).optional() });
22910
+ linearTriggerConfigSchema = linearIssueFiltersSchema.extend({
22911
+ event: external_exports.string(),
22912
+ team_ids: external_exports.array(external_exports.string()).optional(),
22913
+ state_types: external_exports.array(external_exports.enum(LINEAR_STATE_TYPES)).optional()
22914
+ }).superRefine((config3, ctx) => {
22915
+ if (config3.event === LINEAR_ISSUE_MATCHED_EVENT && config3.team_ids?.length !== 1) ctx.addIssue({ code: "custom", message: "The Linear issue matches trigger needs exactly one team", path: ["team_ids"] });
22916
+ });
22909
22917
  automationTriggerSchema = external_exports.discriminatedUnion("type", [
22910
22918
  cronTriggerSchema,
22911
22919
  githubTriggerSchema,
@@ -23383,7 +23391,8 @@ Use this when:
23383
23391
  - A task requires interacting with a website, web app, or desktop application that has no usable API
23384
23392
  - You want the user to watch the agent work - they can open the \`Desktop\` tab, or you can share the URL from \`replicas computer info\`
23385
23393
  - You're testing UI changes in a browser before reporting them as done
23386
- - You want to record a screen capture of a task as proof to share back`;
23394
+ - You want to record a screen capture of a task as proof to share back
23395
+ - You need to open or use an app on the user's Mac: use \`replicas computer mac\`, never \`ssh\` with \`open\` or AppleScript, which can switch the user's view`;
23387
23396
  REFERENCE = `# Computer use (Linux desktop control)
23388
23397
 
23389
23398
  Every Replicas workspace boots with a full Linux desktop stack - Xvfb (1920\xD71080), openbox, tint2, PulseAudio, ffmpeg, and Google Chrome. The engine auto-registers the H.264 and Opus viewer (port 6080) as an authenticated preview at startup, so the dashboard \`Desktop\` tab is live the moment the workspace is up. You drive the desktop through the \`replicas computer\` CLI.
@@ -24701,7 +24710,7 @@ var init_local_computer = __esm({
24701
24710
  "../shared/src/default-skills/replicas-agent/abilities/local-computer.ts"() {
24702
24711
  "use strict";
24703
24712
  SECTION8 = `### The user's computer
24704
- Run commands on the user's own Mac or Linux computer over \`ssh <name>\`, such as an Xcode build, a simulator, or a tool that only exists there. Your instructions name the computers this workspace can reach, either through the desktop app's local control or as devices. With none, ask the user for theirs with \`replicas local-control request\`.
24713
+ Run commands on the user's own Mac or Linux computer over \`ssh <name>\`, such as an Xcode build, a simulator, or a tool that only exists there. Your instructions name the computers this workspace can reach, either through the desktop app's local control or as devices. With none, ask the user for theirs with \`replicas local-control request\`. To open or use an app on their Mac, use \`replicas computer mac\` instead (\`references/COMPUTER-USE.md\`), so the user's view never switches.
24705
24714
 
24706
24715
  **Reference:** \`references/LOCAL-COMPUTER.md\`
24707
24716
 
@@ -24724,7 +24733,13 @@ replicas local-control request --reason "Build and run the iOS app in the Simula
24724
24733
 
24725
24734
  It asks the user above the chat composer to let this workspace use their computer and to open the desktop app, waits until their computer connects, and prints its name. If it stops waiting first, end your turn and say what you need the computer for; you get a message when the user answers.
24726
24735
 
24727
- It is a personal machine with the user's files, accounts and running apps. Change only what the task needs, keep your files in one folder, and ask before anything destructive, slow to undo, or visible on their screen (opening apps, booting a simulator window, changing settings).
24736
+ It is a personal machine with the user's files, accounts and running apps. Change only what the task needs, keep your files in one folder, and ask before anything destructive, slow to undo, or visible on their screen (bringing an app to the front, booting a simulator window, changing settings).
24737
+
24738
+ ## Apps on a Mac: use \`replicas computer mac\`, not \`ssh\`
24739
+
24740
+ To open or use an app (launch it, click, type, play music, read its window), use \`replicas computer mac\` (see \`references/COMPUTER-USE.md\`). It keeps the app in the background, so the user's front window and focus stay theirs, and the user sees what you do in Replicas. It takes no host: it drives the Mac connected through the desktop app (a \`desktop-*\` host). When you're working on a different computer, ask the user before using it. \`open\`, \`osascript\` and other commands over \`ssh\` can bring an app to the front and switch the user's view, and they don't show up in Replicas.
24741
+
24742
+ Use \`ssh\` when it makes more sense: files, shell commands, builds, the Simulator through \`xcrun simctl\`, and quick read-only checks (\`osascript\` asking an app what it is doing) that change nothing on screen.
24728
24743
 
24729
24744
  ## Running commands
24730
24745
 
@@ -24781,7 +24796,7 @@ ssh mac 'xcodebuild -version; xcrun simctl list runtimes; xcrun simctl list devi
24781
24796
  LOCAL_COMPUTER_ABILITY = {
24782
24797
  label: "User's computer",
24783
24798
  description: "Run commands, builds and simulators on the user's own Mac or Linux computer over `ssh`.",
24784
- bullet: "- Running commands on the user's own computer (`ssh <name>`), such as a local Xcode build or the iOS Simulator",
24799
+ bullet: "- Running commands on the user's own computer (`ssh <name>`), such as a local Xcode build or the iOS Simulator, or opening and using an app on their Mac in the background (`replicas computer mac`, never `ssh` with `open` or AppleScript)",
24785
24800
  section: SECTION8,
24786
24801
  referenceFile: { name: "LOCAL-COMPUTER.md", content: REFERENCE8 }
24787
24802
  };
@@ -38350,7 +38365,7 @@ var CLI_VERSION;
38350
38365
  var init_cli_version = __esm({
38351
38366
  "../shared/src/cli-version.ts"() {
38352
38367
  "use strict";
38353
- CLI_VERSION = "0.3.418";
38368
+ CLI_VERSION = "0.3.420";
38354
38369
  }
38355
38370
  });
38356
38371
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.418",
3
+ "version": "0.3.420",
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": {