agendex-cli 1.3.0 → 2.0.0
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/README.md +26 -0
- package/dist/cli.js +28 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,20 @@ Node-compatible Agendex CLI for browser login, opening the web app, one-shot syn
|
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
|
+
Recommended one-line installer:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# macOS / Linux
|
|
11
|
+
curl -fsSL https://agendex.dev/install.sh | bash
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
```powershell
|
|
15
|
+
# Windows (PowerShell)
|
|
16
|
+
irm https://agendex.dev/install.ps1 | iex
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or install directly with your package manager:
|
|
20
|
+
|
|
7
21
|
```bash
|
|
8
22
|
npm install -g agendex-cli
|
|
9
23
|
pnpm add -g agendex-cli
|
|
@@ -11,6 +25,18 @@ yarn global add agendex-cli
|
|
|
11
25
|
bun install -g agendex-cli
|
|
12
26
|
```
|
|
13
27
|
|
|
28
|
+
Installer options:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
curl -fsSL https://agendex.dev/install.sh | bash -s -- --version 1.2.3
|
|
32
|
+
curl -fsSL https://agendex.dev/install.sh | bash -s -- --pm pnpm
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```powershell
|
|
36
|
+
& ([scriptblock]::Create((irm https://agendex.dev/install.ps1))) -Version 1.2.3
|
|
37
|
+
& ([scriptblock]::Create((irm https://agendex.dev/install.ps1))) -Pm pnpm
|
|
38
|
+
```
|
|
39
|
+
|
|
14
40
|
## Commands
|
|
15
41
|
|
|
16
42
|
```bash
|
package/dist/cli.js
CHANGED
|
@@ -1060,7 +1060,7 @@ var init_cleanup = __esm(() => {
|
|
|
1060
1060
|
// src/cli.ts
|
|
1061
1061
|
import { spawn as spawn4 } from "node:child_process";
|
|
1062
1062
|
import { existsSync as existsSync13, statSync as statSync2, writeSync } from "node:fs";
|
|
1063
|
-
import { resolve as
|
|
1063
|
+
import { resolve as resolve11 } from "node:path";
|
|
1064
1064
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
1065
1065
|
|
|
1066
1066
|
// ../shared/src/adapters/catalog.ts
|
|
@@ -3217,7 +3217,7 @@ function looksLikeExecutionReport(normalized) {
|
|
|
3217
3217
|
const hasPastCompletion = /\b(?:fixed|pushed|committed|completed|done|implemented|updated|changed|patched|merged|deployed|passed|failed|resolved|reverted)\b/i.test(normalized);
|
|
3218
3218
|
const hasReportSection = /^\s*(?:summary|result|results|changes|verification|status)\s*:/im.test(normalized);
|
|
3219
3219
|
const hasReviewReportMarker = /\b(?:review findings?|review issues?|review comments?)\b/i.test(normalized);
|
|
3220
|
-
const hasCommandMarker = /::[a-z0-9_-]+(?:\{|\[|\s*$)/im.test(normalized) || /`[^`]
|
|
3220
|
+
const hasCommandMarker = /::[a-z0-9_-]+(?:\{|\[|\s*$)/im.test(normalized) || /`[^`]*\b(?:bun|npm|pnpm|yarn|git|tsc|oxfmt|oxlint|biome)\b[^`]*`/i.test(normalized) || /\b(?:git\s+(?:stage|commit|push|status)|bunx?\s+|npm\s+|pnpm\s+|yarn\s+)\b/i.test(normalized);
|
|
3221
3221
|
return hasPastCompletion && (hasReportSection || hasCommandMarker || hasReviewReportMarker);
|
|
3222
3222
|
}
|
|
3223
3223
|
function lowValueAssessment(reasons, signals) {
|
|
@@ -3283,7 +3283,7 @@ function assessPlanValue(input) {
|
|
|
3283
3283
|
reasons.push("tool-log");
|
|
3284
3284
|
if (conversationArtifact && !explicitPlanBlock && !strongPositive)
|
|
3285
3285
|
reasons.push("conversation-artifact");
|
|
3286
|
-
if (executionReport && !explicitPlanBlock)
|
|
3286
|
+
if (executionReport && !explicitPlanBlock && !strongPositive)
|
|
3287
3287
|
reasons.push("execution-report");
|
|
3288
3288
|
if (wrapperTitle && !explicitPlanBlock)
|
|
3289
3289
|
reasons.push("wrapper-title");
|
|
@@ -5744,7 +5744,7 @@ import { join as join15 } from "node:path";
|
|
|
5744
5744
|
// package.json
|
|
5745
5745
|
var package_default = {
|
|
5746
5746
|
name: "agendex-cli",
|
|
5747
|
-
version: "
|
|
5747
|
+
version: "2.0.0",
|
|
5748
5748
|
description: "Agendex CLI for login, sync, and daemon workflows",
|
|
5749
5749
|
homepage: "https://github.com/Tyru5/Agendex#readme",
|
|
5750
5750
|
bugs: {
|
|
@@ -6055,6 +6055,7 @@ async function runUpgrade(opts) {
|
|
|
6055
6055
|
import { readFile as readFile8, stat as stat8 } from "node:fs/promises";
|
|
6056
6056
|
import { existsSync as existsSync12 } from "node:fs";
|
|
6057
6057
|
import { hostname as osHostname4 } from "node:os";
|
|
6058
|
+
import { isAbsolute, resolve as resolve10 } from "node:path";
|
|
6058
6059
|
function resolveAgentOverride(args) {
|
|
6059
6060
|
const idx = args.indexOf("--agent");
|
|
6060
6061
|
if (idx === -1)
|
|
@@ -6081,6 +6082,22 @@ function resolvePathArg(args) {
|
|
|
6081
6082
|
}
|
|
6082
6083
|
return;
|
|
6083
6084
|
}
|
|
6085
|
+
function resolveLaunchCwd() {
|
|
6086
|
+
const initCwd = process.env.INIT_CWD?.trim();
|
|
6087
|
+
if (initCwd && isAbsolute(initCwd))
|
|
6088
|
+
return initCwd;
|
|
6089
|
+
const shellPwd = process.env.PWD?.trim();
|
|
6090
|
+
if (shellPwd && isAbsolute(shellPwd))
|
|
6091
|
+
return shellPwd;
|
|
6092
|
+
return process.cwd();
|
|
6093
|
+
}
|
|
6094
|
+
function resolveUploadFilePath(pathArg) {
|
|
6095
|
+
const trimmed = pathArg.trim();
|
|
6096
|
+
if (isAbsolute(trimmed) || trimmed === "~" || trimmed.startsWith("~/")) {
|
|
6097
|
+
return resolveCustomPlanDirPath(trimmed);
|
|
6098
|
+
}
|
|
6099
|
+
return resolve10(resolveLaunchCwd(), trimmed);
|
|
6100
|
+
}
|
|
6084
6101
|
async function runUpload(args, deps) {
|
|
6085
6102
|
const syncPlanFn = deps?.syncPlan ?? syncPlan;
|
|
6086
6103
|
const log = deps?.log ?? ((m) => console.log(m));
|
|
@@ -6091,7 +6108,7 @@ async function runUpload(args, deps) {
|
|
|
6091
6108
|
error("[agendex] usage: agendex upload <path> [--agent <name>] [--open]");
|
|
6092
6109
|
return 1;
|
|
6093
6110
|
}
|
|
6094
|
-
const absolutePath =
|
|
6111
|
+
const absolutePath = resolveUploadFilePath(pathArg);
|
|
6095
6112
|
if (!existsSync12(absolutePath)) {
|
|
6096
6113
|
error(`[agendex] path does not exist: ${absolutePath}`);
|
|
6097
6114
|
return 1;
|
|
@@ -6165,7 +6182,7 @@ async function runUpload(args, deps) {
|
|
|
6165
6182
|
// src/web.ts
|
|
6166
6183
|
async function openAgendexWeb(siteUrlOverride) {
|
|
6167
6184
|
const base = siteUrlOverride ?? getSiteUrl();
|
|
6168
|
-
const url = base.replace(/\/$/, "")
|
|
6185
|
+
const url = `${base.replace(/\/$/, "")}/dashboard`;
|
|
6169
6186
|
launchBrowser(url, "Agendex in your browser");
|
|
6170
6187
|
}
|
|
6171
6188
|
async function openSharedPlan(url) {
|
|
@@ -6199,7 +6216,7 @@ function firstCommandToken(argv) {
|
|
|
6199
6216
|
return;
|
|
6200
6217
|
}
|
|
6201
6218
|
var command = firstCommandToken(args) ?? "start";
|
|
6202
|
-
var cliEntry =
|
|
6219
|
+
var cliEntry = resolve11(process.argv[1] ?? fileURLToPath3(import.meta.url));
|
|
6203
6220
|
async function main() {
|
|
6204
6221
|
const isInternal = args.includes("--daemon") || args.includes("--worker");
|
|
6205
6222
|
if (command === "--version" || command === "-v") {
|
|
@@ -6430,7 +6447,7 @@ async function main() {
|
|
|
6430
6447
|
const { request } = await import("node:http");
|
|
6431
6448
|
const body = JSON.stringify({ path: resolved });
|
|
6432
6449
|
try {
|
|
6433
|
-
const res = await new Promise((
|
|
6450
|
+
const res = await new Promise((resolve12, reject) => {
|
|
6434
6451
|
const req = request(`http://localhost:${port}/api/v1/plan-sources`, {
|
|
6435
6452
|
method: "POST",
|
|
6436
6453
|
headers: {
|
|
@@ -6444,7 +6461,7 @@ async function main() {
|
|
|
6444
6461
|
res2.on("data", (chunk) => {
|
|
6445
6462
|
data += chunk;
|
|
6446
6463
|
});
|
|
6447
|
-
res2.on("end", () =>
|
|
6464
|
+
res2.on("end", () => resolve12({ status: res2.statusCode ?? 0, body: data }));
|
|
6448
6465
|
res2.on("error", reject);
|
|
6449
6466
|
});
|
|
6450
6467
|
req.on("error", reject);
|
|
@@ -6640,13 +6657,13 @@ function flushStream(stream) {
|
|
|
6640
6657
|
if (stream.destroyed || !stream.writable) {
|
|
6641
6658
|
return Promise.resolve();
|
|
6642
6659
|
}
|
|
6643
|
-
return new Promise((
|
|
6660
|
+
return new Promise((resolve12, reject) => {
|
|
6644
6661
|
stream.write("", (error) => {
|
|
6645
6662
|
if (error) {
|
|
6646
6663
|
reject(error);
|
|
6647
6664
|
return;
|
|
6648
6665
|
}
|
|
6649
|
-
|
|
6666
|
+
resolve12();
|
|
6650
6667
|
});
|
|
6651
6668
|
});
|
|
6652
6669
|
}
|