replicas-cli 0.2.781 → 0.2.783
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.
- package/dist/index.cjs +59 -16
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7388,6 +7388,7 @@ var WEB_APP_PATHS = {
|
|
|
7388
7388
|
settings: `${DASHBOARD_PATH}/settings`,
|
|
7389
7389
|
billing: `${DASHBOARD_PATH}/billing`,
|
|
7390
7390
|
members: `${DASHBOARD_PATH}/members`,
|
|
7391
|
+
learnings: `${DASHBOARD_PATH}/learnings`,
|
|
7391
7392
|
"audit-logs": `${DASHBOARD_PATH}/audit-logs`,
|
|
7392
7393
|
accountAgents: `${DASHBOARD_PATH}/account/agents`,
|
|
7393
7394
|
accountProfile: `${DASHBOARD_PATH}/account/profile`,
|
|
@@ -23571,7 +23572,11 @@ var REPLICAS_MCP_TOOLS = {
|
|
|
23571
23572
|
spawn: "spawn_workspace",
|
|
23572
23573
|
relay: "relay_to_workspace",
|
|
23573
23574
|
linearStart: "start_linear_session",
|
|
23574
|
-
linearSessionIntent: "register_linear_session_intent"
|
|
23575
|
+
linearSessionIntent: "register_linear_session_intent",
|
|
23576
|
+
spawnSubagent: "spawn_subagent",
|
|
23577
|
+
messageSubagent: "message_subagent",
|
|
23578
|
+
listSubagents: "list_subagents",
|
|
23579
|
+
readSubagent: "read_subagent"
|
|
23575
23580
|
};
|
|
23576
23581
|
var automationToolInputSchema = external_exports.object({
|
|
23577
23582
|
name: external_exports.string().describe("Short automation name."),
|
|
@@ -25270,6 +25275,7 @@ In agent mode the CLI hides commands that don't make sense for in-workspace agen
|
|
|
25270
25275
|
| \`replicas preview ...\` | Register / list preview URLs (covered in \`PREVIEWS.md\`) |
|
|
25271
25276
|
| \`replicas service ...\` | Run long-lived services detached so they survive workspace sleep/wake (see below) |
|
|
25272
25277
|
| \`replicas media ...\` | Upload, list, share, revoke, or delete workspace media; follow \`MEDIA.md\` for destination embedding |
|
|
25278
|
+
| \`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 |
|
|
25273
25279
|
| \`replicas slack thread ...\` | Attach or switch Slack thread routing (covered in \`SLACK.md\`) |
|
|
25274
25280
|
|
|
25275
25281
|
\`replicas <command> --help\` is always the source of truth for flags.
|
|
@@ -27885,6 +27891,12 @@ var SLASH_COMMANDS = [
|
|
|
27885
27891
|
providers: [...VALID_AGENT_PROVIDERS]
|
|
27886
27892
|
}))
|
|
27887
27893
|
];
|
|
27894
|
+
var MULTITASK_SLASH_COMMAND = {
|
|
27895
|
+
command: "/multitask",
|
|
27896
|
+
description: "Hand work to parallel subagent workspaces that report back here.",
|
|
27897
|
+
argumentHint: "[prompt]",
|
|
27898
|
+
providers: [...VALID_AGENT_PROVIDERS]
|
|
27899
|
+
};
|
|
27888
27900
|
|
|
27889
27901
|
// ../shared/src/replicas-config.ts
|
|
27890
27902
|
var import_yaml = __toESM(require_dist());
|
|
@@ -27924,7 +27936,7 @@ var headlessAgentRequestSchema = external_exports.object({
|
|
|
27924
27936
|
});
|
|
27925
27937
|
|
|
27926
27938
|
// ../shared/src/cli-version.ts
|
|
27927
|
-
var CLI_VERSION = "0.2.
|
|
27939
|
+
var CLI_VERSION = "0.2.783";
|
|
27928
27940
|
|
|
27929
27941
|
// ../shared/src/version.ts
|
|
27930
27942
|
function compareVersions(v1, v2) {
|
|
@@ -28607,6 +28619,16 @@ function isPublicMediaKind(value) {
|
|
|
28607
28619
|
}
|
|
28608
28620
|
var MAX_ENGINE_LOG_BYTES = 50 * 1024 * 1024;
|
|
28609
28621
|
|
|
28622
|
+
// ../shared/src/frontmatter.ts
|
|
28623
|
+
var import_yaml2 = __toESM(require_dist());
|
|
28624
|
+
|
|
28625
|
+
// ../shared/src/learned-skills.ts
|
|
28626
|
+
var LEARNED_SKILLS_ROOT = `${SANDBOX_PATHS.REPLICAS_DIR}/learned-skills`;
|
|
28627
|
+
var LEARNED_SKILLS_MANIFEST_PATH = `${LEARNED_SKILLS_ROOT}/manifest.json`;
|
|
28628
|
+
var learnedSkillsManifestSchema = external_exports.object({
|
|
28629
|
+
skills: external_exports.array(external_exports.object({ name: external_exports.string(), sha256: external_exports.string() }))
|
|
28630
|
+
});
|
|
28631
|
+
|
|
28610
28632
|
// ../shared/src/sse.ts
|
|
28611
28633
|
function parseSseChunk(chunk) {
|
|
28612
28634
|
let data = "";
|
|
@@ -28641,9 +28663,6 @@ async function readSseStream(body, onEvent, shouldContinue = () => true) {
|
|
|
28641
28663
|
}
|
|
28642
28664
|
}
|
|
28643
28665
|
|
|
28644
|
-
// ../shared/src/frontmatter.ts
|
|
28645
|
-
var import_yaml2 = __toESM(require_dist());
|
|
28646
|
-
|
|
28647
28666
|
// ../shared/src/workspace-identity.ts
|
|
28648
28667
|
var AWS_SOURCE_IDENTITY_CLAIM = "https://aws.amazon.com/source_identity";
|
|
28649
28668
|
var WORKSPACE_TOKEN_TTL_SECONDS = 15 * 60;
|
|
@@ -32506,6 +32525,19 @@ async function historyTranscriptCommand(name) {
|
|
|
32506
32525
|
console.log(file2);
|
|
32507
32526
|
}
|
|
32508
32527
|
|
|
32528
|
+
// src/commands/skills.ts
|
|
32529
|
+
var import_node_fs3 = require("fs");
|
|
32530
|
+
async function skillsSuggestCommand(file2, options) {
|
|
32531
|
+
const body = { content: (0, import_node_fs3.readFileSync)(file2, "utf-8"), title: options.title };
|
|
32532
|
+
const { id, name, update } = await agentFetch("/v1/learned-skills/suggestions", {
|
|
32533
|
+
method: "POST",
|
|
32534
|
+
body
|
|
32535
|
+
});
|
|
32536
|
+
console.log(`Suggested ${update ? "an update to the" : "a new"} learning '${name}'. It is saved only if the user accepts it.`);
|
|
32537
|
+
console.log("Put this link on its own line in your reply; it renders as a chip where the user can review it:");
|
|
32538
|
+
console.log(`[${name}](${MONOLITH_URL}/v1/learned-skills/suggestions/${id})`);
|
|
32539
|
+
}
|
|
32540
|
+
|
|
32509
32541
|
// src/commands/slack.ts
|
|
32510
32542
|
var import_chalk22 = __toESM(require("chalk"));
|
|
32511
32543
|
function getThreadOptions(options) {
|
|
@@ -32558,7 +32590,7 @@ async function slackThreadSwitchCommand(workspace, options) {
|
|
|
32558
32590
|
// src/commands/service.ts
|
|
32559
32591
|
var import_chalk23 = __toESM(require("chalk"));
|
|
32560
32592
|
var import_node_child_process2 = require("child_process");
|
|
32561
|
-
var
|
|
32593
|
+
var import_node_fs4 = require("fs");
|
|
32562
32594
|
var import_node_os2 = require("os");
|
|
32563
32595
|
var import_node_path3 = require("path");
|
|
32564
32596
|
var SERVICES_DIR = (0, import_node_path3.join)((0, import_node_os2.homedir)(), ".replicas", "services");
|
|
@@ -32582,7 +32614,7 @@ function isServiceState(value) {
|
|
|
32582
32614
|
function readState(name) {
|
|
32583
32615
|
let parsed;
|
|
32584
32616
|
try {
|
|
32585
|
-
parsed = JSON.parse((0,
|
|
32617
|
+
parsed = JSON.parse((0, import_node_fs4.readFileSync)(statePath(name), "utf-8"));
|
|
32586
32618
|
} catch {
|
|
32587
32619
|
return null;
|
|
32588
32620
|
}
|
|
@@ -32616,7 +32648,7 @@ async function killServiceGroup(pid) {
|
|
|
32616
32648
|
}
|
|
32617
32649
|
function tailLog(logFile, lines) {
|
|
32618
32650
|
try {
|
|
32619
|
-
return tailLines((0,
|
|
32651
|
+
return tailLines((0, import_node_fs4.readFileSync)(logFile, "utf-8"), lines);
|
|
32620
32652
|
} catch {
|
|
32621
32653
|
return "";
|
|
32622
32654
|
}
|
|
@@ -32634,11 +32666,11 @@ async function serviceStartCommand(name, commandParts, options) {
|
|
|
32634
32666
|
console.log(`Stopping existing "${name}" (pid ${existing.pid}) before restart`);
|
|
32635
32667
|
await killServiceGroup(existing.pid);
|
|
32636
32668
|
}
|
|
32637
|
-
(0,
|
|
32669
|
+
(0, import_node_fs4.mkdirSync)(SERVICES_DIR, { recursive: true });
|
|
32638
32670
|
const cwd = (0, import_node_path3.resolve)(options.cwd ?? process.cwd());
|
|
32639
32671
|
const logFile = (0, import_node_path3.join)(SERVICES_DIR, `${name}.log`);
|
|
32640
|
-
const logFd = (0,
|
|
32641
|
-
(0,
|
|
32672
|
+
const logFd = (0, import_node_fs4.openSync)(logFile, "a");
|
|
32673
|
+
(0, import_node_fs4.writeFileSync)(logFd, `
|
|
32642
32674
|
=== [replicas service] "${name}" started ${(/* @__PURE__ */ new Date()).toISOString()} in ${cwd}: ${command} ===
|
|
32643
32675
|
`);
|
|
32644
32676
|
const child = (0, import_node_child_process2.spawn)("bash", ["-lc", command], {
|
|
@@ -32647,7 +32679,7 @@ async function serviceStartCommand(name, commandParts, options) {
|
|
|
32647
32679
|
stdio: ["ignore", logFd, logFd],
|
|
32648
32680
|
env: process.env
|
|
32649
32681
|
});
|
|
32650
|
-
(0,
|
|
32682
|
+
(0, import_node_fs4.closeSync)(logFd);
|
|
32651
32683
|
if (child.pid === void 0) {
|
|
32652
32684
|
throw new Error("Failed to spawn service process");
|
|
32653
32685
|
}
|
|
@@ -32660,11 +32692,11 @@ async function serviceStartCommand(name, commandParts, options) {
|
|
|
32660
32692
|
logFile,
|
|
32661
32693
|
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
32662
32694
|
};
|
|
32663
|
-
(0,
|
|
32695
|
+
(0, import_node_fs4.writeFileSync)(statePath(name), JSON.stringify(state, null, 2));
|
|
32664
32696
|
await sleep(1e3);
|
|
32665
32697
|
if (!isRunning(child.pid)) {
|
|
32666
32698
|
const logs = tailLog(logFile, 20);
|
|
32667
|
-
(0,
|
|
32699
|
+
(0, import_node_fs4.rmSync)(statePath(name), { force: true });
|
|
32668
32700
|
throw new Error(`Service "${name}" exited immediately.${logs ? `
|
|
32669
32701
|
|
|
32670
32702
|
Last log output:
|
|
@@ -32684,12 +32716,12 @@ async function serviceStopCommand(name) {
|
|
|
32684
32716
|
} else {
|
|
32685
32717
|
console.log(`Service "${name}" was not running`);
|
|
32686
32718
|
}
|
|
32687
|
-
(0,
|
|
32719
|
+
(0, import_node_fs4.rmSync)(statePath(name), { force: true });
|
|
32688
32720
|
}
|
|
32689
32721
|
async function serviceListCommand() {
|
|
32690
32722
|
let entries;
|
|
32691
32723
|
try {
|
|
32692
|
-
entries = (0,
|
|
32724
|
+
entries = (0, import_node_fs4.readdirSync)(SERVICES_DIR).filter((f) => f.endsWith(".json"));
|
|
32693
32725
|
} catch {
|
|
32694
32726
|
entries = [];
|
|
32695
32727
|
}
|
|
@@ -34067,6 +34099,16 @@ if (isAgentMode()) {
|
|
|
34067
34099
|
} catch (error51) {
|
|
34068
34100
|
if (error51 instanceof Error) console.error(import_chalk25.default.red(`
|
|
34069
34101
|
\u2717 ${error51.message}
|
|
34102
|
+
`));
|
|
34103
|
+
process.exit(1);
|
|
34104
|
+
}
|
|
34105
|
+
});
|
|
34106
|
+
program.command("skills").description("Organization skills learned from users").command("suggest <file>").description("Suggest saving a SKILL.md as an organization skill; the user reviews it before it is saved").requiredOption("--title <text>", 'Short title shown to the user, e.g. "Always use Conventional Commits"').action(async (file2, options) => {
|
|
34107
|
+
try {
|
|
34108
|
+
await skillsSuggestCommand(file2, options);
|
|
34109
|
+
} catch (error51) {
|
|
34110
|
+
if (error51 instanceof Error) console.error(import_chalk25.default.red(`
|
|
34111
|
+
\u2717 ${error51.message}
|
|
34070
34112
|
`));
|
|
34071
34113
|
process.exit(1);
|
|
34072
34114
|
}
|
|
@@ -34082,6 +34124,7 @@ if (isAgentMode()) {
|
|
|
34082
34124
|
"service",
|
|
34083
34125
|
"media",
|
|
34084
34126
|
"history",
|
|
34127
|
+
"skills",
|
|
34085
34128
|
"slack",
|
|
34086
34129
|
"computer",
|
|
34087
34130
|
"automation",
|