replicas-engine 0.1.1633 → 0.1.1634

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.
@@ -12547,7 +12547,7 @@ var LINEAR_ICON_DEFINITION = {
12547
12547
  };
12548
12548
 
12549
12549
  // ../shared/src/replicas-mcp.ts
12550
- import { z as z24 } from "zod";
12550
+ import { z as z27 } from "zod";
12551
12551
 
12552
12552
  // ../shared/src/automations/types.ts
12553
12553
  var AUTOMATION_DEBOUNCE_MAX_SECONDS = 24 * 60 * 60;
@@ -12568,746 +12568,69 @@ var AUTOMATION_AUTO_PAUSE_DAYS = 7;
12568
12568
  var AUTOMATION_AUTO_PAUSE_LABEL = `Paused after failing every run for ${AUTOMATION_AUTO_PAUSE_DAYS} days`;
12569
12569
 
12570
12570
  // ../shared/src/routes/environment-config-source.ts
12571
- import { z as z23 } from "zod";
12571
+ import { z as z26 } from "zod";
12572
12572
 
12573
12573
  // ../shared/src/environment-config.ts
12574
+ import { z as z25 } from "zod";
12575
+
12576
+ // ../shared/src/routes/preferences.ts
12577
+ import { z as z24 } from "zod";
12578
+
12579
+ // ../shared/src/routes/push.ts
12574
12580
  import { z as z22 } from "zod";
12575
12581
 
12576
- // ../shared/src/environment-files.ts
12577
- var HOME_PREFIX = "~/";
12578
- var ENVIRONMENT_FILE_PATH_GUIDANCE = "Use ~/... for home-directory files, or ~/workspaces/... for files that should live alongside your cloned repositories.";
12579
- function validateEnvironmentFilePath(path) {
12580
- const trimmedPath = path.trim();
12581
- if (!trimmedPath) {
12582
- return "Path is required.";
12583
- }
12584
- if (!trimmedPath.startsWith(HOME_PREFIX)) {
12585
- return `Path must start with the home-directory prefix ~/ . ${ENVIRONMENT_FILE_PATH_GUIDANCE}`.replace("~/ .", "~/");
12586
- }
12587
- if (trimmedPath === HOME_PREFIX) {
12588
- return "Path must include a file name after ~/.";
12589
- }
12590
- return null;
12591
- }
12582
+ // ../shared/src/workspace-attention.ts
12583
+ var WORKSPACE_ATTENTION_REASONS = ["question", "plan", "variables", "blocked", "setup", "deploy_failed"];
12584
+ var CHAT_ATTENTION_REASONS = ["question", "blocked"];
12592
12585
 
