replicas-cli 0.3.438 → 0.3.440

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.cjs +54 -6
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -22609,7 +22609,7 @@ function designColors({ mode, palette, accent, custom: custom2 }) {
22609
22609
  const colors = { ...DESIGN_COLORS[mode], ...paletteColors, ...accent === "custom" ? customAccent(custom2.accent, paletteColors) : ACCENT_COLORS[accent][mode] };
22610
22610
  return resolved === "custom" ? { ...colors, ...Object.fromEntries(READABLE_TEXT_KEYS.map((key) => [key, readableText(colors[key], paletteColors)])) } : colors;
22611
22611
  }
22612
- var plain, PALETTE_PRESETS, PALETTES, PALETTE_COLORS, ACCENT_PRESETS, ACCENTS, ACCENT_COLORS, dark, DESIGN_COLORS, SERIES, BRAND_COLORS, channels, mix, luminance, contrast, customMode, DEFAULT_APPEARANCE, resolvePalette, READABLE_TEXT_KEYS;
22612
+ var plain, THEME_PREFERENCES, PALETTE_PRESETS, PALETTES, PALETTE_COLORS, ACCENT_PRESETS, ACCENTS, ACCENT_COLORS, dark, DESIGN_COLORS, SERIES, BRAND_COLORS, channels, mix, luminance, contrast, customMode, themeCode, DEFAULT_THEME, resolvePalette, READABLE_TEXT_KEYS;
22613
22613
  var init_design_tokens = __esm({
22614
22614
  "../shared/src/design-tokens.ts"() {
22615
22615
  "use strict";
@@ -22625,6 +22625,7 @@ var init_design_tokens = __esm({
22625
22625
  teal: "#14b8a6",
22626
22626
  lime: "#84cc16"
22627
22627
  };
22628
+ THEME_PREFERENCES = ["system", "light", "dark"];
22628
22629
  PALETTE_PRESETS = {
22629
22630
  dark: ["default", "slate", "stone", "black", "high-contrast"],
22630
22631
  light: ["default", "slate", "stone", "neutral", "high-contrast"]
@@ -22735,7 +22736,8 @@ var init_design_tokens = __esm({
22735
22736
  return (lighter + 0.05) / (darker + 0.05);
22736
22737
  };
22737
22738
  customMode = ({ background, foreground }) => luminance(background) < luminance(foreground) ? "dark" : "light";
22738
- DEFAULT_APPEARANCE = {
22739
+ themeCode = ({ background, foreground, accent }) => [background, foreground, accent].join(",");
22740
+ DEFAULT_THEME = {
22739
22741
  palette: "default",
22740
22742
  accent: "green",
22741
22743
  custom: { background: PALETTE_COLORS.dark.default.background, foreground: PALETTE_COLORS.dark.default.foreground, accent: "#888888" }
@@ -26236,8 +26238,8 @@ curl -sS --fail-with-body -X POST "\${REPLICAS_MONOLITH_URL:-$MONOLITH_URL}/v1/e
26236
26238
  });
26237
26239
 
26238
26240
  // ../shared/src/visuals.ts
26239
- function visualTheme(mode, fontUrl, appearance = DEFAULT_APPEARANCE) {
26240
- const colors = designColors({ ...appearance, mode });
26241
+ function visualTheme(mode, fontUrl, theme = DEFAULT_THEME) {
26242
+ const colors = designColors({ ...theme, mode });
26241
26243
  return {
26242
26244
  appearance: mode,
26243
26245
  variables: {
@@ -26614,6 +26616,7 @@ var init_replicas_agent = __esm({
26614
26616
  "../shared/src/default-skills/replicas-agent/index.ts"() {
26615
26617
  "use strict";
26616
26618
  init_registry();
26619
+ init_replicas();
26617
26620
  init_registry();
26618
26621
  }
26619
26622
  });
@@ -38647,7 +38650,7 @@ var CLI_VERSION;
38647
38650
  var init_cli_version = __esm({
38648
38651
  "../shared/src/cli-version.ts"() {
38649
38652
  "use strict";
38650
- CLI_VERSION = "0.3.438";
38653
+ CLI_VERSION = "0.3.440";
38651
38654
  }
38652
38655
  });
38653
38656
 
@@ -39538,6 +39541,16 @@ var init_web_auth = __esm({
39538
39541
  }
39539
39542
  });
39540
39543
 
39544
+ // ../shared/src/routes/themes.ts
39545
+ var updateThemeRequestSchema;
39546
+ var init_themes = __esm({
39547
+ "../shared/src/routes/themes.ts"() {
39548
+ "use strict";
39549
+ init_zod();
39550
+ updateThemeRequestSchema = external_exports.object({ theme: external_exports.string(), palette: external_exports.string(), accent: external_exports.string(), code: external_exports.string() }).partial();
39551
+ }
39552
+ });
39553
+
39541
39554
  // ../shared/src/routes/client-state.ts
39542
39555
  var MAX_CLIENT_STATE_REQUEST_BYTES, MAX_CLIENT_STATE_BYTES_PER_USER, WORKSPACE_LAST_VIEWED_AT_CLIENT_STATE_KEY_PREFIX, WORKSPACE_ATTENTION_DONE_CLIENT_STATE_KEY_PREFIX, WORKSPACE_SECTION_ORDER_CLIENT_STATE_KEY_PREFIX, WORKSPACE_STAGES_CLIENT_STATE_KEY_PREFIX, WORKSPACE_MARKED_UNREAD_CLIENT_STATE_KEY_PREFIX, WORKSPACE_PINNED_CLIENT_STATE_KEY_PREFIX, PROMPT_HISTORY_CLIENT_STATE_KEY_PREFIX, WORKSPACE_SEARCH_OPENS_CLIENT_STATE_KEY_PREFIX, orgUserClientStateKey, workspaceLastViewedAtClientStateKey, workspaceAttentionDoneClientStateKey, workspaceStagesClientStateKey, workspaceSectionOrderClientStateKey, workspaceMarkedUnreadClientStateKey, workspacePinnedClientStateKey, promptHistoryClientStateKey, workspaceSearchOpensClientStateKey;
39543
39556
  var init_client_state = __esm({
@@ -39664,7 +39677,8 @@ var init_workspace_events = __esm({
39664
39677
  sharedWithUserId: external_exports.string(),
39665
39678
  sharedByName: external_exports.string(),
39666
39679
  ts: external_exports.string()
39667
- })
39680
+ }),
39681
+ external_exports.object({ type: external_exports.literal("client-state.changed"), userId: external_exports.string(), keys: external_exports.array(external_exports.string()), ts: external_exports.string() })
39668
39682
  ]);
39669
39683
  workspaceChangedEventSchema = external_exports.union([
39670
39684
  workspaceEventSchemaByType,
@@ -50046,6 +50060,7 @@ var init_src = __esm({
50046
50060
  init_organization();
50047
50061
  init_user();
50048
50062
  init_web_auth();
50063
+ init_themes();
50049
50064
  init_client_state();
50050
50065
  init_workspaces();
50051
50066
  init_mothership();
@@ -56563,6 +56578,33 @@ var init_device = __esm({
56563
56578
  }
56564
56579
  });
56565
56580
 
56581
+ // src/commands/theme.ts
56582
+ async function themeGetCommand() {
56583
+ print((email3) => `Theme of ${email3}`)(await agentFetch("/v1/engine/theme"));
56584
+ }
56585
+ async function themeSetCommand(options) {
56586
+ const body = { theme: options.theme, palette: options.colorTheme, accent: options.accent, code: options.code };
56587
+ print((email3) => `Changed the theme of ${email3}. Their open web and desktop apps repaint on their own.`)(
56588
+ await agentFetch("/v1/engine/theme", { method: "PUT", body })
56589
+ );
56590
+ }
56591
+ var print;
56592
+ var init_theme = __esm({
56593
+ "src/commands/theme.ts"() {
56594
+ "use strict";
56595
+ init_design_tokens();
56596
+ init_agent_api();
56597
+ init_output();
56598
+ print = (title2) => (saved) => output2(saved, ({ email: email3, theme, palette, accent, custom: custom2 }) => {
56599
+ console.log(title2(email3));
56600
+ console.log(`theme: ${theme}`);
56601
+ console.log(`color theme: ${palette}`);
56602
+ console.log(`accent: ${accent === "custom" ? custom2.accent : accent}`);
56603
+ if (palette === "custom") console.log(`theme code: ${themeCode(custom2)}`);
56604
+ });
56605
+ }
56606
+ });
56607
+
56566
56608
  // src/commands/local-control.ts
56567
56609
  async function connectedComputers() {
56568
56610
  const dir = import_path10.default.join(import_os5.default.homedir(), DEVICES_DIR);
@@ -56711,12 +56753,14 @@ var init_src2 = __esm({
56711
56753
  init_service();
56712
56754
  init_environment3();
56713
56755
  init_device();
56756
+ init_theme();
56714
56757
  init_local_control();
56715
56758
  init_config();
56716
56759
  init_organization2();
56717
56760
  init_output();
56718
56761
  init_visuals();
56719
56762
  init_port();
56763
+ init_design_tokens();
56720
56764
  init_src();
56721
56765
  collect = (value, previous) => [...previous, value];
56722
56766
  program = new import_commander.Command();
@@ -56989,6 +57033,9 @@ ${VISUAL_PAGE_RULES}`).action(run(visualizeCommand));
56989
57033
  }
56990
57034
  program.command("history").description("Read past session history").command("transcript <name>").description("Download the full transcript of a session in INDEX.md and print its path").action(run(historyTranscriptCommand));
56991
57035
  skills.command("suggest [file]").description("Suggest saving a SKILL.md as an organization skill, or removing one with --delete; the user reviews it first").option("--title <text>", 'Short title shown to the user, e.g. "Always use Conventional Commits" (required with a file)').option("--delete <name-or-id>", "Suggest removing this organization skill instead").action(run(skillsSuggestCommand));
57036
+ const theme = program.command("theme").description("The web and desktop app theme of the person who wrote in this workspace");
57037
+ theme.command("get").description("Show their theme, color theme and accent").action(run(themeGetCommand));
57038
+ theme.command("set").description("Change their theme; their open web and desktop apps repaint on their own").option("--theme <theme>", THEME_PREFERENCES.join(", ")).option("--color-theme <name>", `With --theme dark: ${PALETTE_PRESETS.dark.join(", ")}. With --theme light: ${PALETTE_PRESETS.light.join(", ")}`).option("--accent <color>", `${ACCENT_PRESETS.join(", ")}, or any hex color such as ff5500`).option("--code <code>", "Custom colors as a theme code of three hex colors, background,text,accent, such as 0d1117,e6ecf4,ff5500. The text has to read on the background").action(run(themeSetCommand));
56992
57039
  program.command("computer").description("Drive the workspace Linux desktop through replicas-computer");
56993
57040
  const allowed = /* @__PURE__ */ new Set([
56994
57041
  "identity",
@@ -57006,6 +57053,7 @@ ${VISUAL_PAGE_RULES}`).action(run(visualizeCommand));
57006
57053
  "slack",
57007
57054
  "computer",
57008
57055
  "local-control",
57056
+ "theme",
57009
57057
  "automation",
57010
57058
  "repos",
57011
57059
  "environment",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.438",
3
+ "version": "0.3.440",
4
4
  "description": "CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {