replicas-cli 0.2.348 → 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 +242 -141
- 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,7 @@ 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
9605
|
|
|
9606
9606
|
// ../shared/src/version.ts
|
|
9607
9607
|
function compareVersions(v1, v2) {
|
|
@@ -12243,11 +12243,21 @@ function isInsideGitRepo() {
|
|
|
12243
12243
|
}
|
|
12244
12244
|
|
|
12245
12245
|
// src/lib/workspace-connection.ts
|
|
12246
|
-
async function
|
|
12247
|
-
const
|
|
12248
|
-
|
|
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()) {
|
|
12249
12257
|
throw new Error('No organization selected. Please run "replicas org switch" first.');
|
|
12250
12258
|
}
|
|
12259
|
+
const exactWorkspace = await fetchWorkspaceById(workspaceName);
|
|
12260
|
+
if (exactWorkspace) return exactWorkspace;
|
|
12251
12261
|
console.log(chalk4.blue(`
|
|
12252
12262
|
Searching for workspace: ${workspaceName}...`));
|
|
12253
12263
|
const response = await orgAuthenticatedFetch(
|
|
@@ -12275,11 +12285,19 @@ Found ${response.workspaces.length} workspaces matching "${workspaceName}":`));
|
|
|
12275
12285
|
if (!selectResponse.workspaceId) {
|
|
12276
12286
|
throw new Error("Workspace selection cancelled.");
|
|
12277
12287
|
}
|
|
12278
|
-
|
|
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;
|
|
12279
12293
|
}
|
|
12280
12294
|
console.log(chalk4.green(`
|
|
12281
12295
|
\u2713 Selected workspace: ${selectedWorkspace.name}`));
|
|
12282
12296
|
console.log(chalk4.gray(` Status: ${selectedWorkspace.status || "unknown"}`));
|
|
12297
|
+
return selectedWorkspace;
|
|
12298
|
+
}
|
|
12299
|
+
async function prepareWorkspaceConnection(workspaceName) {
|
|
12300
|
+
const selectedWorkspace = await resolveWorkspaceRecord(workspaceName);
|
|
12283
12301
|
if (isWorkspaceSuspendedStatus(selectedWorkspace.status)) {
|
|
12284
12302
|
throw new Error(
|
|
12285
12303
|
`Workspace is currently ${selectedWorkspace.status}. Wake it using \`replicas interact\` (press w on a suspended workspace) or visit https://tryreplicas.com`
|
|
@@ -13236,7 +13254,7 @@ function formatDisplayMessage(message) {
|
|
|
13236
13254
|
}
|
|
13237
13255
|
}
|
|
13238
13256
|
async function replicaListCommand(options) {
|
|
13239
|
-
if (!
|
|
13257
|
+
if (!canCallOrgApi()) {
|
|
13240
13258
|
console.log(chalk15.red('Not logged in. Please run "replicas login" first.'));
|
|
13241
13259
|
process.exit(1);
|
|
13242
13260
|
}
|
|
@@ -13565,6 +13583,9 @@ function ensureOrgApiAuthenticated() {
|
|
|
13565
13583
|
process.exit(1);
|
|
13566
13584
|
}
|
|
13567
13585
|
}
|
|
13586
|
+
function resolveByNameOrId(input, items) {
|
|
13587
|
+
return items.find((item) => item.id === input || item.name === input);
|
|
13588
|
+
}
|
|
13568
13589
|
|
|
13569
13590
|
// src/commands/repositories.ts
|
|
13570
13591
|
async function repositoriesListCommand() {
|
|
@@ -13742,14 +13763,14 @@ function formatModeSummary(automation2) {
|
|
|
13742
13763
|
return modes.length > 0 ? modes.join(", ") : "default";
|
|
13743
13764
|
}
|
|
13744
13765
|
function resolveSelectableEnvironmentId(envInput, selectableEnvs) {
|
|
13745
|
-
const
|
|
13746
|
-
if (!
|
|
13766
|
+
const resolved = resolveByNameOrId(envInput, selectableEnvs);
|
|
13767
|
+
if (!resolved) {
|
|
13747
13768
|
console.log(chalk18.red(`Environment not found: ${envInput}`));
|
|
13748
13769
|
const available = selectableEnvs.map((e) => e.name).join(", ");
|
|
13749
13770
|
console.log(chalk18.gray(`Available: ${available || "(none)"}`));
|
|
13750
13771
|
process.exit(1);
|
|
13751
13772
|
}
|
|
13752
|
-
return
|
|
13773
|
+
return resolved.id;
|
|
13753
13774
|
}
|
|
13754
13775
|
function printAutomation(automation2) {
|
|
13755
13776
|
console.log(chalk18.white(` ${automation2.name}`));
|
|
@@ -14653,6 +14674,55 @@ async function mediaListCommand(options) {
|
|
|
14653
14674
|
}
|
|
14654
14675
|
}
|
|
14655
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
|
+
|
|
14656
14726
|
// src/commands/learnings.ts
|
|
14657
14727
|
function printBlocks(learnings) {
|
|
14658
14728
|
for (const learning of learnings) {
|
|
@@ -14728,7 +14798,7 @@ import { spawn as spawn4, spawnSync as spawnSync3 } from "child_process";
|
|
|
14728
14798
|
import { createHash as createHash2 } from "crypto";
|
|
14729
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";
|
|
14730
14800
|
import { dirname as dirname2 } from "path";
|
|
14731
|
-
import
|
|
14801
|
+
import chalk21 from "chalk";
|
|
14732
14802
|
|
|
14733
14803
|
// src/commands/computer/desktop.ts
|
|
14734
14804
|
import { spawnSync } from "child_process";
|
|
@@ -15517,7 +15587,7 @@ async function computerInfoCommand() {
|
|
|
15517
15587
|
);
|
|
15518
15588
|
}
|
|
15519
15589
|
console.log(viewerUrl);
|
|
15520
|
-
console.error(
|
|
15590
|
+
console.error(chalk21.dim(`Share this URL with the user to let them watch the desktop live.`));
|
|
15521
15591
|
}
|
|
15522
15592
|
async function computerStatusCommand() {
|
|
15523
15593
|
ensureServicesRunning();
|
|
@@ -15527,13 +15597,13 @@ async function computerStatusCommand() {
|
|
|
15527
15597
|
const r = spawnSync3("pgrep", ["-af", p], { stdio: "pipe" });
|
|
15528
15598
|
const running = r.status === 0 && !!r.stdout?.toString().trim();
|
|
15529
15599
|
const suffix = p === "x11vnc" && bridge ? bridgeStatus(bridge.x11vnc, true) : p === "websockify" && bridge ? bridgeStatus(bridge.websockify, false, true) : "";
|
|
15530
|
-
console.log(` ${running ?
|
|
15600
|
+
console.log(` ${running ? chalk21.green("\u25CF") : chalk21.red("\u25CB")} ${p}${suffix}`);
|
|
15531
15601
|
}
|
|
15532
15602
|
const viewerUrl = await lookupDesktopViewerUrl();
|
|
15533
15603
|
if (viewerUrl) {
|
|
15534
|
-
console.log(` ${
|
|
15604
|
+
console.log(` ${chalk21.cyan("preview")}: ${viewerUrl}`);
|
|
15535
15605
|
} else {
|
|
15536
|
-
console.log(` ${
|
|
15606
|
+
console.log(` ${chalk21.dim("preview: not yet registered (engine registers it at startup)")}`);
|
|
15537
15607
|
}
|
|
15538
15608
|
}
|
|
15539
15609
|
var PNG_SIGNATURE = Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]);
|
|
@@ -16381,7 +16451,7 @@ async function computerLaunchCommand(app, args) {
|
|
|
16381
16451
|
}
|
|
16382
16452
|
|
|
16383
16453
|
// src/commands/interactive.ts
|
|
16384
|
-
import
|
|
16454
|
+
import chalk22 from "chalk";
|
|
16385
16455
|
|
|
16386
16456
|
// src/interactive/index.tsx
|
|
16387
16457
|
import { createCliRenderer } from "@opentui/core";
|
|
@@ -19562,13 +19632,13 @@ async function interactiveCommand() {
|
|
|
19562
19632
|
'No organization selected. Please run "replicas org switch" to select an organization.'
|
|
19563
19633
|
);
|
|
19564
19634
|
}
|
|
19565
|
-
console.log(
|
|
19635
|
+
console.log(chalk22.gray("Starting interactive mode..."));
|
|
19566
19636
|
await launchInteractive();
|
|
19567
19637
|
}
|
|
19568
19638
|
|
|
19569
19639
|
// src/commands/environment.ts
|
|
19570
19640
|
import fs5 from "fs";
|
|
19571
|
-
import
|
|
19641
|
+
import chalk23 from "chalk";
|
|
19572
19642
|
import prompts5 from "prompts";
|
|
19573
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}$/;
|
|
19574
19644
|
function maskValue(value) {
|
|
@@ -19579,40 +19649,40 @@ async function resolveEnvironmentId(input) {
|
|
|
19579
19649
|
if (input === "global") return "global";
|
|
19580
19650
|
if (UUID_RE.test(input)) return input;
|
|
19581
19651
|
const response = await orgAuthenticatedFetch("/v1/environments");
|
|
19582
|
-
const
|
|
19583
|
-
if (!
|
|
19584
|
-
console.log(
|
|
19652
|
+
const resolved = resolveByNameOrId(input, response.environments);
|
|
19653
|
+
if (!resolved) {
|
|
19654
|
+
console.log(chalk23.red(`Environment not found: ${input}`));
|
|
19585
19655
|
const available = response.environments.map((e) => e.name).join(", ");
|
|
19586
|
-
console.log(
|
|
19656
|
+
console.log(chalk23.gray(`Available: ${available || "(none)"}`));
|
|
19587
19657
|
process.exit(1);
|
|
19588
19658
|
}
|
|
19589
|
-
return
|
|
19659
|
+
return resolved.id;
|
|
19590
19660
|
}
|
|
19591
19661
|
function printEnvironment(env) {
|
|
19592
|
-
console.log(
|
|
19593
|
-
console.log(
|
|
19662
|
+
console.log(chalk23.white(` ${env.name}${env.is_global ? chalk23.gray(" (global)") : ""}`));
|
|
19663
|
+
console.log(chalk23.gray(` ID: ${env.id}`));
|
|
19594
19664
|
if (env.description) {
|
|
19595
|
-
console.log(
|
|
19665
|
+
console.log(chalk23.gray(` Description: ${env.description}`));
|
|
19596
19666
|
}
|
|
19597
19667
|
if (env.repository_id) {
|
|
19598
|
-
console.log(
|
|
19668
|
+
console.log(chalk23.gray(` Repository: ${env.repository_id}`));
|
|
19599
19669
|
} else if (env.repository_set_id) {
|
|
19600
|
-
console.log(
|
|
19670
|
+
console.log(chalk23.gray(` Repository Set: ${env.repository_set_id}`));
|
|
19601
19671
|
}
|
|
19602
19672
|
if (env.variable_count !== void 0) {
|
|
19603
|
-
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}`));
|
|
19604
19674
|
}
|
|
19605
|
-
console.log(
|
|
19675
|
+
console.log(chalk23.gray(` Updated: ${formatDate2(env.updated_at)}`));
|
|
19606
19676
|
console.log();
|
|
19607
19677
|
}
|
|
19608
19678
|
async function environmentListCommand() {
|
|
19609
19679
|
ensureOrgApiAuthenticated();
|
|
19610
19680
|
const response = await orgAuthenticatedFetch("/v1/environments");
|
|
19611
19681
|
if (response.environments.length === 0) {
|
|
19612
|
-
console.log(
|
|
19682
|
+
console.log(chalk23.yellow("\nNo environments found.\n"));
|
|
19613
19683
|
return;
|
|
19614
19684
|
}
|
|
19615
|
-
console.log(
|
|
19685
|
+
console.log(chalk23.green(`
|
|
19616
19686
|
Environments (${response.environments.length}):
|
|
19617
19687
|
`));
|
|
19618
19688
|
for (const env of response.environments) {
|
|
@@ -19623,7 +19693,7 @@ async function environmentGetCommand(idOrName) {
|
|
|
19623
19693
|
ensureOrgApiAuthenticated();
|
|
19624
19694
|
const id = await resolveEnvironmentId(idOrName);
|
|
19625
19695
|
const response = await orgAuthenticatedFetch(`/v1/environments/${id}`);
|
|
19626
|
-
console.log(
|
|
19696
|
+
console.log(chalk23.green(`
|
|
19627
19697
|
Environment: ${response.environment.name}
|
|
19628
19698
|
`));
|
|
19629
19699
|
printEnvironment(response.environment);
|
|
@@ -19639,7 +19709,7 @@ async function environmentCreateCommand(name, options) {
|
|
|
19639
19709
|
validate: (v) => v.trim() ? true : "Name is required"
|
|
19640
19710
|
});
|
|
19641
19711
|
if (!r.name) {
|
|
19642
|
-
console.log(
|
|
19712
|
+
console.log(chalk23.yellow("\nCancelled."));
|
|
19643
19713
|
return;
|
|
19644
19714
|
}
|
|
19645
19715
|
envName = r.name;
|
|
@@ -19652,8 +19722,8 @@ async function environmentCreateCommand(name, options) {
|
|
|
19652
19722
|
const repos2 = await orgAuthenticatedFetch("/v1/repositories");
|
|
19653
19723
|
const repo = repos2.repositories.find((r) => r.name === options.repository);
|
|
19654
19724
|
if (!repo) {
|
|
19655
|
-
console.log(
|
|
19656
|
-
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(", ")}`));
|
|
19657
19727
|
process.exit(1);
|
|
19658
19728
|
}
|
|
19659
19729
|
repositoryId = repo.id;
|
|
@@ -19683,9 +19753,9 @@ async function environmentCreateCommand(name, options) {
|
|
|
19683
19753
|
method: "POST",
|
|
19684
19754
|
body
|
|
19685
19755
|
});
|
|
19686
|
-
console.log(
|
|
19756
|
+
console.log(chalk23.green(`
|
|
19687
19757
|
Created environment: ${response.environment.name}`));
|
|
19688
|
-
console.log(
|
|
19758
|
+
console.log(chalk23.gray(` ID: ${response.environment.id}
|
|
19689
19759
|
`));
|
|
19690
19760
|
}
|
|
19691
19761
|
async function environmentEditCommand(idOrName, options) {
|
|
@@ -19704,21 +19774,21 @@ async function environmentEditCommand(idOrName, options) {
|
|
|
19704
19774
|
const repos2 = await orgAuthenticatedFetch("/v1/repositories");
|
|
19705
19775
|
const repo = repos2.repositories.find((r) => r.name === options.repository);
|
|
19706
19776
|
if (!repo) {
|
|
19707
|
-
console.log(
|
|
19777
|
+
console.log(chalk23.red(`Repository not found: ${options.repository}`));
|
|
19708
19778
|
process.exit(1);
|
|
19709
19779
|
}
|
|
19710
19780
|
body.repository_id = repo.id;
|
|
19711
19781
|
}
|
|
19712
19782
|
}
|
|
19713
19783
|
if (Object.keys(body).length === 0) {
|
|
19714
|
-
console.log(
|
|
19784
|
+
console.log(chalk23.yellow("\nNo changes specified. Pass --name, --description, --repository, or --system-prompt."));
|
|
19715
19785
|
return;
|
|
19716
19786
|
}
|
|
19717
19787
|
const response = await orgAuthenticatedFetch(`/v1/environments/${id}`, {
|
|
19718
19788
|
method: "PATCH",
|
|
19719
19789
|
body
|
|
19720
19790
|
});
|
|
19721
|
-
console.log(
|
|
19791
|
+
console.log(chalk23.green(`
|
|
19722
19792
|
Updated environment: ${response.environment.name}
|
|
19723
19793
|
`));
|
|
19724
19794
|
}
|
|
@@ -19733,20 +19803,20 @@ async function environmentDeleteCommand(idOrName, options) {
|
|
|
19733
19803
|
initial: false
|
|
19734
19804
|
});
|
|
19735
19805
|
if (!r.confirm) {
|
|
19736
|
-
console.log(
|
|
19806
|
+
console.log(chalk23.yellow("\nCancelled."));
|
|
19737
19807
|
return;
|
|
19738
19808
|
}
|
|
19739
19809
|
}
|
|
19740
19810
|
await orgAuthenticatedFetch(`/v1/environments/${id}`, { method: "DELETE" });
|
|
19741
|
-
console.log(
|
|
19811
|
+
console.log(chalk23.green(`
|
|
19742
19812
|
Deleted environment ${idOrName}.
|
|
19743
19813
|
`));
|
|
19744
19814
|
}
|
|
19745
19815
|
function printVariable(v, reveal) {
|
|
19746
|
-
console.log(
|
|
19747
|
-
console.log(
|
|
19748
|
-
console.log(
|
|
19749
|
-
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)}`));
|
|
19750
19820
|
console.log();
|
|
19751
19821
|
}
|
|
19752
19822
|
async function envVarsListCommand(envIdOrName, options) {
|
|
@@ -19756,14 +19826,14 @@ async function envVarsListCommand(envIdOrName, options) {
|
|
|
19756
19826
|
`/v1/environments/${id}/variables`
|
|
19757
19827
|
);
|
|
19758
19828
|
if (response.environment_variables.length === 0) {
|
|
19759
|
-
console.log(
|
|
19829
|
+
console.log(chalk23.yellow("\nNo variables.\n"));
|
|
19760
19830
|
return;
|
|
19761
19831
|
}
|
|
19762
|
-
console.log(
|
|
19832
|
+
console.log(chalk23.green(`
|
|
19763
19833
|
Variables (${response.environment_variables.length}):
|
|
19764
19834
|
`));
|
|
19765
19835
|
if (!options.reveal) {
|
|
19766
|
-
console.log(
|
|
19836
|
+
console.log(chalk23.gray(" Values are masked. Pass --reveal to show full values.\n"));
|
|
19767
19837
|
}
|
|
19768
19838
|
for (const v of response.environment_variables) printVariable(v, !!options.reveal);
|
|
19769
19839
|
}
|
|
@@ -19780,7 +19850,7 @@ async function envVarsSetCommand(envIdOrName, key, value) {
|
|
|
19780
19850
|
`/v1/environments/${id}/variables/${match.id}`,
|
|
19781
19851
|
{ method: "PATCH", body: body2 }
|
|
19782
19852
|
);
|
|
19783
|
-
console.log(
|
|
19853
|
+
console.log(chalk23.green(`
|
|
19784
19854
|
Updated variable ${response2.environment_variable.key}.
|
|
19785
19855
|
`));
|
|
19786
19856
|
return;
|
|
@@ -19794,7 +19864,7 @@ Updated variable ${response2.environment_variable.key}.
|
|
|
19794
19864
|
`/v1/environments/${id}/variables`,
|
|
19795
19865
|
{ method: "POST", body }
|
|
19796
19866
|
);
|
|
19797
|
-
console.log(
|
|
19867
|
+
console.log(chalk23.green(`
|
|
19798
19868
|
Created variable ${response.environment_variable.key}.
|
|
19799
19869
|
`));
|
|
19800
19870
|
}
|
|
@@ -19808,7 +19878,7 @@ async function envVarsDeleteCommand(envIdOrName, keyOrId, options) {
|
|
|
19808
19878
|
);
|
|
19809
19879
|
const match = existing.environment_variables.find((v) => v.key === keyOrId);
|
|
19810
19880
|
if (!match) {
|
|
19811
|
-
console.log(
|
|
19881
|
+
console.log(chalk23.red(`Variable not found: ${keyOrId}`));
|
|
19812
19882
|
process.exit(1);
|
|
19813
19883
|
}
|
|
19814
19884
|
variableId = match.id;
|
|
@@ -19821,23 +19891,23 @@ async function envVarsDeleteCommand(envIdOrName, keyOrId, options) {
|
|
|
19821
19891
|
initial: false
|
|
19822
19892
|
});
|
|
19823
19893
|
if (!r.confirm) {
|
|
19824
|
-
console.log(
|
|
19894
|
+
console.log(chalk23.yellow("\nCancelled."));
|
|
19825
19895
|
return;
|
|
19826
19896
|
}
|
|
19827
19897
|
}
|
|
19828
19898
|
await orgAuthenticatedFetch(`/v1/environments/${id}/variables/${variableId}`, {
|
|
19829
19899
|
method: "DELETE"
|
|
19830
19900
|
});
|
|
19831
|
-
console.log(
|
|
19901
|
+
console.log(chalk23.green(`
|
|
19832
19902
|
Deleted variable ${keyOrId}.
|
|
19833
19903
|
`));
|
|
19834
19904
|
}
|
|
19835
19905
|
function printFile(f) {
|
|
19836
|
-
console.log(
|
|
19837
|
-
console.log(
|
|
19838
|
-
console.log(
|
|
19839
|
-
console.log(
|
|
19840
|
-
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)}`));
|
|
19841
19911
|
console.log();
|
|
19842
19912
|
}
|
|
19843
19913
|
async function envFilesListCommand(envIdOrName) {
|
|
@@ -19847,10 +19917,10 @@ async function envFilesListCommand(envIdOrName) {
|
|
|
19847
19917
|
`/v1/environments/${id}/files`
|
|
19848
19918
|
);
|
|
19849
19919
|
if (response.environment_files.length === 0) {
|
|
19850
|
-
console.log(
|
|
19920
|
+
console.log(chalk23.yellow("\nNo files.\n"));
|
|
19851
19921
|
return;
|
|
19852
19922
|
}
|
|
19853
|
-
console.log(
|
|
19923
|
+
console.log(chalk23.green(`
|
|
19854
19924
|
Files (${response.environment_files.length}):
|
|
19855
19925
|
`));
|
|
19856
19926
|
for (const f of response.environment_files) printFile(f);
|
|
@@ -19881,7 +19951,7 @@ async function envFilesSetCommand(envIdOrName, destinationPath, options) {
|
|
|
19881
19951
|
`/v1/environments/${id}/files/${match.id}`,
|
|
19882
19952
|
{ method: "PATCH", body: body2 }
|
|
19883
19953
|
);
|
|
19884
|
-
console.log(
|
|
19954
|
+
console.log(chalk23.green(`
|
|
19885
19955
|
Updated file ${response2.environment_file.path}.
|
|
19886
19956
|
`));
|
|
19887
19957
|
return;
|
|
@@ -19896,7 +19966,7 @@ Updated file ${response2.environment_file.path}.
|
|
|
19896
19966
|
`/v1/environments/${id}/files`,
|
|
19897
19967
|
{ method: "POST", body }
|
|
19898
19968
|
);
|
|
19899
|
-
console.log(
|
|
19969
|
+
console.log(chalk23.green(`
|
|
19900
19970
|
Created file ${response.environment_file.path}.
|
|
19901
19971
|
`));
|
|
19902
19972
|
}
|
|
@@ -19910,7 +19980,7 @@ async function envFilesDeleteCommand(envIdOrName, pathOrId, options) {
|
|
|
19910
19980
|
);
|
|
19911
19981
|
const match = existing.environment_files.find((f) => f.path === pathOrId);
|
|
19912
19982
|
if (!match) {
|
|
19913
|
-
console.log(
|
|
19983
|
+
console.log(chalk23.red(`File not found: ${pathOrId}`));
|
|
19914
19984
|
process.exit(1);
|
|
19915
19985
|
}
|
|
19916
19986
|
fileId = match.id;
|
|
@@ -19923,14 +19993,14 @@ async function envFilesDeleteCommand(envIdOrName, pathOrId, options) {
|
|
|
19923
19993
|
initial: false
|
|
19924
19994
|
});
|
|
19925
19995
|
if (!r.confirm) {
|
|
19926
|
-
console.log(
|
|
19996
|
+
console.log(chalk23.yellow("\nCancelled."));
|
|
19927
19997
|
return;
|
|
19928
19998
|
}
|
|
19929
19999
|
}
|
|
19930
20000
|
await orgAuthenticatedFetch(`/v1/environments/${id}/files/${fileId}`, {
|
|
19931
20001
|
method: "DELETE"
|
|
19932
20002
|
});
|
|
19933
|
-
console.log(
|
|
20003
|
+
console.log(chalk23.green(`
|
|
19934
20004
|
Deleted file ${pathOrId}.
|
|
19935
20005
|
`));
|
|
19936
20006
|
}
|
|
@@ -19941,15 +20011,15 @@ async function envStartHookGetCommand(envIdOrName) {
|
|
|
19941
20011
|
`/v1/environments/${id}/start-hooks`
|
|
19942
20012
|
);
|
|
19943
20013
|
if (!response.start_hook) {
|
|
19944
|
-
console.log(
|
|
20014
|
+
console.log(chalk23.yellow("\nNo start hook configured.\n"));
|
|
19945
20015
|
return;
|
|
19946
20016
|
}
|
|
19947
20017
|
const hook = response.start_hook;
|
|
19948
|
-
console.log(
|
|
20018
|
+
console.log(chalk23.green(`
|
|
19949
20019
|
Start hook (v${hook.version}, ${hook.is_active ? "active" : "inactive"}):
|
|
19950
20020
|
`));
|
|
19951
|
-
console.log(
|
|
19952
|
-
console.log(
|
|
20021
|
+
console.log(chalk23.gray(` ID: ${hook.id}`));
|
|
20022
|
+
console.log(chalk23.gray(` Created: ${formatDate2(hook.created_at)}
|
|
19953
20023
|
`));
|
|
19954
20024
|
console.log(hook.content);
|
|
19955
20025
|
console.log();
|
|
@@ -19964,10 +20034,10 @@ async function envStartHookSaveCommand(envIdOrName, options) {
|
|
|
19964
20034
|
{ method: "POST", body }
|
|
19965
20035
|
);
|
|
19966
20036
|
if (!response.start_hook) {
|
|
19967
|
-
console.log(
|
|
20037
|
+
console.log(chalk23.green("\nCleared start hook.\n"));
|
|
19968
20038
|
return;
|
|
19969
20039
|
}
|
|
19970
|
-
console.log(
|
|
20040
|
+
console.log(chalk23.green(`
|
|
19971
20041
|
Saved start hook v${response.start_hook.version}.
|
|
19972
20042
|
`));
|
|
19973
20043
|
}
|
|
@@ -19984,7 +20054,7 @@ async function envStartHookTestCommand(envIdOrName, options) {
|
|
|
19984
20054
|
body: { content },
|
|
19985
20055
|
onEvent: (event) => {
|
|
19986
20056
|
if (event.type === "progress" && event.message) {
|
|
19987
|
-
console.log(
|
|
20057
|
+
console.log(chalk23.gray(event.message));
|
|
19988
20058
|
} else if (event.type === "output" && event.output) {
|
|
19989
20059
|
process.stdout.write(event.output);
|
|
19990
20060
|
} else if (event.type === "complete") {
|
|
@@ -19997,21 +20067,21 @@ async function envStartHookTestCommand(envIdOrName, options) {
|
|
|
19997
20067
|
}
|
|
19998
20068
|
);
|
|
19999
20069
|
if (errorMessage) {
|
|
20000
|
-
console.log(
|
|
20070
|
+
console.log(chalk23.red(`
|
|
20001
20071
|
${errorMessage}
|
|
20002
20072
|
`));
|
|
20003
20073
|
process.exit(1);
|
|
20004
20074
|
}
|
|
20005
20075
|
if (timedOut) {
|
|
20006
|
-
console.log(
|
|
20076
|
+
console.log(chalk23.yellow("\nStart hook timed out.\n"));
|
|
20007
20077
|
process.exit(1);
|
|
20008
20078
|
}
|
|
20009
20079
|
if (exitCode === 0) {
|
|
20010
|
-
console.log(
|
|
20080
|
+
console.log(chalk23.green(`
|
|
20011
20081
|
Start hook passed (exit code ${exitCode}).
|
|
20012
20082
|
`));
|
|
20013
20083
|
} else {
|
|
20014
|
-
console.log(
|
|
20084
|
+
console.log(chalk23.red(`
|
|
20015
20085
|
Start hook failed (exit code ${exitCode ?? "unknown"}).
|
|
20016
20086
|
`));
|
|
20017
20087
|
process.exit(1);
|
|
@@ -20024,24 +20094,24 @@ async function envStartHookRepositoryHooksCommand(envIdOrName) {
|
|
|
20024
20094
|
`/v1/environments/${id}/start-hooks/repository-hooks`
|
|
20025
20095
|
);
|
|
20026
20096
|
if (response.repositories.length === 0) {
|
|
20027
|
-
console.log(
|
|
20097
|
+
console.log(chalk23.yellow("\nNo repositories bound to this environment.\n"));
|
|
20028
20098
|
return;
|
|
20029
20099
|
}
|
|
20030
|
-
console.log(
|
|
20100
|
+
console.log(chalk23.green(`
|
|
20031
20101
|
Repository start hooks (${response.repositories.length}):
|
|
20032
20102
|
`));
|
|
20033
20103
|
for (const repo of response.repositories) {
|
|
20034
|
-
console.log(
|
|
20104
|
+
console.log(chalk23.white(` ${repo.repository_name} @${repo.default_branch}`));
|
|
20035
20105
|
if (repo.error) {
|
|
20036
|
-
console.log(
|
|
20106
|
+
console.log(chalk23.red(` Error: ${repo.error}`));
|
|
20037
20107
|
} else if (repo.start_hook) {
|
|
20038
|
-
console.log(
|
|
20039
|
-
console.log(
|
|
20108
|
+
console.log(chalk23.gray(` Source: ${repo.filename ?? "(unknown)"}`));
|
|
20109
|
+
console.log(chalk23.gray(` Commands (${repo.start_hook.commands.length}):`));
|
|
20040
20110
|
for (const cmd of repo.start_hook.commands) {
|
|
20041
|
-
console.log(
|
|
20111
|
+
console.log(chalk23.gray(` ${cmd}`));
|
|
20042
20112
|
}
|
|
20043
20113
|
} else {
|
|
20044
|
-
console.log(
|
|
20114
|
+
console.log(chalk23.gray(` No startHook defined.`));
|
|
20045
20115
|
}
|
|
20046
20116
|
console.log();
|
|
20047
20117
|
}
|
|
@@ -20055,12 +20125,41 @@ function parseBooleanOption(value) {
|
|
|
20055
20125
|
}
|
|
20056
20126
|
var program = new Command();
|
|
20057
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);
|
|
20058
20157
|
program.command("login").description("Authenticate with your Replicas account").action(async () => {
|
|
20059
20158
|
try {
|
|
20060
20159
|
await loginCommand();
|
|
20061
20160
|
} catch (error) {
|
|
20062
20161
|
if (error instanceof Error) {
|
|
20063
|
-
console.error(
|
|
20162
|
+
console.error(chalk24.red(`
|
|
20064
20163
|
\u2717 ${error.message}
|
|
20065
20164
|
`));
|
|
20066
20165
|
}
|
|
@@ -20072,7 +20171,7 @@ program.command("init").description("Create a replicas.json or replicas.yaml con
|
|
|
20072
20171
|
initCommand(options);
|
|
20073
20172
|
} catch (error) {
|
|
20074
20173
|
if (error instanceof Error) {
|
|
20075
|
-
console.error(
|
|
20174
|
+
console.error(chalk24.red(`
|
|
20076
20175
|
\u2717 ${error.message}
|
|
20077
20176
|
`));
|
|
20078
20177
|
}
|
|
@@ -20084,7 +20183,7 @@ program.command("logout").description("Clear stored credentials").action(() => {
|
|
|
20084
20183
|
logoutCommand();
|
|
20085
20184
|
} catch (error) {
|
|
20086
20185
|
if (error instanceof Error) {
|
|
20087
|
-
console.error(
|
|
20186
|
+
console.error(chalk24.red(`
|
|
20088
20187
|
\u2717 ${error.message}
|
|
20089
20188
|
`));
|
|
20090
20189
|
}
|
|
@@ -20096,7 +20195,7 @@ program.command("whoami").description("Display current authenticated user").acti
|
|
|
20096
20195
|
await whoamiCommand();
|
|
20097
20196
|
} catch (error) {
|
|
20098
20197
|
if (error instanceof Error) {
|
|
20099
|
-
console.error(
|
|
20198
|
+
console.error(chalk24.red(`
|
|
20100
20199
|
\u2717 ${error.message}
|
|
20101
20200
|
`));
|
|
20102
20201
|
}
|
|
@@ -20108,7 +20207,7 @@ program.command("codex-auth").description("Authenticate Replicas with your Codex
|
|
|
20108
20207
|
await codexAuthCommand(options);
|
|
20109
20208
|
} catch (error) {
|
|
20110
20209
|
if (error instanceof Error) {
|
|
20111
|
-
console.error(
|
|
20210
|
+
console.error(chalk24.red(`
|
|
20112
20211
|
\u2717 ${error.message}
|
|
20113
20212
|
`));
|
|
20114
20213
|
}
|
|
@@ -20120,7 +20219,7 @@ program.command("claude-auth").description("Authenticate Replicas with your Clau
|
|
|
20120
20219
|
await claudeAuthCommand(options);
|
|
20121
20220
|
} catch (error) {
|
|
20122
20221
|
if (error instanceof Error) {
|
|
20123
|
-
console.error(
|
|
20222
|
+
console.error(chalk24.red(`
|
|
20124
20223
|
\u2717 ${error.message}
|
|
20125
20224
|
`));
|
|
20126
20225
|
}
|
|
@@ -20133,7 +20232,7 @@ org.command("switch").description("Switch to a different organization").action(a
|
|
|
20133
20232
|
await orgSwitchCommand();
|
|
20134
20233
|
} catch (error) {
|
|
20135
20234
|
if (error instanceof Error) {
|
|
20136
|
-
console.error(
|
|
20235
|
+
console.error(chalk24.red(`
|
|
20137
20236
|
\u2717 ${error.message}
|
|
20138
20237
|
`));
|
|
20139
20238
|
}
|
|
@@ -20145,7 +20244,7 @@ org.action(async () => {
|
|
|
20145
20244
|
await orgCommand();
|
|
20146
20245
|
} catch (error) {
|
|
20147
20246
|
if (error instanceof Error) {
|
|
20148
|
-
console.error(
|
|
20247
|
+
console.error(chalk24.red(`
|
|
20149
20248
|
\u2717 ${error.message}
|
|
20150
20249
|
`));
|
|
20151
20250
|
}
|
|
@@ -20157,7 +20256,7 @@ program.command("connect <workspace-name>").description("Connect to a workspace
|
|
|
20157
20256
|
await connectCommand(workspaceName);
|
|
20158
20257
|
} catch (error) {
|
|
20159
20258
|
if (error instanceof Error) {
|
|
20160
|
-
console.error(
|
|
20259
|
+
console.error(chalk24.red(`
|
|
20161
20260
|
\u2717 ${error.message}
|
|
20162
20261
|
`));
|
|
20163
20262
|
}
|
|
@@ -20169,7 +20268,7 @@ program.command("code <workspace-name>").description("Open a workspace in VSCode
|
|
|
20169
20268
|
await codeCommand(workspaceName);
|
|
20170
20269
|
} catch (error) {
|
|
20171
20270
|
if (error instanceof Error) {
|
|
20172
|
-
console.error(
|
|
20271
|
+
console.error(chalk24.red(`
|
|
20173
20272
|
\u2717 ${error.message}
|
|
20174
20273
|
`));
|
|
20175
20274
|
}
|
|
@@ -20182,7 +20281,7 @@ config.command("get <key>").description("Get a configuration value").action(asyn
|
|
|
20182
20281
|
await configGetCommand(key);
|
|
20183
20282
|
} catch (error) {
|
|
20184
20283
|
if (error instanceof Error) {
|
|
20185
|
-
console.error(
|
|
20284
|
+
console.error(chalk24.red(`
|
|
20186
20285
|
\u2717 ${error.message}
|
|
20187
20286
|
`));
|
|
20188
20287
|
}
|
|
@@ -20194,7 +20293,7 @@ config.command("set <key> <value>").description("Set a configuration value").act
|
|
|
20194
20293
|
await configSetCommand(key, value);
|
|
20195
20294
|
} catch (error) {
|
|
20196
20295
|
if (error instanceof Error) {
|
|
20197
|
-
console.error(
|
|
20296
|
+
console.error(chalk24.red(`
|
|
20198
20297
|
\u2717 ${error.message}
|
|
20199
20298
|
`));
|
|
20200
20299
|
}
|
|
@@ -20206,7 +20305,7 @@ config.command("list").description("List all configuration values").action(async
|
|
|
20206
20305
|
await configListCommand();
|
|
20207
20306
|
} catch (error) {
|
|
20208
20307
|
if (error instanceof Error) {
|
|
20209
|
-
console.error(
|
|
20308
|
+
console.error(chalk24.red(`
|
|
20210
20309
|
\u2717 ${error.message}
|
|
20211
20310
|
`));
|
|
20212
20311
|
}
|
|
@@ -20218,7 +20317,7 @@ program.command("list").description("List all replicas").option("-p, --page <pag
|
|
|
20218
20317
|
await replicaListCommand(options);
|
|
20219
20318
|
} catch (error) {
|
|
20220
20319
|
if (error instanceof Error) {
|
|
20221
|
-
console.error(
|
|
20320
|
+
console.error(chalk24.red(`
|
|
20222
20321
|
\u2717 ${error.message}
|
|
20223
20322
|
`));
|
|
20224
20323
|
}
|
|
@@ -20230,7 +20329,7 @@ program.command("get <id>").description("Get replica details by ID").action(asyn
|
|
|
20230
20329
|
await replicaGetCommand(id);
|
|
20231
20330
|
} catch (error) {
|
|
20232
20331
|
if (error instanceof Error) {
|
|
20233
|
-
console.error(
|
|
20332
|
+
console.error(chalk24.red(`
|
|
20234
20333
|
\u2717 ${error.message}
|
|
20235
20334
|
`));
|
|
20236
20335
|
}
|
|
@@ -20242,7 +20341,7 @@ program.command("create [name]").description("Create a new replica").option("-m,
|
|
|
20242
20341
|
await replicaCreateCommand(name, options);
|
|
20243
20342
|
} catch (error) {
|
|
20244
20343
|
if (error instanceof Error) {
|
|
20245
|
-
console.error(
|
|
20344
|
+
console.error(chalk24.red(`
|
|
20246
20345
|
\u2717 ${error.message}
|
|
20247
20346
|
`));
|
|
20248
20347
|
}
|
|
@@ -20254,7 +20353,7 @@ program.command("send <id>").description("Send a message to a replica").option("
|
|
|
20254
20353
|
await replicaSendCommand(id, options);
|
|
20255
20354
|
} catch (error) {
|
|
20256
20355
|
if (error instanceof Error) {
|
|
20257
|
-
console.error(
|
|
20356
|
+
console.error(chalk24.red(`
|
|
20258
20357
|
\u2717 ${error.message}
|
|
20259
20358
|
`));
|
|
20260
20359
|
}
|
|
@@ -20266,7 +20365,7 @@ program.command("delete <id>").description("Delete a replica").option("-f, --for
|
|
|
20266
20365
|
await replicaDeleteCommand(id, options);
|
|
20267
20366
|
} catch (error) {
|
|
20268
20367
|
if (error instanceof Error) {
|
|
20269
|
-
console.error(
|
|
20368
|
+
console.error(chalk24.red(`
|
|
20270
20369
|
\u2717 ${error.message}
|
|
20271
20370
|
`));
|
|
20272
20371
|
}
|
|
@@ -20278,7 +20377,7 @@ program.command("read <id>").description("Read conversation history of a replica
|
|
|
20278
20377
|
await replicaReadCommand(id, options);
|
|
20279
20378
|
} catch (error) {
|
|
20280
20379
|
if (error instanceof Error) {
|
|
20281
|
-
console.error(
|
|
20380
|
+
console.error(chalk24.red(`
|
|
20282
20381
|
\u2717 ${error.message}
|
|
20283
20382
|
`));
|
|
20284
20383
|
}
|
|
@@ -20291,7 +20390,7 @@ automation.command("list").description("List all automations").option("-p, --pag
|
|
|
20291
20390
|
await automationListCommand(options);
|
|
20292
20391
|
} catch (error) {
|
|
20293
20392
|
if (error instanceof Error) {
|
|
20294
|
-
console.error(
|
|
20393
|
+
console.error(chalk24.red(`
|
|
20295
20394
|
\u2717 ${error.message}
|
|
20296
20395
|
`));
|
|
20297
20396
|
}
|
|
@@ -20303,7 +20402,7 @@ automation.command("get <id>").description("Get automation details by ID").actio
|
|
|
20303
20402
|
await automationGetCommand(id);
|
|
20304
20403
|
} catch (error) {
|
|
20305
20404
|
if (error instanceof Error) {
|
|
20306
|
-
console.error(
|
|
20405
|
+
console.error(chalk24.red(`
|
|
20307
20406
|
\u2717 ${error.message}
|
|
20308
20407
|
`));
|
|
20309
20408
|
}
|
|
@@ -20318,7 +20417,7 @@ automation.command("create [name]").description("Create a new automation").optio
|
|
|
20318
20417
|
});
|
|
20319
20418
|
} catch (error) {
|
|
20320
20419
|
if (error instanceof Error) {
|
|
20321
|
-
console.error(
|
|
20420
|
+
console.error(chalk24.red(`
|
|
20322
20421
|
\u2717 ${error.message}
|
|
20323
20422
|
`));
|
|
20324
20423
|
}
|
|
@@ -20330,7 +20429,7 @@ automation.command("edit <id>").description("Edit an existing automation").optio
|
|
|
20330
20429
|
await automationEditCommand(id, options);
|
|
20331
20430
|
} catch (error) {
|
|
20332
20431
|
if (error instanceof Error) {
|
|
20333
|
-
console.error(
|
|
20432
|
+
console.error(chalk24.red(`
|
|
20334
20433
|
\u2717 ${error.message}
|
|
20335
20434
|
`));
|
|
20336
20435
|
}
|
|
@@ -20342,7 +20441,7 @@ automation.command("run <id>").description("Manually trigger an automation (cron
|
|
|
20342
20441
|
await automationRunCommand(id);
|
|
20343
20442
|
} catch (error) {
|
|
20344
20443
|
if (error instanceof Error) {
|
|
20345
|
-
console.error(
|
|
20444
|
+
console.error(chalk24.red(`
|
|
20346
20445
|
\u2717 ${error.message}
|
|
20347
20446
|
`));
|
|
20348
20447
|
}
|
|
@@ -20354,7 +20453,7 @@ automation.command("delete <id>").description("Delete an automation").option("-f
|
|
|
20354
20453
|
await automationDeleteCommand(id, options);
|
|
20355
20454
|
} catch (error) {
|
|
20356
20455
|
if (error instanceof Error) {
|
|
20357
|
-
console.error(
|
|
20456
|
+
console.error(chalk24.red(`
|
|
20358
20457
|
\u2717 ${error.message}
|
|
20359
20458
|
`));
|
|
20360
20459
|
}
|
|
@@ -20366,7 +20465,7 @@ automation.action(async () => {
|
|
|
20366
20465
|
await automationListCommand({});
|
|
20367
20466
|
} catch (error) {
|
|
20368
20467
|
if (error instanceof Error) {
|
|
20369
|
-
console.error(
|
|
20468
|
+
console.error(chalk24.red(`
|
|
20370
20469
|
\u2717 ${error.message}
|
|
20371
20470
|
`));
|
|
20372
20471
|
}
|
|
@@ -20379,7 +20478,7 @@ repos.command("list").description("List all repositories").action(async () => {
|
|
|
20379
20478
|
await repositoriesListCommand();
|
|
20380
20479
|
} catch (error) {
|
|
20381
20480
|
if (error instanceof Error) {
|
|
20382
|
-
console.error(
|
|
20481
|
+
console.error(chalk24.red(`
|
|
20383
20482
|
\u2717 ${error.message}
|
|
20384
20483
|
`));
|
|
20385
20484
|
}
|
|
@@ -20391,7 +20490,7 @@ repos.action(async () => {
|
|
|
20391
20490
|
await repositoriesListCommand();
|
|
20392
20491
|
} catch (error) {
|
|
20393
20492
|
if (error instanceof Error) {
|
|
20394
|
-
console.error(
|
|
20493
|
+
console.error(chalk24.red(`
|
|
20395
20494
|
\u2717 ${error.message}
|
|
20396
20495
|
`));
|
|
20397
20496
|
}
|
|
@@ -20404,7 +20503,7 @@ environment.command("list").description("List all environments").action(async ()
|
|
|
20404
20503
|
await environmentListCommand();
|
|
20405
20504
|
} catch (error) {
|
|
20406
20505
|
if (error instanceof Error) {
|
|
20407
|
-
console.error(
|
|
20506
|
+
console.error(chalk24.red(`
|
|
20408
20507
|
\u2717 ${error.message}
|
|
20409
20508
|
`));
|
|
20410
20509
|
}
|
|
@@ -20416,7 +20515,7 @@ environment.command("get <id-or-name>").description('Get an environment by ID or
|
|
|
20416
20515
|
await environmentGetCommand(idOrName);
|
|
20417
20516
|
} catch (error) {
|
|
20418
20517
|
if (error instanceof Error) {
|
|
20419
|
-
console.error(
|
|
20518
|
+
console.error(chalk24.red(`
|
|
20420
20519
|
\u2717 ${error.message}
|
|
20421
20520
|
`));
|
|
20422
20521
|
}
|
|
@@ -20428,7 +20527,7 @@ environment.command("create [name]").description("Create a new environment").opt
|
|
|
20428
20527
|
await environmentCreateCommand(name, options);
|
|
20429
20528
|
} catch (error) {
|
|
20430
20529
|
if (error instanceof Error) {
|
|
20431
|
-
console.error(
|
|
20530
|
+
console.error(chalk24.red(`
|
|
20432
20531
|
\u2717 ${error.message}
|
|
20433
20532
|
`));
|
|
20434
20533
|
}
|
|
@@ -20440,7 +20539,7 @@ environment.command("edit <id-or-name>").description("Edit an environment").opti
|
|
|
20440
20539
|
await environmentEditCommand(idOrName, options);
|
|
20441
20540
|
} catch (error) {
|
|
20442
20541
|
if (error instanceof Error) {
|
|
20443
|
-
console.error(
|
|
20542
|
+
console.error(chalk24.red(`
|
|
20444
20543
|
\u2717 ${error.message}
|
|
20445
20544
|
`));
|
|
20446
20545
|
}
|
|
@@ -20452,7 +20551,7 @@ environment.command("delete <id-or-name>").description("Delete an environment").
|
|
|
20452
20551
|
await environmentDeleteCommand(idOrName, options);
|
|
20453
20552
|
} catch (error) {
|
|
20454
20553
|
if (error instanceof Error) {
|
|
20455
|
-
console.error(
|
|
20554
|
+
console.error(chalk24.red(`
|
|
20456
20555
|
\u2717 ${error.message}
|
|
20457
20556
|
`));
|
|
20458
20557
|
}
|
|
@@ -20465,7 +20564,7 @@ envVars.command("list <env>").description("List variables in an environment (val
|
|
|
20465
20564
|
await envVarsListCommand(env, options);
|
|
20466
20565
|
} catch (error) {
|
|
20467
20566
|
if (error instanceof Error) {
|
|
20468
|
-
console.error(
|
|
20567
|
+
console.error(chalk24.red(`
|
|
20469
20568
|
\u2717 ${error.message}
|
|
20470
20569
|
`));
|
|
20471
20570
|
}
|
|
@@ -20477,7 +20576,7 @@ envVars.command("set <env> <key> <value>").description("Create or update a varia
|
|
|
20477
20576
|
await envVarsSetCommand(env, key, value);
|
|
20478
20577
|
} catch (error) {
|
|
20479
20578
|
if (error instanceof Error) {
|
|
20480
|
-
console.error(
|
|
20579
|
+
console.error(chalk24.red(`
|
|
20481
20580
|
\u2717 ${error.message}
|
|
20482
20581
|
`));
|
|
20483
20582
|
}
|
|
@@ -20489,7 +20588,7 @@ envVars.command("delete <env> <key-or-id>").description("Delete a variable by ke
|
|
|
20489
20588
|
await envVarsDeleteCommand(env, keyOrId, options);
|
|
20490
20589
|
} catch (error) {
|
|
20491
20590
|
if (error instanceof Error) {
|
|
20492
|
-
console.error(
|
|
20591
|
+
console.error(chalk24.red(`
|
|
20493
20592
|
\u2717 ${error.message}
|
|
20494
20593
|
`));
|
|
20495
20594
|
}
|
|
@@ -20502,7 +20601,7 @@ envFiles.command("list <env>").description("List files in an environment").actio
|
|
|
20502
20601
|
await envFilesListCommand(env);
|
|
20503
20602
|
} catch (error) {
|
|
20504
20603
|
if (error instanceof Error) {
|
|
20505
|
-
console.error(
|
|
20604
|
+
console.error(chalk24.red(`
|
|
20506
20605
|
\u2717 ${error.message}
|
|
20507
20606
|
`));
|
|
20508
20607
|
}
|
|
@@ -20514,7 +20613,7 @@ envFiles.command("set <env> <destination-path>").description("Create or update a
|
|
|
20514
20613
|
await envFilesSetCommand(env, destinationPath, options);
|
|
20515
20614
|
} catch (error) {
|
|
20516
20615
|
if (error instanceof Error) {
|
|
20517
|
-
console.error(
|
|
20616
|
+
console.error(chalk24.red(`
|
|
20518
20617
|
\u2717 ${error.message}
|
|
20519
20618
|
`));
|
|
20520
20619
|
}
|
|
@@ -20526,7 +20625,7 @@ envFiles.command("delete <env> <path-or-id>").description("Delete a file by dest
|
|
|
20526
20625
|
await envFilesDeleteCommand(env, pathOrId, options);
|
|
20527
20626
|
} catch (error) {
|
|
20528
20627
|
if (error instanceof Error) {
|
|
20529
|
-
console.error(
|
|
20628
|
+
console.error(chalk24.red(`
|
|
20530
20629
|
\u2717 ${error.message}
|
|
20531
20630
|
`));
|
|
20532
20631
|
}
|
|
@@ -20539,7 +20638,7 @@ envStartHooks.command("get <env>").description("Show the active start hook for a
|
|
|
20539
20638
|
await envStartHookGetCommand(env);
|
|
20540
20639
|
} catch (error) {
|
|
20541
20640
|
if (error instanceof Error) {
|
|
20542
|
-
console.error(
|
|
20641
|
+
console.error(chalk24.red(`
|
|
20543
20642
|
\u2717 ${error.message}
|
|
20544
20643
|
`));
|
|
20545
20644
|
}
|
|
@@ -20551,7 +20650,7 @@ envStartHooks.command("save <env>").description("Save and activate a start hook
|
|
|
20551
20650
|
await envStartHookSaveCommand(env, options);
|
|
20552
20651
|
} catch (error) {
|
|
20553
20652
|
if (error instanceof Error) {
|
|
20554
|
-
console.error(
|
|
20653
|
+
console.error(chalk24.red(`
|
|
20555
20654
|
\u2717 ${error.message}
|
|
20556
20655
|
`));
|
|
20557
20656
|
}
|
|
@@ -20563,7 +20662,7 @@ envStartHooks.command("test <env>").description("Run a start hook in an isolated
|
|
|
20563
20662
|
await envStartHookTestCommand(env, options);
|
|
20564
20663
|
} catch (error) {
|
|
20565
20664
|
if (error instanceof Error) {
|
|
20566
|
-
console.error(
|
|
20665
|
+
console.error(chalk24.red(`
|
|
20567
20666
|
\u2717 ${error.message}
|
|
20568
20667
|
`));
|
|
20569
20668
|
}
|
|
@@ -20575,7 +20674,7 @@ envStartHooks.command("repository-hooks <env>").description("List per-repo start
|
|
|
20575
20674
|
await envStartHookRepositoryHooksCommand(env);
|
|
20576
20675
|
} catch (error) {
|
|
20577
20676
|
if (error instanceof Error) {
|
|
20578
|
-
console.error(
|
|
20677
|
+
console.error(chalk24.red(`
|
|
20579
20678
|
\u2717 ${error.message}
|
|
20580
20679
|
`));
|
|
20581
20680
|
}
|
|
@@ -20587,7 +20686,7 @@ environment.action(async () => {
|
|
|
20587
20686
|
await environmentListCommand();
|
|
20588
20687
|
} catch (error) {
|
|
20589
20688
|
if (error instanceof Error) {
|
|
20590
|
-
console.error(
|
|
20689
|
+
console.error(chalk24.red(`
|
|
20591
20690
|
\u2717 ${error.message}
|
|
20592
20691
|
`));
|
|
20593
20692
|
}
|
|
@@ -20599,7 +20698,7 @@ program.command("interact").alias("i").description("Launch the interactive termi
|
|
|
20599
20698
|
await interactiveCommand();
|
|
20600
20699
|
} catch (error) {
|
|
20601
20700
|
if (error instanceof Error) {
|
|
20602
|
-
console.error(
|
|
20701
|
+
console.error(chalk24.red(`
|
|
20603
20702
|
\u2717 ${error.message}
|
|
20604
20703
|
`));
|
|
20605
20704
|
}
|
|
@@ -20650,7 +20749,7 @@ if (isAgentMode()) {
|
|
|
20650
20749
|
await previewAddCommand(workspaceId, options);
|
|
20651
20750
|
} catch (error) {
|
|
20652
20751
|
if (error instanceof Error) {
|
|
20653
|
-
console.error(
|
|
20752
|
+
console.error(chalk24.red(`
|
|
20654
20753
|
\u2717 ${error.message}
|
|
20655
20754
|
`));
|
|
20656
20755
|
}
|
|
@@ -20662,7 +20761,7 @@ if (isAgentMode()) {
|
|
|
20662
20761
|
await previewListCommand(workspaceId);
|
|
20663
20762
|
} catch (error) {
|
|
20664
20763
|
if (error instanceof Error) {
|
|
20665
|
-
console.error(
|
|
20764
|
+
console.error(chalk24.red(`
|
|
20666
20765
|
\u2717 ${error.message}
|
|
20667
20766
|
`));
|
|
20668
20767
|
}
|
|
@@ -20674,7 +20773,7 @@ if (isAgentMode()) {
|
|
|
20674
20773
|
await previewRemoveCommand(workspaceId, options);
|
|
20675
20774
|
} catch (error) {
|
|
20676
20775
|
if (error instanceof Error) {
|
|
20677
|
-
console.error(
|
|
20776
|
+
console.error(chalk24.red(`
|
|
20678
20777
|
\u2717 ${error.message}
|
|
20679
20778
|
`));
|
|
20680
20779
|
}
|
|
@@ -20689,7 +20788,7 @@ if (isAgentMode()) {
|
|
|
20689
20788
|
await mediaUploadCommand(files, options);
|
|
20690
20789
|
} catch (error) {
|
|
20691
20790
|
if (error instanceof Error) {
|
|
20692
|
-
console.error(
|
|
20791
|
+
console.error(chalk24.red(`
|
|
20693
20792
|
\u2717 ${error.message}
|
|
20694
20793
|
`));
|
|
20695
20794
|
}
|
|
@@ -20701,7 +20800,7 @@ if (isAgentMode()) {
|
|
|
20701
20800
|
await mediaListCommand(options);
|
|
20702
20801
|
} catch (error) {
|
|
20703
20802
|
if (error instanceof Error) {
|
|
20704
|
-
console.error(
|
|
20803
|
+
console.error(chalk24.red(`
|
|
20705
20804
|
\u2717 ${error.message}
|
|
20706
20805
|
`));
|
|
20707
20806
|
}
|
|
@@ -20714,7 +20813,7 @@ if (isAgentMode()) {
|
|
|
20714
20813
|
await learningsReadCommand(options);
|
|
20715
20814
|
} catch (error) {
|
|
20716
20815
|
if (error instanceof Error) {
|
|
20717
|
-
console.error(
|
|
20816
|
+
console.error(chalk24.red(`
|
|
20718
20817
|
\u2717 ${error.message}
|
|
20719
20818
|
`));
|
|
20720
20819
|
}
|
|
@@ -20726,7 +20825,7 @@ if (isAgentMode()) {
|
|
|
20726
20825
|
await learningsAddCommand(options);
|
|
20727
20826
|
} catch (error) {
|
|
20728
20827
|
if (error instanceof Error) {
|
|
20729
|
-
console.error(
|
|
20828
|
+
console.error(chalk24.red(`
|
|
20730
20829
|
\u2717 ${error.message}
|
|
20731
20830
|
`));
|
|
20732
20831
|
}
|
|
@@ -20738,7 +20837,7 @@ if (isAgentMode()) {
|
|
|
20738
20837
|
await learningsUpdateCommand(id, options);
|
|
20739
20838
|
} catch (error) {
|
|
20740
20839
|
if (error instanceof Error) {
|
|
20741
|
-
console.error(
|
|
20840
|
+
console.error(chalk24.red(`
|
|
20742
20841
|
\u2717 ${error.message}
|
|
20743
20842
|
`));
|
|
20744
20843
|
}
|
|
@@ -20750,7 +20849,7 @@ if (isAgentMode()) {
|
|
|
20750
20849
|
await learningsDeleteCommand(id);
|
|
20751
20850
|
} catch (error) {
|
|
20752
20851
|
if (error instanceof Error) {
|
|
20753
|
-
console.error(
|
|
20852
|
+
console.error(chalk24.red(`
|
|
20754
20853
|
\u2717 ${error.message}
|
|
20755
20854
|
`));
|
|
20756
20855
|
}
|
|
@@ -20763,7 +20862,7 @@ if (isAgentMode()) {
|
|
|
20763
20862
|
await fn(...args);
|
|
20764
20863
|
} catch (error) {
|
|
20765
20864
|
if (error instanceof Error) {
|
|
20766
|
-
console.error(
|
|
20865
|
+
console.error(chalk24.red(`
|
|
20767
20866
|
\u2717 ${error.message}
|
|
20768
20867
|
`));
|
|
20769
20868
|
}
|
|
@@ -20791,9 +20890,11 @@ if (isAgentMode()) {
|
|
|
20791
20890
|
const allowed = /* @__PURE__ */ new Set([
|
|
20792
20891
|
"init",
|
|
20793
20892
|
"whoami",
|
|
20893
|
+
"list",
|
|
20794
20894
|
"connect",
|
|
20795
20895
|
"preview",
|
|
20796
20896
|
"media",
|
|
20897
|
+
"slack",
|
|
20797
20898
|
"computer",
|
|
20798
20899
|
"automation",
|
|
20799
20900
|
"repos",
|