12593
- // ../shared/src/routes/plugin-catalog.ts
12594
- var EXPLICIT_PLUGIN_CATALOG = [
12595
- {
12596
- id: "attio",
12597
- backend: "composio",
12598
- toolkit: "attio",
12599
- authType: "oauth",
12600
- category: "business",
12601
- name: "Attio",
12602
- description: "Manage CRM records, people, companies, lists, and notes."
12603
- },
12604
- {
12605
- id: "calendly",
12606
- backend: "composio",
12607
- toolkit: "calendly",
12608
- authType: "oauth",
12609
- category: "productivity",
12610
- name: "Calendly",
12611
- description: "Manage event types, scheduled events, invitees, and scheduling links."
12612
- },
12613
- {
12614
- id: "clickhouse",
12615
- backend: "composio",
12616
- toolkit: "clickhouse",
12617
- authType: "basic",
12618
- category: "data",
12619
- name: "ClickHouse",
12620
- description: "Manage databases, tables, schemas, and queries."
12621
- },
12622
- {
12623
- id: "cloudflare",
12624
- backend: "composio",
12625
- toolkit: "cloudflare_api_key",
12626
- authType: "api_key",
12627
- category: "data",
12628
- name: "Cloudflare",
12629
- description: "Manage zones, DNS records, analytics, and security settings."
12630
- },
12631
- {
12632
- id: "e2b",
12633
- toolkit: "e2b",
12634
- backend: "native",
12635
- authType: "api_key",
12636
- category: "data",
12637
- name: "E2B",
12638
- description: "Create secure cloud sandboxes and run commands in them."
12639
- },
12640
- {
12641
- id: "gmail",
12642
- backend: "composio",
12643
- toolkit: "gmail",
12644
- authType: "oauth",
12645
- category: "productivity",
12646
- name: "Gmail",
12647
- description: "Manage messages, threads, attachments, labels, and mailbox settings."
12648
- },
12649
- {
12650
- id: "greptile",
12651
- backend: "native",
12652
- toolkit: "greptile",
12653
- authType: "api_key",
12654
- category: "data",
12655
- name: "Greptile Knowledge Base",
12656
- description: "Search and read self-updating codebase documentation, architecture, and flows."
12657
- },
12658
- {
12659
- id: "googleads",
12660
- backend: "composio",
12661
- toolkit: "googleads",
12662
- authType: "oauth",
12663
- category: "data",
12664
- name: "Google Ads",
12665
- description: "Manage campaigns, customers, accounts, and reporting data."
12666
- },
12667
- {
12668
- id: "googledocs",
12669
- backend: "composio",
12670
- toolkit: "googledocs",
12671
- authType: "oauth",
12672
- category: "productivity",
12673
- name: "Google Docs",
12674
- description: "Manage documents, structure, comments, and exported content."
12675
- },
12676
- {
12677
- id: "googledrive",
12678
- backend: "composio",
12679
- toolkit: "googledrive",
12680
- authType: "oauth",
12681
- category: "productivity",
12682
- name: "Google Drive",
12683
- description: "Manage files, folders, metadata, permissions, and shared drives."
12684
- },
12685
- {
12686
- id: "googlesearch",
12687
- backend: "composio",
12688
- toolkit: "google_search_console",
12689
- authType: "oauth",
12690
- category: "data",
12691
- name: "Google Search",
12692
- description: "Manage Search Console performance, indexing, sites, and sitemaps."
12693
- },
12694
- {
12695
- id: "googlesheets",
12696
- backend: "composio",
12697
- toolkit: "googlesheets",
12698
- authType: "oauth",
12699
- category: "productivity",
12700
- name: "Google Sheets",
12701
- description: "Manage spreadsheets, worksheets, ranges, tables, and charts."
12702
- },
12703
- {
12704
- id: "linkedin",
12705
- backend: "composio",
12706
- toolkit: "linkedin",
12707
- authType: "oauth",
12708
- category: "business",
12709
- name: "LinkedIn",
12710
- description: "Manage profiles, organizations, posts, and professional activity."
12711
- },
12712
- {
12713
- id: "modal",
12714
- backend: "native",
12715
- toolkit: "modal",
12716
- authType: "basic",
12717
- category: "data",
12718
- name: "Modal",
12719
- description: "Invoke deployed functions through Modal compute."
12720
- },
12721
- {
12722
- id: "posthog",
12723
- backend: "composio",
12724
- toolkit: "posthog",
12725
- authType: "api_key",
12726
- category: "data",
12727
- name: "PostHog",
12728
- description: "Manage projects, events, insights, dashboards, flags, and recordings."
12729
- },
12730
- {
12731
- id: "planetscale",
12732
- toolkit: "planetscale",
12733
- backend: "native",
12734
- authType: "oauth",
12735
- category: "data",
12736
- name: "PlanetScale",
12737
- description: "Manage organizations, databases, branches, deploy requests, and Insights."
12738
- },
12739
- {
12740
- id: "sazabi",
12741
- backend: "native",
12742
- toolkit: "sazabi",
12743
- authType: "oauth",
12744
- category: "data",
12745
- name: "Sazabi",
12746
- description: "Query logs, investigate issues, and run the Sazabi observability agent."
12747
- },
12748
- {
12749
- id: "stripe",
12750
- backend: "composio",
12751
- toolkit: "stripe",
12752
- authType: "oauth",
12753
- category: "business",
12754
- name: "Stripe",
12755
- description: "Manage customers, payments, invoices, subscriptions, and balances."
12756
- },
12757
- {
12758
- id: "kondo",
12759
- backend: "native",
12760
- toolkit: "kondo",
12761
- authType: "oauth",
12762
- category: "business",
12763
- name: "Kondo",
12764
- description: "Manage LinkedIn chats, labels, reminders, drafts, connections, and invites."
12765
- },
12766
- {
12767
- id: "lightfield",
12768
- backend: "native",
12769
- toolkit: "lightfield",
12770
- authType: "api_key",
12771
- category: "business",
12772
- name: "Lightfield",
12773
- description: "Manage CRM accounts, contacts, opportunities, meetings, notes, and tasks."
12774
- },
12775
- {
12776
- id: "pangram",
12777
- backend: "native",
12778
- toolkit: "pangram",
12779
- authType: "api_key",
12780
- category: "data",
12781
- name: "Pangram",
12782
- description: "Analyze text for AI generation and plagiarism signals."
12783
- },
12784
- {
12785
- id: "vercel",
12786
- backend: "native",
12787
- toolkit: "vercel",
12788
- authType: "api_key",
12789
- category: "data",
12790
- name: "Vercel",
12791
- description: "Manage projects, deployments, logs, domains, and infrastructure."
12792
- },
12793
- {
12794
- id: "turbopuffer",
12795
- backend: "native",
12796
- toolkit: "turbopuffer",
12797
- authType: "api_key",
12798
- category: "data",
12799
- name: "turbopuffer",
12800
- description: "Query and manage turbopuffer namespaces."
12801
- },
12802
- {
12803
- id: "vanta",
12804
- backend: "native",
12805
- toolkit: "vanta",
12806
- authType: "credentials",
12807
- category: "data",
12808
- name: "Vanta",
12809
- description: "Review and manage controls, tests, evidence, vendors, risks, and compliance data."
12810
- }
12811
- ];
12812
- var HOSTED_COMPOSIO_PLUGIN_DEFINITIONS = [
12813
- ["notion", "notion", "OAUTH2", true, "productivity", "Notion"],
12814
- ["jira", "jira", "OAUTH2", true, "productivity", "Jira"],
12815
- ["confluence", "confluence", "OAUTH2", true, "productivity", "Confluence"],
12816
- ["googlecalendar", "googlecalendar", "OAUTH2", true, "productivity", "Google Calendar"],
12817
- ["microsoftteams", "microsoft_teams", "OAUTH2", true, "productivity", "Microsoft Teams"],
12818
- ["outlook", "outlook", "OAUTH2", true, "productivity", "Outlook"],
12819
- ["bitbucket", "bitbucket", "OAUTH2", true, "data", "Bitbucket"],
12820
- ["datadog", "datadog", "API_KEY", false, "data", "Datadog"],
12821
- ["pagerduty", "pagerduty", "OAUTH2", true, "data", "PagerDuty"],
12822
- ["intercom", "intercom", "OAUTH2", true, "business", "Intercom"],
12823
- ["zendesk", "zendesk", "OAUTH2", true, "business", "Zendesk"],
12824
- ["hubspot", "hubspot", "OAUTH2", true, "business", "HubSpot"],
12825
- ["supabase", "supabase", "OAUTH2", true, "data", "Supabase"],
12826
- ["figma", "figma", "OAUTH2", true, "productivity", "Figma"],
12827
- ["launchdarkly", "launch_darkly", "API_KEY", false, "data", "LaunchDarkly"],
12828
- ["asana", "asana", "OAUTH2", true, "productivity", "Asana"],
12829
- ["clickup", "clickup", "OAUTH2", true, "productivity", "ClickUp"],
12830
- ["trello", "trello", "OAUTH1", true, "productivity", "Trello"],
12831
- ["todoist", "todoist", "OAUTH2", true, "productivity", "Todoist"],
12832
- ["airtable", "airtable", "OAUTH2", true, "productivity", "Airtable"],
12833
- ["coda", "coda", "API_KEY", false, "productivity", "Coda"],
12834
- ["miro", "miro", "OAUTH2", true, "productivity", "Miro"],
12835
- ["sharepoint", "share_point", "OAUTH2", true, "productivity", "SharePoint"],
12836
- ["onedrive", "one_drive", "OAUTH2", true, "productivity", "OneDrive"],
12837
- ["googleslides", "googleslides", "OAUTH2", true, "productivity", "Google Slides"],
12838
- ["googlemeet", "googlemeet", "OAUTH2", true, "productivity", "Google Meet"],
12839
- ["circleback", "circleback_mcp", "DCR_OAUTH", false, "productivity", "Circleback"],
12840
- ["granola", "granola_mcp", "DCR_OAUTH", false, "productivity", "Granola"],
12841
- ["mercury", "mercury_mcp", "DCR_OAUTH", false, "business", "Mercury"],
12842
- ["googletasks", "googletasks", "OAUTH2", true, "productivity", "Google Tasks"],
12843
- ["dropbox", "dropbox", "OAUTH2", true, "productivity", "Dropbox"],
12844
- ["box", "box", "OAUTH2", true, "productivity", "Box"],
12845
- ["discord", "discord", "OAUTH2", true, "productivity", "Discord"],
12846
- ["discordbot", "discordbot", "OAUTH2", true, "productivity", "Discord Bot"],
12847
- ["zoom", "zoom", "OAUTH2", true, "productivity", "Zoom"],
12848
- ["googlechat", "google_chat", "OAUTH2", false, "productivity", "Google Chat"],
12849
- ["newrelic", "new_relic", "API_KEY", false, "data", "New Relic"],
12850
- ["betterstack", "better_stack", "API_KEY", false, "data", "Better Stack"],
12851
- ["incidentio", "incident_io", "API_KEY", false, "data", "incident.io"],
12852
- ["grafana", "grafana", "BEARER_TOKEN", false, "data", "Grafana"],
12853
- ["honeycomb", "honeycomb_mcp", "DCR_OAUTH", false, "data", "Honeycomb MCP"],
12854
- ["neon", "neon_mcp", "DCR_OAUTH", false, "data", "Neon"],
12855
- ["glen", "glen_mcp", "DCR_OAUTH", false, "data", "Glen"],
12856
- ["bugsnag", "bugsnag", "API_KEY", false, "data", "Bugsnag"],
12857
- ["circleci", "circleci", "API_KEY", false, "data", "CircleCI"],
12858
- ["buildkite", "buildkite", "API_KEY", false, "data", "Buildkite"],
12859
- ["dockerhub", "docker_hub", "API_KEY", false, "data", "Docker Hub"],
12860
- ["digitalocean", "digital_ocean", "OAUTH2", true, "data", "DigitalOcean"],
12861
- ["railway", "railway", "API_KEY", false, "data", "Railway"],
12862
- ["render", "render", "API_KEY", false, "data", "Render"],
12863
- ["firebase", "firebase", "API_KEY", false, "data", "Firebase"],
12864
- ["cloudinary", "cloudinary", "API_KEY", false, "data", "Cloudinary"],
12865
- ["configcat", "configcat", "API_KEY", false, "data", "ConfigCat"],
12866
- ["contextdev", "context_dev", "API_KEY", false, "data", "Context.dev"],
12867
- ["googleanalytics", "google_analytics", "OAUTH2", true, "data", "Google Analytics"],
12868
- ["googlebigquery", "googlebigquery", "OAUTH2", true, "data", "Google BigQuery"],
12869
- ["amplitude", "amplitude", "API_KEY", false, "data", "Amplitude"],
12870
- ["mixpanel", "mixpanel", "BASIC", false, "data", "Mixpanel"],
12871
- ["segment", "segment", "API_KEY", false, "data", "Segment"],
12872
- ["supermemory", "supermemory", "API_KEY", false, "data", "Supermemory"],
12873
- ["databricks", "databricks", "API_KEY", false, "data", "Databricks"],
12874
- ["snowflake", "snowflake", "OAUTH2", false, "data", "Snowflake"],
12875
- ["algolia", "algolia", "API_KEY", false, "data", "Algolia"],
12876
- ["elasticsearch", "elasticsearch", "API_KEY", false, "data", "Elasticsearch"],
12877
- ["salesforce", "salesforce", "OAUTH2", true, "business", "Salesforce"],
12878
- ["pipedrive", "pipedrive", "API_KEY", false, "business", "Pipedrive"],
12879
- ["close", "close", "API_KEY", false, "business", "Close"],
12880
- ["apollo", "apollo", "API_KEY", false, "business", "Apollo"],
12881
- ["gong", "gong", "OAUTH2", true, "business", "Gong"],
12882
- ["freshdesk", "freshdesk", "API_KEY", false, "business", "Freshdesk"],
12883
- ["helpscout", "help_scout", "OAUTH2", false, "business", "Help Scout"],
12884
- ["servicenow", "servicenow", "BASIC", false, "business", "ServiceNow"],
12885
- ["mailchimp", "mailchimp", "OAUTH2", true, "business", "Mailchimp"],
12886
- ["customerio", "customerio", "API_KEY", false, "business", "Customer.io"],
12887
- ["klaviyo", "klaviyo", "API_KEY", false, "business", "Klaviyo"],
12888
- ["shopify", "shopify", "API_KEY", false, "business", "Shopify"],
12889
- ["quickbooks", "quickbooks", "OAUTH2", true, "business", "QuickBooks"],
12890
- ["xero", "xero", "OAUTH2", false, "business", "Xero"],
12891
- ["brex", "brex", "API_KEY", false, "business", "Brex"],
12892
- ["buffer", "buffer", "OAUTH2", false, "business", "Buffer"],
12893
- ["canva", "canva", "OAUTH2", true, "productivity", "Canva"],
12894
- ["webflow", "webflow", "API_KEY", false, "business", "Webflow"],
12895
- ["firecrawl", "firecrawl", "API_KEY", false, "data", "Firecrawl"],
12896
- ["browserbase", "browserbase_tool", "API_KEY", false, "data", "Browserbase"],
12897
- ["exa", "exa", "API_KEY", false, "data", "Exa"],
12898
- ["youtube", "youtube", "OAUTH2", true, "business", "YouTube"],
12899
- ["twitter", "twitter", "OAUTH2", false, "business", "Twitter/X"],
12900
- ["instagram", "instagram", "OAUTH2", true, "business", "Instagram"],
12901
- ["facebook", "facebook", "OAUTH2", true, "business", "Facebook"]
12902
- ];
12903
- var HOSTED_COMPOSIO_PLUGINS = HOSTED_COMPOSIO_PLUGIN_DEFINITIONS.map(
12904
- ([id, toolkit, authScheme, managedAuth, category, name]) => ({
12905
- id,
12906
- backend: "composio",
12907
- toolkit,
12908
- authType: "hosted",
12909
- authScheme,
12910
- managedAuth,
12911
- category,
12912
- name,
12913
- description: `Use ${name} tools from workspace agents.`
12586
+ // ../shared/src/routes/push.ts
12587
+ var registerPushDeviceRequestSchema = z22.discriminatedUnion("platform", [
12588
+ z22.object({
12589
+ platform: z22.literal("ios"),
12590
+ token: z22.string().regex(/^[0-9a-f]{64,200}$/i),
12591
+ appId: z22.string().min(1).max(255),
12592
+ apnsEnvironment: z22.enum(["sandbox", "production"])
12593
+ }),
12594
+ z22.object({
12595
+ platform: z22.literal("android"),
12596
+ token: z22.string().min(1).max(4096),
12597
+ appId: z22.string().min(1).max(255)
12914
12598
  })
12915
- );
12916
- var READ_ONLY_SCOPES = {
12917
- gmail: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/contacts.readonly", "https://www.googleapis.com/auth/contacts.other.readonly", "https://www.googleapis.com/auth/gmail.readonly"],
12918
- googledocs: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/drive.readonly", "https://www.googleapis.com/auth/documents.readonly"],
12919
- googledrive: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/drive.readonly"],
12920
- googlesheets: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/drive.readonly", "https://www.googleapis.com/auth/spreadsheets.readonly"],
12921
- googleslides: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/drive.readonly", "https://www.googleapis.com/auth/presentations.readonly"],
12922
- googlecalendar: ["https://www.googleapis.com/auth/calendar.readonly"],
12923
- googletasks: ["https://www.googleapis.com/auth/tasks.readonly"],
12924
- googlesearch: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/webmasters.readonly"],
12925
- googleanalytics: ["https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/analytics.readonly"],
12926
- youtube: ["https://www.googleapis.com/auth/youtube.readonly"],
12927
- outlook: ["User.Read", "Mail.Read", "MailboxSettings.Read", "Calendars.Read", "Contacts.Read", "offline_access"],
12928
- onedrive: ["Files.Read.All", "Sites.Read.All", "offline_access"],
12929
- microsoftteams: ["User.Read", "Team.ReadBasic.All", "Channel.ReadBasic.All", "ChannelMessage.Read.All", "Chat.Read", "Chat.ReadBasic", "ChatMessage.Read", "People.Read.All", "TeamsActivity.Read", "offline_access"],
12930
- jira: ["read:jira-work", "read:jira-user", "read:servicedesk-request", "read:servicemanagement-insight-objects", "read:sprint:jira-software", "read:board-scope:jira-software", "read:project:jira", "read:issue-type-scheme:jira", "offline_access"],
12931
- confluence: ["read:space-details:confluence", "read:audit-log:confluence", "read:page:confluence", "read:blogpost:confluence", "read:whiteboard:confluence", "read:comment:confluence", "read:content.restriction:confluence", "read:content.metadata:confluence", "read:inlinetask:confluence", "read:task:confluence", "offline_access"],
12932
- zendesk: ["read"],
12933
- gong: ["api:calls:read:basic", "api:calls:read:extensive", "api:calls:read:transcript", "api:calls:read:media-url", "api:users:read", "api:stats:interaction", "api:stats:scorecards", "api:stats:user-actions", "api:stats:user-actions:detailed", "api:settings:scorecards:read", "api:settings:trackers:read", "api:library:read", "api:tasks:read", "api:flows:read", "api:workspaces:read", "api:crm:get-objects", "api:crm:schema", "api:crm:integrations:read", "api:call-outcomes:read", "api:permission-profile:read", "api:logs:read"],
12934
- figma: ["current_user:read", "file_content:read", "file_comments:read", "file_metadata:read", "file_versions:read", "projects:read", "library_assets:read", "library_content:read", "team_library_content:read", "webhooks:read"],
12935
- airtable: ["data.records:read", "data.recordComments:read", "schema.bases:read", "user.email:read"],
12936
- todoist: ["data:read"],
12937
- dropbox: ["openid", "email", "profile", "account_info.read", "files.metadata.read", "files.content.read", "file_requests.read", "sharing.read", "contacts.read"],
12938
- canva: ["profile:read", "asset:read", "brandtemplate:content:read", "brandtemplate:meta:read", "comment:read", "design:content:read", "design:meta:read", "folder:read"],
12939
- facebook: ["public_profile", "email", "pages_show_list", "pages_read_engagement", "pages_read_user_content", "read_insights"],
12940
- instagram: ["instagram_business_basic", "instagram_business_manage_insights"]
12941
- };
12942
- var PLUGIN_CATALOG = [
12943
- ...EXPLICIT_PLUGIN_CATALOG,
12944
- ...HOSTED_COMPOSIO_PLUGINS
12945
- ].map((plugin) => ({ ...plugin, readOnlyScopes: READ_ONLY_SCOPES[plugin.id] }));
12946
-
12947
- // ../shared/src/routes/plugins.ts
12948
- function isPluginId(value) {
12949
- return PLUGIN_CATALOG.some((plugin) => plugin.id === value);
12950
- }
12951
-
12952
- // ../shared/src/environment-config.ts
12953
- var variableNameSchema = z22.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name");
12954
- var mcpValueSchema = z22.union([
12955
- z22.string(),
12956
- environmentMcpVariableReferenceSchema
12957
12599
  ]);
12958
- var mcpValuesSchema = z22.record(z22.string(), mcpValueSchema);
12959
- var httpConfigSchema = environmentMcpHttpConfigSchema.pick({ url: true, auth: true }).extend({
12960
- headers: mcpValuesSchema.default({})
12961
- }).strict();
12962
- var replicasMcpDefinitionSchema = z22.discriminatedUnion("transport", [
12963
- z22.strictObject({
12964
- transport: z22.literal("stdio"),
12965
- config: environmentMcpStdioConfigSchema.pick({ command: true }).extend({
12966
- args: environmentMcpStdioConfigSchema.shape.args.unwrap().default([]),
12967
- env: z22.record(variableNameSchema, mcpValueSchema).default({})
12968
- }).strict()
12969
- }),
12970
- z22.strictObject({ transport: z22.literal("http"), config: httpConfigSchema }),
12971
- z22.strictObject({ transport: z22.literal("sse"), config: httpConfigSchema })
12972
- ]).superRefine((definition, context) => {
12973
- if (definition.transport === "stdio") return;
12974
- const result = validateEnvironmentMcpAuthentication(definition.transport, definition.config);
12975
- if (!result.ok) context.addIssue({ code: "custom", path: result.error.code === "transport" ? ["transport"] : ["config", result.error.code ?? "auth"], message: result.error.message });
12600
+ var PUSH_HOLD_MINUTES = 5;
12601
+ var chatRefSchema = z22.object({ workspaceId: z22.string().uuid(), chatId: z22.string().min(1).max(100) });
12602
+ var recordPushActivityRequestSchema = z22.object({
12603
+ organizationId: z22.string().uuid(),
12604
+ /** Seconds since the last keyboard or mouse input on this computer. A phone leaves it out: it only reports what it has open. */
12605
+ idleSeconds: z22.number().min(0).optional(),
12606
+ seenWorkspaceIds: z22.array(z22.string().uuid()).max(20),
12607
+ seenChats: z22.array(chatRefSchema).max(20).optional()
12976
12608
  });
12977
- var replicasEnvironmentConfigSchema = z22.strictObject({
12978
- repositories: z22.array(z22.string().trim().min(1)).optional(),
12979
- workspaceSize: z22.enum(WORKSPACE_SIZE_OPTIONS).optional(),
12980
- files: z22.record(z22.string().trim().refine((path) => !validateEnvironmentFilePath(path), "must be a file path starting with ~/"), z22.strictObject({
12981
- name: z22.string().trim().min(1).optional(),
12982
- content: z22.string().max(65536)
12983
- })).optional(),
12984
- skills: z22.record(z22.string().trim().min(1), z22.strictObject({ source: z22.string().trim().min(1), name: z22.string().trim().min(1).optional() })).optional(),
12985
- requiredPlugins: z22.array(z22.string().refine(isPluginId, "must be a supported plugin")).transform((plugins) => [...new Set(plugins)]).optional(),
12986
- systemPrompt: z22.string().optional(),
12987
- warmHook: z22.string().optional(),
12988
- startHook: z22.string().optional(),
12989
- variables: z22.record(variableNameSchema, z22.string()).optional(),
12990
- requiredSecrets: z22.array(variableNameSchema).optional(),
12991
- mcps: z22.record(z22.string().regex(MCP_NAME_PATTERN, "must be 1\u201364 letters, digits, underscores or hyphens, starting with a letter or digit").refine((name) => !isReservedMcpName(name), "is reserved for Replicas"), replicasMcpDefinitionSchema).optional()
12992
- }).superRefine((config, context) => {
12993
- const skillNames = Object.keys(config.skills ?? {}).map((slug) => slug.toLowerCase());
12994
- if (new Set(skillNames).size !== skillNames.length) context.addIssue({ code: "custom", path: ["skills"], message: "Skill slugs must be unique regardless of case" });
12995
- const names = /* @__PURE__ */ new Set();
12996
- for (const name of Object.keys(config.mcps ?? {})) {
12997
- const normalized = name.toLowerCase();
12998
- if (names.has(normalized)) {
12999
- context.addIssue({ code: "custom", path: ["mcps", name], message: "MCP names must be unique regardless of case" });
13000
- }
13001
- names.add(normalized);
13002
- }
13003
- for (const key of config.requiredSecrets ?? []) {
13004
- if (config.variables && Object.hasOwn(config.variables, key)) {
13005
- context.addIssue({ code: "custom", path: ["requiredSecrets"], message: `"${key}" cannot also be declared as a non-secret variable` });
13006
- }
13007
- }
12609
+ var PUSH_NOTIFICATION_KINDS = [...WORKSPACE_ATTENTION_REASONS, "finished"];
12610
+ var PUSH_OPTION_LABEL_MAX = 60;
12611
+ var PUSH_OPTIONS_MAX = 4;
12612
+ var pushQuestionSchema = z22.object({ id: z22.string().max(64), allowCustom: z22.boolean().optional(), options: z22.array(z22.object({ id: z22.string().max(64), label: z22.string().min(1).max(PUSH_OPTION_LABEL_MAX) })).min(1).max(PUSH_OPTIONS_MAX) });
12613
+ var pushNotificationDataSchema = z22.object({
12614
+ organizationId: z22.string(),
12615
+ workspaceId: z22.string(),
12616
+ chatId: z22.string().nullable(),
12617
+ kind: z22.enum(PUSH_NOTIFICATION_KINDS),
12618
+ completedAt: z22.string(),
12619
+ toolRequestId: z22.string().optional(),
12620
+ question: pushQuestionSchema.optional()
13008
12621
  });
13009
-
13010
- // ../shared/src/routes/environment-config-source.ts
13011
- var environmentConfigLocationSchema = z23.union([
13012
- z23.object({
13013
- kind: z23.literal("git").default("git"),
13014
- entrypoint_filename: z23.string().optional(),
13015
- repository_id: z23.string(),
13016
- repository_name: z23.string(),
13017
- filename: z23.string(),
13018
- commit_sha: z23.string(),
13019
- source_url: z23.string(),
13020
- file_sha: z23.undefined().optional()
13021
- }),
13022
- z23.object({
13023
- kind: z23.literal("file"),
13024
- repository_id: z23.null(),
13025
- repository_name: z23.null(),
13026
- filename: z23.string(),
13027
- commit_sha: z23.null(),
13028
- source_url: z23.null(),
13029
- file_sha: z23.string()
13030
- })
13031
- ]);
13032
- var sourceInput = {
13033
- repository_id: z23.string().min(1).optional(),
13034
- file: z23.strictObject({ filename: z23.string().min(1).max(1024), environment: replicasEnvironmentConfigSchema }).optional()
13035
- };
13036
- var previewEnvironmentConfigSourceRequestSchema = z23.strictObject(sourceInput).refine(
13037
- (input) => !input.file || !input.repository_id,
13038
- { message: "Choose either a repository or a file" }
13039
- );
13040
- var applyEnvironmentConfigSourceRequestSchema = z23.strictObject({
13041
- ...sourceInput,
13042
- commit_sha: z23.string().min(1).optional(),
13043
- fingerprint: z23.string().min(1)
13044
- }).refine((input) => input.file ? !input.repository_id && !input.commit_sha : !!input.commit_sha, {
13045
- message: "File configuration requires file contents; Git configuration requires a reviewed commit"
12622
+ var workspaceSharedPushDataSchema = pushNotificationDataSchema.pick({ organizationId: true, workspaceId: true, chatId: true, completedAt: true }).extend({ kind: z22.literal("shared") });
12623
+ var registerLiveActivityRequestSchema = chatRefSchema.extend({
12624
+ deviceId: z22.string().uuid(),
12625
+ /** The iOS activity's push token. Android leaves it out and gets FCM data messages on the device token. */
12626
+ pushToken: z22.string().regex(/^[0-9a-f]{64,400}$/i).optional(),
12627
+ /** iOS only: when the card's turn started, in seconds. Cards keep their order by it. */
12628
+ startedAt: z22.number().positive().optional()
13046
12629
  });
13047
-
13048
- // ../shared/src/replicas-mcp.ts
13049
- var REPLICAS_MCP_SERVER_NAME = "replicas-mcp";
13050
- var REPLICAS_MCP_TOOLS = {
13051
- listEnvironments: "list_environments",
13052
- createAutomation: "create_automation",
13053
- spawn: "spawn_workspace",
13054
- spawnInNewThread: "spawn_workspace_in_new_thread",
13055
- relay: "relay_to_workspace",
13056
- listWorkspaces: "list_workspaces",
13057
- linearStart: "start_linear_session",
13058
- linearSessionIntent: "register_linear_session_intent",
13059
- routeLinearTicket: "route_linear_ticket",
13060
- listChannelSettings: "list_channel_settings",
13061
- saveChannelPreset: "save_channel_preset",
13062
- deleteChannelPreset: "delete_channel_preset",
13063
- updateChannelSettings: "update_channel_settings",
13064
- setOrganizationProactivity: "set_organization_proactivity",
13065
- setSlackAgentDefaults: "set_slack_agent_defaults",
13066
- claimSettingsOffer: "claim_settings_offer",
13067
- setThreadMuted: "set_thread_muted",
13068
- stopWorkspace: "stop_workspace",
13069
- setSlackConnectMuted: "set_slack_connect_muted",
13070
- setSlackConnectDefaults: "set_slack_connect_defaults",
13071
- spawnSubagent: "spawn_subagent",
13072
- messageSubagent: "message_subagent",
13073
- listSubagents: "list_subagents",
13074
- readSubagent: "read_subagent",
13075
- archiveSubagent: "archive_subagent",
13076
- mergeWhenReady: "merge_when_ready",
13077
- waitForSubagents: "wait_for_subagents",
13078
- getBoard: "get_board",
13079
- updateBoard: "update_board",
13080
- updateTicket: "update_ticket",
13081
- replyOnTicket: "reply_on_ticket",
13082
- sendToChat: "send_to_chat",
13083
- setStatus: "set_status",
13084
- getLinearRouting: "get_linear_routing",
13085
- setLinearRouting: "set_linear_routing",
13086
- clearLinearRouting: "clear_linear_routing",
13087
- getSlackChannel: "get_slack_channel",
13088
- linkSlackChannel: "link_slack_channel",
13089
- createSlackChannel: "create_slack_channel",
13090
- unlinkSlackChannel: "unlink_slack_channel",
13091
- setSlackChannelLevel: "set_slack_channel_level",
13092
- createReplica: "create_replica",
13093
- listReplicas: "list_replicas",
13094
- getReplica: "get_replica",
13095
- deleteReplica: "delete_replica",
13096
- wakeReplica: "wake_replica",
13097
- sleepReplica: "sleep_replica",
13098
- archiveReplica: "archive_replica",
13099
- waitForReplica: "wait_for_replica",
13100
- runCommand: "run_command",
13101
- getReplicaHooks: "get_replica_hooks",
13102
- whoami: "whoami",
13103
- sendReplicaMessage: "send_replica_message",
13104
- readReplicaHistory: "read_replica_history",
13105
- listChats: "list_chats",
13106
- createChat: "create_chat",
13107
- deleteChat: "delete_chat",
13108
- listRepositories: "list_repositories"
13109
- };
13110
- var automationToolInputSchema = z24.object({
13111
- name: z24.string().describe("Short automation name."),
13112
- prompt: z24.string().describe("Prompt each automation run starts with."),
13113
- environment_id: z24.string().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`.`),
13114
- triggers: z24.array(automationTriggerSchema).min(1).describe(
13115
- `One or more triggers. Cron: \`{ "type": "cron", "config": { "schedule": "0 9 * * 1", "timezone": "America/New_York" } }\`. GitHub: \`{ "type": "github", "config": { "event": "pull_request.opened", "repository_ids": ["<repository uuid>"] } }\`. Linear: \`{ "type": "linear", "config": { "event": "${LINEAR_ISSUE_STATE_CHANGED_EVENT}", "state_types": ["completed"] } }\`.`
13116
- ),
13117
- description: z24.string().optional().describe("One-line summary shown in the dashboard."),
13118
- plan_mode: z24.boolean().optional(),
13119
- goal_mode: z24.boolean().optional(),
13120
- fast_mode: z24.boolean().optional(),
13121
- workspace_lifecycle_policy: z24.enum(AUTOMATION_LIFECYCLE_POLICIES).optional().describe(
13122
- "What happens to a run's workspace when the agent finishes. `delete_when_done` (default, except one-time runs, which default to `default`) when the output lives elsewhere (PR comments, checks, Slack posts); `sleep_when_done` when later runs reuse the workspace, like one per PR across pushes; `default` (keep alive) when people follow up in the workspace."
13123
- )
12630
+ var syncLiveActivitiesRequestSchema = z22.object({
12631
+ activities: z22.array(chatRefSchema).max(100)
13124
12632
  });
13125
- var credentialUserIdDescription = `Organization automations only: the user ID (see \`${REPLICAS_MCP_TOOLS.whoami}\`) of the member whose coding agent credentials, such as their Claude subscription, runs use before the organization's. Only your workspace's owner, or whoever's credentials this workspace runs on.`;
13126
- var automationBackgroundSchema = z24.boolean().optional().describe(
13127
- "Marks this as an AI agent's own automation (a reminder, follow-up or recurring check-in for its task). Kept out of the main automations list."
13128
- );
13129
- var automationCreateToolInputSchema = automationToolInputSchema.extend({
13130
- credential_user_id: z24.string().optional().describe(`${credentialUserIdDescription} Omit to use the organization's.`),
13131
- background: automationBackgroundSchema,
13132
- scope: z24.enum(["org", "user"]).optional().describe("`org` (default) or `user` for a personal automation, which needs a personal API key.")
13133
- });
13134
- var automationUpdateToolInputSchema = automationToolInputSchema.partial().extend({
13135
- automation_id: z24.string().describe("Automation ID"),
13136
- enabled: z24.boolean().optional(),
13137
- agent_provider: z24.enum(ENGINE_AGENT_PROVIDERS).nullable().optional(),
13138
- model: z24.string().nullable().optional(),
13139
- thinking_level: z24.enum(VALID_THINKING_LEVELS).nullable().optional(),
13140
- workspace_size: z24.enum(WORKSPACE_SIZES).optional(),
13141
- credential_user_id: z24.string().nullable().optional().describe(`${credentialUserIdDescription} Null switches back to the organization's.`),
13142
- background: automationBackgroundSchema,
13143
- scope: z24.literal("org").optional().describe("`org` moves a personal automation to the organization so teammates can see and edit it. It cannot be moved back.")
13144
- });
13145
- var chatPath = { id: z24.string().describe("Workspace ID"), chat_id: z24.string().describe("Chat ID") };
13146
- var { provider, model, thinkingLevel, title, message } = forkChatRequestSchema.shape;
13147
- var createChatToolInputSchema = z24.object({ id: chatPath.id, provider, title: createChatRequestSchema.shape.title });
13148
- var forkChatToolInputSchema = z24.object({ ...chatPath, provider, model, thinking_level: thinkingLevel, title, message });
13149
- var renameChatToolInputSchema = z24.object({ ...chatPath, display_name: updateChatDisplayNameRequestSchema.shape.displayName });
13150
- var runCommandToolInputSchema = z24.object({ id: chatPath.id, ...workspaceExecRequestSchema.shape });
13151
- var environmentMcpPath = { environment_id: z24.string().describe("Environment ID") };
13152
- var createEnvironmentMcpToolInputSchema = z24.object({ ...environmentMcpPath, ...createEnvironmentMcpRequestSchema.shape });
13153
- var updateEnvironmentMcpToolInputSchema = z24.object({
13154
- ...environmentMcpPath,
13155
- mcp_id: z24.string().describe("MCP ID"),
13156
- ...updateEnvironmentMcpRequestSchema.shape
13157
- });
13158
- var createEnvironmentDeviceToolInputSchema = z24.object({ ...environmentMcpPath, ...createEnvironmentDeviceRequestSchema.shape });
13159
- var previewEnvironmentConfigSourceToolInputSchema = previewEnvironmentConfigSourceRequestSchema.safeExtend(environmentMcpPath);
13160
- var applyEnvironmentConfigSourceToolInputSchema = applyEnvironmentConfigSourceRequestSchema.safeExtend(environmentMcpPath);
13161
-
13162
- // ../shared/src/scout.ts
13163
- var SCOUT_SOURCE_TYPES = ["slack", "linear"];
13164
- var SCOUT_PROACTIVITY_LEVELS = ["tagged", "conservative", "balanced", "proactive"];
13165
- var SCOUT_PRESET_NAME_MAX_LENGTH = 50;
13166
- var SCOUT_CHANNEL_SETTINGS_OFFERS = ["proactivity", "raise_proactivity", "instructions"];
13167
- var SCOUT_SETTINGS_OFFERS = [...SCOUT_CHANNEL_SETTINGS_OFFERS, "organization_proactivity", "raise_organization_proactivity"];
13168
- var SCOUT_PRESET_ICONS = [
13169
- "users",
13170
- "user",
13171
- "inbox",
13172
- "building",
13173
- "bug",
13174
- "message-circle",
13175
- "headphones",
13176
- "heart",
13177
- "star",
13178
- "flag",
13179
- "zap",
13180
- "shield",
13181
- "code",
13182
- "terminal",
13183
- "rocket",
13184
- "wrench",
13185
- "briefcase",
13186
- "globe",
13187
- "book-open",
13188
- "lightbulb",
13189
- "target",
13190
- "bell",
13191
- "layers",
13192
- "tag"
13193
- ];
13194
-
13195
- // ../shared/src/default-skills/scout-settings.ts
13196
- var SCOUT_SETTINGS_SKILL_NAME = "scout-settings";
13197
- var CONTENT = `---
13198
- name: ${SCOUT_SETTINGS_SKILL_NAME}
13199
- description: Use when someone asks what Replicas can do or what they can change ("what can you do?", "what can I change here?"), asks to change or explain how Replicas behaves in Slack or Linear (channel levels, "be quieter", "only reply when tagged", silent mode, mute, channel or team instructions, presets, monitored Linear teams, Slack Connect defaults, Slack agent defaults), when someone is annoyed that Scout replied unasked ("not you", "nobody asked", a thumbs-down), when making or answering a settings or automation offer, or when setting up an automation. Not for routing ordinary requests.
13200
- ---
13201
-
13202
- # Scout settings
13203
-
13204
- There is no settings page: people change how Replicas behaves by asking you, and you own every setting below. Handle requests here, never by spawning a workspace. People know you as Replicas, so never say Scout to them.
13205
-
13206
- ## What you can do
13207
- | Ask | How | Who |
13208
- | --- | --- | --- |
13209
- | How much you speak up in a channel or group DM (Mentions only, Low, Balanced, High) | \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\` \`proactivity\` | Any member, except that raising one from Mentions only needs an admin |
13210
- | How much you speak up in every channel | \`${REPLICAS_MCP_TOOLS.setOrganizationProactivity}\` | Admin |
13211
- | Silent mode for a channel, also asked as muting you there (you still read it and follow its instructions, but never post there) | \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\` \`silent\` | Admin |
13212
- | Instructions for a channel or Linear team, such as "file bugs in Linear and post them in #triage", "send actionable messages to App Support", or "mobile requests go to the mobile-ios environment" | \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\` \`instructions\` | Any member |
13213
- | Create, edit, or delete a preset (reusable instructions), or assign one | \`${REPLICAS_MCP_TOOLS.saveChannelPreset}\`, \`${REPLICAS_MCP_TOOLS.deleteChannelPreset}\`, \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\` \`preset_id\` | Any member |
13214
- | Defaults for every channel shared with another company: preset, instructions, level, silent mode | \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\` | Admin |
13215
- | Triage new issues in a Linear team, or stop | \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\` \`source: linear\`, \`monitored\` | Admin starts; any member stops |
13216
- | Agent, model, thinking level, goal mode, and fast mode for tasks started from Slack | \`${REPLICAS_MCP_TOOLS.setSlackAgentDefaults}\` | Admin |
13217
- | Stay quiet in this thread, or come back | \`${REPLICAS_MCP_TOOLS.setThreadMuted}\` | Anyone in the thread |
13218
- | A recurring task ("every Monday, summarize open PRs in #eng") | \`${REPLICAS_MCP_TOOLS.createAutomation}\` (see Automations) | Members who can create automations |
13219
-
13220
- You also answer questions, start a workspace for a task (in a separate thread when asked), relay follow-ups to a thread's workspace, stop it, hand a thread to a Mothership by name, and file Linear tickets with \`replicas.linear.graphql\`. Spawn for a one-time reminder ("remind me tomorrow at 9"): workspaces can schedule one-time runs.
13221
-
13222
- A person's own defaults (agent, model, environment) and the organization's general defaults are changed in the Replicas app, not by you; Slack tasks use them unless the Slack agent defaults above say otherwise.
13223
-
13224
- You can't add yourself to or remove yourself from a channel: people type \`/invite @Replicas\` or \`/remove @Replicas\` there, and an admin can pick channels under Integrations, Slack, Configure. To keep you in a channel but out of the way, lower it to Mentions only or put it in silent mode. A channel becomes a Mothership's own channel from that Mothership, not here; any channel's instructions can still send its messages to a Mothership.
13225
-
13226
- ## Tools
13227
- Read presets, channel instructions, and levels with \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Change them with \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\`, \`${REPLICAS_MCP_TOOLS.saveChannelPreset}\`, \`${REPLICAS_MCP_TOOLS.deleteChannelPreset}\`, \`${REPLICAS_MCP_TOOLS.setOrganizationProactivity}\`, \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`, or \`${REPLICAS_MCP_TOOLS.setSlackAgentDefaults}\`. Every change takes \`confirmation_*\` arguments naming who asked. For a Slack message, fill them with its envelope \`channel_id\`, \`thread_ts\`, \`message_ts\`, and \`user_id\`. A message from a person in the Replicas dashboard has no \`[Slack]\` envelope and carries a \`confirmation_dashboard_token\`: pass only that, never one from another message, and answer in the chat. The server checks that the person who asked is an organization member (and an admin where noted). If it refuses, say why briefly and change nothing.
13228
-
13229
- ## Changing settings
13230
- - Settings also change outside your chat, often on purpose: read the current settings first, never trust earlier messages, and never re-apply an earlier request the current message doesn't ask for. Save only what the current message asks.
13231
- - **Levels**, lowest to highest: \`tagged\` (only @Replicas pings reach you, not even messages naming Replicas), \`conservative\` (also messages naming Replicas or Scout, and follow-ups in threads with a workspace), \`balanced\` (the normal triage rules), \`proactive\` (also clear untagged questions and requests). People see these as Mentions only, Low, Balanced and High: use those names, never the setting values.
13232
- - The organization has one level for its whole Slack workspace, which only an admin can set with \`${REPLICAS_MCP_TOOLS.setOrganizationProactivity}\`. A channel or group DM can override it with \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\` and \`proactivity\`. 1:1 DMs are always addressed to you. Any member can lower a channel; raising one above \`tagged\` needs an admin.
13233
- - A request that points at a channel ("here", "in #eng", "stop replying in #random") changes that channel only. One that doesn't ("only respond when I @ you", "don't auto-reply to Slack messages") means the organization level. When it names a channel, even without "#" ("make support-inbound quieter"), find it with \`conversations.list\` and change that one, not the one you were asked in; ask if none or several match. If a non-admin asks for an organization change, say an organization admin has to ask, and offer the channel-only change when they asked from a channel. Instructions don't substitute for a level.
13234
- - **Instructions and presets:** prefer changing the channel's own instructions; edit a shared preset only when asked, since every channel using it changes. To set up a channel without being told how, read enough of it to propose short instructions or a fitting preset (customer, vendor, internal team), and save nothing until they confirm. Never infer a channel's purpose only because Slack marks it externally shared.
13235
- - **Silent mode** is what people mean by muting you in a channel. A channel in silent mode still reaches you as its level allows, and you follow its instructions anywhere but there. For "watch #alerts and report to #team", an admin turns on \`silent\` for the watched channel, raises it to Balanced or High so untagged messages reach you, and its instructions name where to report. It is separate from a thread mute, which lasts hours and only quiets one thread.
13236
- - **Linear teams:** set \`monitored: true\` to start triaging a team (admin only) and \`monitored: false\` to stop. Teams take a preset or instructions like channels.
13237
- - **Slack Connect** channels shared with another company follow the organization's shared-channel defaults (\`tagged\` with no preset unless an admin set them with \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`) until they get their own settings, unless a Mothership is linked to one. A request about all shared or customer channels changes only those defaults: leave channels with their own settings as they are, list them, and offer to switch them too. Asked why you stay quiet in one, say it's external and an admin can ask you to raise its level.
13238
- - **Slack agent defaults:** to change the agent, model, thinking level, goal mode, or fast mode for tasks started from Slack ("use Codex for Slack tasks"), call \`${REPLICAS_MCP_TOOLS.setSlackAgentDefaults}\` (admin only).
13239
- - **"What can you do?"** Keep it short: one line on what you do (answer questions, start a workspace for a task, hand work to a Mothership, file Linear tickets, set up recurring tasks), two or three example requests in backticks drawn from both work and behavior (like \`fix the flaky login test\`, \`only reply here when tagged\`, \`every Monday, summarize open PRs\`), then "Ask me what you can change here to see every setting." No settings list or current values.
13240
- - **"What can I change?"** Read the current settings, then reply in a few short lines from **What you can do**: what applies here with its current value (this channel's level, silent mode, instructions or preset), then what applies everywhere (the every-channel level, shared-channel defaults, Linear teams, Slack agent defaults), marking what needs an admin. Give one example phrasing, like "only reply here when tagged".
13241
- - After any change, say what changed and its scope ("every channel", or "#eng only"). Confirm only after the tool succeeded and only what it changed; say so when it failed or did less than asked.
13242
-
13243
- ## Offers
13244
- When the envelope has \`offers\`, it lists the offers you may still make in this channel (${SCOUT_CHANNEL_SETTINGS_OFFERS.map((offer) => `\`${offer}\``).join(", ")}); \`offers=none\` means none. Offer only what it lists, at most one per message. Claim the offer with \`${REPLICAS_MCP_TOOLS.claimSettingsOffer}\` right before posting it, and post only when the claim succeeds. When someone declines ("no", "it's fine", "leave it"), record it with \`declined: true\`; never repeat an ignored offer. When they accept, apply it with the tools above using the accepting message as confirmation, then confirm in one short line.
13245
- - **Frustration.** When someone is clearly annoyed that you replied or acted unasked ("wtf why did replicas respond", "not you", "nobody asked", or a thumbs-down on a reply you posted unasked), claim \`proactivity\` and post one short apology offering to lower this channel exactly one step. From Balanced or High: "Sorry for jumping in. Want me to only reply here when someone mentions me by name?" From Low: "Sorry for jumping in. Want me to only reply here when someone @mentions me?" On a yes, set that level, nothing lower. Do nothing else in that thread. When the claim answers \`offer: organization\`, offer to set every channel's default to \`organization_target\` instead; when \`requester_is_admin\` is false, say an admin can change it for every channel and offer this channel. An explicit "stop replying in this thread" is still a thread mute.
13246
- - **Having to tag you.** After doing what an earlier untagged message asked, claim \`raise_proactivity\` and end your reply with one line offering one step up. From Mentions only: "Want me to pick up messages here that name me, without an @mention? @mention me with your answer." From Low: "Want me to pick up requests like that here without a tag next time? I can raise this channel to Balanced." From Balanced: "Want me to jump in on requests like that here without being asked? I can raise this channel to High." When the claim answers \`offer: organization\`, offer to raise every channel's default to \`organization_target\` instead, and say channels with their own level keep it. Mention an admin only when the claim answers \`needs_admin: true\`, then offer this channel instead. On a yes, raise to that level only.
13247
- - **Channel instructions.** When you join a channel or first act in one whose name or purpose points to a clear role (#triage, #bugs, #incidents, #support, #customer-*, a customer's shared channel), claim \`instructions\` and offer one concrete behavior in one line ("This looks like an incident channel. Want me to triage new reports here, check for duplicates, and post findings in the thread?"). Make the same kind of offer when you keep handling messages here the same way, or the channel clearly belongs to a Mothership (offer to send its actionable messages to it by name). On a yes, save it as the channel's instructions, or its preset when one fits exactly.
13248
-
13249
- ## Automations
13250
- When someone asks for a recurring task or accepts an offer to automate a repeated request, set it up here instead of spawning. Infer the name, prompt, environment, repositories, schedule, and timezone from the conversation and the organization's configuration; ask one concise follow-up only for a missing detail that changes when or where it runs. Create it with \`${REPLICAS_MCP_TOOLS.createAutomation}\`, filling \`confirmation_*\` from the envelope of the message that asked or accepted. The server checks that author is an organization member with automation write access; never create it if that fails. Post the result in the same thread.
13251
- `;
13252
-
13253
- // ../shared/src/routes/preferences.ts
13254
- import { z as z27 } from "zod";
13255
-
13256
- // ../shared/src/routes/push.ts
13257
- import { z as z25 } from "zod";
13258
-
13259
- // ../shared/src/workspace-attention.ts
13260
- var WORKSPACE_ATTENTION_REASONS = ["question", "plan", "variables", "blocked", "setup", "deploy_failed"];
13261
- var CHAT_ATTENTION_REASONS = ["question", "blocked"];
13262
-
13263
- // ../shared/src/routes/push.ts
13264
- var registerPushDeviceRequestSchema = z25.discriminatedUnion("platform", [
13265
- z25.object({
13266
- platform: z25.literal("ios"),
13267
- token: z25.string().regex(/^[0-9a-f]{64,200}$/i),
13268
- appId: z25.string().min(1).max(255),
13269
- apnsEnvironment: z25.enum(["sandbox", "production"])
13270
- }),
13271
- z25.object({
13272
- platform: z25.literal("android"),
13273
- token: z25.string().min(1).max(4096),
13274
- appId: z25.string().min(1).max(255)
13275
- })
13276
- ]);
13277
- var PUSH_HOLD_MINUTES = 5;
13278
- var chatRefSchema = z25.object({ workspaceId: z25.string().uuid(), chatId: z25.string().min(1).max(100) });
13279
- var recordPushActivityRequestSchema = z25.object({
13280
- organizationId: z25.string().uuid(),
13281
- /** Seconds since the last keyboard or mouse input on this computer. A phone leaves it out: it only reports what it has open. */
13282
- idleSeconds: z25.number().min(0).optional(),
13283
- seenWorkspaceIds: z25.array(z25.string().uuid()).max(20),
13284
- seenChats: z25.array(chatRefSchema).max(20).optional()
13285
- });
13286
- var PUSH_NOTIFICATION_KINDS = [...WORKSPACE_ATTENTION_REASONS, "finished"];
13287
- var PUSH_OPTION_LABEL_MAX = 60;
13288
- var PUSH_OPTIONS_MAX = 4;
13289
- var pushQuestionSchema = z25.object({ id: z25.string().max(64), allowCustom: z25.boolean().optional(), options: z25.array(z25.object({ id: z25.string().max(64), label: z25.string().min(1).max(PUSH_OPTION_LABEL_MAX) })).min(1).max(PUSH_OPTIONS_MAX) });
13290
- var pushNotificationDataSchema = z25.object({
13291
- organizationId: z25.string(),
13292
- workspaceId: z25.string(),
13293
- chatId: z25.string().nullable(),
13294
- kind: z25.enum(PUSH_NOTIFICATION_KINDS),
13295
- completedAt: z25.string(),
13296
- toolRequestId: z25.string().optional(),
13297
- question: pushQuestionSchema.optional()
13298
- });
13299
- var workspaceSharedPushDataSchema = pushNotificationDataSchema.pick({ organizationId: true, workspaceId: true, chatId: true, completedAt: true }).extend({ kind: z25.literal("shared") });
13300
- var registerLiveActivityRequestSchema = chatRefSchema.extend({
13301
- deviceId: z25.string().uuid(),
13302
- /** The iOS activity's push token. Android leaves it out and gets FCM data messages on the device token. */
13303
- pushToken: z25.string().regex(/^[0-9a-f]{64,400}$/i).optional(),
13304
- /** iOS only: when the card's turn started, in seconds. Cards keep their order by it. */
13305
- startedAt: z25.number().positive().optional()
13306
- });
13307
- var syncLiveActivitiesRequestSchema = z25.object({
13308
- activities: z25.array(chatRefSchema).max(100)
13309
- });
13310
- var setLiveActivityStartTokenRequestSchema = z25.object({ token: z25.string().regex(/^[0-9a-f]{64,400}$/i) });
12633
+ var setLiveActivityStartTokenRequestSchema = z22.object({ token: z22.string().regex(/^[0-9a-f]{64,400}$/i) });
13311
12634
 
13312
12635
  // ../shared/src/default-skills/replicas-agent/abilities/computer.ts
13313
12636
  var SECTION = `### Computer use (Linux desktop control)
@@ -14059,7 +13382,7 @@ var GITLAB_ABILITY = {
14059
13382
  };
14060
13383
 
14061
13384
  // ../shared/src/routes/compute.ts
14062
- import { z as z26 } from "zod";
13385
+ import { z as z23 } from "zod";
14063
13386
  var COMPUTE_SANDBOX_KINDS = ["gpu", "macos"];
14064
13387
  var GPU_TYPES = ["T4", "L4", "A10G", "L40S", "A100", "A100-80GB", "H100", "H200", "B200"];
14065
13388
  var DEFAULT_GPU_TYPE = "L4";
@@ -14077,27 +13400,27 @@ var COMPUTE_SANDBOX_LIMITS = {
14077
13400
  maxIdleTimeoutMinutes: 60,
14078
13401
  maxTransferBytes: 1024 ** 3
14079
13402
  };
14080
- var computeEnvSchema = z26.record(z26.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z26.string().max(32768)).refine((env) => Object.keys(env).length <= 64, "At most 64 environment variables are allowed");
14081
- var createComputeSandboxRequestSchema = z26.object({
14082
- kind: z26.enum(COMPUTE_SANDBOX_KINDS),
14083
- gpu: z26.string().trim().optional(),
14084
- image: z26.string().trim().min(1).max(256).regex(/^\S+$/, "Image must not contain whitespace").optional(),
14085
- timeoutMinutes: z26.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTimeoutMinutes).optional(),
14086
- idleTimeoutMinutes: z26.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxIdleTimeoutMinutes).optional(),
14087
- ports: z26.array(z26.number().int().min(1).max(65535)).max(COMPUTE_SANDBOX_LIMITS.maxPorts).optional(),
13403
+ var computeEnvSchema = z23.record(z23.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z23.string().max(32768)).refine((env) => Object.keys(env).length <= 64, "At most 64 environment variables are allowed");
13404
+ var createComputeSandboxRequestSchema = z23.object({
13405
+ kind: z23.enum(COMPUTE_SANDBOX_KINDS),
13406
+ gpu: z23.string().trim().optional(),
13407
+ image: z23.string().trim().min(1).max(256).regex(/^\S+$/, "Image must not contain whitespace").optional(),
13408
+ timeoutMinutes: z23.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTimeoutMinutes).optional(),
13409
+ idleTimeoutMinutes: z23.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxIdleTimeoutMinutes).optional(),
13410
+ ports: z23.array(z23.number().int().min(1).max(65535)).max(COMPUTE_SANDBOX_LIMITS.maxPorts).optional(),
14088
13411
  env: computeEnvSchema.optional()
14089
13412
  });
14090
- var computeExecRequestSchema = z26.object({
14091
- command: z26.string().min(1).max(1e5),
14092
- workdir: z26.string().min(1).max(4096).optional(),
13413
+ var computeExecRequestSchema = z23.object({
13414
+ command: z23.string().min(1).max(1e5),
13415
+ workdir: z23.string().min(1).max(4096).optional(),
14093
13416
  env: computeEnvSchema.optional(),
14094
- detach: z26.boolean().optional()
13417
+ detach: z23.boolean().optional()
14095
13418
  });
14096
- var computeUploadRequestSchema = z26.object({
14097
- size: z26.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTransferBytes)
13419
+ var computeUploadRequestSchema = z23.object({
13420
+ size: z23.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTransferBytes)
14098
13421
  });
14099
- var computeTransferPathSchema = z26.object({
14100
- path: z26.string().min(1).max(4096).optional()
13422
+ var computeTransferPathSchema = z23.object({
13423
+ path: z23.string().min(1).max(4096).optional()
14101
13424
  });
14102
13425
 
14103
13426
  // ../shared/src/default-skills/replicas-agent/abilities/gpu.ts
@@ -15632,302 +14955,995 @@ For screenshots, recordings, diagrams, or other media, read \`references/MEDIA.m
15632
14955
 
15633
14956
  Attach every new top-level conversation so future replies route to this workspace. For a reply in another thread, attach its root \`thread_ts\`, not the reply timestamp. Do not attach the originating thread again.
15634
14957
 
15635
- ## Search and batch
14958
+ ## Search and batch
14959
+
14960
+ \`\`\`ts
14961
+ const [messages, users] = await Promise.all([
14962
+ replicas.slack.call('search.messages', { query: 'launch status' }),
14963
+ replicas.slack.call('users.list', { limit: 200 }),
14964
+ ]);
14965
+ \`\`\`
14966
+
14967
+ Supported methods cover conversations, messages, search, users, reactions, and Slack's external file-upload flow. An unsupported method is rejected by Replicas before Slack is called.
14968
+
14969
+ ## Older workspaces without the SDK
14970
+
14971
+ If \`@replicas/sdk\` cannot be imported, use the gateway with workspace authentication. Send JSON containing \`method\` and \`arguments\` on stdin, for example \`{"method":"conversations.list","arguments":{"limit":3,"types":"public_channel"}}\`:
14972
+
14973
+ \`\`\`bash
14974
+ curl -sS --fail-with-body -X POST "\${REPLICAS_MONOLITH_URL:-$MONOLITH_URL}/v1/engine/slack/api" \\
14975
+ -H "Authorization: Bearer $REPLICAS_ENGINE_SECRET" \\
14976
+ -H "X-Workspace-Id: \${REPLICAS_WORKSPACE_ID:-$WORKSPACE_ID}" \\
14977
+ -H "X-Replicas-Chat-Id: \${REPLICAS_CHAT_ID:-}" \\
14978
+ -H "Content-Type: application/json" \\
14979
+ --data-binary @-
14980
+ \`\`\`
14981
+ `;
14982
+ var SLACK_ABILITY = {
14983
+ label: "Slack",
14984
+ description: "Send messages, read threads, search, and transfer files through @replicas/sdk.",
14985
+ bullet: "- Interacting with Slack (listing channels, sending messages, reading threads, or searching): use replicas.slack.call from @replicas/sdk. Read references/SLACK.md; no Slack MCP server or provider token in the VM is required.",
14986
+ section: SECTION16,
14987
+ referenceFile: { name: "SLACK.md", content: REFERENCE16 }
14988
+ };
14989
+
14990
+ // ../shared/src/visuals.ts
14991
+ var VISUAL_COLUMN_WIDTH = 760;
14992
+ var VISUAL_PHONE_WIDTH = 390;
14993
+ var FONT_FAMILIES = ["Inter", "General Sans"];
14994
+ var FONT_SANS = `${FONT_FAMILIES.map((family) => `"${family}"`).join(", ")}, system-ui, -apple-system, "Segoe UI", sans-serif`;
14995
+ var VISUAL_PAGE_RULES = `- Write one self-contained HTML file with inline <style> and <script>; a fragment without <html> or <head> is fine. Put data inline instead of fetching it. Libraries may load from public CDNs such as cdn.jsdelivr.net. Local images written as absolute paths (src="/abs/shot.png", url(/abs/bg.webp)) are inlined when you publish.
14996
+ - The page sits directly on the chat background, as wide as your reply (about ${VISUAL_COLUMN_WIDTH}px on desktop, ${VISUAL_PHONE_WIDTH - 30}px on phones), with its left edge aligned to your text. Leave html and body transparent, use a fluid width with no outer padding, and add no outer card, border, or title banner: the page is part of your reply.
14997
+ - Let content set the height. Never use 100vh, height:100%, or min-height:100vh on html, body, or the outer element; publishing refuses a page whose height follows the frame. Give charts fixed pixel heights.
14998
+ - Color everything with the theme variables so the page follows light and dark mode live: --foreground, --muted-foreground (secondary text), --background, --muted (subtle fills), --accent, --border, --primary and --primary-foreground (the brand accent, for emphasis), --success (passed, done, or added), --destructive, --warning, --code-background, --code-foreground, and --chart-1 to --chart-8 for series (use them in order and label series directly). Never hardcode a light or dark palette. A canvas or chart library that needs literal colors can read them with getComputedStyle(document.documentElement) and redraw on matchMedia("(prefers-color-scheme: dark)") changes.
14999
+ - Text is 13px Inter, like the chat; --font-sans and --font-mono are set. Keep Replicas' flat look: separate sections with 1px var(--border) lines or var(--muted) fills, without shadows or rounded cards. Use var(--radius) only on small controls.
15000
+ - A mockup of a specific product's UI, such as a client's app or a competitor's screen, is the exception: give it its own panel with at least 16px of padding and use that product's real colors, fonts, corners, and shadows inside it, so it looks like the product. Everything around the panel follows the rules above.
15001
+ - Interaction is welcome: hover details, tabs, toggles, sliders. Links open in a new browser tab.
15002
+ - Keep the top-right corner (about 110\xD740px) free of anything essential: the chat shows the visual's actions there on hover.`;
15003
+ var THEME_FRAGMENT_KEY = "replicas-theme";
15004
+ var HOST_CONTEXT_CHANGED_METHOD = "ui/notifications/host-context-changed";
15005
+ var SIZE_CHANGED_METHOD = "ui/notifications/size-changed";
15006
+ var OPEN_LINK_METHOD = "ui/open-link";
15007
+ var OPEN_IMAGE_METHOD = "replicas/open-image";
15008
+ var VISUAL_CONTENT_HEIGHT_EXPRESSION = "(function(){var r=document.documentElement;return Math.ceil(r.scrollHeight>r.clientHeight?r.scrollHeight:r.getBoundingClientRect().height)})()";
15009
+ var BASE_CSS = "html{color:var(--foreground);font-family:var(--font-sans);font-size:13px;line-height:1.5;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;scrollbar-width:none}html::-webkit-scrollbar{display:none}body{margin:0}:where(*,*::before,*::after){box-sizing:border-box}code,kbd,pre,samp{font-family:var(--font-mono)}:where(:focus-visible){outline:2px solid var(--ring);outline-offset:-2px}";
15010
+ var THEME_STYLE_ID = "replicas-visual-theme";
15011
+ var BOOTSTRAP_SCRIPT = `
15012
+ (() => {
15013
+ const style = document.getElementById('${THEME_STYLE_ID}');
15014
+ const nativeView = window.ReactNativeWebView;
15015
+ const framed = window.parent !== window;
15016
+ const post = (message) => nativeView ? nativeView.postMessage(JSON.stringify(message)) : window.parent.postMessage(message, '*');
15017
+ const applyTheme = (theme) => {
15018
+ const variables = Object.entries(theme.variables).map(([name, value]) => name + ':' + value + ';').join('');
15019
+ const font = theme.fontUrl ? ${JSON.stringify(FONT_FAMILIES)}.map((family) => '@font-face{font-family:"' + family + '";src:url("' + theme.fontUrl + '") format("woff2");font-weight:100 900;font-display:swap}').join('') : '';
15020
+ style.textContent = ':root{color-scheme:' + theme.appearance + ';' + variables + '}' + font + ${JSON.stringify(BASE_CSS)};
15021
+ };
15022
+ try {
15023
+ const fragment = /[#&]${THEME_FRAGMENT_KEY}=([^&]*)/.exec(location.hash);
15024
+ if (fragment) {
15025
+ applyTheme(JSON.parse(decodeURIComponent(fragment[1])));
15026
+ history.replaceState(history.state, '', location.pathname + location.search);
15027
+ }
15028
+ } catch {}
15029
+ if (!nativeView) {
15030
+ document.addEventListener('click', (event) => {
15031
+ const anchor = event.isTrusted && event.composedPath().find((target) => target instanceof Element && target.matches('a[href]'));
15032
+ if (!anchor) return;
15033
+ const url = new URL(anchor.getAttribute('href'), document.baseURI);
15034
+ if (!/^https?:$/.test(url.protocol) || url.href.split('#')[0] === location.href.split('#')[0]) return;
15035
+ if (framed) {
15036
+ event.preventDefault();
15037
+ post({ jsonrpc: '2.0', method: '${OPEN_LINK_METHOD}', params: { url: url.href } });
15038
+ } else {
15039
+ anchor.setAttribute('target', '_blank');
15040
+ anchor.setAttribute('rel', 'noopener');
15041
+ }
15042
+ }, true);
15043
+ }
15044
+ if (!framed && !nativeView) return;
15045
+ window.addEventListener('click', (event) => {
15046
+ const image = event.composedPath()[0];
15047
+ if (!event.isTrusted || event.defaultPrevented || !(image instanceof HTMLImageElement) || image.closest('a[href], button')) return;
15048
+ let src = image.currentSrc || image.src;
15049
+ if (/^blob:/i.test(src) || (nativeView && /^data:image\\/svg|\\.svg(?:[?#]|$)/i.test(src))) {
15050
+ try {
15051
+ const canvas = document.createElement('canvas');
15052
+ canvas.width = (image.naturalWidth || image.width) * 2;
15053
+ canvas.height = (image.naturalHeight || image.height) * 2;
15054
+ canvas.getContext('2d').drawImage(image, 0, 0, canvas.width, canvas.height);
15055
+ src = canvas.toDataURL('image/png');
15056
+ } catch {
15057
+ return;
15058
+ }
15059
+ }
15060
+ if (src) post({ jsonrpc: '2.0', method: '${OPEN_IMAGE_METHOD}', params: { src, name: image.alt } });
15061
+ });
15062
+ let reportedHeight;
15063
+ const reportHeight = () => {
15064
+ const height = ${VISUAL_CONTENT_HEIGHT_EXPRESSION};
15065
+ if (height === reportedHeight) return;
15066
+ reportedHeight = height;
15067
+ post({ jsonrpc: '2.0', method: '${SIZE_CHANGED_METHOD}', params: { height } });
15068
+ };
15069
+ window.addEventListener('message', (event) => {
15070
+ if (event.source !== window.parent || event.data?.method !== '${HOST_CONTEXT_CHANGED_METHOD}') return;
15071
+ const { theme, styles, fontUrl } = event.data.params;
15072
+ applyTheme({ appearance: theme, variables: styles.variables, fontUrl });
15073
+ reportedHeight = undefined;
15074
+ if (document.readyState !== 'loading') reportHeight();
15075
+ });
15076
+ const resizeObserver = new ResizeObserver(reportHeight);
15077
+ resizeObserver.observe(document.documentElement);
15078
+ document.addEventListener('DOMContentLoaded', () => {
15079
+ resizeObserver.observe(document.body);
15080
+ reportHeight();
15081
+ });
15082
+ window.addEventListener('load', reportHeight);
15083
+ })();
15084
+ `.trim().replace(/\s*\n\s*/g, " ");
15085
+
15086
+ // ../shared/src/default-skills/replicas-agent/abilities/visuals.ts
15087
+ var SECTION17 = `### Visuals
15088
+ Show a chart, diagram, comparison, timeline, or mockup inline in your Replicas chat reply, in the chat's own font and colors.
15089
+
15090
+ **Reference:** \`references/VISUALS.md\`
15091
+
15092
+ Use this when:
15093
+ - Seeing it would explain faster than reading it: numbers over time, a flow or architecture, a before and after, options side by side
15094
+ - The user asks to see, chart, plot, compare, or visualize something`;
15095
+ var REFERENCE17 = `# Visuals
15096
+
15097
+ A visual is a self-contained HTML page shown inline in your Replicas chat reply. It sits on the chat background in the chat's font and colors, grows to fit its content, and follows the user's light or dark theme live.
15098
+
15099
+ ## When to make one
15100
+
15101
+ Make one when seeing beats reading: how parts of a system connect, how a request or data flows, numbers or options compared, a timeline, a before and after, or a UI mockup. Make one when the user asks to see, chart, compare, sketch, or visualize something. Never draw these as ASCII art or text diagrams.
15102
+
15103
+ Don't make one when:
15104
+ - A short answer or list covers it.
15105
+ - It is a plain table: write a Markdown table.
15106
+ - It is screenshots, or a before and after of them: upload them as images, which readers can open full screen and zoom. See "Before and after" in \`references/MEDIA.md\`.
15107
+ - The user wants a page, site, or component in their project: build that in the repo.
15108
+
15109
+ A long report or write-up goes in the Canvas, and its key charts and comparisons go in a visual in your reply. Never screenshot a report, chart, or diagram you made to show it: a long page shrunk to an image can't be read, and it ignores the reader's theme. Screenshots of app UI you changed are still right.
15110
+
15111
+ ## Make it
15112
+
15113
+ 1. Write the page, for example \`/tmp/visuals/<name>.html\`, following the page rules below.
15114
+ 2. Run \`replicas visualize <page.html> --title "<short title>"\`. It checks the page in a headless browser, publishes it, and prints two screenshots (dark at desktop width, light at phone width) with any console errors and layout warnings.
15115
+ 3. Open both screenshots and look. If anything is wrong, fix the page and publish again, then use the newest line. While iterating, \`replicas visualize <page.html> --check\` renders without publishing.
15116
+ 4. Paste the printed \`![\u2026](\u2026)\` line on its own line where the visual belongs in your final reply.
15117
+
15118
+ ## Page rules
15119
+
15120
+ ${VISUAL_PAGE_RULES}
15121
+
15122
+ ## In your reply
15123
+
15124
+ - The user sees the visual itself. Don't introduce it ("Here's a chart", "Here's the diagram"), say where it is, or restate its data. Add only what it doesn't say, such as the takeaway or a caveat.
15125
+ - Paste the line in your final reply, not in a progress update. To change a visual, edit the page, publish it again, and paste the new line.
15126
+ - The line only renders in Replicas chat. When you post to pull requests, Slack, Linear, or anywhere else, link the printed Forge link instead. Leave the Forge link out of your chat reply.
15127
+ `;
15128
+ var VISUALS_ABILITY = {
15129
+ label: "Visuals",
15130
+ description: "Show charts, diagrams, comparisons, and mockups inline in chat replies.",
15131
+ // The visuals_instructions system prompt block is its trigger.
15132
+ bullet: "",
15133
+ section: SECTION17,
15134
+ referenceFile: { name: "VISUALS.md", content: REFERENCE17 }
15135
+ };
15136
+
15137
+ // ../shared/src/default-skills/replicas-agent/registry.ts
15138
+ var REPLICAS_AGENT_ABILITY_REGISTRY = {
15139
+ replicas: REPLICAS_ABILITY,
15140
+ memory: SESSION_HISTORY_ABILITY,
15141
+ computer: COMPUTER_ABILITY,
15142
+ docker: DOCKER_ABILITY,
15143
+ environment_setup: ENVIRONMENT_SETUP_ABILITY,
15144
+ github: GITHUB_ABILITY,
15145
+ gitlab: GITLAB_ABILITY,
15146
+ gpu: GPU_ABILITY,
15147
+ linear: LINEAR_ABILITY,
15148
+ local_computer: LOCAL_COMPUTER_ABILITY,
15149
+ macos: MACOS_ABILITY,
15150
+ media: MEDIA_ABILITY,
15151
+ plugins: PLUGINS_ABILITY,
15152
+ previews: PREVIEWS_ABILITY,
15153
+ sentry: SENTRY_ABILITY,
15154
+ slack: SLACK_ABILITY,
15155
+ visuals: VISUALS_ABILITY
15156
+ };
15157
+ var REPLICAS_AGENT_ABILITIES = Object.keys(
15158
+ REPLICAS_AGENT_ABILITY_REGISTRY
15159
+ );
15160
+
15161
+ // ../shared/src/routes/preferences.ts
15162
+ var EMPTY_AGENT_DEFAULT_SETTINGS = {
15163
+ agent_provider: null,
15164
+ model: null,
15165
+ thinking_level: null,
15166
+ goal_mode: null,
15167
+ fast_mode: null
15168
+ };
15169
+ var DEFAULT_SUBAGENT_MCP_PROVIDERS = [...ENGINE_AGENT_PROVIDERS];
15170
+ var ALERT_SOUND_FAMILIES = {
15171
+ glass: ["glint", "tap", "ripple", "halo"],
15172
+ wood: ["ready", "pluck", "knock", "bloom", "steps"]
15173
+ };
15174
+ var ALERT_SOUNDS = [...ALERT_SOUND_FAMILIES.glass, ...ALERT_SOUND_FAMILIES.wood];
15175
+ var WALLPAPER_DITHERS = ["dither", "halftone", "modulation"];
15176
+ var WALLPAPER_EFFECTS = ["soft", "grain", "duotone", ...WALLPAPER_DITHERS, "none"];
15177
+ var PUSH_WHEN_ACTIVE_COPY = {
15178
+ wait: `Wait ${PUSH_HOLD_MINUTES} minutes`,
15179
+ skip: "Don\u2019t send",
15180
+ send: "Send right away"
15181
+ };
15182
+ var DEFAULT_USER_PREFERENCES = {
15183
+ default_agent: null,
15184
+ default_model: null,
15185
+ claude_models: null,
15186
+ codex_models: null,
15187
+ cursor_models: null,
15188
+ claude_hidden_models: null,
15189
+ codex_hidden_models: null,
15190
+ cursor_hidden_models: null,
15191
+ openrouter_models: null,
15192
+ opencode_go_models: null,
15193
+ close_workspace_on_pr_close: false,
15194
+ close_workspace_on_pr_merge: false,
15195
+ default_environment_id: null,
15196
+ respond_to_ci_workflows: true,
15197
+ respond_to_ci_checks: true,
15198
+ respond_to_human_pr_reviews: false,
15199
+ pr_user_attribution: false,
15200
+ github_commit_name: null,
15201
+ github_commit_email: null,
15202
+ auto_draft_prs: false,
15203
+ open_prs_in_graphite: false,
15204
+ open_links_in_desktop_app: false,
15205
+ local_control: false,
15206
+ spotify_controls: false,
15207
+ appshot_shortcut: "command",
15208
+ appshot_destination: "automatic",
15209
+ appshot_sound: true,
15210
+ keyboard_shortcuts: {},
15211
+ mothership_tour_seen: false,
15212
+ slack_settings_moved_notice: false,
15213
+ mothership_board_opened: false,
15214
+ follow_up_mode: "steer",
15215
+ send_key: "enter",
15216
+ memory_enabled: null,
15217
+ subagent_mcp_enabled: null,
15218
+ default_fast_mode: false,
15219
+ auto_compact_tokens: null,
15220
+ agent_defaults: { ...EMPTY_AGENT_DEFAULT_SETTINGS },
15221
+ fallback_chains: null,
15222
+ alert_sound: null,
15223
+ workspace_alerts: {},
15224
+ automation_alerts: {},
15225
+ push_types: { needs_you: true, finished: true, automations: true, usage_limit: true },
15226
+ push_when_active: "wait",
15227
+ chat_text_size: "default",
15228
+ app_font: "inter",
15229
+ code_font: "geist-mono",
15230
+ wallpaper: null
15231
+ };
15232
+ function defaultReplicasAgentAbilities() {
15233
+ const abilities = {};
15234
+ for (const key of REPLICAS_AGENT_ABILITIES) {
15235
+ abilities[key] = true;
15236
+ }
15237
+ if (hasAllReplicasAgentAbilities(abilities)) return abilities;
15238
+ throw new Error("Default Replicas agent ability flags are incomplete");
15239
+ }
15240
+ function hasAllReplicasAgentAbilities(abilities) {
15241
+ return REPLICAS_AGENT_ABILITIES.every((key) => typeof abilities[key] === "boolean");
15242
+ }
15243
+ var DEFAULT_DEFAULT_SKILLS = {
15244
+ replicas_agent: {
15245
+ enabled: true,
15246
+ abilities: defaultReplicasAgentAbilities()
15247
+ }
15248
+ };
15249
+ var defaultSkillsOverridesSchema = z24.strictObject({
15250
+ replicas_agent: z24.strictObject({
15251
+ enabled: z24.boolean().optional(),
15252
+ abilities: z24.partialRecord(z24.enum(REPLICAS_AGENT_ABILITIES), z24.boolean()).optional()
15253
+ }).optional()
15254
+ });
15255
+ var LINEAR_ROUTING_SKILL_MAX_LENGTH = 5e4;
15256
+ var linearRoutingSkillSchema = z24.union([
15257
+ z24.object({ name: z24.string().min(1), content: z24.string().trim().min(1).max(LINEAR_ROUTING_SKILL_MAX_LENGTH) }),
15258
+ z24.object({ name: z24.string().min(1), repository_id: z24.string().regex(UUID_RE), path: z24.string().min(1) })
15259
+ ]);
15260
+
15261
+ // ../shared/src/environment-files.ts
15262
+ var HOME_PREFIX = "~/";
15263
+ var ENVIRONMENT_FILE_PATH_GUIDANCE = "Use ~/... for home-directory files, or ~/workspaces/... for files that should live alongside your cloned repositories.";
15264
+ function validateEnvironmentFilePath(path) {
15265
+ const trimmedPath = path.trim();
15266
+ if (!trimmedPath) {
15267
+ return "Path is required.";
15268
+ }
15269
+ if (!trimmedPath.startsWith(HOME_PREFIX)) {
15270
+ return `Path must start with the home-directory prefix ~/ . ${ENVIRONMENT_FILE_PATH_GUIDANCE}`.replace("~/ .", "~/");
15271
+ }
15272
+ if (trimmedPath === HOME_PREFIX) {
15273
+ return "Path must include a file name after ~/.";
15274
+ }
15275
+ return null;
15276
+ }
15277
+
15278
+ // ../shared/src/routes/plugin-catalog.ts
15279
+ var EXPLICIT_PLUGIN_CATALOG = [
15280
+ {
15281
+ id: "attio",
15282
+ backend: "composio",
15283
+ toolkit: "attio",
15284
+ authType: "oauth",
15285
+ category: "business",
15286
+ name: "Attio",
15287
+ description: "Manage CRM records, people, companies, lists, and notes."
15288
+ },
15289
+ {
15290
+ id: "calendly",
15291
+ backend: "composio",
15292
+ toolkit: "calendly",
15293
+ authType: "oauth",
15294
+ category: "productivity",
15295
+ name: "Calendly",
15296
+ description: "Manage event types, scheduled events, invitees, and scheduling links."
15297
+ },
15298
+ {
15299
+ id: "clickhouse",
15300
+ backend: "composio",
15301
+ toolkit: "clickhouse",
15302
+ authType: "basic",
15303
+ category: "data",
15304
+ name: "ClickHouse",
15305
+ description: "Manage databases, tables, schemas, and queries."
15306
+ },
15307
+ {
15308
+ id: "cloudflare",
15309
+ backend: "composio",
15310
+ toolkit: "cloudflare_api_key",
15311
+ authType: "api_key",
15312
+ category: "data",
15313
+ name: "Cloudflare",
15314
+ description: "Manage zones, DNS records, analytics, and security settings."
15315
+ },
15316
+ {
15317
+ id: "e2b",
15318
+ toolkit: "e2b",
15319
+ backend: "native",
15320
+ authType: "api_key",
15321
+ category: "data",
15322
+ name: "E2B",
15323
+ description: "Create secure cloud sandboxes and run commands in them."
15324
+ },
15325
+ {
15326
+ id: "gmail",
15327
+ backend: "composio",
15328
+ toolkit: "gmail",
15329
+ authType: "oauth",
15330
+ category: "productivity",
15331
+ name: "Gmail",
15332
+ description: "Manage messages, threads, attachments, labels, and mailbox settings."
15333
+ },
15334
+ {
15335
+ id: "greptile",
15336
+ backend: "native",
15337
+ toolkit: "greptile",
15338
+ authType: "api_key",
15339
+ category: "data",
15340
+ name: "Greptile Knowledge Base",
15341
+ description: "Search and read self-updating codebase documentation, architecture, and flows."
15342
+ },
15343
+ {
15344
+ id: "googleads",
15345
+ backend: "composio",
15346
+ toolkit: "googleads",
15347
+ authType: "oauth",
15348
+ category: "data",
15349
+ name: "Google Ads",
15350
+ description: "Manage campaigns, customers, accounts, and reporting data."
15351
+ },
15352
+ {
15353
+ id: "googledocs",
15354
+ backend: "composio",
15355
+ toolkit: "googledocs",
15356
+ authType: "oauth",
15357
+ category: "productivity",
15358
+ name: "Google Docs",
15359
+ description: "Manage documents, structure, comments, and exported content."
15360
+ },
15361
+ {
15362
+ id: "googledrive",
15363
+ backend: "composio",
15364
+ toolkit: "googledrive",
15365
+ authType: "oauth",
15366
+ category: "productivity",
15367
+ name: "Google Drive",
15368
+ description: "Manage files, folders, metadata, permissions, and shared drives."
15369
+ },
15370
+ {
15371
+ id: "googlesearch",
15372
+ backend: "composio",
15373
+ toolkit: "google_search_console",
15374
+ authType: "oauth",
15375
+ category: "data",
15376
+ name: "Google Search",
15377
+ description: "Manage Search Console performance, indexing, sites, and sitemaps."
15378
+ },
15379
+ {
15380
+ id: "googlesheets",
15381
+ backend: "composio",
15382
+ toolkit: "googlesheets",
15383
+ authType: "oauth",
15384
+ category: "productivity",
15385
+ name: "Google Sheets",
15386
+ description: "Manage spreadsheets, worksheets, ranges, tables, and charts."
15387
+ },
15388
+ {
15389
+ id: "linkedin",
15390
+ backend: "composio",
15391
+ toolkit: "linkedin",
15392
+ authType: "oauth",
15393
+ category: "business",
15394
+ name: "LinkedIn",
15395
+ description: "Manage profiles, organizations, posts, and professional activity."
15396
+ },
15397
+ {
15398
+ id: "modal",
15399
+ backend: "native",
15400
+ toolkit: "modal",
15401
+ authType: "basic",
15402
+ category: "data",
15403
+ name: "Modal",
15404
+ description: "Invoke deployed functions through Modal compute."
15405
+ },
15406
+ {
15407
+ id: "posthog",
15408
+ backend: "composio",
15409
+ toolkit: "posthog",
15410
+ authType: "api_key",
15411
+ category: "data",
15412
+ name: "PostHog",
15413
+ description: "Manage projects, events, insights, dashboards, flags, and recordings."
15414
+ },
15415
+ {
15416
+ id: "planetscale",
15417
+ toolkit: "planetscale",
15418
+ backend: "native",
15419
+ authType: "oauth",
15420
+ category: "data",
15421
+ name: "PlanetScale",
15422
+ description: "Manage organizations, databases, branches, deploy requests, and Insights."
15423
+ },
15424
+ {
15425
+ id: "sazabi",
15426
+ backend: "native",
15427
+ toolkit: "sazabi",
15428
+ authType: "oauth",
15429
+ category: "data",
15430
+ name: "Sazabi",
15431
+ description: "Query logs, investigate issues, and run the Sazabi observability agent."
15432
+ },
15433
+ {
15434
+ id: "stripe",
15435
+ backend: "composio",
15436
+ toolkit: "stripe",
15437
+ authType: "oauth",
15438
+ category: "business",
15439
+ name: "Stripe",
15440
+ description: "Manage customers, payments, invoices, subscriptions, and balances."
15441
+ },
15442
+ {
15443
+ id: "kondo",
15444
+ backend: "native",
15445
+ toolkit: "kondo",
15446
+ authType: "oauth",
15447
+ category: "business",
15448
+ name: "Kondo",
15449
+ description: "Manage LinkedIn chats, labels, reminders, drafts, connections, and invites."
15450
+ },
15451
+ {
15452
+ id: "lightfield",
15453
+ backend: "native",
15454
+ toolkit: "lightfield",
15455
+ authType: "api_key",
15456
+ category: "business",
15457
+ name: "Lightfield",
15458
+ description: "Manage CRM accounts, contacts, opportunities, meetings, notes, and tasks."
15459
+ },
15460
+ {
15461
+ id: "pangram",
15462
+ backend: "native",
15463
+ toolkit: "pangram",
15464
+ authType: "api_key",
15465
+ category: "data",
15466
+ name: "Pangram",
15467
+ description: "Analyze text for AI generation and plagiarism signals."
15468
+ },
15469
+ {
15470
+ id: "vercel",
15471
+ backend: "native",
15472
+ toolkit: "vercel",
15473
+ authType: "api_key",
15474
+ category: "data",
15475
+ name: "Vercel",
15476
+ description: "Manage projects, deployments, logs, domains, and infrastructure."
15477
+ },
15478
+ {
15479
+ id: "turbopuffer",
15480
+ backend: "native",
15481
+ toolkit: "turbopuffer",
15482
+ authType: "api_key",
15483
+ category: "data",
15484
+ name: "turbopuffer",
15485
+ description: "Query and manage turbopuffer namespaces."
15486
+ },
15487
+ {
15488
+ id: "vanta",
15489
+ backend: "native",
15490
+ toolkit: "vanta",
15491
+ authType: "credentials",
15492
+ category: "data",
15493
+ name: "Vanta",
15494
+ description: "Review and manage controls, tests, evidence, vendors, risks, and compliance data."
15495
+ }
15496
+ ];
15497
+ var HOSTED_COMPOSIO_PLUGIN_DEFINITIONS = [
15498
+ ["notion", "notion", "OAUTH2", true, "productivity", "Notion"],
15499
+ ["jira", "jira", "OAUTH2", true, "productivity", "Jira"],
15500
+ ["confluence", "confluence", "OAUTH2", true, "productivity", "Confluence"],
15501
+ ["googlecalendar", "googlecalendar", "OAUTH2", true, "productivity", "Google Calendar"],
15502
+ ["microsoftteams", "microsoft_teams", "OAUTH2", true, "productivity", "Microsoft Teams"],
15503
+ ["outlook", "outlook", "OAUTH2", true, "productivity", "Outlook"],
15504
+ ["bitbucket", "bitbucket", "OAUTH2", true, "data", "Bitbucket"],
15505
+ ["datadog", "datadog", "API_KEY", false, "data", "Datadog"],
15506
+ ["pagerduty", "pagerduty", "OAUTH2", true, "data", "PagerDuty"],
15507
+ ["intercom", "intercom", "OAUTH2", true, "business", "Intercom"],
15508
+ ["zendesk", "zendesk", "OAUTH2", true, "business", "Zendesk"],
15509
+ ["hubspot", "hubspot", "OAUTH2", true, "business", "HubSpot"],
15510
+ ["supabase", "supabase", "OAUTH2", true, "data", "Supabase"],
15511
+ ["figma", "figma", "OAUTH2", true, "productivity", "Figma"],
15512
+ ["launchdarkly", "launch_darkly", "API_KEY", false, "data", "LaunchDarkly"],
15513
+ ["asana", "asana", "OAUTH2", true, "productivity", "Asana"],
15514
+ ["clickup", "clickup", "OAUTH2", true, "productivity", "ClickUp"],
15515
+ ["trello", "trello", "OAUTH1", true, "productivity", "Trello"],
15516
+ ["todoist", "todoist", "OAUTH2", true, "productivity", "Todoist"],
15517
+ ["airtable", "airtable", "OAUTH2", true, "productivity", "Airtable"],
15518
+ ["coda", "coda", "API_KEY", false, "productivity", "Coda"],
15519
+ ["miro", "miro", "OAUTH2", true, "productivity", "Miro"],
15520
+ ["sharepoint", "share_point", "OAUTH2", true, "productivity", "SharePoint"],
15521
+ ["onedrive", "one_drive", "OAUTH2", true, "productivity", "OneDrive"],
15522
+ ["googleslides", "googleslides", "OAUTH2", true, "productivity", "Google Slides"],
15523
+ ["googlemeet", "googlemeet", "OAUTH2", true, "productivity", "Google Meet"],
15524
+ ["circleback", "circleback_mcp", "DCR_OAUTH", false, "productivity", "Circleback"],
15525
+ ["granola", "granola_mcp", "DCR_OAUTH", false, "productivity", "Granola"],
15526
+ ["mercury", "mercury_mcp", "DCR_OAUTH", false, "business", "Mercury"],
15527
+ ["googletasks", "googletasks", "OAUTH2", true, "productivity", "Google Tasks"],
15528
+ ["dropbox", "dropbox", "OAUTH2", true, "productivity", "Dropbox"],
15529
+ ["box", "box", "OAUTH2", true, "productivity", "Box"],
15530
+ ["discord", "discord", "OAUTH2", true, "productivity", "Discord"],
15531
+ ["discordbot", "discordbot", "OAUTH2", true, "productivity", "Discord Bot"],
15532
+ ["zoom", "zoom", "OAUTH2", true, "productivity", "Zoom"],
15533
+ ["googlechat", "google_chat", "OAUTH2", false, "productivity", "Google Chat"],
15534
+ ["newrelic", "new_relic", "API_KEY", false, "data", "New Relic"],
15535
+ ["betterstack", "better_stack", "API_KEY", false, "data", "Better Stack"],
15536
+ ["incidentio", "incident_io", "API_KEY", false, "data", "incident.io"],
15537
+ ["grafana", "grafana", "BEARER_TOKEN", false, "data", "Grafana"],
15538
+ ["honeycomb", "honeycomb_mcp", "DCR_OAUTH", false, "data", "Honeycomb MCP"],
15539
+ ["neon", "neon_mcp", "DCR_OAUTH", false, "data", "Neon"],
15540
+ ["glen", "glen_mcp", "DCR_OAUTH", false, "data", "Glen"],
15541
+ ["bugsnag", "bugsnag", "API_KEY", false, "data", "Bugsnag"],
15542
+ ["circleci", "circleci", "API_KEY", false, "data", "CircleCI"],
15543
+ ["buildkite", "buildkite", "API_KEY", false, "data", "Buildkite"],
15544
+ ["dockerhub", "docker_hub", "API_KEY", false, "data", "Docker Hub"],
15545
+ ["digitalocean", "digital_ocean", "OAUTH2", true, "data", "DigitalOcean"],
15546
+ ["railway", "railway", "API_KEY", false, "data", "Railway"],
15547
+ ["render", "render", "API_KEY", false, "data", "Render"],
15548
+ ["firebase", "firebase", "API_KEY", false, "data", "Firebase"],
15549
+ ["cloudinary", "cloudinary", "API_KEY", false, "data", "Cloudinary"],
15550
+ ["configcat", "configcat", "API_KEY", false, "data", "ConfigCat"],
15551
+ ["contextdev", "context_dev", "API_KEY", false, "data", "Context.dev"],
15552
+ ["googleanalytics", "google_analytics", "OAUTH2", true, "data", "Google Analytics"],
15553
+ ["googlebigquery", "googlebigquery", "OAUTH2", true, "data", "Google BigQuery"],
15554
+ ["amplitude", "amplitude", "API_KEY", false, "data", "Amplitude"],
15555
+ ["mixpanel", "mixpanel", "BASIC", false, "data", "Mixpanel"],
15556
+ ["segment", "segment", "API_KEY", false, "data", "Segment"],
15557
+ ["supermemory", "supermemory", "API_KEY", false, "data", "Supermemory"],
15558
+ ["databricks", "databricks", "API_KEY", false, "data", "Databricks"],
15559
+ ["snowflake", "snowflake", "OAUTH2", false, "data", "Snowflake"],
15560
+ ["algolia", "algolia", "API_KEY", false, "data", "Algolia"],
15561
+ ["elasticsearch", "elasticsearch", "API_KEY", false, "data", "Elasticsearch"],
15562
+ ["salesforce", "salesforce", "OAUTH2", true, "business", "Salesforce"],
15563
+ ["pipedrive", "pipedrive", "API_KEY", false, "business", "Pipedrive"],
15564
+ ["close", "close", "API_KEY", false, "business", "Close"],
15565
+ ["apollo", "apollo", "API_KEY", false, "business", "Apollo"],
15566
+ ["gong", "gong", "OAUTH2", true, "business", "Gong"],
15567
+ ["freshdesk", "freshdesk", "API_KEY", false, "business", "Freshdesk"],
15568
+ ["helpscout", "help_scout", "OAUTH2", false, "business", "Help Scout"],
15569
+ ["servicenow", "servicenow", "BASIC", false, "business", "ServiceNow"],
15570
+ ["mailchimp", "mailchimp", "OAUTH2", true, "business", "Mailchimp"],
15571
+ ["customerio", "customerio", "API_KEY", false, "business", "Customer.io"],
15572
+ ["klaviyo", "klaviyo", "API_KEY", false, "business", "Klaviyo"],
15573
+ ["shopify", "shopify", "API_KEY", false, "business", "Shopify"],
15574
+ ["quickbooks", "quickbooks", "OAUTH2", true, "business", "QuickBooks"],
15575
+ ["xero", "xero", "OAUTH2", false, "business", "Xero"],
15576
+ ["brex", "brex", "API_KEY", false, "business", "Brex"],
15577
+ ["buffer", "buffer", "OAUTH2", false, "business", "Buffer"],
15578
+ ["canva", "canva", "OAUTH2", true, "productivity", "Canva"],
15579
+ ["webflow", "webflow", "API_KEY", false, "business", "Webflow"],
15580
+ ["firecrawl", "firecrawl", "API_KEY", false, "data", "Firecrawl"],
15581
+ ["browserbase", "browserbase_tool", "API_KEY", false, "data", "Browserbase"],
15582
+ ["exa", "exa", "API_KEY", false, "data", "Exa"],
15583
+ ["youtube", "youtube", "OAUTH2", true, "business", "YouTube"],
15584
+ ["twitter", "twitter", "OAUTH2", false, "business", "Twitter/X"],
15585
+ ["instagram", "instagram", "OAUTH2", true, "business", "Instagram"],
15586
+ ["facebook", "facebook", "OAUTH2", true, "business", "Facebook"]
15587
+ ];
15588
+ var HOSTED_COMPOSIO_PLUGINS = HOSTED_COMPOSIO_PLUGIN_DEFINITIONS.map(
15589
+ ([id, toolkit, authScheme, managedAuth, category, name]) => ({
15590
+ id,
15591
+ backend: "composio",
15592
+ toolkit,
15593
+ authType: "hosted",
15594
+ authScheme,
15595
+ managedAuth,
15596
+ category,
15597
+ name,
15598
+ description: `Use ${name} tools from workspace agents.`
15599
+ })
15600
+ );
15601
+ var READ_ONLY_SCOPES = {
15602
+ gmail: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/contacts.readonly", "https://www.googleapis.com/auth/contacts.other.readonly", "https://www.googleapis.com/auth/gmail.readonly"],
15603
+ googledocs: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/drive.readonly", "https://www.googleapis.com/auth/documents.readonly"],
15604
+ googledrive: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/drive.readonly"],
15605
+ googlesheets: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/drive.readonly", "https://www.googleapis.com/auth/spreadsheets.readonly"],
15606
+ googleslides: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/drive.readonly", "https://www.googleapis.com/auth/presentations.readonly"],
15607
+ googlecalendar: ["https://www.googleapis.com/auth/calendar.readonly"],
15608
+ googletasks: ["https://www.googleapis.com/auth/tasks.readonly"],
15609
+ googlesearch: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/webmasters.readonly"],
15610
+ googleanalytics: ["https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/analytics.readonly"],
15611
+ youtube: ["https://www.googleapis.com/auth/youtube.readonly"],
15612
+ outlook: ["User.Read", "Mail.Read", "MailboxSettings.Read", "Calendars.Read", "Contacts.Read", "offline_access"],
15613
+ onedrive: ["Files.Read.All", "Sites.Read.All", "offline_access"],
15614
+ microsoftteams: ["User.Read", "Team.ReadBasic.All", "Channel.ReadBasic.All", "ChannelMessage.Read.All", "Chat.Read", "Chat.ReadBasic", "ChatMessage.Read", "People.Read.All", "TeamsActivity.Read", "offline_access"],
15615
+ jira: ["read:jira-work", "read:jira-user", "read:servicedesk-request", "read:servicemanagement-insight-objects", "read:sprint:jira-software", "read:board-scope:jira-software", "read:project:jira", "read:issue-type-scheme:jira", "offline_access"],
15616
+ confluence: ["read:space-details:confluence", "read:audit-log:confluence", "read:page:confluence", "read:blogpost:confluence", "read:whiteboard:confluence", "read:comment:confluence", "read:content.restriction:confluence", "read:content.metadata:confluence", "read:inlinetask:confluence", "read:task:confluence", "offline_access"],
15617
+ zendesk: ["read"],
15618
+ gong: ["api:calls:read:basic", "api:calls:read:extensive", "api:calls:read:transcript", "api:calls:read:media-url", "api:users:read", "api:stats:interaction", "api:stats:scorecards", "api:stats:user-actions", "api:stats:user-actions:detailed", "api:settings:scorecards:read", "api:settings:trackers:read", "api:library:read", "api:tasks:read", "api:flows:read", "api:workspaces:read", "api:crm:get-objects", "api:crm:schema", "api:crm:integrations:read", "api:call-outcomes:read", "api:permission-profile:read", "api:logs:read"],
15619
+ figma: ["current_user:read", "file_content:read", "file_comments:read", "file_metadata:read", "file_versions:read", "projects:read", "library_assets:read", "library_content:read", "team_library_content:read", "webhooks:read"],
15620
+ airtable: ["data.records:read", "data.recordComments:read", "schema.bases:read", "user.email:read"],
15621
+ todoist: ["data:read"],
15622
+ dropbox: ["openid", "email", "profile", "account_info.read", "files.metadata.read", "files.content.read", "file_requests.read", "sharing.read", "contacts.read"],
15623
+ canva: ["profile:read", "asset:read", "brandtemplate:content:read", "brandtemplate:meta:read", "comment:read", "design:content:read", "design:meta:read", "folder:read"],
15624
+ facebook: ["public_profile", "email", "pages_show_list", "pages_read_engagement", "pages_read_user_content", "read_insights"],
15625
+ instagram: ["instagram_business_basic", "instagram_business_manage_insights"]
15626
+ };
15627
+ var PLUGIN_CATALOG = [
15628
+ ...EXPLICIT_PLUGIN_CATALOG,
15629
+ ...HOSTED_COMPOSIO_PLUGINS
15630
+ ].map((plugin) => ({ ...plugin, readOnlyScopes: READ_ONLY_SCOPES[plugin.id] }));
15631
+
15632
+ // ../shared/src/routes/plugins.ts
15633
+ function isPluginId(value) {
15634
+ return PLUGIN_CATALOG.some((plugin) => plugin.id === value);
15635
+ }
15636
15636
 
15637
- \`\`\`ts
15638
- const [messages, users] = await Promise.all([
15639
- replicas.slack.call('search.messages', { query: 'launch status' }),
15640
- replicas.slack.call('users.list', { limit: 200 }),
15637
+ // ../shared/src/environment-config.ts
15638
+ var variableNameSchema = z25.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name");
15639
+ var mcpValueSchema = z25.union([
15640
+ z25.string(),
15641
+ environmentMcpVariableReferenceSchema
15641
15642
  ]);
15642
- \`\`\`
15643
-
15644
- Supported methods cover conversations, messages, search, users, reactions, and Slack's external file-upload flow. An unsupported method is rejected by Replicas before Slack is called.
15645
-
15646
- ## Older workspaces without the SDK
15647
-
15648
- If \`@replicas/sdk\` cannot be imported, use the gateway with workspace authentication. Send JSON containing \`method\` and \`arguments\` on stdin, for example \`{"method":"conversations.list","arguments":{"limit":3,"types":"public_channel"}}\`:
15649
-
15650
- \`\`\`bash
15651
- curl -sS --fail-with-body -X POST "\${REPLICAS_MONOLITH_URL:-$MONOLITH_URL}/v1/engine/slack/api" \\
15652
- -H "Authorization: Bearer $REPLICAS_ENGINE_SECRET" \\
15653
- -H "X-Workspace-Id: \${REPLICAS_WORKSPACE_ID:-$WORKSPACE_ID}" \\
15654
- -H "X-Replicas-Chat-Id: \${REPLICAS_CHAT_ID:-}" \\
15655
- -H "Content-Type: application/json" \\
15656
- --data-binary @-
15657
- \`\`\`
15658
- `;
15659
- var SLACK_ABILITY = {
15660
- label: "Slack",
15661
- description: "Send messages, read threads, search, and transfer files through @replicas/sdk.",
15662
- bullet: "- Interacting with Slack (listing channels, sending messages, reading threads, or searching): use replicas.slack.call from @replicas/sdk. Read references/SLACK.md; no Slack MCP server or provider token in the VM is required.",
15663
- section: SECTION16,
15664
- referenceFile: { name: "SLACK.md", content: REFERENCE16 }
15665
- };
15666
-
15667
- // ../shared/src/visuals.ts
15668
- var VISUAL_COLUMN_WIDTH = 760;
15669
- var VISUAL_PHONE_WIDTH = 390;
15670
- var FONT_FAMILIES = ["Inter", "General Sans"];
15671
- var FONT_SANS = `${FONT_FAMILIES.map((family) => `"${family}"`).join(", ")}, system-ui, -apple-system, "Segoe UI", sans-serif`;
15672
- var VISUAL_PAGE_RULES = `- Write one self-contained HTML file with inline <style> and <script>; a fragment without <html> or <head> is fine. Put data inline instead of fetching it. Libraries may load from public CDNs such as cdn.jsdelivr.net. Local images written as absolute paths (src="/abs/shot.png", url(/abs/bg.webp)) are inlined when you publish.
15673
- - The page sits directly on the chat background, as wide as your reply (about ${VISUAL_COLUMN_WIDTH}px on desktop, ${VISUAL_PHONE_WIDTH - 30}px on phones), with its left edge aligned to your text. Leave html and body transparent, use a fluid width with no outer padding, and add no outer card, border, or title banner: the page is part of your reply.
15674
- - Let content set the height. Never use 100vh, height:100%, or min-height:100vh on html, body, or the outer element; publishing refuses a page whose height follows the frame. Give charts fixed pixel heights.
15675
- - Color everything with the theme variables so the page follows light and dark mode live: --foreground, --muted-foreground (secondary text), --background, --muted (subtle fills), --accent, --border, --primary and --primary-foreground (the brand accent, for emphasis), --success (passed, done, or added), --destructive, --warning, --code-background, --code-foreground, and --chart-1 to --chart-8 for series (use them in order and label series directly). Never hardcode a light or dark palette. A canvas or chart library that needs literal colors can read them with getComputedStyle(document.documentElement) and redraw on matchMedia("(prefers-color-scheme: dark)") changes.
15676
- - Text is 13px Inter, like the chat; --font-sans and --font-mono are set. Keep Replicas' flat look: separate sections with 1px var(--border) lines or var(--muted) fills, without shadows or rounded cards. Use var(--radius) only on small controls.
15677
- - A mockup of a specific product's UI, such as a client's app or a competitor's screen, is the exception: give it its own panel with at least 16px of padding and use that product's real colors, fonts, corners, and shadows inside it, so it looks like the product. Everything around the panel follows the rules above.
15678
- - Interaction is welcome: hover details, tabs, toggles, sliders. Links open in a new browser tab.
15679
- - Keep the top-right corner (about 110\xD740px) free of anything essential: the chat shows the visual's actions there on hover.`;
15680
- var THEME_FRAGMENT_KEY = "replicas-theme";
15681
- var HOST_CONTEXT_CHANGED_METHOD = "ui/notifications/host-context-changed";
15682
- var SIZE_CHANGED_METHOD = "ui/notifications/size-changed";
15683
- var OPEN_LINK_METHOD = "ui/open-link";
15684
- var OPEN_IMAGE_METHOD = "replicas/open-image";
15685
- var VISUAL_CONTENT_HEIGHT_EXPRESSION = "(function(){var r=document.documentElement;return Math.ceil(r.scrollHeight>r.clientHeight?r.scrollHeight:r.getBoundingClientRect().height)})()";
15686
- var BASE_CSS = "html{color:var(--foreground);font-family:var(--font-sans);font-size:13px;line-height:1.5;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;scrollbar-width:none}html::-webkit-scrollbar{display:none}body{margin:0}:where(*,*::before,*::after){box-sizing:border-box}code,kbd,pre,samp{font-family:var(--font-mono)}:where(:focus-visible){outline:2px solid var(--ring);outline-offset:-2px}";
15687
- var THEME_STYLE_ID = "replicas-visual-theme";
15688
- var BOOTSTRAP_SCRIPT = `
15689
- (() => {
15690
- const style = document.getElementById('${THEME_STYLE_ID}');
15691
- const nativeView = window.ReactNativeWebView;
15692
- const framed = window.parent !== window;
15693
- const post = (message) => nativeView ? nativeView.postMessage(JSON.stringify(message)) : window.parent.postMessage(message, '*');
15694
- const applyTheme = (theme) => {
15695
- const variables = Object.entries(theme.variables).map(([name, value]) => name + ':' + value + ';').join('');
15696
- const font = theme.fontUrl ? ${JSON.stringify(FONT_FAMILIES)}.map((family) => '@font-face{font-family:"' + family + '";src:url("' + theme.fontUrl + '") format("woff2");font-weight:100 900;font-display:swap}').join('') : '';
15697
- style.textContent = ':root{color-scheme:' + theme.appearance + ';' + variables + '}' + font + ${JSON.stringify(BASE_CSS)};
15698
- };
15699
- try {
15700
- const fragment = /[#&]${THEME_FRAGMENT_KEY}=([^&]*)/.exec(location.hash);
15701
- if (fragment) {
15702
- applyTheme(JSON.parse(decodeURIComponent(fragment[1])));
15703
- history.replaceState(history.state, '', location.pathname + location.search);
15643
+ var mcpValuesSchema = z25.record(z25.string(), mcpValueSchema);
15644
+ var httpConfigSchema = environmentMcpHttpConfigSchema.pick({ url: true, auth: true }).extend({
15645
+ headers: mcpValuesSchema.default({})
15646
+ }).strict();
15647
+ var replicasMcpDefinitionSchema = z25.discriminatedUnion("transport", [
15648
+ z25.strictObject({
15649
+ transport: z25.literal("stdio"),
15650
+ config: environmentMcpStdioConfigSchema.pick({ command: true }).extend({
15651
+ args: environmentMcpStdioConfigSchema.shape.args.unwrap().default([]),
15652
+ env: z25.record(variableNameSchema, mcpValueSchema).default({})
15653
+ }).strict()
15654
+ }),
15655
+ z25.strictObject({ transport: z25.literal("http"), config: httpConfigSchema }),
15656
+ z25.strictObject({ transport: z25.literal("sse"), config: httpConfigSchema })
15657
+ ]).superRefine((definition, context) => {
15658
+ if (definition.transport === "stdio") return;
15659
+ const result = validateEnvironmentMcpAuthentication(definition.transport, definition.config);
15660
+ if (!result.ok) context.addIssue({ code: "custom", path: result.error.code === "transport" ? ["transport"] : ["config", result.error.code ?? "auth"], message: result.error.message });
15661
+ });
15662
+ var replicasEnvironmentConfigSchema = z25.strictObject({
15663
+ inheritRepositories: z25.boolean().optional(),
15664
+ memory: z25.strictObject({ read: z25.boolean().optional(), write: z25.boolean().optional() }).nullable().optional(),
15665
+ gpu: z25.boolean().nullable().optional(),
15666
+ mobileTesting: z25.boolean().nullable().optional(),
15667
+ defaultSkills: defaultSkillsOverridesSchema.superRefine((skills, context) => {
15668
+ for (const ability of REPLICAS_AGENT_ABILITIES) if (skills.replicas_agent?.abilities?.[ability] === false && REPLICAS_AGENT_ABILITY_REGISTRY[ability].locked) context.addIssue({ code: "custom", path: ["replicas_agent", "abilities", ability], message: "This built-in ability cannot be disabled" });
15669
+ }).nullable().optional(),
15670
+ repositories: z25.array(z25.string().trim().min(1)).optional(),
15671
+ workspaceSize: z25.enum(WORKSPACE_SIZE_OPTIONS).optional(),
15672
+ files: z25.record(z25.string().trim().refine((path) => !validateEnvironmentFilePath(path), "must be a file path starting with ~/"), z25.strictObject({
15673
+ name: z25.string().trim().min(1).optional(),
15674
+ content: z25.string().max(65536)
15675
+ })).optional(),
15676
+ skills: z25.record(z25.string().trim().min(1), z25.strictObject({ source: z25.string().trim().min(1), name: z25.string().trim().min(1).optional() })).optional(),
15677
+ requiredPlugins: z25.array(z25.string().refine(isPluginId, "must be a supported plugin")).transform((plugins) => [...new Set(plugins)]).optional(),
15678
+ systemPrompt: z25.string().optional(),
15679
+ warmHook: z25.string().optional(),
15680
+ startHook: z25.string().optional(),
15681
+ variables: z25.record(variableNameSchema, z25.string()).optional(),
15682
+ requiredSecrets: z25.array(variableNameSchema).optional(),
15683
+ mcps: z25.record(z25.string().regex(MCP_NAME_PATTERN, "must be 1\u201364 letters, digits, underscores or hyphens, starting with a letter or digit").refine((name) => !isReservedMcpName(name), "is reserved for Replicas"), replicasMcpDefinitionSchema).optional()
15684
+ }).superRefine((config, context) => {
15685
+ if (config.inheritRepositories === true && config.repositories !== void 0) context.addIssue({ code: "custom", path: ["repositories"], message: "Inherited repositories cannot also be declared explicitly" });
15686
+ const skillNames = Object.keys(config.skills ?? {}).map((slug) => slug.toLowerCase());
15687
+ if (new Set(skillNames).size !== skillNames.length) context.addIssue({ code: "custom", path: ["skills"], message: "Skill slugs must be unique regardless of case" });
15688
+ const names = /* @__PURE__ */ new Set();
15689
+ for (const name of Object.keys(config.mcps ?? {})) {
15690
+ const normalized = name.toLowerCase();
15691
+ if (names.has(normalized)) {
15692
+ context.addIssue({ code: "custom", path: ["mcps", name], message: "MCP names must be unique regardless of case" });
15704
15693
  }
15705
- } catch {}
15706
- if (!nativeView) {
15707
- document.addEventListener('click', (event) => {
15708
- const anchor = event.isTrusted && event.composedPath().find((target) => target instanceof Element && target.matches('a[href]'));
15709
- if (!anchor) return;
15710
- const url = new URL(anchor.getAttribute('href'), document.baseURI);
15711
- if (!/^https?:$/.test(url.protocol) || url.href.split('#')[0] === location.href.split('#')[0]) return;
15712
- if (framed) {
15713
- event.preventDefault();
15714
- post({ jsonrpc: '2.0', method: '${OPEN_LINK_METHOD}', params: { url: url.href } });
15715
- } else {
15716
- anchor.setAttribute('target', '_blank');
15717
- anchor.setAttribute('rel', 'noopener');
15718
- }
15719
- }, true);
15694
+ names.add(normalized);
15720
15695
  }
15721
- if (!framed && !nativeView) return;
15722
- window.addEventListener('click', (event) => {
15723
- const image = event.composedPath()[0];
15724
- if (!event.isTrusted || event.defaultPrevented || !(image instanceof HTMLImageElement) || image.closest('a[href], button')) return;
15725
- let src = image.currentSrc || image.src;
15726
- if (/^blob:/i.test(src) || (nativeView && /^data:image\\/svg|\\.svg(?:[?#]|$)/i.test(src))) {
15727
- try {
15728
- const canvas = document.createElement('canvas');
15729
- canvas.width = (image.naturalWidth || image.width) * 2;
15730
- canvas.height = (image.naturalHeight || image.height) * 2;
15731
- canvas.getContext('2d').drawImage(image, 0, 0, canvas.width, canvas.height);
15732
- src = canvas.toDataURL('image/png');
15733
- } catch {
15734
- return;
15735
- }
15696
+ for (const key of config.requiredSecrets ?? []) {
15697
+ if (config.variables && Object.hasOwn(config.variables, key)) {
15698
+ context.addIssue({ code: "custom", path: ["requiredSecrets"], message: `"${key}" cannot also be declared as a non-secret variable` });
15736
15699
  }
15737
- if (src) post({ jsonrpc: '2.0', method: '${OPEN_IMAGE_METHOD}', params: { src, name: image.alt } });
15738
- });
15739
- let reportedHeight;
15740
- const reportHeight = () => {
15741
- const height = ${VISUAL_CONTENT_HEIGHT_EXPRESSION};
15742
- if (height === reportedHeight) return;
15743
- reportedHeight = height;
15744
- post({ jsonrpc: '2.0', method: '${SIZE_CHANGED_METHOD}', params: { height } });
15745
- };
15746
- window.addEventListener('message', (event) => {
15747
- if (event.source !== window.parent || event.data?.method !== '${HOST_CONTEXT_CHANGED_METHOD}') return;
15748
- const { theme, styles, fontUrl } = event.data.params;
15749
- applyTheme({ appearance: theme, variables: styles.variables, fontUrl });
15750
- reportedHeight = undefined;
15751
- if (document.readyState !== 'loading') reportHeight();
15752
- });
15753
- const resizeObserver = new ResizeObserver(reportHeight);
15754
- resizeObserver.observe(document.documentElement);
15755
- document.addEventListener('DOMContentLoaded', () => {
15756
- resizeObserver.observe(document.body);
15757
- reportHeight();
15758
- });
15759
- window.addEventListener('load', reportHeight);
15760
- })();
15761
- `.trim().replace(/\s*\n\s*/g, " ");
15700
+ }
15701
+ });
15762
15702
 
15763
- // ../shared/src/default-skills/replicas-agent/abilities/visuals.ts
15764
- var SECTION17 = `### Visuals
15765
- Show a chart, diagram, comparison, timeline, or mockup inline in your Replicas chat reply, in the chat's own font and colors.
15703
+ // ../shared/src/routes/environment-config-source.ts
15704
+ var ENVIRONMENT_CONFIG_PREFERENCES = [["memory", "memory"], ["gpu", "gpu"], ["mobileTesting", "mobile_testing"], ["defaultSkills", "default_skills"]];
15705
+ var ENVIRONMENT_CONFIG_SETTING_FIELDS = ["repositories", "workspaceSize", "inheritRepositories", ...ENVIRONMENT_CONFIG_PREFERENCES.map(([field]) => field)];
15706
+ var environmentConfigLocationSchema = z26.union([
15707
+ z26.object({
15708
+ kind: z26.literal("git").default("git"),
15709
+ entrypoint_filename: z26.string().optional(),
15710
+ repository_id: z26.string(),
15711
+ repository_name: z26.string(),
15712
+ filename: z26.string(),
15713
+ commit_sha: z26.string(),
15714
+ source_url: z26.string(),
15715
+ file_sha: z26.undefined().optional()
15716
+ }),
15717
+ z26.object({
15718
+ kind: z26.literal("file"),
15719
+ repository_id: z26.null(),
15720
+ repository_name: z26.null(),
15721
+ filename: z26.string(),
15722
+ commit_sha: z26.null(),
15723
+ source_url: z26.null(),
15724
+ file_sha: z26.string()
15725
+ })
15726
+ ]);
15727
+ var sourceInput = {
15728
+ repository_id: z26.string().min(1).optional(),
15729
+ file: z26.strictObject({ filename: z26.string().min(1).max(1024), environment: replicasEnvironmentConfigSchema }).optional()
15730
+ };
15731
+ var previewEnvironmentConfigSourceRequestSchema = z26.strictObject(sourceInput).refine(
15732
+ (input) => !input.file || !input.repository_id,
15733
+ { message: "Choose either a repository or a file" }
15734
+ );
15735
+ var applyEnvironmentConfigSourceRequestSchema = z26.strictObject({
15736
+ ...sourceInput,
15737
+ commit_sha: z26.string().min(1).optional(),
15738
+ fingerprint: z26.string().min(1)
15739
+ }).refine((input) => input.file ? !input.repository_id && !input.commit_sha : !!input.commit_sha, {
15740
+ message: "File configuration requires file contents; Git configuration requires a reviewed commit"
15741
+ });
15766
15742
 
15767
- **Reference:** \`references/VISUALS.md\`
15743
+ // ../shared/src/replicas-mcp.ts
15744
+ var REPLICAS_MCP_SERVER_NAME = "replicas-mcp";
15745
+ var REPLICAS_MCP_TOOLS = {
15746
+ listEnvironments: "list_environments",
15747
+ createAutomation: "create_automation",
15748
+ spawn: "spawn_workspace",
15749
+ spawnInNewThread: "spawn_workspace_in_new_thread",
15750
+ relay: "relay_to_workspace",
15751
+ listWorkspaces: "list_workspaces",
15752
+ linearStart: "start_linear_session",
15753
+ linearSessionIntent: "register_linear_session_intent",
15754
+ routeLinearTicket: "route_linear_ticket",
15755
+ listChannelSettings: "list_channel_settings",
15756
+ saveChannelPreset: "save_channel_preset",
15757
+ deleteChannelPreset: "delete_channel_preset",
15758
+ updateChannelSettings: "update_channel_settings",
15759
+ setOrganizationProactivity: "set_organization_proactivity",
15760
+ setSlackAgentDefaults: "set_slack_agent_defaults",
15761
+ claimSettingsOffer: "claim_settings_offer",
15762
+ setThreadMuted: "set_thread_muted",
15763
+ stopWorkspace: "stop_workspace",
15764
+ setSlackConnectMuted: "set_slack_connect_muted",
15765
+ setSlackConnectDefaults: "set_slack_connect_defaults",
15766
+ spawnSubagent: "spawn_subagent",
15767
+ messageSubagent: "message_subagent",
15768
+ listSubagents: "list_subagents",
15769
+ readSubagent: "read_subagent",
15770
+ archiveSubagent: "archive_subagent",
15771
+ mergeWhenReady: "merge_when_ready",
15772
+ waitForSubagents: "wait_for_subagents",
15773
+ getBoard: "get_board",
15774
+ updateBoard: "update_board",
15775
+ updateTicket: "update_ticket",
15776
+ replyOnTicket: "reply_on_ticket",
15777
+ sendToChat: "send_to_chat",
15778
+ setStatus: "set_status",
15779
+ getLinearRouting: "get_linear_routing",
15780
+ setLinearRouting: "set_linear_routing",
15781
+ clearLinearRouting: "clear_linear_routing",
15782
+ getSlackChannel: "get_slack_channel",
15783
+ linkSlackChannel: "link_slack_channel",
15784
+ createSlackChannel: "create_slack_channel",
15785
+ unlinkSlackChannel: "unlink_slack_channel",
15786
+ setSlackChannelLevel: "set_slack_channel_level",
15787
+ createReplica: "create_replica",
15788
+ listReplicas: "list_replicas",
15789
+ getReplica: "get_replica",
15790
+ deleteReplica: "delete_replica",
15791
+ wakeReplica: "wake_replica",
15792
+ sleepReplica: "sleep_replica",
15793
+ archiveReplica: "archive_replica",
15794
+ waitForReplica: "wait_for_replica",
15795
+ runCommand: "run_command",
15796
+ getReplicaHooks: "get_replica_hooks",
15797
+ whoami: "whoami",
15798
+ sendReplicaMessage: "send_replica_message",
15799
+ readReplicaHistory: "read_replica_history",
15800
+ listChats: "list_chats",
15801
+ createChat: "create_chat",
15802
+ deleteChat: "delete_chat",
15803
+ listRepositories: "list_repositories"
15804
+ };
15805
+ var automationToolInputSchema = z27.object({
15806
+ name: z27.string().describe("Short automation name."),
15807
+ prompt: z27.string().describe("Prompt each automation run starts with."),
15808
+ environment_id: z27.string().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`.`),
15809
+ triggers: z27.array(automationTriggerSchema).min(1).describe(
15810
+ `One or more triggers. Cron: \`{ "type": "cron", "config": { "schedule": "0 9 * * 1", "timezone": "America/New_York" } }\`. GitHub: \`{ "type": "github", "config": { "event": "pull_request.opened", "repository_ids": ["<repository uuid>"] } }\`. Linear: \`{ "type": "linear", "config": { "event": "${LINEAR_ISSUE_STATE_CHANGED_EVENT}", "state_types": ["completed"] } }\`.`
15811
+ ),
15812
+ description: z27.string().optional().describe("One-line summary shown in the dashboard."),
15813
+ plan_mode: z27.boolean().optional(),
15814
+ goal_mode: z27.boolean().optional(),
15815
+ fast_mode: z27.boolean().optional(),
15816
+ workspace_lifecycle_policy: z27.enum(AUTOMATION_LIFECYCLE_POLICIES).optional().describe(
15817
+ "What happens to a run's workspace when the agent finishes. `delete_when_done` (default, except one-time runs, which default to `default`) when the output lives elsewhere (PR comments, checks, Slack posts); `sleep_when_done` when later runs reuse the workspace, like one per PR across pushes; `default` (keep alive) when people follow up in the workspace."
15818
+ )
15819
+ });
15820
+ var credentialUserIdDescription = `Organization automations only: the user ID (see \`${REPLICAS_MCP_TOOLS.whoami}\`) of the member whose coding agent credentials, such as their Claude subscription, runs use before the organization's. Only your workspace's owner, or whoever's credentials this workspace runs on.`;
15821
+ var automationBackgroundSchema = z27.boolean().optional().describe(
15822
+ "Marks this as an AI agent's own automation (a reminder, follow-up or recurring check-in for its task). Kept out of the main automations list."
15823
+ );
15824
+ var automationCreateToolInputSchema = automationToolInputSchema.extend({
15825
+ credential_user_id: z27.string().optional().describe(`${credentialUserIdDescription} Omit to use the organization's.`),
15826
+ background: automationBackgroundSchema,
15827
+ scope: z27.enum(["org", "user"]).optional().describe("`org` (default) or `user` for a personal automation, which needs a personal API key.")
15828
+ });
15829
+ var automationUpdateToolInputSchema = automationToolInputSchema.partial().extend({
15830
+ automation_id: z27.string().describe("Automation ID"),
15831
+ enabled: z27.boolean().optional(),
15832
+ agent_provider: z27.enum(ENGINE_AGENT_PROVIDERS).nullable().optional(),
15833
+ model: z27.string().nullable().optional(),
15834
+ thinking_level: z27.enum(VALID_THINKING_LEVELS).nullable().optional(),
15835
+ workspace_size: z27.enum(WORKSPACE_SIZES).optional(),
15836
+ credential_user_id: z27.string().nullable().optional().describe(`${credentialUserIdDescription} Null switches back to the organization's.`),
15837
+ background: automationBackgroundSchema,
15838
+ scope: z27.literal("org").optional().describe("`org` moves a personal automation to the organization so teammates can see and edit it. It cannot be moved back.")
15839
+ });
15840
+ var chatPath = { id: z27.string().describe("Workspace ID"), chat_id: z27.string().describe("Chat ID") };
15841
+ var { provider, model, thinkingLevel, title, message } = forkChatRequestSchema.shape;
15842
+ var createChatToolInputSchema = z27.object({ id: chatPath.id, provider, title: createChatRequestSchema.shape.title });
15843
+ var forkChatToolInputSchema = z27.object({ ...chatPath, provider, model, thinking_level: thinkingLevel, title, message });
15844
+ var renameChatToolInputSchema = z27.object({ ...chatPath, display_name: updateChatDisplayNameRequestSchema.shape.displayName });
15845
+ var runCommandToolInputSchema = z27.object({ id: chatPath.id, ...workspaceExecRequestSchema.shape });
15846
+ var environmentMcpPath = { environment_id: z27.string().describe("Environment ID") };
15847
+ var createEnvironmentMcpToolInputSchema = z27.object({ ...environmentMcpPath, ...createEnvironmentMcpRequestSchema.shape });
15848
+ var updateEnvironmentMcpToolInputSchema = z27.object({
15849
+ ...environmentMcpPath,
15850
+ mcp_id: z27.string().describe("MCP ID"),
15851
+ ...updateEnvironmentMcpRequestSchema.shape
15852
+ });
15853
+ var createEnvironmentDeviceToolInputSchema = z27.object({ ...environmentMcpPath, ...createEnvironmentDeviceRequestSchema.shape });
15854
+ var previewEnvironmentConfigSourceToolInputSchema = previewEnvironmentConfigSourceRequestSchema.safeExtend(environmentMcpPath);
15855
+ var applyEnvironmentConfigSourceToolInputSchema = applyEnvironmentConfigSourceRequestSchema.safeExtend(environmentMcpPath);
15768
15856
 
15769
- Use this when:
15770
- - Seeing it would explain faster than reading it: numbers over time, a flow or architecture, a before and after, options side by side
15771
- - The user asks to see, chart, plot, compare, or visualize something`;
15772
- var REFERENCE17 = `# Visuals
15857
+ // ../shared/src/scout.ts
15858
+ var SCOUT_SOURCE_TYPES = ["slack", "linear"];
15859
+ var SCOUT_PROACTIVITY_LEVELS = ["tagged", "conservative", "balanced", "proactive"];
15860
+ var SCOUT_PRESET_NAME_MAX_LENGTH = 50;
15861
+ var SCOUT_CHANNEL_SETTINGS_OFFERS = ["proactivity", "raise_proactivity", "instructions"];
15862
+ var SCOUT_SETTINGS_OFFERS = [...SCOUT_CHANNEL_SETTINGS_OFFERS, "organization_proactivity", "raise_organization_proactivity"];
15863
+ var SCOUT_PRESET_ICONS = [
15864
+ "users",
15865
+ "user",
15866
+ "inbox",
15867
+ "building",
15868
+ "bug",
15869
+ "message-circle",
15870
+ "headphones",
15871
+ "heart",
15872
+ "star",
15873
+ "flag",
15874
+ "zap",
15875
+ "shield",
15876
+ "code",
15877
+ "terminal",
15878
+ "rocket",
15879
+ "wrench",
15880
+ "briefcase",
15881
+ "globe",
15882
+ "book-open",
15883
+ "lightbulb",
15884
+ "target",
15885
+ "bell",
15886
+ "layers",
15887
+ "tag"
15888
+ ];
15773
15889
 
15774
- A visual is a self-contained HTML page shown inline in your Replicas chat reply. It sits on the chat background in the chat's font and colors, grows to fit its content, and follows the user's light or dark theme live.
15890
+ // ../shared/src/default-skills/scout-settings.ts
15891
+ var SCOUT_SETTINGS_SKILL_NAME = "scout-settings";
15892
+ var CONTENT = `---
15893
+ name: ${SCOUT_SETTINGS_SKILL_NAME}
15894
+ description: Use when someone asks what Replicas can do or what they can change ("what can you do?", "what can I change here?"), asks to change or explain how Replicas behaves in Slack or Linear (channel levels, "be quieter", "only reply when tagged", silent mode, mute, channel or team instructions, presets, monitored Linear teams, Slack Connect defaults, Slack agent defaults), when someone is annoyed that Scout replied unasked ("not you", "nobody asked", a thumbs-down), when making or answering a settings or automation offer, or when setting up an automation. Not for routing ordinary requests.
15895
+ ---
15775
15896
 
15776
- ## When to make one
15897
+ # Scout settings
15777
15898
 
15778
- Make one when seeing beats reading: how parts of a system connect, how a request or data flows, numbers or options compared, a timeline, a before and after, or a UI mockup. Make one when the user asks to see, chart, compare, sketch, or visualize something. Never draw these as ASCII art or text diagrams.
15899
+ There is no settings page: people change how Replicas behaves by asking you, and you own every setting below. Handle requests here, never by spawning a workspace. People know you as Replicas, so never say Scout to them.
15779
15900
 
15780
- Don't make one when:
15781
- - A short answer or list covers it.
15782
- - It is a plain table: write a Markdown table.
15783
- - It is screenshots, or a before and after of them: upload them as images, which readers can open full screen and zoom. See "Before and after" in \`references/MEDIA.md\`.
15784
- - The user wants a page, site, or component in their project: build that in the repo.
15901
+ ## What you can do
15902
+ | Ask | How | Who |
15903
+ | --- | --- | --- |
15904
+ | How much you speak up in a channel or group DM (Mentions only, Low, Balanced, High) | \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\` \`proactivity\` | Any member, except that raising one from Mentions only needs an admin |
15905
+ | How much you speak up in every channel | \`${REPLICAS_MCP_TOOLS.setOrganizationProactivity}\` | Admin |
15906
+ | Silent mode for a channel, also asked as muting you there (you still read it and follow its instructions, but never post there) | \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\` \`silent\` | Admin |
15907
+ | Instructions for a channel or Linear team, such as "file bugs in Linear and post them in #triage", "send actionable messages to App Support", or "mobile requests go to the mobile-ios environment" | \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\` \`instructions\` | Any member |
15908
+ | Create, edit, or delete a preset (reusable instructions), or assign one | \`${REPLICAS_MCP_TOOLS.saveChannelPreset}\`, \`${REPLICAS_MCP_TOOLS.deleteChannelPreset}\`, \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\` \`preset_id\` | Any member |
15909
+ | Defaults for every channel shared with another company: preset, instructions, level, silent mode | \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\` | Admin |
15910
+ | Triage new issues in a Linear team, or stop | \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\` \`source: linear\`, \`monitored\` | Admin starts; any member stops |
15911
+ | Agent, model, thinking level, goal mode, and fast mode for tasks started from Slack | \`${REPLICAS_MCP_TOOLS.setSlackAgentDefaults}\` | Admin |
15912
+ | Stay quiet in this thread, or come back | \`${REPLICAS_MCP_TOOLS.setThreadMuted}\` | Anyone in the thread |
15913
+ | A recurring task ("every Monday, summarize open PRs in #eng") | \`${REPLICAS_MCP_TOOLS.createAutomation}\` (see Automations) | Members who can create automations |
15785
15914
 
15786
- A long report or write-up goes in the Canvas, and its key charts and comparisons go in a visual in your reply. Never screenshot a report, chart, or diagram you made to show it: a long page shrunk to an image can't be read, and it ignores the reader's theme. Screenshots of app UI you changed are still right.
15915
+ You also answer questions, start a workspace for a task (in a separate thread when asked), relay follow-ups to a thread's workspace, stop it, hand a thread to a Mothership by name, and file Linear tickets with \`replicas.linear.graphql\`. Spawn for a one-time reminder ("remind me tomorrow at 9"): workspaces can schedule one-time runs.
15787
15916
 
15788
- ## Make it
15917
+ A person's own defaults (agent, model, environment) and the organization's general defaults are changed in the Replicas app, not by you; Slack tasks use them unless the Slack agent defaults above say otherwise.
15789
15918
 
15790
- 1. Write the page, for example \`/tmp/visuals/<name>.html\`, following the page rules below.
15791
- 2. Run \`replicas visualize <page.html> --title "<short title>"\`. It checks the page in a headless browser, publishes it, and prints two screenshots (dark at desktop width, light at phone width) with any console errors and layout warnings.
15792
- 3. Open both screenshots and look. If anything is wrong, fix the page and publish again, then use the newest line. While iterating, \`replicas visualize <page.html> --check\` renders without publishing.
15793
- 4. Paste the printed \`![\u2026](\u2026)\` line on its own line where the visual belongs in your final reply.
15919
+ You can't add yourself to or remove yourself from a channel: people type \`/invite @Replicas\` or \`/remove @Replicas\` there, and an admin can pick channels under Integrations, Slack, Configure. To keep you in a channel but out of the way, lower it to Mentions only or put it in silent mode. A channel becomes a Mothership's own channel from that Mothership, not here; any channel's instructions can still send its messages to a Mothership.
15794
15920
 
15795
- ## Page rules
15921
+ ## Tools
15922
+ Read presets, channel instructions, and levels with \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Change them with \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\`, \`${REPLICAS_MCP_TOOLS.saveChannelPreset}\`, \`${REPLICAS_MCP_TOOLS.deleteChannelPreset}\`, \`${REPLICAS_MCP_TOOLS.setOrganizationProactivity}\`, \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`, or \`${REPLICAS_MCP_TOOLS.setSlackAgentDefaults}\`. Every change takes \`confirmation_*\` arguments naming who asked. For a Slack message, fill them with its envelope \`channel_id\`, \`thread_ts\`, \`message_ts\`, and \`user_id\`. A message from a person in the Replicas dashboard has no \`[Slack]\` envelope and carries a \`confirmation_dashboard_token\`: pass only that, never one from another message, and answer in the chat. The server checks that the person who asked is an organization member (and an admin where noted). If it refuses, say why briefly and change nothing.
15796
15923
 
15797
- ${VISUAL_PAGE_RULES}
15924
+ ## Changing settings
15925
+ - Settings also change outside your chat, often on purpose: read the current settings first, never trust earlier messages, and never re-apply an earlier request the current message doesn't ask for. Save only what the current message asks.
15926
+ - **Levels**, lowest to highest: \`tagged\` (only @Replicas pings reach you, not even messages naming Replicas), \`conservative\` (also messages naming Replicas or Scout, and follow-ups in threads with a workspace), \`balanced\` (the normal triage rules), \`proactive\` (also clear untagged questions and requests). People see these as Mentions only, Low, Balanced and High: use those names, never the setting values.
15927
+ - The organization has one level for its whole Slack workspace, which only an admin can set with \`${REPLICAS_MCP_TOOLS.setOrganizationProactivity}\`. A channel or group DM can override it with \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\` and \`proactivity\`. 1:1 DMs are always addressed to you. Any member can lower a channel; raising one above \`tagged\` needs an admin.
15928
+ - A request that points at a channel ("here", "in #eng", "stop replying in #random") changes that channel only. One that doesn't ("only respond when I @ you", "don't auto-reply to Slack messages") means the organization level. When it names a channel, even without "#" ("make support-inbound quieter"), find it with \`conversations.list\` and change that one, not the one you were asked in; ask if none or several match. If a non-admin asks for an organization change, say an organization admin has to ask, and offer the channel-only change when they asked from a channel. Instructions don't substitute for a level.
15929
+ - **Instructions and presets:** prefer changing the channel's own instructions; edit a shared preset only when asked, since every channel using it changes. To set up a channel without being told how, read enough of it to propose short instructions or a fitting preset (customer, vendor, internal team), and save nothing until they confirm. Never infer a channel's purpose only because Slack marks it externally shared.
15930
+ - **Silent mode** is what people mean by muting you in a channel. A channel in silent mode still reaches you as its level allows, and you follow its instructions anywhere but there. For "watch #alerts and report to #team", an admin turns on \`silent\` for the watched channel, raises it to Balanced or High so untagged messages reach you, and its instructions name where to report. It is separate from a thread mute, which lasts hours and only quiets one thread.
15931
+ - **Linear teams:** set \`monitored: true\` to start triaging a team (admin only) and \`monitored: false\` to stop. Teams take a preset or instructions like channels.
15932
+ - **Slack Connect** channels shared with another company follow the organization's shared-channel defaults (\`tagged\` with no preset unless an admin set them with \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`) until they get their own settings, unless a Mothership is linked to one. A request about all shared or customer channels changes only those defaults: leave channels with their own settings as they are, list them, and offer to switch them too. Asked why you stay quiet in one, say it's external and an admin can ask you to raise its level.
15933
+ - **Slack agent defaults:** to change the agent, model, thinking level, goal mode, or fast mode for tasks started from Slack ("use Codex for Slack tasks"), call \`${REPLICAS_MCP_TOOLS.setSlackAgentDefaults}\` (admin only).
15934
+ - **"What can you do?"** Keep it short: one line on what you do (answer questions, start a workspace for a task, hand work to a Mothership, file Linear tickets, set up recurring tasks), two or three example requests in backticks drawn from both work and behavior (like \`fix the flaky login test\`, \`only reply here when tagged\`, \`every Monday, summarize open PRs\`), then "Ask me what you can change here to see every setting." No settings list or current values.
15935
+ - **"What can I change?"** Read the current settings, then reply in a few short lines from **What you can do**: what applies here with its current value (this channel's level, silent mode, instructions or preset), then what applies everywhere (the every-channel level, shared-channel defaults, Linear teams, Slack agent defaults), marking what needs an admin. Give one example phrasing, like "only reply here when tagged".
15936
+ - After any change, say what changed and its scope ("every channel", or "#eng only"). Confirm only after the tool succeeded and only what it changed; say so when it failed or did less than asked.
15798
15937
 
15799
- ## In your reply
15938
+ ## Offers
15939
+ When the envelope has \`offers\`, it lists the offers you may still make in this channel (${SCOUT_CHANNEL_SETTINGS_OFFERS.map((offer) => `\`${offer}\``).join(", ")}); \`offers=none\` means none. Offer only what it lists, at most one per message. Claim the offer with \`${REPLICAS_MCP_TOOLS.claimSettingsOffer}\` right before posting it, and post only when the claim succeeds. When someone declines ("no", "it's fine", "leave it"), record it with \`declined: true\`; never repeat an ignored offer. When they accept, apply it with the tools above using the accepting message as confirmation, then confirm in one short line.
15940
+ - **Frustration.** When someone is clearly annoyed that you replied or acted unasked ("wtf why did replicas respond", "not you", "nobody asked", or a thumbs-down on a reply you posted unasked), claim \`proactivity\` and post one short apology offering to lower this channel exactly one step. From Balanced or High: "Sorry for jumping in. Want me to only reply here when someone mentions me by name?" From Low: "Sorry for jumping in. Want me to only reply here when someone @mentions me?" On a yes, set that level, nothing lower. Do nothing else in that thread. When the claim answers \`offer: organization\`, offer to set every channel's default to \`organization_target\` instead; when \`requester_is_admin\` is false, say an admin can change it for every channel and offer this channel. An explicit "stop replying in this thread" is still a thread mute.
15941
+ - **Having to tag you.** After doing what an earlier untagged message asked, claim \`raise_proactivity\` and end your reply with one line offering one step up. From Mentions only: "Want me to pick up messages here that name me, without an @mention? @mention me with your answer." From Low: "Want me to pick up requests like that here without a tag next time? I can raise this channel to Balanced." From Balanced: "Want me to jump in on requests like that here without being asked? I can raise this channel to High." When the claim answers \`offer: organization\`, offer to raise every channel's default to \`organization_target\` instead, and say channels with their own level keep it. Mention an admin only when the claim answers \`needs_admin: true\`, then offer this channel instead. On a yes, raise to that level only.
15942
+ - **Channel instructions.** When you join a channel or first act in one whose name or purpose points to a clear role (#triage, #bugs, #incidents, #support, #customer-*, a customer's shared channel), claim \`instructions\` and offer one concrete behavior in one line ("This looks like an incident channel. Want me to triage new reports here, check for duplicates, and post findings in the thread?"). Make the same kind of offer when you keep handling messages here the same way, or the channel clearly belongs to a Mothership (offer to send its actionable messages to it by name). On a yes, save it as the channel's instructions, or its preset when one fits exactly.
15800
15943
 
15801
- - The user sees the visual itself. Don't introduce it ("Here's a chart", "Here's the diagram"), say where it is, or restate its data. Add only what it doesn't say, such as the takeaway or a caveat.
15802
- - Paste the line in your final reply, not in a progress update. To change a visual, edit the page, publish it again, and paste the new line.
15803
- - The line only renders in Replicas chat. When you post to pull requests, Slack, Linear, or anywhere else, link the printed Forge link instead. Leave the Forge link out of your chat reply.
15944
+ ## Automations
15945
+ When someone asks for a recurring task or accepts an offer to automate a repeated request, set it up here instead of spawning. Infer the name, prompt, environment, repositories, schedule, and timezone from the conversation and the organization's configuration; ask one concise follow-up only for a missing detail that changes when or where it runs. Create it with \`${REPLICAS_MCP_TOOLS.createAutomation}\`, filling \`confirmation_*\` from the envelope of the message that asked or accepted. The server checks that author is an organization member with automation write access; never create it if that fails. Post the result in the same thread.
15804
15946
  `;
