replicas-cli 0.2.347 → 0.2.349
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.mjs +255 -152
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -7335,7 +7335,7 @@ var require_dist = __commonJS({
|
|
|
7335
7335
|
// src/index.ts
|
|
7336
7336
|
import "dotenv/config";
|
|
7337
7337
|
import { Command, InvalidArgumentError } from "commander";
|
|
7338
|
-
import
|
|
7338
|
+
import chalk24 from "chalk";
|
|
7339
7339
|
|
|
7340
7340
|
// src/commands/login.ts
|
|
7341
7341
|
import http from "http";
|
|
@@ -9601,7 +9601,20 @@ var HOOK_EXEC_MAX_BUFFER_BYTES = 10 * 1024 * 1024;
|
|
|
9601
9601
|
var REPLICAS_CONFIG_FILENAMES = ["replicas.json", "replicas.yaml", "replicas.yml"];
|
|
9602
9602
|
|
|
9603
9603
|
// ../shared/src/cli-version.ts
|
|
9604
|
-
var CLI_VERSION = "0.2.
|
|
9604
|
+
var CLI_VERSION = "0.2.349";
|
|
9605
|
+
|
|
9606
|
+
// ../shared/src/version.ts
|
|
9607
|
+
function compareVersions(v1, v2) {
|
|
9608
|
+
const parts1 = v1.split(".").map(Number);
|
|
9609
|
+
const parts2 = v2.split(".").map(Number);
|
|
9610
|
+
for (let i = 0; i < Math.max(parts1.length, parts2.length); i++) {
|
|
9611
|
+
const num1 = parts1[i] || 0;
|
|
9612
|
+
const num2 = parts2[i] || 0;
|
|
9613
|
+
if (num1 > num2) return 1;
|
|
9614
|
+
if (num1 < num2) return -1;
|
|
9615
|
+
}
|
|
9616
|
+
return 0;
|
|
9617
|
+
}
|
|
9605
9618
|
|
|
9606
9619
|
// ../shared/src/engine/environment.ts
|
|
9607
9620
|
var DESKTOP_NOVNC_PORT = 6080;
|
|
@@ -12230,11 +12243,21 @@ function isInsideGitRepo() {
|
|
|
12230
12243
|
}
|
|
12231
12244
|
|
|
12232
12245
|
// src/lib/workspace-connection.ts
|
|
12233
|
-
async function
|
|
12234
|
-
const
|
|
12235
|
-
|
|
12246
|
+
async function fetchWorkspaceById(workspaceId) {
|
|
12247
|
+
const response = await orgAuthenticatedFetch(
|
|
12248
|
+
`/v1/workspaces/${encodeURIComponent(workspaceId)}`
|
|
12249
|
+
).catch((error) => {
|
|
12250
|
+
if (error instanceof Error && error.message.includes("Workspace not found")) return null;
|
|
12251
|
+
throw error;
|
|
12252
|
+
});
|
|
12253
|
+
return response?.workspace ?? null;
|
|
12254
|
+
}
|
|
12255
|
+
async function resolveWorkspaceRecord(workspaceName) {
|
|
12256
|
+
if (!canCallOrgApi()) {
|
|
12236
12257
|
throw new Error('No organization selected. Please run "replicas org switch" first.');
|
|
12237
12258
|
}
|
|
12259
|
+
const exactWorkspace = await fetchWorkspaceById(workspaceName);
|
|
12260
|
+
if (exactWorkspace) return exactWorkspace;
|
|
12238
12261
|
console.log(chalk4.blue(`
|
|
12239
12262
|
Searching for workspace: ${workspaceName}...`));
|
|
12240
12263
|
const response = await orgAuthenticatedFetch(
|
|
@@ -12262,11 +12285,19 @@ Found ${response.workspaces.length} workspaces matching "${workspaceName}":`));
|
|
|
12262
12285
|
if (!selectResponse.workspaceId) {
|
|
12263
12286
|
throw new Error("Workspace selection cancelled.");
|
|
12264
12287
|
}
|
|
12265
|
-
|
|
12288
|
+
const selected = response.workspaces.find((ws) => ws.id === selectResponse.workspaceId);
|
|
12289
|
+
if (!selected) {
|
|
12290
|
+
throw new Error("Selected workspace was not found.");
|
|
12291
|
+
}
|
|
12292
|
+
selectedWorkspace = selected;
|
|
12266
12293
|
}
|
|
12267
12294
|
console.log(chalk4.green(`
|
|
12268
12295
|
\u2713 Selected workspace: ${selectedWorkspace.name}`));
|
|
12269
12296
|
console.log(chalk4.gray(` Status: ${selectedWorkspace.status || "unknown"}`));
|
|
12297
|
+
return selectedWorkspace;
|
|
12298
|
+
}
|
|
12299
|
+
async function prepareWorkspaceConnection(workspaceName) {
|
|
12300
|
+
const selectedWorkspace = await resolveWorkspaceRecord(workspaceName);
|
|
12270
12301
|
if (isWorkspaceSuspendedStatus(selectedWorkspace.status)) {
|
|
12271
12302
|
throw new Error(
|
|
12272
12303
|
`Workspace is currently ${selectedWorkspace.status}. Wake it using \`replicas interact\` (press w on a suspended workspace) or visit https://tryreplicas.com`
|
|
@@ -13094,17 +13125,6 @@ function initCommand(options) {
|
|
|
13094
13125
|
import chalk14 from "chalk";
|
|
13095
13126
|
var MONOLITH_URL2 = process.env.REPLICAS_MONOLITH_URL || "https://api.tryreplicas.com";
|
|
13096
13127
|
var VERSION_CHECK_TIMEOUT = 2e3;
|
|
13097
|
-
function compareVersions(v1, v2) {
|
|
13098
|
-
const parts1 = v1.split(".").map(Number);
|
|
13099
|
-
const parts2 = v2.split(".").map(Number);
|
|
13100
|
-
for (let i = 0; i < Math.max(parts1.length, parts2.length); i++) {
|
|
13101
|
-
const num1 = parts1[i] || 0;
|
|
13102
|
-
const num2 = parts2[i] || 0;
|
|
13103
|
-
if (num1 > num2) return 1;
|
|
13104
|
-
if (num1 < num2) return -1;
|
|
13105
|
-
}
|
|
13106
|
-
return 0;
|
|
13107
|
-
}
|
|
13108
13128
|
async function checkForUpdates(currentVersion) {
|
|
13109
13129
|
try {
|
|
13110
13130
|
const controller = new AbortController();
|
|
@@ -13234,7 +13254,7 @@ function formatDisplayMessage(message) {
|
|
|
13234
13254
|
}
|
|
13235
13255
|
}
|
|
13236
13256
|
async function replicaListCommand(options) {
|
|
13237
|
-
if (!
|
|
13257
|
+
if (!canCallOrgApi()) {
|
|
13238
13258
|
console.log(chalk15.red('Not logged in. Please run "replicas login" first.'));
|
|
13239
13259
|
process.exit(1);
|
|
13240
13260
|
}
|
|
@@ -13563,6 +13583,9 @@ function ensureOrgApiAuthenticated() {
|
|
|
13563
13583
|
process.exit(1);
|
|
13564
13584
|
}
|
|
13565
13585
|
}
|
|
13586
|
+
function resolveByNameOrId(input, items) {
|
|
13587
|
+
return items.find((item) => item.id === input || item.name === input);
|
|
13588
|
+
}
|
|
13566
13589
|
|
|
13567
13590
|
// src/commands/repositories.ts
|
|
13568
13591
|
async function repositoriesListCommand() {
|
|
@@ -13740,14 +13763,14 @@ function formatModeSummary(automation2) {
|
|
|
13740
13763
|
return modes.length > 0 ? modes.join(", ") : "default";
|
|
13741
13764
|
}
|
|
13742
13765
|
function resolveSelectableEnvironmentId(envInput, selectableEnvs) {
|
|
13743
|
-
const
|
|
13744
|
-
if (!
|
|
13766
|
+
const resolved = resolveByNameOrId(envInput, selectableEnvs);
|
|
13767
|
+
if (!resolved) {
|
|
13745
13768
|
console.log(chalk18.red(`Environment not found: ${envInput}`));
|
|
13746
13769
|
const available = selectableEnvs.map((e) => e.name).join(", ");
|
|
13747
13770
|
console.log(chalk18.gray(`Available: ${available || "(none)"}`));
|
|
13748
13771
|
process.exit(1);
|
|
13749
13772
|
}
|
|
13750
|
-
return
|
|
13773
|
+
return resolved.id;
|
|
13751
13774
|
}
|
|
13752
13775
|
function printAutomation(automation2) {
|
|
13753
13776
|
console.log(chalk18.white(` ${automation2.name}`));
|
|
@@ -14651,6 +14674,55 @@ async function mediaListCommand(options) {
|
|
|
14651
14674
|
}
|
|
14652
14675
|
}
|
|
14653
14676
|
|
|
14677
|
+
// src/commands/slack.ts
|
|
14678
|
+
import chalk20 from "chalk";
|
|
14679
|
+
function getThreadOptions(options) {
|
|
14680
|
+
const channelId = options.channel || process.env.SLACK_CHANNEL_ID;
|
|
14681
|
+
const threadTs = options.threadTs || process.env.SLACK_THREAD_TS;
|
|
14682
|
+
if (!channelId) {
|
|
14683
|
+
throw new Error("--channel is required when SLACK_CHANNEL_ID is not set");
|
|
14684
|
+
}
|
|
14685
|
+
if (!threadTs) {
|
|
14686
|
+
throw new Error("--thread-ts is required when SLACK_THREAD_TS is not set");
|
|
14687
|
+
}
|
|
14688
|
+
return { channelId, threadTs };
|
|
14689
|
+
}
|
|
14690
|
+
async function attachThread(request) {
|
|
14691
|
+
const response = await orgAuthenticatedFetch("/v1/slack/threads/attach", {
|
|
14692
|
+
method: "POST",
|
|
14693
|
+
body: request
|
|
14694
|
+
});
|
|
14695
|
+
console.log(chalk20.green("Slack thread attached."));
|
|
14696
|
+
console.log(chalk20.gray(` Channel: ${response.thread.channel_id}`));
|
|
14697
|
+
console.log(chalk20.gray(` Thread: ${response.thread.thread_ts}`));
|
|
14698
|
+
console.log(chalk20.gray(` Workspace: ${response.workspace.name} (${response.workspace.id})`));
|
|
14699
|
+
}
|
|
14700
|
+
async function slackThreadAttachCommand(options) {
|
|
14701
|
+
const agentConfig = readAgentConfig();
|
|
14702
|
+
if (!agentConfig?.workspace_id) {
|
|
14703
|
+
throw new Error("This command must run inside a Replicas workspace, or use `replicas slack thread switch <workspace>`.");
|
|
14704
|
+
}
|
|
14705
|
+
const { channelId, threadTs } = getThreadOptions(options);
|
|
14706
|
+
await attachThread({
|
|
14707
|
+
channel_id: channelId,
|
|
14708
|
+
thread_ts: threadTs,
|
|
14709
|
+
workspace_id: agentConfig.workspace_id
|
|
14710
|
+
});
|
|
14711
|
+
}
|
|
14712
|
+
async function slackThreadSwitchCommand(workspace, options) {
|
|
14713
|
+
const { channelId, threadTs } = getThreadOptions(options);
|
|
14714
|
+
const agentConfig = readAgentConfig();
|
|
14715
|
+
const workspaceId = (await resolveWorkspaceRecord(workspace)).id;
|
|
14716
|
+
if (agentConfig?.workspace_id && workspaceId !== agentConfig.workspace_id) {
|
|
14717
|
+
throw new Error("Agent-mode Slack thread switching can only target the current workspace. Run this command with user authentication to switch to another workspace.");
|
|
14718
|
+
}
|
|
14719
|
+
await attachThread({
|
|
14720
|
+
channel_id: channelId,
|
|
14721
|
+
thread_ts: threadTs,
|
|
14722
|
+
workspace_id: workspaceId
|
|
14723
|
+
});
|
|
14724
|
+
}
|
|
14725
|
+
|
|
14654
14726
|
// src/commands/learnings.ts
|
|
14655
14727
|
function printBlocks(learnings) {
|
|
14656
14728
|
for (const learning of learnings) {
|
|
@@ -14726,7 +14798,7 @@ import { spawn as spawn4, spawnSync as spawnSync3 } from "child_process";
|
|
|
14726
14798
|
import { createHash as createHash2 } from "crypto";
|
|
14727
14799
|
import { closeSync, copyFileSync as copyFileSync2, existsSync as existsSync3, mkdirSync as mkdirSync2, openSync, readFileSync as readFileSync2, readSync, rmSync as rmSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
14728
14800
|
import { dirname as dirname2 } from "path";
|
|
14729
|
-
import
|
|
14801
|
+
import chalk21 from "chalk";
|
|
14730
14802
|
|
|
14731
14803
|
// src/commands/computer/desktop.ts
|
|
14732
14804
|
import { spawnSync } from "child_process";
|
|
@@ -15515,7 +15587,7 @@ async function computerInfoCommand() {
|
|
|
15515
15587
|
);
|
|
15516
15588
|
}
|
|
15517
15589
|
console.log(viewerUrl);
|
|
15518
|
-
console.error(
|
|
15590
|
+
console.error(chalk21.dim(`Share this URL with the user to let them watch the desktop live.`));
|
|
15519
15591
|
}
|
|
15520
15592
|
async function computerStatusCommand() {
|
|
15521
15593
|
ensureServicesRunning();
|
|
@@ -15525,13 +15597,13 @@ async function computerStatusCommand() {
|
|
|
15525
15597
|
const r = spawnSync3("pgrep", ["-af", p], { stdio: "pipe" });
|
|
15526
15598
|
const running = r.status === 0 && !!r.stdout?.toString().trim();
|
|
15527
15599
|
const suffix = p === "x11vnc" && bridge ? bridgeStatus(bridge.x11vnc, true) : p === "websockify" && bridge ? bridgeStatus(bridge.websockify, false, true) : "";
|
|
15528
|
-
console.log(` ${running ?
|
|
15600
|
+
console.log(` ${running ? chalk21.green("\u25CF") : chalk21.red("\u25CB")} ${p}${suffix}`);
|
|
15529
15601
|
}
|
|
15530
15602
|
const viewerUrl = await lookupDesktopViewerUrl();
|
|
15531
15603
|
if (viewerUrl) {
|
|
15532
|
-
console.log(` ${
|
|
15604
|
+
console.log(` ${chalk21.cyan("preview")}: ${viewerUrl}`);
|
|
15533
15605
|
} else {
|
|
15534
|
-
console.log(` ${
|
|
15606
|
+
console.log(` ${chalk21.dim("preview: not yet registered (engine registers it at startup)")}`);
|
|
15535
15607
|
}
|
|
15536
15608
|
}
|
|
15537
15609
|
var PNG_SIGNATURE = Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]);
|
|
@@ -16379,7 +16451,7 @@ async function computerLaunchCommand(app, args) {
|
|
|
16379
16451
|
}
|
|
16380
16452
|
|
|
16381
16453
|
// src/commands/interactive.ts
|
|
16382
|
-
import
|
|
16454
|
+
import chalk22 from "chalk";
|
|
16383
16455
|
|
|
16384
16456
|
// src/interactive/index.tsx
|
|
16385
16457
|
import { createCliRenderer } from "@opentui/core";
|
|
@@ -19560,13 +19632,13 @@ async function interactiveCommand() {
|
|
|
19560
19632
|
'No organization selected. Please run "replicas org switch" to select an organization.'
|
|
19561
19633
|
);
|
|
19562
19634
|
}
|
|
19563
|
-
console.log(
|
|
19635
|
+
console.log(chalk22.gray("Starting interactive mode..."));
|
|
19564
19636
|
await launchInteractive();
|
|
19565
19637
|
}
|
|
19566
19638
|
|
|
19567
19639
|
// src/commands/environment.ts
|
|
19568
19640
|
import fs5 from "fs";
|
|
19569
|
-
import
|
|
19641
|
+
import chalk23 from "chalk";
|
|
19570
19642
|
import prompts5 from "prompts";
|
|
19571
19643
|
var UUID_RE = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
|
|
19572
19644
|
function maskValue(value) {
|
|
@@ -19577,40 +19649,40 @@ async function resolveEnvironmentId(input) {
|
|
|
19577
19649
|
if (input === "global") return "global";
|
|
19578
19650
|
if (UUID_RE.test(input)) return input;
|
|
19579
19651
|
const response = await orgAuthenticatedFetch("/v1/environments");
|
|
19580
|
-
const
|
|
19581
|
-
if (!
|
|
19582
|
-
console.log(
|
|
19652
|
+
const resolved = resolveByNameOrId(input, response.environments);
|
|
19653
|
+
if (!resolved) {
|
|
19654
|
+
console.log(chalk23.red(`Environment not found: ${input}`));
|
|
19583
19655
|
const available = response.environments.map((e) => e.name).join(", ");
|
|
19584
|
-
console.log(
|
|
19656
|
+
console.log(chalk23.gray(`Available: ${available || "(none)"}`));
|
|
19585
19657
|
process.exit(1);
|
|
19586
19658
|
}
|
|
19587
|
-
return
|
|
19659
|
+
return resolved.id;
|
|
19588
19660
|
}
|
|
19589
19661
|
function printEnvironment(env) {
|
|
19590
|
-
console.log(
|
|
19591
|
-
console.log(
|
|
19662
|
+
console.log(chalk23.white(` ${env.name}${env.is_global ? chalk23.gray(" (global)") : ""}`));
|
|
19663
|
+
console.log(chalk23.gray(` ID: ${env.id}`));
|
|
19592
19664
|
if (env.description) {
|
|
19593
|
-
console.log(
|
|
19665
|
+
console.log(chalk23.gray(` Description: ${env.description}`));
|
|
19594
19666
|
}
|
|
19595
19667
|
if (env.repository_id) {
|
|
19596
|
-
console.log(
|
|
19668
|
+
console.log(chalk23.gray(` Repository: ${env.repository_id}`));
|
|
19597
19669
|
} else if (env.repository_set_id) {
|
|
19598
|
-
console.log(
|
|
19670
|
+
console.log(chalk23.gray(` Repository Set: ${env.repository_set_id}`));
|
|
19599
19671
|
}
|
|
19600
19672
|
if (env.variable_count !== void 0) {
|
|
19601
|
-
console.log(
|
|
19673
|
+
console.log(chalk23.gray(` Variables: ${env.variable_count}, Files: ${env.file_count ?? 0}, Skills: ${env.skill_count ?? 0}, MCPs: ${env.mcp_count ?? 0}`));
|
|
19602
19674
|
}
|
|
19603
|
-
console.log(
|
|
19675
|
+
console.log(chalk23.gray(` Updated: ${formatDate2(env.updated_at)}`));
|
|
19604
19676
|
console.log();
|
|
19605
19677
|
}
|
|
19606
19678
|
async function environmentListCommand() {
|
|
19607
19679
|
ensureOrgApiAuthenticated();
|
|
19608
19680
|
const response = await orgAuthenticatedFetch("/v1/environments");
|
|
19609
19681
|
if (response.environments.length === 0) {
|
|
19610
|
-
console.log(
|
|
19682
|
+
console.log(chalk23.yellow("\nNo environments found.\n"));
|
|
19611
19683
|
return;
|
|
19612
19684
|
}
|
|
19613
|
-
console.log(
|
|
19685
|
+
console.log(chalk23.green(`
|
|
19614
19686
|
Environments (${response.environments.length}):
|
|
19615
19687
|
`));
|
|
19616
19688
|
for (const env of response.environments) {
|
|
@@ -19621,7 +19693,7 @@ async function environmentGetCommand(idOrName) {
|
|
|
19621
19693
|
ensureOrgApiAuthenticated();
|
|
19622
19694
|
const id = await resolveEnvironmentId(idOrName);
|
|
19623
19695
|
const response = await orgAuthenticatedFetch(`/v1/environments/${id}`);
|
|
19624
|
-
console.log(
|
|
19696
|
+
console.log(chalk23.green(`
|
|
19625
19697
|
Environment: ${response.environment.name}
|
|
19626
19698
|
`));
|
|
19627
19699
|
printEnvironment(response.environment);
|
|
@@ -19637,7 +19709,7 @@ async function environmentCreateCommand(name, options) {
|
|
|
19637
19709
|
validate: (v) => v.trim() ? true : "Name is required"
|
|
19638
19710
|
});
|
|
19639
19711
|
if (!r.name) {
|
|
19640
|
-
console.log(
|
|
19712
|
+
console.log(chalk23.yellow("\nCancelled."));
|
|
19641
19713
|
return;
|
|
19642
19714
|
}
|
|
19643
19715
|
envName = r.name;
|
|
@@ -19650,8 +19722,8 @@ async function environmentCreateCommand(name, options) {
|
|
|
19650
19722
|
const repos2 = await orgAuthenticatedFetch("/v1/repositories");
|
|
19651
19723
|
const repo = repos2.repositories.find((r) => r.name === options.repository);
|
|
19652
19724
|
if (!repo) {
|
|
19653
|
-
console.log(
|
|
19654
|
-
console.log(
|
|
19725
|
+
console.log(chalk23.red(`Repository not found: ${options.repository}`));
|
|
19726
|
+
console.log(chalk23.gray(`Available: ${repos2.repositories.map((r) => r.name).join(", ")}`));
|
|
19655
19727
|
process.exit(1);
|
|
19656
19728
|
}
|
|
19657
19729
|
repositoryId = repo.id;
|
|
@@ -19681,9 +19753,9 @@ async function environmentCreateCommand(name, options) {
|
|
|
19681
19753
|
method: "POST",
|
|
19682
19754
|
body
|
|
19683
19755
|
});
|
|
19684
|
-
console.log(
|
|
19756
|
+
console.log(chalk23.green(`
|
|
19685
19757
|
Created environment: ${response.environment.name}`));
|
|
19686
|
-
console.log(
|
|
19758
|
+
console.log(chalk23.gray(` ID: ${response.environment.id}
|
|
19687
19759
|
`));
|
|
19688
19760
|
}
|
|
19689
19761
|
async function environmentEditCommand(idOrName, options) {
|
|
@@ -19702,21 +19774,21 @@ async function environmentEditCommand(idOrName, options) {
|
|
|
19702
19774
|
const repos2 = await orgAuthenticatedFetch("/v1/repositories");
|
|
19703
19775
|
const repo = repos2.repositories.find((r) => r.name === options.repository);
|
|
19704
19776
|
if (!repo) {
|
|
19705
|
-
console.log(
|
|
19777
|
+
console.log(chalk23.red(`Repository not found: ${options.repository}`));
|
|
19706
19778
|
process.exit(1);
|
|
19707
19779
|
}
|
|
19708
19780
|
body.repository_id = repo.id;
|
|
19709
19781
|
}
|
|
19710
19782
|
}
|
|
19711
19783
|
if (Object.keys(body).length === 0) {
|
|
19712
|
-
console.log(
|
|
19784
|
+
console.log(chalk23.yellow("\nNo changes specified. Pass --name, --description, --repository, or --system-prompt."));
|
|
19713
19785
|
return;
|
|
19714
19786
|
}
|
|
19715
19787
|
const response = await orgAuthenticatedFetch(`/v1/environments/${id}`, {
|
|
19716
19788
|
method: "PATCH",
|
|
19717
19789
|
body
|
|
19718
19790
|
});
|
|
19719
|
-
console.log(
|
|
19791
|
+
console.log(chalk23.green(`
|
|
19720
19792
|
Updated environment: ${response.environment.name}
|
|
19721
19793
|
`));
|
|
19722
19794
|
}
|
|
@@ -19731,20 +19803,20 @@ async function environmentDeleteCommand(idOrName, options) {
|
|
|
19731
19803
|
initial: false
|
|
19732
19804
|
});
|
|
19733
19805
|
if (!r.confirm) {
|
|
19734
|
-
console.log(
|
|
19806
|
+
console.log(chalk23.yellow("\nCancelled."));
|
|
19735
19807
|
return;
|
|
19736
19808
|
}
|
|
19737
19809
|
}
|
|
19738
19810
|
await orgAuthenticatedFetch(`/v1/environments/${id}`, { method: "DELETE" });
|
|
19739
|
-
console.log(
|
|
19811
|
+
console.log(chalk23.green(`
|
|
19740
19812
|
Deleted environment ${idOrName}.
|
|
19741
19813
|
`));
|
|
19742
19814
|
}
|
|
19743
19815
|
function printVariable(v, reveal) {
|
|
19744
|
-
console.log(
|
|
19745
|
-
console.log(
|
|
19746
|
-
console.log(
|
|
19747
|
-
console.log(
|
|
19816
|
+
console.log(chalk23.white(` ${v.key}`));
|
|
19817
|
+
console.log(chalk23.gray(` ID: ${v.id}`));
|
|
19818
|
+
console.log(chalk23.gray(` Value: ${reveal ? v.value : maskValue(v.value)}`));
|
|
19819
|
+
console.log(chalk23.gray(` Updated: ${formatDate2(v.updated_at)}`));
|
|
19748
19820
|
console.log();
|
|
19749
19821
|
}
|
|
19750
19822
|
async function envVarsListCommand(envIdOrName, options) {
|
|
@@ -19754,14 +19826,14 @@ async function envVarsListCommand(envIdOrName, options) {
|
|
|
19754
19826
|
`/v1/environments/${id}/variables`
|
|
19755
19827
|
);
|
|
19756
19828
|
if (response.environment_variables.length === 0) {
|
|
19757
|
-
console.log(
|
|
19829
|
+
console.log(chalk23.yellow("\nNo variables.\n"));
|
|
19758
19830
|
return;
|
|
19759
19831
|
}
|
|
19760
|
-
console.log(
|
|
19832
|
+
console.log(chalk23.green(`
|
|
19761
19833
|
Variables (${response.environment_variables.length}):
|
|
19762
19834
|
`));
|
|
19763
19835
|
if (!options.reveal) {
|
|
19764
|
-
console.log(
|
|
19836
|
+
console.log(chalk23.gray(" Values are masked. Pass --reveal to show full values.\n"));
|
|
19765
19837
|
}
|
|
19766
19838
|
for (const v of response.environment_variables) printVariable(v, !!options.reveal);
|
|
19767
19839
|
}
|
|
@@ -19778,7 +19850,7 @@ async function envVarsSetCommand(envIdOrName, key, value) {
|
|
|
19778
19850
|
`/v1/environments/${id}/variables/${match.id}`,
|
|
19779
19851
|
{ method: "PATCH", body: body2 }
|
|
19780
19852
|
);
|
|
19781
|
-
console.log(
|
|
19853
|
+
console.log(chalk23.green(`
|
|
19782
19854
|
Updated variable ${response2.environment_variable.key}.
|
|
19783
19855
|
`));
|
|
19784
19856
|
return;
|
|
@@ -19792,7 +19864,7 @@ Updated variable ${response2.environment_variable.key}.
|
|
|
19792
19864
|
`/v1/environments/${id}/variables`,
|
|
19793
19865
|
{ method: "POST", body }
|
|
19794
19866
|
);
|
|
19795
|
-
console.log(
|
|
19867
|
+
console.log(chalk23.green(`
|
|
19796
19868
|
Created variable ${response.environment_variable.key}.
|
|
19797
19869
|
`));
|
|
19798
19870
|
}
|
|
@@ -19806,7 +19878,7 @@ async function envVarsDeleteCommand(envIdOrName, keyOrId, options) {
|
|
|
19806
19878
|
);
|
|
19807
19879
|
const match = existing.environment_variables.find((v) => v.key === keyOrId);
|
|
19808
19880
|
if (!match) {
|
|
19809
|
-
console.log(
|
|
19881
|
+
console.log(chalk23.red(`Variable not found: ${keyOrId}`));
|
|
19810
19882
|
process.exit(1);
|
|
19811
19883
|
}
|
|
19812
19884
|
variableId = match.id;
|
|
@@ -19819,23 +19891,23 @@ async function envVarsDeleteCommand(envIdOrName, keyOrId, options) {
|
|
|
19819
19891
|
initial: false
|
|
19820
19892
|
});
|
|
19821
19893
|
if (!r.confirm) {
|
|
19822
|
-
console.log(
|
|
19894
|
+
console.log(chalk23.yellow("\nCancelled."));
|
|
19823
19895
|
return;
|
|
19824
19896
|
}
|
|
19825
19897
|
}
|
|
19826
19898
|
await orgAuthenticatedFetch(`/v1/environments/${id}/variables/${variableId}`, {
|
|
19827
19899
|
method: "DELETE"
|
|
19828
19900
|
});
|
|
19829
|
-
console.log(
|
|
19901
|
+
console.log(chalk23.green(`
|
|
19830
19902
|
Deleted variable ${keyOrId}.
|
|
19831
19903
|
`));
|
|
19832
19904
|
}
|
|
19833
19905
|
function printFile(f) {
|
|
19834
|
-
console.log(
|
|
19835
|
-
console.log(
|
|
19836
|
-
console.log(
|
|
19837
|
-
console.log(
|
|
19838
|
-
console.log(
|
|
19906
|
+
console.log(chalk23.white(` ${f.path}`));
|
|
19907
|
+
console.log(chalk23.gray(` ID: ${f.id}`));
|
|
19908
|
+
console.log(chalk23.gray(` Name: ${f.name}`));
|
|
19909
|
+
console.log(chalk23.gray(` Size: ${f.content.length} bytes`));
|
|
19910
|
+
console.log(chalk23.gray(` Updated: ${formatDate2(f.updated_at)}`));
|
|
19839
19911
|
console.log();
|
|
19840
19912
|
}
|
|
19841
19913
|
async function envFilesListCommand(envIdOrName) {
|
|
@@ -19845,10 +19917,10 @@ async function envFilesListCommand(envIdOrName) {
|
|
|
19845
19917
|
`/v1/environments/${id}/files`
|
|
19846
19918
|
);
|
|
19847
19919
|
if (response.environment_files.length === 0) {
|
|
19848
|
-
console.log(
|
|
19920
|
+
console.log(chalk23.yellow("\nNo files.\n"));
|
|
19849
19921
|
return;
|
|
19850
19922
|
}
|
|
19851
|
-
console.log(
|
|
19923
|
+
console.log(chalk23.green(`
|
|
19852
19924
|
Files (${response.environment_files.length}):
|
|
19853
19925
|
`));
|
|
19854
19926
|
for (const f of response.environment_files) printFile(f);
|
|
@@ -19879,7 +19951,7 @@ async function envFilesSetCommand(envIdOrName, destinationPath, options) {
|
|
|
19879
19951
|
`/v1/environments/${id}/files/${match.id}`,
|
|
19880
19952
|
{ method: "PATCH", body: body2 }
|
|
19881
19953
|
);
|
|
19882
|
-
console.log(
|
|
19954
|
+
console.log(chalk23.green(`
|
|
19883
19955
|
Updated file ${response2.environment_file.path}.
|
|
19884
19956
|
`));
|
|
19885
19957
|
return;
|
|
@@ -19894,7 +19966,7 @@ Updated file ${response2.environment_file.path}.
|
|
|
19894
19966
|
`/v1/environments/${id}/files`,
|
|
19895
19967
|
{ method: "POST", body }
|
|
19896
19968
|
);
|
|
19897
|
-
console.log(
|
|
19969
|
+
console.log(chalk23.green(`
|
|
19898
19970
|
Created file ${response.environment_file.path}.
|
|
19899
19971
|
`));
|
|
19900
19972
|
}
|
|
@@ -19908,7 +19980,7 @@ async function envFilesDeleteCommand(envIdOrName, pathOrId, options) {
|
|
|
19908
19980
|
);
|
|
19909
19981
|
const match = existing.environment_files.find((f) => f.path === pathOrId);
|
|
19910
19982
|
if (!match) {
|
|
19911
|
-
console.log(
|
|
19983
|
+
console.log(chalk23.red(`File not found: ${pathOrId}`));
|
|
19912
19984
|
process.exit(1);
|
|
19913
19985
|
}
|
|
19914
19986
|
fileId = match.id;
|
|
@@ -19921,14 +19993,14 @@ async function envFilesDeleteCommand(envIdOrName, pathOrId, options) {
|
|
|
19921
19993
|
initial: false
|
|
19922
19994
|
});
|
|
19923
19995
|
if (!r.confirm) {
|
|
19924
|
-
console.log(
|
|
19996
|
+
console.log(chalk23.yellow("\nCancelled."));
|
|
19925
19997
|
return;
|
|
19926
19998
|
}
|
|
19927
19999
|
}
|
|
19928
20000
|
await orgAuthenticatedFetch(`/v1/environments/${id}/files/${fileId}`, {
|
|
19929
20001
|
method: "DELETE"
|
|
19930
20002
|
});
|
|
19931
|
-
console.log(
|
|
20003
|
+
console.log(chalk23.green(`
|
|
19932
20004
|
Deleted file ${pathOrId}.
|
|
19933
20005
|
`));
|
|
19934
20006
|
}
|
|
@@ -19939,15 +20011,15 @@ async function envStartHookGetCommand(envIdOrName) {
|
|
|
19939
20011
|
`/v1/environments/${id}/start-hooks`
|
|
19940
20012
|
);
|
|
19941
20013
|
if (!response.start_hook) {
|
|
19942
|
-
console.log(
|
|
20014
|
+
console.log(chalk23.yellow("\nNo start hook configured.\n"));
|
|
19943
20015
|
return;
|
|
19944
20016
|
}
|
|
19945
20017
|
const hook = response.start_hook;
|
|
19946
|
-
console.log(
|
|
20018
|
+
console.log(chalk23.green(`
|
|
19947
20019
|
Start hook (v${hook.version}, ${hook.is_active ? "active" : "inactive"}):
|
|
19948
20020
|
`));
|
|
19949
|
-
console.log(
|
|
19950
|
-
console.log(
|
|
20021
|
+
console.log(chalk23.gray(` ID: ${hook.id}`));
|
|
20022
|
+
console.log(chalk23.gray(` Created: ${formatDate2(hook.created_at)}
|
|
19951
20023
|
`));
|
|
19952
20024
|
console.log(hook.content);
|
|
19953
20025
|
console.log();
|
|
@@ -19962,10 +20034,10 @@ async function envStartHookSaveCommand(envIdOrName, options) {
|
|
|
19962
20034
|
{ method: "POST", body }
|
|
19963
20035
|
);
|
|
19964
20036
|
if (!response.start_hook) {
|
|
19965
|
-
console.log(
|
|
20037
|
+
console.log(chalk23.green("\nCleared start hook.\n"));
|
|
19966
20038
|
return;
|
|
19967
20039
|
}
|
|
19968
|
-
console.log(
|
|
20040
|
+
console.log(chalk23.green(`
|
|
19969
20041
|
Saved start hook v${response.start_hook.version}.
|
|
19970
20042
|
`));
|
|
19971
20043
|
}
|
|
@@ -19982,7 +20054,7 @@ async function envStartHookTestCommand(envIdOrName, options) {
|
|
|
19982
20054
|
body: { content },
|
|
19983
20055
|
onEvent: (event) => {
|
|
19984
20056
|
if (event.type === "progress" && event.message) {
|
|
19985
|
-
console.log(
|
|
20057
|
+
console.log(chalk23.gray(event.message));
|
|
19986
20058
|
} else if (event.type === "output" && event.output) {
|
|
19987
20059
|
process.stdout.write(event.output);
|
|
19988
20060
|
} else if (event.type === "complete") {
|
|
@@ -19995,21 +20067,21 @@ async function envStartHookTestCommand(envIdOrName, options) {
|
|
|
19995
20067
|
}
|
|
19996
20068
|
);
|
|
19997
20069
|
if (errorMessage) {
|
|
19998
|
-
console.log(
|
|
20070
|
+
console.log(chalk23.red(`
|
|
19999
20071
|
${errorMessage}
|
|
20000
20072
|
`));
|
|
20001
20073
|
process.exit(1);
|
|
20002
20074
|
}
|
|
20003
20075
|
if (timedOut) {
|
|
20004
|
-
console.log(
|
|
20076
|
+
console.log(chalk23.yellow("\nStart hook timed out.\n"));
|
|
20005
20077
|
process.exit(1);
|
|
20006
20078
|
}
|
|
20007
20079
|
if (exitCode === 0) {
|
|
20008
|
-
console.log(
|
|
20080
|
+
console.log(chalk23.green(`
|
|
20009
20081
|
Start hook passed (exit code ${exitCode}).
|
|
20010
20082
|
`));
|
|
20011
20083
|
} else {
|
|
20012
|
-
console.log(
|
|
20084
|
+
console.log(chalk23.red(`
|
|
20013
20085
|
Start hook failed (exit code ${exitCode ?? "unknown"}).
|
|
20014
20086
|
`));
|
|
20015
20087
|
process.exit(1);
|
|
@@ -20022,24 +20094,24 @@ async function envStartHookRepositoryHooksCommand(envIdOrName) {
|
|
|
20022
20094
|
`/v1/environments/${id}/start-hooks/repository-hooks`
|
|
20023
20095
|
);
|
|
20024
20096
|
if (response.repositories.length === 0) {
|
|
20025
|
-
console.log(
|
|
20097
|
+
console.log(chalk23.yellow("\nNo repositories bound to this environment.\n"));
|
|
20026
20098
|
return;
|
|
20027
20099
|
}
|
|
20028
|
-
console.log(
|
|
20100
|
+
console.log(chalk23.green(`
|
|
20029
20101
|
Repository start hooks (${response.repositories.length}):
|
|
20030
20102
|
`));
|
|
20031
20103
|
for (const repo of response.repositories) {
|
|
20032
|
-
console.log(
|
|
20104
|
+
console.log(chalk23.white(` ${repo.repository_name} @${repo.default_branch}`));
|
|
20033
20105
|
if (repo.error) {
|
|
20034
|
-
console.log(
|
|
20106
|
+
console.log(chalk23.red(` Error: ${repo.error}`));
|
|
20035
20107
|
} else if (repo.start_hook) {
|
|
20036
|
-
console.log(
|
|
20037
|
-
console.log(
|
|
20108
|
+
console.log(chalk23.gray(` Source: ${repo.filename ?? "(unknown)"}`));
|
|
20109
|
+
console.log(chalk23.gray(` Commands (${repo.start_hook.commands.length}):`));
|
|
20038
20110
|
for (const cmd of repo.start_hook.commands) {
|
|
20039
|
-
console.log(
|
|
20111
|
+
console.log(chalk23.gray(` ${cmd}`));
|
|
20040
20112
|
}
|
|
20041
20113
|
} else {
|
|
20042
|
-
console.log(
|
|
20114
|
+
console.log(chalk23.gray(` No startHook defined.`));
|
|
20043
20115
|
}
|
|
20044
20116
|
console.log();
|
|
20045
20117
|
}
|
|
@@ -20053,12 +20125,41 @@ function parseBooleanOption(value) {
|
|
|
20053
20125
|
}
|
|
20054
20126
|
var program = new Command();
|
|
20055
20127
|
program.name("replicas").description("CLI for managing Replicas workspaces").version(CLI_VERSION);
|
|
20128
|
+
function registerSlackCommands(parent) {
|
|
20129
|
+
const slack = parent.command("slack").description("Manage Slack thread routing");
|
|
20130
|
+
const slackThread = slack.command("thread").description("Attach or switch the Slack thread that routes to a workspace");
|
|
20131
|
+
slackThread.command("attach").description("Attach the current Slack thread to this workspace").option("-c, --channel <channelId>", "Slack channel ID (defaults to SLACK_CHANNEL_ID)").option("-t, --thread-ts <threadTs>", "Slack thread timestamp (defaults to SLACK_THREAD_TS)").action(async (options) => {
|
|
20132
|
+
try {
|
|
20133
|
+
await slackThreadAttachCommand(options);
|
|
20134
|
+
} catch (error) {
|
|
20135
|
+
if (error instanceof Error) {
|
|
20136
|
+
console.error(chalk24.red(`
|
|
20137
|
+
\u2717 ${error.message}
|
|
20138
|
+
`));
|
|
20139
|
+
}
|
|
20140
|
+
process.exit(1);
|
|
20141
|
+
}
|
|
20142
|
+
});
|
|
20143
|
+
slackThread.command("switch <workspace>").description("Point the current Slack thread at another workspace ID or name").option("-c, --channel <channelId>", "Slack channel ID (defaults to SLACK_CHANNEL_ID)").option("-t, --thread-ts <threadTs>", "Slack thread timestamp (defaults to SLACK_THREAD_TS)").action(async (workspace, options) => {
|
|
20144
|
+
try {
|
|
20145
|
+
await slackThreadSwitchCommand(workspace, options);
|
|
20146
|
+
} catch (error) {
|
|
20147
|
+
if (error instanceof Error) {
|
|
20148
|
+
console.error(chalk24.red(`
|
|
20149
|
+
\u2717 ${error.message}
|
|
20150
|
+
`));
|
|
20151
|
+
}
|
|
20152
|
+
process.exit(1);
|
|
20153
|
+
}
|
|
20154
|
+
});
|
|
20155
|
+
}
|
|
20156
|
+
registerSlackCommands(program);
|
|
20056
20157
|
program.command("login").description("Authenticate with your Replicas account").action(async () => {
|
|
20057
20158
|
try {
|
|
20058
20159
|
await loginCommand();
|
|
20059
20160
|
} catch (error) {
|
|
20060
20161
|
if (error instanceof Error) {
|
|
20061
|
-
console.error(
|
|
20162
|
+
console.error(chalk24.red(`
|
|
20062
20163
|
\u2717 ${error.message}
|
|
20063
20164
|
`));
|
|
20064
20165
|
}
|
|
@@ -20070,7 +20171,7 @@ program.command("init").description("Create a replicas.json or replicas.yaml con
|
|
|
20070
20171
|
initCommand(options);
|
|
20071
20172
|
} catch (error) {
|
|
20072
20173
|
if (error instanceof Error) {
|
|
20073
|
-
console.error(
|
|
20174
|
+
console.error(chalk24.red(`
|
|
20074
20175
|
\u2717 ${error.message}
|
|
20075
20176
|
`));
|
|
20076
20177
|
}
|
|
@@ -20082,7 +20183,7 @@ program.command("logout").description("Clear stored credentials").action(() => {
|
|
|
20082
20183
|
logoutCommand();
|
|
20083
20184
|
} catch (error) {
|
|
20084
20185
|
if (error instanceof Error) {
|
|
20085
|
-
console.error(
|
|
20186
|
+
console.error(chalk24.red(`
|
|
20086
20187
|
\u2717 ${error.message}
|
|
20087
20188
|
`));
|
|
20088
20189
|
}
|
|
@@ -20094,7 +20195,7 @@ program.command("whoami").description("Display current authenticated user").acti
|
|
|
20094
20195
|
await whoamiCommand();
|
|
20095
20196
|
} catch (error) {
|
|
20096
20197
|
if (error instanceof Error) {
|
|
20097
|
-
console.error(
|
|
20198
|
+
console.error(chalk24.red(`
|
|
20098
20199
|
\u2717 ${error.message}
|
|
20099
20200
|
`));
|
|
20100
20201
|
}
|
|
@@ -20106,7 +20207,7 @@ program.command("codex-auth").description("Authenticate Replicas with your Codex
|
|
|
20106
20207
|
await codexAuthCommand(options);
|
|
20107
20208
|
} catch (error) {
|
|
20108
20209
|
if (error instanceof Error) {
|
|
20109
|
-
console.error(
|
|
20210
|
+
console.error(chalk24.red(`
|
|
20110
20211
|
\u2717 ${error.message}
|
|
20111
20212
|
`));
|
|
20112
20213
|
}
|
|
@@ -20118,7 +20219,7 @@ program.command("claude-auth").description("Authenticate Replicas with your Clau
|
|
|
20118
20219
|
await claudeAuthCommand(options);
|
|
20119
20220
|
} catch (error) {
|
|
20120
20221
|
if (error instanceof Error) {
|
|
20121
|
-
console.error(
|
|
20222
|
+
console.error(chalk24.red(`
|
|
20122
20223
|
\u2717 ${error.message}
|
|
20123
20224
|
`));
|
|
20124
20225
|
}
|
|
@@ -20131,7 +20232,7 @@ org.command("switch").description("Switch to a different organization").action(a
|
|
|
20131
20232
|
await orgSwitchCommand();
|
|
20132
20233
|
} catch (error) {
|
|
20133
20234
|
if (error instanceof Error) {
|
|
20134
|
-
console.error(
|
|
20235
|
+
console.error(chalk24.red(`
|
|
20135
20236
|
\u2717 ${error.message}
|
|
20136
20237
|
`));
|
|
20137
20238
|
}
|
|
@@ -20143,7 +20244,7 @@ org.action(async () => {
|
|
|
20143
20244
|
await orgCommand();
|
|
20144
20245
|
} catch (error) {
|
|
20145
20246
|
if (error instanceof Error) {
|
|
20146
|
-
console.error(
|
|
20247
|
+
console.error(chalk24.red(`
|
|
20147
20248
|
\u2717 ${error.message}
|
|
20148
20249
|
`));
|
|
20149
20250
|
}
|
|
@@ -20155,7 +20256,7 @@ program.command("connect <workspace-name>").description("Connect to a workspace
|
|
|
20155
20256
|
await connectCommand(workspaceName);
|
|
20156
20257
|
} catch (error) {
|
|
20157
20258
|
if (error instanceof Error) {
|
|
20158
|
-
console.error(
|
|
20259
|
+
console.error(chalk24.red(`
|
|
20159
20260
|
\u2717 ${error.message}
|
|
20160
20261
|
`));
|
|
20161
20262
|
}
|
|
@@ -20167,7 +20268,7 @@ program.command("code <workspace-name>").description("Open a workspace in VSCode
|
|
|
20167
20268
|
await codeCommand(workspaceName);
|
|
20168
20269
|
} catch (error) {
|
|
20169
20270
|
if (error instanceof Error) {
|
|
20170
|
-
console.error(
|
|
20271
|
+
console.error(chalk24.red(`
|
|
20171
20272
|
\u2717 ${error.message}
|
|
20172
20273
|
`));
|
|
20173
20274
|
}
|
|
@@ -20180,7 +20281,7 @@ config.command("get <key>").description("Get a configuration value").action(asyn
|
|
|
20180
20281
|
await configGetCommand(key);
|
|
20181
20282
|
} catch (error) {
|
|
20182
20283
|
if (error instanceof Error) {
|
|
20183
|
-
console.error(
|
|
20284
|
+
console.error(chalk24.red(`
|
|
20184
20285
|
\u2717 ${error.message}
|
|
20185
20286
|
`));
|
|
20186
20287
|
}
|
|
@@ -20192,7 +20293,7 @@ config.command("set <key> <value>").description("Set a configuration value").act
|
|
|
20192
20293
|
await configSetCommand(key, value);
|
|
20193
20294
|
} catch (error) {
|
|
20194
20295
|
if (error instanceof Error) {
|
|
20195
|
-
console.error(
|
|
20296
|
+
console.error(chalk24.red(`
|
|
20196
20297
|
\u2717 ${error.message}
|
|
20197
20298
|
`));
|
|
20198
20299
|
}
|
|
@@ -20204,7 +20305,7 @@ config.command("list").description("List all configuration values").action(async
|
|
|
20204
20305
|
await configListCommand();
|
|
20205
20306
|
} catch (error) {
|
|
20206
20307
|
if (error instanceof Error) {
|
|
20207
|
-
console.error(
|
|
20308
|
+
console.error(chalk24.red(`
|
|
20208
20309
|
\u2717 ${error.message}
|
|
20209
20310
|
`));
|
|
20210
20311
|
}
|
|
@@ -20216,7 +20317,7 @@ program.command("list").description("List all replicas").option("-p, --page <pag
|
|
|
20216
20317
|
await replicaListCommand(options);
|
|
20217
20318
|
} catch (error) {
|
|
20218
20319
|
if (error instanceof Error) {
|
|
20219
|
-
console.error(
|
|
20320
|
+
console.error(chalk24.red(`
|
|
20220
20321
|
\u2717 ${error.message}
|
|
20221
20322
|
`));
|
|
20222
20323
|
}
|
|
@@ -20228,7 +20329,7 @@ program.command("get <id>").description("Get replica details by ID").action(asyn
|
|
|
20228
20329
|
await replicaGetCommand(id);
|
|
20229
20330
|
} catch (error) {
|
|
20230
20331
|
if (error instanceof Error) {
|
|
20231
|
-
console.error(
|
|
20332
|
+
console.error(chalk24.red(`
|
|
20232
20333
|
\u2717 ${error.message}
|
|
20233
20334
|
`));
|
|
20234
20335
|
}
|
|
@@ -20240,7 +20341,7 @@ program.command("create [name]").description("Create a new replica").option("-m,
|
|
|
20240
20341
|
await replicaCreateCommand(name, options);
|
|
20241
20342
|
} catch (error) {
|
|
20242
20343
|
if (error instanceof Error) {
|
|
20243
|
-
console.error(
|
|
20344
|
+
console.error(chalk24.red(`
|
|
20244
20345
|
\u2717 ${error.message}
|
|
20245
20346
|
`));
|
|
20246
20347
|
}
|
|
@@ -20252,7 +20353,7 @@ program.command("send <id>").description("Send a message to a replica").option("
|
|
|
20252
20353
|
await replicaSendCommand(id, options);
|
|
20253
20354
|
} catch (error) {
|
|
20254
20355
|
if (error instanceof Error) {
|
|
20255
|
-
console.error(
|
|
20356
|
+
console.error(chalk24.red(`
|
|
20256
20357
|
\u2717 ${error.message}
|
|
20257
20358
|
`));
|
|
20258
20359
|
}
|
|
@@ -20264,7 +20365,7 @@ program.command("delete <id>").description("Delete a replica").option("-f, --for
|
|
|
20264
20365
|
await replicaDeleteCommand(id, options);
|
|
20265
20366
|
} catch (error) {
|
|
20266
20367
|
if (error instanceof Error) {
|
|
20267
|
-
console.error(
|
|
20368
|
+
console.error(chalk24.red(`
|
|
20268
20369
|
\u2717 ${error.message}
|
|
20269
20370
|
`));
|
|
20270
20371
|
}
|
|
@@ -20276,7 +20377,7 @@ program.command("read <id>").description("Read conversation history of a replica
|
|
|
20276
20377
|
await replicaReadCommand(id, options);
|
|
20277
20378
|
} catch (error) {
|
|
20278
20379
|
if (error instanceof Error) {
|
|
20279
|
-
console.error(
|
|
20380
|
+
console.error(chalk24.red(`
|
|
20280
20381
|
\u2717 ${error.message}
|
|
20281
20382
|
`));
|
|
20282
20383
|
}
|
|
@@ -20289,7 +20390,7 @@ automation.command("list").description("List all automations").option("-p, --pag
|
|
|
20289
20390
|
await automationListCommand(options);
|
|
20290
20391
|
} catch (error) {
|
|
20291
20392
|
if (error instanceof Error) {
|
|
20292
|
-
console.error(
|
|
20393
|
+
console.error(chalk24.red(`
|
|
20293
20394
|
\u2717 ${error.message}
|
|
20294
20395
|
`));
|
|
20295
20396
|
}
|
|
@@ -20301,7 +20402,7 @@ automation.command("get <id>").description("Get automation details by ID").actio
|
|
|
20301
20402
|
await automationGetCommand(id);
|
|
20302
20403
|
} catch (error) {
|
|
20303
20404
|
if (error instanceof Error) {
|
|
20304
|
-
console.error(
|
|
20405
|
+
console.error(chalk24.red(`
|
|
20305
20406
|
\u2717 ${error.message}
|
|
20306
20407
|
`));
|
|
20307
20408
|
}
|
|
@@ -20316,7 +20417,7 @@ automation.command("create [name]").description("Create a new automation").optio
|
|
|
20316
20417
|
});
|
|
20317
20418
|
} catch (error) {
|
|
20318
20419
|
if (error instanceof Error) {
|
|
20319
|
-
console.error(
|
|
20420
|
+
console.error(chalk24.red(`
|
|
20320
20421
|
\u2717 ${error.message}
|
|
20321
20422
|
`));
|
|
20322
20423
|
}
|
|
@@ -20328,7 +20429,7 @@ automation.command("edit <id>").description("Edit an existing automation").optio
|
|
|
20328
20429
|
await automationEditCommand(id, options);
|
|
20329
20430
|
} catch (error) {
|
|
20330
20431
|
if (error instanceof Error) {
|
|
20331
|
-
console.error(
|
|
20432
|
+
console.error(chalk24.red(`
|
|
20332
20433
|
\u2717 ${error.message}
|
|
20333
20434
|
`));
|
|
20334
20435
|
}
|
|
@@ -20340,7 +20441,7 @@ automation.command("run <id>").description("Manually trigger an automation (cron
|
|
|
20340
20441
|
await automationRunCommand(id);
|
|
20341
20442
|
} catch (error) {
|
|
20342
20443
|
if (error instanceof Error) {
|
|
20343
|
-
console.error(
|
|
20444
|
+
console.error(chalk24.red(`
|
|
20344
20445
|
\u2717 ${error.message}
|
|
20345
20446
|
`));
|
|
20346
20447
|
}
|
|
@@ -20352,7 +20453,7 @@ automation.command("delete <id>").description("Delete an automation").option("-f
|
|
|
20352
20453
|
await automationDeleteCommand(id, options);
|
|
20353
20454
|
} catch (error) {
|
|
20354
20455
|
if (error instanceof Error) {
|
|
20355
|
-
console.error(
|
|
20456
|
+
console.error(chalk24.red(`
|
|
20356
20457
|
\u2717 ${error.message}
|
|
20357
20458
|
`));
|
|
20358
20459
|
}
|
|
@@ -20364,7 +20465,7 @@ automation.action(async () => {
|
|
|
20364
20465
|
await automationListCommand({});
|
|
20365
20466
|
} catch (error) {
|
|
20366
20467
|
if (error instanceof Error) {
|
|
20367
|
-
console.error(
|
|
20468
|
+
console.error(chalk24.red(`
|
|
20368
20469
|
\u2717 ${error.message}
|
|
20369
20470
|
`));
|
|
20370
20471
|
}
|
|
@@ -20377,7 +20478,7 @@ repos.command("list").description("List all repositories").action(async () => {
|
|
|
20377
20478
|
await repositoriesListCommand();
|
|
20378
20479
|
} catch (error) {
|
|
20379
20480
|
if (error instanceof Error) {
|
|
20380
|
-
console.error(
|
|
20481
|
+
console.error(chalk24.red(`
|
|
20381
20482
|
\u2717 ${error.message}
|
|
20382
20483
|
`));
|
|
20383
20484
|
}
|
|
@@ -20389,7 +20490,7 @@ repos.action(async () => {
|
|
|
20389
20490
|
await repositoriesListCommand();
|
|
20390
20491
|
} catch (error) {
|
|
20391
20492
|
if (error instanceof Error) {
|
|
20392
|
-
console.error(
|
|
20493
|
+
console.error(chalk24.red(`
|
|
20393
20494
|
\u2717 ${error.message}
|
|
20394
20495
|
`));
|
|
20395
20496
|
}
|
|
@@ -20402,7 +20503,7 @@ environment.command("list").description("List all environments").action(async ()
|
|
|
20402
20503
|
await environmentListCommand();
|
|
20403
20504
|
} catch (error) {
|
|
20404
20505
|
if (error instanceof Error) {
|
|
20405
|
-
console.error(
|
|
20506
|
+
console.error(chalk24.red(`
|
|
20406
20507
|
\u2717 ${error.message}
|
|
20407
20508
|
`));
|
|
20408
20509
|
}
|
|
@@ -20414,7 +20515,7 @@ environment.command("get <id-or-name>").description('Get an environment by ID or
|
|
|
20414
20515
|
await environmentGetCommand(idOrName);
|
|
20415
20516
|
} catch (error) {
|
|
20416
20517
|
if (error instanceof Error) {
|
|
20417
|
-
console.error(
|
|
20518
|
+
console.error(chalk24.red(`
|
|
20418
20519
|
\u2717 ${error.message}
|
|
20419
20520
|
`));
|
|
20420
20521
|
}
|
|
@@ -20426,7 +20527,7 @@ environment.command("create [name]").description("Create a new environment").opt
|
|
|
20426
20527
|
await environmentCreateCommand(name, options);
|
|
20427
20528
|
} catch (error) {
|
|
20428
20529
|
if (error instanceof Error) {
|
|
20429
|
-
console.error(
|
|
20530
|
+
console.error(chalk24.red(`
|
|
20430
20531
|
\u2717 ${error.message}
|
|
20431
20532
|
`));
|
|
20432
20533
|
}
|
|
@@ -20438,7 +20539,7 @@ environment.command("edit <id-or-name>").description("Edit an environment").opti
|
|
|
20438
20539
|
await environmentEditCommand(idOrName, options);
|
|
20439
20540
|
} catch (error) {
|
|
20440
20541
|
if (error instanceof Error) {
|
|
20441
|
-
console.error(
|
|
20542
|
+
console.error(chalk24.red(`
|
|
20442
20543
|
\u2717 ${error.message}
|
|
20443
20544
|
`));
|
|
20444
20545
|
}
|
|
@@ -20450,7 +20551,7 @@ environment.command("delete <id-or-name>").description("Delete an environment").
|
|
|
20450
20551
|
await environmentDeleteCommand(idOrName, options);
|
|
20451
20552
|
} catch (error) {
|
|
20452
20553
|
if (error instanceof Error) {
|
|
20453
|
-
console.error(
|
|
20554
|
+
console.error(chalk24.red(`
|
|
20454
20555
|
\u2717 ${error.message}
|
|
20455
20556
|
`));
|
|
20456
20557
|
}
|
|
@@ -20463,7 +20564,7 @@ envVars.command("list <env>").description("List variables in an environment (val
|
|
|
20463
20564
|
await envVarsListCommand(env, options);
|
|
20464
20565
|
} catch (error) {
|
|
20465
20566
|
if (error instanceof Error) {
|
|
20466
|
-
console.error(
|
|
20567
|
+
console.error(chalk24.red(`
|
|
20467
20568
|
\u2717 ${error.message}
|
|
20468
20569
|
`));
|
|
20469
20570
|
}
|
|
@@ -20475,7 +20576,7 @@ envVars.command("set <env> <key> <value>").description("Create or update a varia
|
|
|
20475
20576
|
await envVarsSetCommand(env, key, value);
|
|
20476
20577
|
} catch (error) {
|
|
20477
20578
|
if (error instanceof Error) {
|
|
20478
|
-
console.error(
|
|
20579
|
+
console.error(chalk24.red(`
|
|
20479
20580
|
\u2717 ${error.message}
|
|
20480
20581
|
`));
|
|
20481
20582
|
}
|
|
@@ -20487,7 +20588,7 @@ envVars.command("delete <env> <key-or-id>").description("Delete a variable by ke
|
|
|
20487
20588
|
await envVarsDeleteCommand(env, keyOrId, options);
|
|
20488
20589
|
} catch (error) {
|
|
20489
20590
|
if (error instanceof Error) {
|
|
20490
|
-
console.error(
|
|
20591
|
+
console.error(chalk24.red(`
|
|
20491
20592
|
\u2717 ${error.message}
|
|
20492
20593
|
`));
|
|
20493
20594
|
}
|
|
@@ -20500,7 +20601,7 @@ envFiles.command("list <env>").description("List files in an environment").actio
|
|
|
20500
20601
|
await envFilesListCommand(env);
|
|
20501
20602
|
} catch (error) {
|
|
20502
20603
|
if (error instanceof Error) {
|
|
20503
|
-
console.error(
|
|
20604
|
+
console.error(chalk24.red(`
|
|
20504
20605
|
\u2717 ${error.message}
|
|
20505
20606
|
`));
|
|
20506
20607
|
}
|
|
@@ -20512,7 +20613,7 @@ envFiles.command("set <env> <destination-path>").description("Create or update a
|
|
|
20512
20613
|
await envFilesSetCommand(env, destinationPath, options);
|
|
20513
20614
|
} catch (error) {
|
|
20514
20615
|
if (error instanceof Error) {
|
|
20515
|
-
console.error(
|
|
20616
|
+
console.error(chalk24.red(`
|
|
20516
20617
|
\u2717 ${error.message}
|
|
20517
20618
|
`));
|
|
20518
20619
|
}
|
|
@@ -20524,7 +20625,7 @@ envFiles.command("delete <env> <path-or-id>").description("Delete a file by dest
|
|
|
20524
20625
|
await envFilesDeleteCommand(env, pathOrId, options);
|
|
20525
20626
|
} catch (error) {
|
|
20526
20627
|
if (error instanceof Error) {
|
|
20527
|
-
console.error(
|
|
20628
|
+
console.error(chalk24.red(`
|
|
20528
20629
|
\u2717 ${error.message}
|
|
20529
20630
|
`));
|
|
20530
20631
|
}
|
|
@@ -20537,7 +20638,7 @@ envStartHooks.command("get <env>").description("Show the active start hook for a
|
|
|
20537
20638
|
await envStartHookGetCommand(env);
|
|
20538
20639
|
} catch (error) {
|
|
20539
20640
|
if (error instanceof Error) {
|
|
20540
|
-
console.error(
|
|
20641
|
+
console.error(chalk24.red(`
|
|
20541
20642
|
\u2717 ${error.message}
|
|
20542
20643
|
`));
|
|
20543
20644
|
}
|
|
@@ -20549,7 +20650,7 @@ envStartHooks.command("save <env>").description("Save and activate a start hook
|
|
|
20549
20650
|
await envStartHookSaveCommand(env, options);
|
|
20550
20651
|
} catch (error) {
|
|
20551
20652
|
if (error instanceof Error) {
|
|
20552
|
-
console.error(
|
|
20653
|
+
console.error(chalk24.red(`
|
|
20553
20654
|
\u2717 ${error.message}
|
|
20554
20655
|
`));
|
|
20555
20656
|
}
|
|
@@ -20561,7 +20662,7 @@ envStartHooks.command("test <env>").description("Run a start hook in an isolated
|
|
|
20561
20662
|
await envStartHookTestCommand(env, options);
|
|
20562
20663
|
} catch (error) {
|
|
20563
20664
|
if (error instanceof Error) {
|
|
20564
|
-
console.error(
|
|
20665
|
+
console.error(chalk24.red(`
|
|
20565
20666
|
\u2717 ${error.message}
|
|
20566
20667
|
`));
|
|
20567
20668
|
}
|
|
@@ -20573,7 +20674,7 @@ envStartHooks.command("repository-hooks <env>").description("List per-repo start
|
|
|
20573
20674
|
await envStartHookRepositoryHooksCommand(env);
|
|
20574
20675
|
} catch (error) {
|
|
20575
20676
|
if (error instanceof Error) {
|
|
20576
|
-
console.error(
|
|
20677
|
+
console.error(chalk24.red(`
|
|
20577
20678
|
\u2717 ${error.message}
|
|
20578
20679
|
`));
|
|
20579
20680
|
}
|
|
@@ -20585,7 +20686,7 @@ environment.action(async () => {
|
|
|
20585
20686
|
await environmentListCommand();
|
|
20586
20687
|
} catch (error) {
|
|
20587
20688
|
if (error instanceof Error) {
|
|
20588
|
-
console.error(
|
|
20689
|
+
console.error(chalk24.red(`
|
|
20589
20690
|
\u2717 ${error.message}
|
|
20590
20691
|
`));
|
|
20591
20692
|
}
|
|
@@ -20597,7 +20698,7 @@ program.command("interact").alias("i").description("Launch the interactive termi
|
|
|
20597
20698
|
await interactiveCommand();
|
|
20598
20699
|
} catch (error) {
|
|
20599
20700
|
if (error instanceof Error) {
|
|
20600
|
-
console.error(
|
|
20701
|
+
console.error(chalk24.red(`
|
|
20601
20702
|
\u2717 ${error.message}
|
|
20602
20703
|
`));
|
|
20603
20704
|
}
|
|
@@ -20648,7 +20749,7 @@ if (isAgentMode()) {
|
|
|
20648
20749
|
await previewAddCommand(workspaceId, options);
|
|
20649
20750
|
} catch (error) {
|
|
20650
20751
|
if (error instanceof Error) {
|
|
20651
|
-
console.error(
|
|
20752
|
+
console.error(chalk24.red(`
|
|
20652
20753
|
\u2717 ${error.message}
|
|
20653
20754
|
`));
|
|
20654
20755
|
}
|
|
@@ -20660,7 +20761,7 @@ if (isAgentMode()) {
|
|
|
20660
20761
|
await previewListCommand(workspaceId);
|
|
20661
20762
|
} catch (error) {
|
|
20662
20763
|
if (error instanceof Error) {
|
|
20663
|
-
console.error(
|
|
20764
|
+
console.error(chalk24.red(`
|
|
20664
20765
|
\u2717 ${error.message}
|
|
20665
20766
|
`));
|
|
20666
20767
|
}
|
|
@@ -20672,7 +20773,7 @@ if (isAgentMode()) {
|
|
|
20672
20773
|
await previewRemoveCommand(workspaceId, options);
|
|
20673
20774
|
} catch (error) {
|
|
20674
20775
|
if (error instanceof Error) {
|
|
20675
|
-
console.error(
|
|
20776
|
+
console.error(chalk24.red(`
|
|
20676
20777
|
\u2717 ${error.message}
|
|
20677
20778
|
`));
|
|
20678
20779
|
}
|
|
@@ -20687,7 +20788,7 @@ if (isAgentMode()) {
|
|
|
20687
20788
|
await mediaUploadCommand(files, options);
|
|
20688
20789
|
} catch (error) {
|
|
20689
20790
|
if (error instanceof Error) {
|
|
20690
|
-
console.error(
|
|
20791
|
+
console.error(chalk24.red(`
|
|
20691
20792
|
\u2717 ${error.message}
|
|
20692
20793
|
`));
|
|
20693
20794
|
}
|
|
@@ -20699,7 +20800,7 @@ if (isAgentMode()) {
|
|
|
20699
20800
|
await mediaListCommand(options);
|
|
20700
20801
|
} catch (error) {
|
|
20701
20802
|
if (error instanceof Error) {
|
|
20702
|
-
console.error(
|
|
20803
|
+
console.error(chalk24.red(`
|
|
20703
20804
|
\u2717 ${error.message}
|
|
20704
20805
|
`));
|
|
20705
20806
|
}
|
|
@@ -20712,7 +20813,7 @@ if (isAgentMode()) {
|
|
|
20712
20813
|
await learningsReadCommand(options);
|
|
20713
20814
|
} catch (error) {
|
|
20714
20815
|
if (error instanceof Error) {
|
|
20715
|
-
console.error(
|
|
20816
|
+
console.error(chalk24.red(`
|
|
20716
20817
|
\u2717 ${error.message}
|
|
20717
20818
|
`));
|
|
20718
20819
|
}
|
|
@@ -20724,7 +20825,7 @@ if (isAgentMode()) {
|
|
|
20724
20825
|
await learningsAddCommand(options);
|
|
20725
20826
|
} catch (error) {
|
|
20726
20827
|
if (error instanceof Error) {
|
|
20727
|
-
console.error(
|
|
20828
|
+
console.error(chalk24.red(`
|
|
20728
20829
|
\u2717 ${error.message}
|
|
20729
20830
|
`));
|
|
20730
20831
|
}
|
|
@@ -20736,7 +20837,7 @@ if (isAgentMode()) {
|
|
|
20736
20837
|
await learningsUpdateCommand(id, options);
|
|
20737
20838
|
} catch (error) {
|
|
20738
20839
|
if (error instanceof Error) {
|
|
20739
|
-
console.error(
|
|
20840
|
+
console.error(chalk24.red(`
|
|
20740
20841
|
\u2717 ${error.message}
|
|
20741
20842
|
`));
|
|
20742
20843
|
}
|
|
@@ -20748,7 +20849,7 @@ if (isAgentMode()) {
|
|
|
20748
20849
|
await learningsDeleteCommand(id);
|
|
20749
20850
|
} catch (error) {
|
|
20750
20851
|
if (error instanceof Error) {
|
|
20751
|
-
console.error(
|
|
20852
|
+
console.error(chalk24.red(`
|
|
20752
20853
|
\u2717 ${error.message}
|
|
20753
20854
|
`));
|
|
20754
20855
|
}
|
|
@@ -20761,7 +20862,7 @@ if (isAgentMode()) {
|
|
|
20761
20862
|
await fn(...args);
|
|
20762
20863
|
} catch (error) {
|
|
20763
20864
|
if (error instanceof Error) {
|
|
20764
|
-
console.error(
|
|
20865
|
+
console.error(chalk24.red(`
|
|
20765
20866
|
\u2717 ${error.message}
|
|
20766
20867
|
`));
|
|
20767
20868
|
}
|
|
@@ -20789,9 +20890,11 @@ if (isAgentMode()) {
|
|
|
20789
20890
|
const allowed = /* @__PURE__ */ new Set([
|
|
20790
20891
|
"init",
|
|
20791
20892
|
"whoami",
|
|
20893
|
+
"list",
|
|
20792
20894
|
"connect",
|
|
20793
20895
|
"preview",
|
|
20794
20896
|
"media",
|
|
20897
|
+
"slack",
|
|
20795
20898
|
"computer",
|
|
20796
20899
|
"automation",
|
|
20797
20900
|
"repos",
|