replicas-cli 0.3.685 → 0.3.686

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 +24 -9
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -28503,8 +28503,8 @@ In agent mode the CLI hides commands that don't make sense for in-workspace agen
28503
28503
  | \`replicas preview ...\` | Register / list preview URLs (covered in \`PREVIEWS.md\`) |
28504
28504
  | \`replicas service ...\` | Run long-lived services detached so they survive workspace sleep/wake (see below) |
28505
28505
  | \`replicas media ...\` | Upload, list, share, revoke, or delete workspace media; follow \`MEDIA.md\` for destination embedding |
28506
- | \`replicas skills suggest <SKILL.md> --title <text>\` | Suggest saving a lasting user instruction as a learning (an organization skill); the user accepts or dismisses it |
28507
- | \`replicas skills suggest --delete <name-or-id>\` | When the user asks you to delete a learning, suggest removing it; the user accepts or dismisses it |
28506
+ | \`replicas skills suggest <SKILL.md> --title <text> [--scope manager|org]\` | Suggest saving a lasting user instruction as a learning (defaults to this Manager inside a Manager or its ships, otherwise organization-wide); the user accepts or dismisses it |
28507
+ | \`replicas skills suggest --delete <name-or-id> [--scope manager|org]\` | When the user asks you to delete a learning, suggest removing it; the user accepts or dismisses it |
28508
28508
  | \`replicas slack thread ...\` | Attach or switch Slack thread routing (covered in \`SLACK.md\`) |
28509
28509
  | \`replicas theme get\` / \`replicas theme set ...\` | Show or change the web and desktop app theme of the person who wrote in this workspace (see *Themes*) |
28510
28510
 
@@ -38737,7 +38737,7 @@ var init_frontmatter = __esm({
38737
38737
  });
38738
38738
 
38739
38739
  // ../shared/src/learned-skills.ts
38740
- var LEARNED_SKILLS_ROOT, LEARNED_SKILLS_MANIFEST_PATH, learnedSkillsManifestSchema, dreamVerdictChecksSchema, DREAM_VERDICT_CHECKS, dreamVerdictSchema;
38740
+ var LEARNED_SKILLS_ROOT, LEARNED_SKILLS_MANIFEST_PATH, LEARNED_SKILL_DIR_PREFIX, MANAGER_LEARNED_SKILL_DIR_PREFIX, LEARNED_SKILL_SCOPES, learnedSkillsManifestSchema, dreamVerdictChecksSchema, DREAM_VERDICT_CHECKS, dreamVerdictSchema;
38741
38741
  var init_learned_skills = __esm({
38742
38742
  "../shared/src/learned-skills.ts"() {
38743
38743
  "use strict";
@@ -38747,8 +38747,16 @@ var init_learned_skills = __esm({
38747
38747
  init_sandbox();
38748
38748
  LEARNED_SKILLS_ROOT = `${SANDBOX_PATHS.REPLICAS_DIR}/learned-skills`;
38749
38749
  LEARNED_SKILLS_MANIFEST_PATH = `${LEARNED_SKILLS_ROOT}/manifest.json`;
38750
+ LEARNED_SKILL_DIR_PREFIX = "replicas-learned__";
38751
+ MANAGER_LEARNED_SKILL_DIR_PREFIX = `${LEARNED_SKILL_DIR_PREFIX}manager__`;
38752
+ LEARNED_SKILL_SCOPES = ["org", "manager"];
38750
38753
  learnedSkillsManifestSchema = external_exports.object({
38751
- skills: external_exports.array(external_exports.object({ name: external_exports.string(), sha256: external_exports.string() }))
38754
+ managerWorkspaceId: external_exports.string().nullable().default(null),
38755
+ skills: external_exports.array(external_exports.object({
38756
+ name: external_exports.string(),
38757
+ sha256: external_exports.string(),
38758
+ scope: external_exports.enum(LEARNED_SKILL_SCOPES).optional()
38759
+ }))
38752
38760
  });
38753
38761
  dreamVerdictChecksSchema = external_exports.object({
38754
38762
  repeatable: external_exports.boolean(),
@@ -61750,15 +61758,21 @@ var init_history = __esm({
61750
61758
 
61751
61759
  // src/commands/skills.ts
61752
61760
  async function skillsSuggestCommand(file2, options) {
61753
- const body2 = options.delete ? { remove: options.delete } : file2 && options.title ? { content: (0, import_node_fs5.readFileSync)(file2, "utf-8"), title: options.title } : null;
61761
+ const scope = LEARNED_SKILL_SCOPES.find((scope2) => scope2 === options.scope);
61762
+ if (options.scope !== void 0 && scope === void 0) {
61763
+ throw new Error(`Invalid --scope '${options.scope}'. Use one of: ${LEARNED_SKILL_SCOPES.join(", ")}`);
61764
+ }
61765
+ const target = scope ? { scope } : {};
61766
+ const body2 = options.delete ? { remove: options.delete, ...target } : file2 && options.title ? { content: (0, import_node_fs5.readFileSync)(file2, "utf-8"), title: options.title, ...target } : null;
61754
61767
  if (!body2) throw new Error("Pass a SKILL.md file with --title, or --delete <name-or-id>");
61755
- const { id, name, update } = await agentFetch("/v1/learned-skills/suggestions", {
61768
+ const { id, name, update, scope: resolvedScope, managerWorkspaceId } = await agentFetch("/v1/learned-skills/suggestions", {
61756
61769
  method: "POST",
61757
61770
  body: body2
61758
61771
  });
61759
61772
  const link = `[${name}](${MONOLITH_URL}/v1/learned-skills/suggestions/${id})`;
61760
- output2({ id, name, update, link }, () => {
61761
- console.log(options.delete ? `Suggested removing the learning '${name}'. It is removed only if the user accepts it.` : `Suggested ${update ? "an update to the" : "a new"} learning '${name}'. It is saved only if the user accepts it.`);
61773
+ const scopeLabel2 = resolvedScope === "manager" ? "manager learning" : "organization learning";
61774
+ output2({ id, name, update, scope: resolvedScope, managerWorkspaceId, link }, () => {
61775
+ console.log(options.delete ? `Suggested removing the ${scopeLabel2} '${name}'. It is removed only if the user accepts it.` : `Suggested ${update ? "an update to the" : "a new"} ${scopeLabel2} '${name}'. It is saved only if the user accepts it.`);
61762
61776
  console.log("Put this link on its own line in your reply; it renders as a chip where the user can review it:");
61763
61777
  console.log(link);
61764
61778
  });
@@ -61793,6 +61807,7 @@ var init_skills = __esm({
61793
61807
  "use strict";
61794
61808
  import_node_fs5 = require("fs");
61795
61809
  import_chalk33 = __toESM(require("chalk"));
61810
+ init_src();
61796
61811
  init_agent_api();
61797
61812
  init_api2();
61798
61813
  init_monolith_url();
@@ -63170,7 +63185,7 @@ ${VISUAL_PAGE_RULES}`).action(run(visualizeCommand));
63170
63185
  addComputeCommands("macos", (command) => command.option("-t, --timeout <duration>", `Maximum lifetime, e.g. 90m or 2h (default 1h, max ${MACOS_SANDBOX_MAX_TIMEOUT_MINUTES / 60}h)`).option("-e, --env <KEY=value>", 'Environment variable for the command run by "run" (repeatable)', collect, []));
63171
63186
  }
63172
63187
  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));
63173
- 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));
63188
+ skills.command("suggest [file]").description("Suggest saving a SKILL.md as a learning, 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 learning instead").option("--scope <scope>", "Learning scope: manager or org (defaults to manager inside a Manager or its ships, otherwise org)").action(run(skillsSuggestCommand));
63174
63189
  const theme = program.command("theme").description("The web and desktop app theme of the person who wrote in this workspace");
63175
63190
  theme.command("get").description("Show their theme, color theme and accent").action(run(themeGetCommand));
63176
63191
  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));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.685",
3
+ "version": "0.3.686",
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": {