15805
- var VISUALS_ABILITY = {
15806
- label: "Visuals",
15807
- description: "Show charts, diagrams, comparisons, and mockups inline in chat replies.",
15808
- // The visuals_instructions system prompt block is its trigger.
15809
- bullet: "",
15810
- section: SECTION17,
15811
- referenceFile: { name: "VISUALS.md", content: REFERENCE17 }
15812
- };
15813
-
15814
- // ../shared/src/default-skills/replicas-agent/registry.ts
15815
- var REPLICAS_AGENT_ABILITY_REGISTRY = {
15816
- replicas: REPLICAS_ABILITY,
15817
- memory: SESSION_HISTORY_ABILITY,
15818
- computer: COMPUTER_ABILITY,
15819
- docker: DOCKER_ABILITY,
15820
- environment_setup: ENVIRONMENT_SETUP_ABILITY,
15821
- github: GITHUB_ABILITY,
15822
- gitlab: GITLAB_ABILITY,
15823
- gpu: GPU_ABILITY,
15824
- linear: LINEAR_ABILITY,
15825
- local_computer: LOCAL_COMPUTER_ABILITY,
15826
- macos: MACOS_ABILITY,
15827
- media: MEDIA_ABILITY,
15828
- plugins: PLUGINS_ABILITY,
15829
- previews: PREVIEWS_ABILITY,
15830
- sentry: SENTRY_ABILITY,
15831
- slack: SLACK_ABILITY,
15832
- visuals: VISUALS_ABILITY
15833
- };
15834
- var REPLICAS_AGENT_ABILITIES = Object.keys(
15835
- REPLICAS_AGENT_ABILITY_REGISTRY
15836
- );
15837
-
15838
- // ../shared/src/routes/preferences.ts
15839
- var EMPTY_AGENT_DEFAULT_SETTINGS = {
15840
- agent_provider: null,
15841
- model: null,
15842
- thinking_level: null,
15843
- goal_mode: null,
15844
- fast_mode: null
15845
- };
15846
- var DEFAULT_SUBAGENT_MCP_PROVIDERS = [...ENGINE_AGENT_PROVIDERS];
15847
- var ALERT_SOUND_FAMILIES = {
15848
- glass: ["glint", "tap", "ripple", "halo"],
15849
- wood: ["ready", "pluck", "knock", "bloom", "steps"]
15850
- };
15851
- var ALERT_SOUNDS = [...ALERT_SOUND_FAMILIES.glass, ...ALERT_SOUND_FAMILIES.wood];
15852
- var WALLPAPER_DITHERS = ["dither", "halftone", "modulation"];
15853
- var WALLPAPER_EFFECTS = ["soft", "grain", "duotone", ...WALLPAPER_DITHERS, "none"];
15854
- var PUSH_WHEN_ACTIVE_COPY = {
15855
- wait: `Wait ${PUSH_HOLD_MINUTES} minutes`,
15856
- skip: "Don\u2019t send",
15857
- send: "Send right away"
15858
- };
15859
- var DEFAULT_USER_PREFERENCES = {
15860
- default_agent: null,
15861
- default_model: null,
15862
- claude_models: null,
15863
- codex_models: null,
15864
- cursor_models: null,
15865
- claude_hidden_models: null,
15866
- codex_hidden_models: null,
15867
- cursor_hidden_models: null,
15868
- openrouter_models: null,
15869
- opencode_go_models: null,
15870
- close_workspace_on_pr_close: false,
15871
- close_workspace_on_pr_merge: false,
15872
- default_environment_id: null,
15873
- respond_to_ci_workflows: true,
15874
- respond_to_ci_checks: true,
15875
- respond_to_human_pr_reviews: false,
15876
- pr_user_attribution: false,
15877
- github_commit_name: null,
15878
- github_commit_email: null,
15879
- auto_draft_prs: false,
15880
- open_prs_in_graphite: false,
15881
- open_links_in_desktop_app: false,
15882
- local_control: false,
15883
- spotify_controls: false,
15884
- appshot_shortcut: "command",
15885
- appshot_destination: "automatic",
15886
- appshot_sound: true,
15887
- keyboard_shortcuts: {},
15888
- mothership_tour_seen: false,
15889
- slack_settings_moved_notice: false,
15890
- mothership_board_opened: false,
15891
- follow_up_mode: "steer",
15892
- send_key: "enter",
15893
- memory_enabled: null,
15894
- subagent_mcp_enabled: null,
15895
- default_fast_mode: false,
15896
- auto_compact_tokens: null,
15897
- agent_defaults: { ...EMPTY_AGENT_DEFAULT_SETTINGS },
15898
- fallback_chains: null,
15899
- alert_sound: null,
15900
- workspace_alerts: {},
15901
- automation_alerts: {},
15902
- push_types: { needs_you: true, finished: true, automations: true, usage_limit: true },
15903
- push_when_active: "wait",
15904
- chat_text_size: "default",
15905
- app_font: "inter",
15906
- code_font: "geist-mono",
15907
- wallpaper: null
15908
- };
15909
- function defaultReplicasAgentAbilities() {
15910
- const abilities = {};
15911
- for (const key of REPLICAS_AGENT_ABILITIES) {
15912
- abilities[key] = true;
15913
- }
15914
- if (hasAllReplicasAgentAbilities(abilities)) return abilities;
15915
- throw new Error("Default Replicas agent ability flags are incomplete");
15916
- }
15917
- function hasAllReplicasAgentAbilities(abilities) {
15918
- return REPLICAS_AGENT_ABILITIES.every((key) => typeof abilities[key] === "boolean");
15919
- }
15920
- var DEFAULT_DEFAULT_SKILLS = {
15921
- replicas_agent: {
15922
- enabled: true,
15923
- abilities: defaultReplicasAgentAbilities()
15924
- }
15925
- };
15926
- var LINEAR_ROUTING_SKILL_MAX_LENGTH = 5e4;
15927
- var linearRoutingSkillSchema = z27.union([
15928
- z27.object({ name: z27.string().min(1), content: z27.string().trim().min(1).max(LINEAR_ROUTING_SKILL_MAX_LENGTH) }),
15929
- z27.object({ name: z27.string().min(1), repository_id: z27.string().regex(UUID_RE), path: z27.string().min(1) })
15930
- ]);
15931
15947
 
15932
15948
  // ../shared/src/prompts.ts
15933
15949
  var REPLICAS_INSTRUCTIONS_TAG = "replicas_instructions";
@@ -21117,7 +21133,7 @@ var VOICE_WAVEFORM = {
21117
21133
  };
21118
21134
 
21119
21135
  // ../shared/src/e2b.ts
21120
- var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-18-v8";
21136
+ var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-18-v9";
21121
21137
 
21122
21138
  // ../shared/src/e2b-retry.ts
21123
21139
  var DEFAULT_BACKOFFS_MS = [2e3, 5e3];
@@ -23605,8 +23621,6 @@ export {
23605
23621
  engineMcpOAuthTokenResponseSchema,
23606
23622
  DEVICE_HOST_KEYS_HEADER,
23607
23623
  provisionedDeviceSchema,
23608
- REPLICAS_MCP_SERVER_NAME,
23609
- REPLICAS_MCP_TOOLS,
23610
23624
  REPLICAS_RUNTIME_ENV_ALIASES,
23611
23625
  readReplicasRuntimeEnv,
23612
23626
  shellQuotePosix,
@@ -23627,6 +23641,8 @@ export {
23627
23641
  gitIdentityConfigCommands,
23628
23642
  HISTORY_ROOT,
23629
23643
  HISTORY_INDEX_FILENAME,
23644
+ REPLICAS_MCP_SERVER_NAME,
23645
+ REPLICAS_MCP_TOOLS,
23630
23646
  REPLICAS_INSTRUCTIONS_TAG,
23631
23647
  MOTHERSHIP_INSTRUCTIONS_TAG,
23632
23648
  wrapInTag,