@gnsx/genesys.agent.cli 1.0.6 → 1.0.7
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/bundle/launcher.js +348 -0
- package/dist/bundle/launcher.js.map +1 -0
- package/dist/src/launcher.js +0 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/tsup.config.d.ts +3 -0
- package/dist/tsup.config.d.ts.map +1 -0
- package/dist/tsup.config.js +13 -0
- package/dist/tsup.config.js.map +1 -0
- package/package.json +5 -3
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __esm = (fn, res) => function __init() {
|
|
4
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// ../../../cli-utils/dist/self-update.js
|
|
8
|
+
import { execSync } from "child_process";
|
|
9
|
+
import { fileURLToPath } from "url";
|
|
10
|
+
function isInstalledPackage() {
|
|
11
|
+
try {
|
|
12
|
+
const currentFile = fileURLToPath(import.meta.url);
|
|
13
|
+
return currentFile.includes("node_modules");
|
|
14
|
+
} catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function detectPackageManager() {
|
|
19
|
+
if (process.env.PNPM_PACKAGE_NAME)
|
|
20
|
+
return "pnpm";
|
|
21
|
+
if (process.env.npm_execpath?.includes("pnpm"))
|
|
22
|
+
return "pnpm";
|
|
23
|
+
const execPath = process.argv[1] || "";
|
|
24
|
+
if (execPath.includes("pnpm"))
|
|
25
|
+
return "pnpm";
|
|
26
|
+
if (execPath.includes("npm"))
|
|
27
|
+
return "npm";
|
|
28
|
+
return "pnpm";
|
|
29
|
+
}
|
|
30
|
+
function isNewerVersion(latest, current) {
|
|
31
|
+
const latestParts = latest.split(".").map(Number);
|
|
32
|
+
const currentParts = current.split(".").map(Number);
|
|
33
|
+
for (let i = 0; i < 3; i++) {
|
|
34
|
+
const latestPart = latestParts[i] || 0;
|
|
35
|
+
const currentPart = currentParts[i] || 0;
|
|
36
|
+
if (latestPart > currentPart)
|
|
37
|
+
return true;
|
|
38
|
+
if (latestPart < currentPart)
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
async function checkForUpdates(packageName, currentVersion) {
|
|
44
|
+
try {
|
|
45
|
+
if (!isInstalledPackage())
|
|
46
|
+
return null;
|
|
47
|
+
const encodedName = encodeURIComponent(packageName);
|
|
48
|
+
const response = await fetch(`https://registry.npmjs.org/${encodedName}/latest`, {
|
|
49
|
+
signal: AbortSignal.timeout(1e4)
|
|
50
|
+
});
|
|
51
|
+
if (!response.ok)
|
|
52
|
+
return null;
|
|
53
|
+
const data = await response.json();
|
|
54
|
+
const latestVersion = data.version;
|
|
55
|
+
if (!latestVersion || latestVersion === currentVersion)
|
|
56
|
+
return null;
|
|
57
|
+
if (!isNewerVersion(latestVersion, currentVersion))
|
|
58
|
+
return null;
|
|
59
|
+
return latestVersion;
|
|
60
|
+
} catch {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function performUpdate(packageName, packageManager, currentVersion, latestVersion) {
|
|
65
|
+
console.log(`
|
|
66
|
+
Updating ${packageName}...`);
|
|
67
|
+
console.log(` Current: v${currentVersion}`);
|
|
68
|
+
console.log(` Latest: v${latestVersion}
|
|
69
|
+
`);
|
|
70
|
+
try {
|
|
71
|
+
const updateCommand = packageManager === "pnpm" ? `pnpm remove -g ${packageName} && pnpm add -g ${packageName}@latest` : `npm uninstall -g ${packageName} && npm install -g ${packageName}@latest`;
|
|
72
|
+
execSync(updateCommand, { stdio: "inherit" });
|
|
73
|
+
console.log(`
|
|
74
|
+
\u2705 Update complete! ${packageName} has been updated to v${latestVersion}.`);
|
|
75
|
+
return true;
|
|
76
|
+
} catch (error) {
|
|
77
|
+
console.error(`
|
|
78
|
+
\u274C Update failed. Please try running the commands manually:`);
|
|
79
|
+
if (packageManager === "pnpm") {
|
|
80
|
+
console.error(` pnpm remove -g ${packageName}`);
|
|
81
|
+
console.error(` pnpm add -g ${packageName}@latest`);
|
|
82
|
+
} else {
|
|
83
|
+
console.error(` npm uninstall -g ${packageName}`);
|
|
84
|
+
console.error(` npm install -g ${packageName}@latest`);
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function addUpdateCommand(program, packageName, currentVersion) {
|
|
90
|
+
program.command("update").description("Check for updates and install the latest version").action(async () => {
|
|
91
|
+
if (!isInstalledPackage()) {
|
|
92
|
+
console.log("Skipping update check - running from local development.");
|
|
93
|
+
process.exit(0);
|
|
94
|
+
}
|
|
95
|
+
console.log("Checking for updates...");
|
|
96
|
+
const latestVersion = await checkForUpdates(packageName, currentVersion);
|
|
97
|
+
if (!latestVersion) {
|
|
98
|
+
console.log(`You are already using the latest version (v${currentVersion}).`);
|
|
99
|
+
process.exit(0);
|
|
100
|
+
}
|
|
101
|
+
console.log(`
|
|
102
|
+
\u{1F4E6} Update available: v${currentVersion} \u2192 v${latestVersion}`);
|
|
103
|
+
const packageManager = detectPackageManager();
|
|
104
|
+
if (packageManager === "unknown") {
|
|
105
|
+
console.error("\n\u274C Could not detect package manager. Please update manually:");
|
|
106
|
+
console.error(` pnpm remove -g ${packageName} && pnpm add -g ${packageName}@latest`);
|
|
107
|
+
console.error(` or`);
|
|
108
|
+
console.error(` npm uninstall -g ${packageName} && npm install -g ${packageName}@latest`);
|
|
109
|
+
process.exit(1);
|
|
110
|
+
}
|
|
111
|
+
const success = performUpdate(packageName, packageManager, currentVersion, latestVersion);
|
|
112
|
+
process.exit(success ? 0 : 1);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
var init_self_update = __esm({
|
|
116
|
+
"../../../cli-utils/dist/self-update.js"() {
|
|
117
|
+
"use strict";
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
// src/args.ts
|
|
122
|
+
import { Command } from "commander";
|
|
123
|
+
function isThinkingLevel(value) {
|
|
124
|
+
return THINKING_LEVELS.includes(value);
|
|
125
|
+
}
|
|
126
|
+
function parseModel(value) {
|
|
127
|
+
if (value.includes("/")) {
|
|
128
|
+
const slash = value.indexOf("/");
|
|
129
|
+
return {
|
|
130
|
+
provider: value.slice(0, slash),
|
|
131
|
+
model: value.slice(slash + 1)
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
return { model: value };
|
|
135
|
+
}
|
|
136
|
+
function parseArgs(argv, version, packageName) {
|
|
137
|
+
const program = new Command();
|
|
138
|
+
const args = {
|
|
139
|
+
print: false,
|
|
140
|
+
noSession: false,
|
|
141
|
+
continue: false,
|
|
142
|
+
messages: []
|
|
143
|
+
};
|
|
144
|
+
program.name("genesys").description("Genesys Agent v2 CLI - AI-powered coding assistant").version(version, "-v, --version").usage("[options] [prompt]");
|
|
145
|
+
addUpdateCommand(program, packageName, version);
|
|
146
|
+
program.option("-p, --print", "print mode: send prompt, output response, exit", false).option("-c, --continue", "continue the most recent session", false).option("--no-session", "disable session persistence (in-memory only)", false).option("-m, --model <model>", 'model to use, e.g. "anthropic/claude-opus-4-5"').option("--provider <name>", "provider name (used with --model)").option("--thinking <level>", `thinking level: ${THINKING_LEVELS.join(", ")}`).option("--cwd <dir>", "working directory (default: current directory)").argument("[prompt...]", "initial prompt text").parse(argv, { from: "user" });
|
|
147
|
+
const opts = program.opts();
|
|
148
|
+
const cliArgs = program.processedArgs;
|
|
149
|
+
if (opts.model) {
|
|
150
|
+
const parsed = parseModel(opts.model);
|
|
151
|
+
args.model = parsed.model;
|
|
152
|
+
if (parsed.provider) {
|
|
153
|
+
args.provider = parsed.provider;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (opts.provider) {
|
|
157
|
+
args.provider = opts.provider;
|
|
158
|
+
}
|
|
159
|
+
if (opts.thinking) {
|
|
160
|
+
if (!isThinkingLevel(opts.thinking)) {
|
|
161
|
+
console.error(`--thinking must be one of: ${THINKING_LEVELS.join(", ")}`);
|
|
162
|
+
process.exit(1);
|
|
163
|
+
}
|
|
164
|
+
args.thinking = opts.thinking;
|
|
165
|
+
}
|
|
166
|
+
args.print = opts.print ?? false;
|
|
167
|
+
args.noSession = opts.noSession ?? false;
|
|
168
|
+
args.continue = opts.continue ?? false;
|
|
169
|
+
args.cwd = opts.cwd;
|
|
170
|
+
if (cliArgs.length > 0 && cliArgs[0]) {
|
|
171
|
+
args.messages = cliArgs[0];
|
|
172
|
+
}
|
|
173
|
+
return { args, program };
|
|
174
|
+
}
|
|
175
|
+
var THINKING_LEVELS;
|
|
176
|
+
var init_args = __esm({
|
|
177
|
+
"src/args.ts"() {
|
|
178
|
+
"use strict";
|
|
179
|
+
init_self_update();
|
|
180
|
+
THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh"];
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
// src/utils/package.ts
|
|
185
|
+
import { existsSync, readFileSync } from "fs";
|
|
186
|
+
import { dirname, join } from "path";
|
|
187
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
188
|
+
function getPackageJson() {
|
|
189
|
+
const __dirname3 = dirname(fileURLToPath2(import.meta.url));
|
|
190
|
+
let currentDir = __dirname3;
|
|
191
|
+
while (true) {
|
|
192
|
+
const pkgPath = join(currentDir, "package.json");
|
|
193
|
+
if (existsSync(pkgPath)) {
|
|
194
|
+
const content = readFileSync(pkgPath, "utf-8");
|
|
195
|
+
return JSON.parse(content);
|
|
196
|
+
}
|
|
197
|
+
const parentDir = dirname(currentDir);
|
|
198
|
+
if (parentDir === currentDir) {
|
|
199
|
+
throw new Error("Could not find package.json");
|
|
200
|
+
}
|
|
201
|
+
currentDir = parentDir;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
var init_package = __esm({
|
|
205
|
+
"src/utils/package.ts"() {
|
|
206
|
+
"use strict";
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
// src/cli.ts
|
|
211
|
+
var cli_exports = {};
|
|
212
|
+
import { readdir } from "fs/promises";
|
|
213
|
+
import { dirname as dirname2, join as join2, resolve } from "path";
|
|
214
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
215
|
+
import { getModel, setBedrockProviderModule } from "@mariozechner/pi-ai";
|
|
216
|
+
import { bedrockProviderModule } from "@mariozechner/pi-ai/bedrock-provider";
|
|
217
|
+
import {
|
|
218
|
+
createAgentSession,
|
|
219
|
+
DefaultResourceLoader,
|
|
220
|
+
getAgentDir,
|
|
221
|
+
InteractiveMode,
|
|
222
|
+
runPrintMode,
|
|
223
|
+
SessionManager,
|
|
224
|
+
SettingsManager
|
|
225
|
+
} from "@mariozechner/pi-coding-agent";
|
|
226
|
+
async function readStdin() {
|
|
227
|
+
if (process.stdin.isTTY) {
|
|
228
|
+
return null;
|
|
229
|
+
}
|
|
230
|
+
return new Promise((resolve2, reject) => {
|
|
231
|
+
let data = "";
|
|
232
|
+
process.stdin.setEncoding("utf-8");
|
|
233
|
+
process.stdin.on("data", (chunk) => {
|
|
234
|
+
data += chunk;
|
|
235
|
+
});
|
|
236
|
+
process.stdin.on("end", () => {
|
|
237
|
+
resolve2(data.trim() || null);
|
|
238
|
+
});
|
|
239
|
+
process.stdin.on("error", (err) => {
|
|
240
|
+
reject(err);
|
|
241
|
+
});
|
|
242
|
+
process.stdin.resume();
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
async function main(argv) {
|
|
246
|
+
const pkg = getPackageJson();
|
|
247
|
+
const { args } = parseArgs(argv, pkg.version, pkg.name);
|
|
248
|
+
const cwd = args.cwd ? resolve(args.cwd) : process.cwd();
|
|
249
|
+
let sessionManager;
|
|
250
|
+
if (args.noSession) {
|
|
251
|
+
sessionManager = SessionManager.inMemory();
|
|
252
|
+
} else if (args.continue) {
|
|
253
|
+
sessionManager = SessionManager.continueRecent(cwd);
|
|
254
|
+
}
|
|
255
|
+
let model;
|
|
256
|
+
if (args.model) {
|
|
257
|
+
const provider = args.provider ?? "anthropic";
|
|
258
|
+
try {
|
|
259
|
+
model = getModel(provider, args.model);
|
|
260
|
+
} catch {
|
|
261
|
+
console.warn(`Warning: unknown model "${provider}/${args.model}", falling back to default.`);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
const agentDir = getAgentDir();
|
|
265
|
+
const settingsManager = SettingsManager.create(cwd, agentDir);
|
|
266
|
+
const extensionsDir = join2(__dirname, "extensions");
|
|
267
|
+
const extensionFiles = await readdir(extensionsDir).then(
|
|
268
|
+
(files) => files.filter((f) => (f.endsWith(".ts") || f.endsWith(".js")) && !f.endsWith(".d.ts")).map((f) => join2(extensionsDir, f))
|
|
269
|
+
);
|
|
270
|
+
const resourceLoader = new DefaultResourceLoader({
|
|
271
|
+
cwd,
|
|
272
|
+
agentDir,
|
|
273
|
+
settingsManager,
|
|
274
|
+
additionalExtensionPaths: extensionFiles
|
|
275
|
+
});
|
|
276
|
+
await resourceLoader.reload();
|
|
277
|
+
const { session, modelFallbackMessage } = await createAgentSession({
|
|
278
|
+
cwd,
|
|
279
|
+
...model ? { model } : {},
|
|
280
|
+
...args.thinking ? { thinkingLevel: args.thinking } : {},
|
|
281
|
+
...sessionManager ? { sessionManager } : {},
|
|
282
|
+
settingsManager,
|
|
283
|
+
resourceLoader
|
|
284
|
+
});
|
|
285
|
+
if (modelFallbackMessage) {
|
|
286
|
+
console.warn(`Warning: ${modelFallbackMessage}`);
|
|
287
|
+
}
|
|
288
|
+
let initialMessage = args.messages[0];
|
|
289
|
+
if (args.print && !initialMessage) {
|
|
290
|
+
const stdinContent = await readStdin();
|
|
291
|
+
if (stdinContent) {
|
|
292
|
+
initialMessage = stdinContent;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
if (args.print) {
|
|
296
|
+
await runPrintMode(session, {
|
|
297
|
+
mode: "text",
|
|
298
|
+
initialMessage,
|
|
299
|
+
messages: args.messages.slice(1)
|
|
300
|
+
});
|
|
301
|
+
process.exit(0);
|
|
302
|
+
} else {
|
|
303
|
+
const mode = new InteractiveMode(session, {
|
|
304
|
+
initialMessage,
|
|
305
|
+
initialMessages: args.messages.slice(1)
|
|
306
|
+
});
|
|
307
|
+
await mode.run();
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
var __filename, __dirname;
|
|
311
|
+
var init_cli = __esm({
|
|
312
|
+
"src/cli.ts"() {
|
|
313
|
+
"use strict";
|
|
314
|
+
init_args();
|
|
315
|
+
init_package();
|
|
316
|
+
setBedrockProviderModule(bedrockProviderModule);
|
|
317
|
+
__filename = fileURLToPath3(import.meta.url);
|
|
318
|
+
__dirname = dirname2(__filename);
|
|
319
|
+
main(process.argv.slice(2)).catch((err) => {
|
|
320
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
321
|
+
process.exit(1);
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
// src/launcher.ts
|
|
327
|
+
import { existsSync as existsSync2 } from "fs";
|
|
328
|
+
import { dirname as dirname3, join as join3 } from "path";
|
|
329
|
+
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
330
|
+
var __filename2 = fileURLToPath4(import.meta.url);
|
|
331
|
+
var __dirname2 = dirname3(__filename2);
|
|
332
|
+
function findPackageDir(startDir) {
|
|
333
|
+
let dir = startDir;
|
|
334
|
+
while (dir !== dirname3(dir)) {
|
|
335
|
+
if (existsSync2(join3(dir, "package.json"))) {
|
|
336
|
+
return dir;
|
|
337
|
+
}
|
|
338
|
+
dir = dirname3(dir);
|
|
339
|
+
}
|
|
340
|
+
return void 0;
|
|
341
|
+
}
|
|
342
|
+
var packageDir = findPackageDir(__dirname2);
|
|
343
|
+
if (packageDir) {
|
|
344
|
+
process.env.PI_PACKAGE_DIR = packageDir;
|
|
345
|
+
}
|
|
346
|
+
process.env.PI_SKIP_VERSION_CHECK = "1";
|
|
347
|
+
await Promise.resolve().then(() => (init_cli(), cli_exports));
|
|
348
|
+
//# sourceMappingURL=launcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../cli-utils/src/self-update.ts","../../src/args.ts","../../src/utils/package.ts","../../src/cli.ts","../../src/launcher.ts"],"sourcesContent":["/**\n * Self-update functionality for Genesys CLI tools.\n *\n * Provides utilities for checking and performing CLI updates\n * via npm or pnpm package managers.\n */\n\nimport { execSync } from 'child_process';\nimport { fileURLToPath } from 'url';\nimport type { Command } from 'commander';\n\n/**\n * Check if running from an installed package (not local development).\n * Returns true if the current file is inside node_modules.\n */\nexport function isInstalledPackage(): boolean {\n try {\n const currentFile = fileURLToPath(import.meta.url);\n return currentFile.includes('node_modules');\n } catch {\n return false;\n }\n}\n\n/**\n * Detect which package manager was used to install the CLI.\n * Checks environment variables and execution path.\n *\n * @returns 'pnpm', 'npm', or 'unknown'\n */\nexport function detectPackageManager(): 'pnpm' | 'npm' | 'unknown' {\n // Check environment variables\n if (process.env.PNPM_PACKAGE_NAME) return 'pnpm';\n if (process.env.npm_execpath?.includes('pnpm')) return 'pnpm';\n\n // Check exec path\n const execPath = process.argv[1] || '';\n if (execPath.includes('pnpm')) return 'pnpm';\n if (execPath.includes('npm')) return 'npm';\n\n // Default to pnpm (monorepo preference)\n return 'pnpm';\n}\n\n/**\n * Compare semantic versions.\n * Returns true if latest is newer than current.\n */\nfunction isNewerVersion(latest: string, current: string): boolean {\n const latestParts = latest.split('.').map(Number);\n const currentParts = current.split('.').map(Number);\n\n for (let i = 0; i < 3; i++) {\n const latestPart = latestParts[i] || 0;\n const currentPart = currentParts[i] || 0;\n if (latestPart > currentPart) return true;\n if (latestPart < currentPart) return false;\n }\n\n return false;\n}\n\n/**\n * Check npm registry for the latest version of a package.\n *\n * @param packageName - The npm package name\n * @param currentVersion - The currently installed version\n * @returns Latest version string, or null if up-to-date or error\n */\nexport async function checkForUpdates(\n packageName: string,\n currentVersion: string\n): Promise<string | null> {\n try {\n if (!isInstalledPackage()) return null;\n\n const encodedName = encodeURIComponent(packageName);\n const response = await fetch(`https://registry.npmjs.org/${encodedName}/latest`, {\n signal: AbortSignal.timeout(10000),\n });\n\n if (!response.ok) return null;\n\n const data = (await response.json()) as { version?: string };\n const latestVersion = data.version;\n\n if (!latestVersion || latestVersion === currentVersion) return null;\n if (!isNewerVersion(latestVersion, currentVersion)) return null;\n\n return latestVersion;\n } catch {\n return null;\n }\n}\n\n/**\n * Perform the update using the detected package manager.\n *\n * @param packageName - The npm package name\n * @param packageManager - The package manager to use ('pnpm' or 'npm')\n * @param currentVersion - The current installed version\n * @param latestVersion - The latest available version\n * @returns true on success, false on failure\n */\nexport function performUpdate(\n packageName: string,\n packageManager: 'pnpm' | 'npm',\n currentVersion: string,\n latestVersion: string\n): boolean {\n console.log(`\\nUpdating ${packageName}...`);\n console.log(` Current: v${currentVersion}`);\n console.log(` Latest: v${latestVersion}\\n`);\n\n try {\n const updateCommand = packageManager === 'pnpm'\n ? `pnpm remove -g ${packageName} && pnpm add -g ${packageName}@latest`\n : `npm uninstall -g ${packageName} && npm install -g ${packageName}@latest`;\n\n // Run in shell for cross-platform compatibility (&& works on Unix, needs shell on Windows)\n execSync(updateCommand, { stdio: 'inherit' } as import('child_process').ExecSyncOptions);\n\n console.log(`\\n✅ Update complete! ${packageName} has been updated to v${latestVersion}.`);\n return true;\n } catch (error) {\n console.error(`\\n❌ Update failed. Please try running the commands manually:`);\n if (packageManager === 'pnpm') {\n console.error(` pnpm remove -g ${packageName}`);\n console.error(` pnpm add -g ${packageName}@latest`);\n } else {\n console.error(` npm uninstall -g ${packageName}`);\n console.error(` npm install -g ${packageName}@latest`);\n }\n return false;\n }\n}\n\n/**\n * Add 'update' subcommand to a Commander.js program.\n *\n * @param program - The Commander.js program\n * @param packageName - The npm package name\n * @param currentVersion - The current installed version\n */\nexport function addUpdateCommand(\n program: Command,\n packageName: string,\n currentVersion: string\n): void {\n program\n .command('update')\n .description('Check for updates and install the latest version')\n .action(async () => {\n // Skip if running from local development\n if (!isInstalledPackage()) {\n console.log('Skipping update check - running from local development.');\n process.exit(0);\n }\n\n console.log('Checking for updates...');\n\n const latestVersion = await checkForUpdates(packageName, currentVersion);\n\n if (!latestVersion) {\n console.log(`You are already using the latest version (v${currentVersion}).`);\n process.exit(0);\n }\n\n console.log(`\\n📦 Update available: v${currentVersion} → v${latestVersion}`);\n\n const packageManager = detectPackageManager();\n\n if (packageManager === 'unknown') {\n console.error('\\n❌ Could not detect package manager. Please update manually:');\n console.error(` pnpm remove -g ${packageName} && pnpm add -g ${packageName}@latest`);\n console.error(` or`);\n console.error(` npm uninstall -g ${packageName} && npm install -g ${packageName}@latest`);\n process.exit(1);\n }\n\n const success = performUpdate(packageName, packageManager, currentVersion, latestVersion);\n process.exit(success ? 0 : 1);\n });\n}\n","/**\n * CLI argument definitions for the Genesys Agent v2 CLI.\n *\n * Intentionally minimal — model selection, session management and tool\n * configuration are delegated to pi's own machinery via createAgentSession.\n */\n\nimport { addUpdateCommand } from '@gnsx/cli-utils/self-update';\nimport { Command } from 'commander';\n\nimport type { ThinkingLevel } from '@mariozechner/pi-agent-core';\n\nexport interface Args {\n /** Working directory (default: process.cwd()) */\n cwd?: string;\n\n /** Model identifier, e.g. \"anthropic/claude-opus-4-5\" or \"claude-opus-4-5\" */\n model?: string;\n\n /** LLM provider, e.g. \"anthropic\". Used together with --model. */\n provider?: string;\n\n /** Thinking/reasoning level */\n thinking?: ThinkingLevel;\n\n /**\n * Print mode: send a single prompt, output the response, exit.\n * When true, `messages[0]` is used as the prompt.\n */\n print: boolean;\n\n /**\n * Disable session persistence (in-memory only).\n */\n noSession: boolean;\n\n /**\n * Continue the most recent session for the current working directory.\n */\n continue: boolean;\n\n /** Positional arguments / prompt text (used in print mode) */\n messages: string[];\n}\n\nconst THINKING_LEVELS: ThinkingLevel[] = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh'];\n\nfunction isThinkingLevel(value: string): value is ThinkingLevel {\n return THINKING_LEVELS.includes(value as ThinkingLevel);\n}\n\nfunction parseModel(value: string): { provider?: string; model: string } {\n // Support \"provider/model\" shorthand\n if (value.includes('/')) {\n const slash = value.indexOf('/');\n return {\n provider: value.slice(0, slash),\n model: value.slice(slash + 1),\n };\n }\n return { model: value };\n}\n\nexport function parseArgs(argv: string[], version: string, packageName: string): { args: Args; program: Command } {\n const program = new Command();\n const args: Args = {\n print: false,\n noSession: false,\n continue: false,\n messages: [],\n };\n\n program\n .name('genesys')\n .description('Genesys Agent v2 CLI - AI-powered coding assistant')\n .version(version, '-v, --version')\n .usage('[options] [prompt]');\n\n // Add update command\n addUpdateCommand(program, packageName, version);\n\n program\n .option('-p, --print', 'print mode: send prompt, output response, exit', false)\n .option('-c, --continue', 'continue the most recent session', false)\n .option('--no-session', 'disable session persistence (in-memory only)', false)\n .option('-m, --model <model>', 'model to use, e.g. \"anthropic/claude-opus-4-5\"')\n .option('--provider <name>', 'provider name (used with --model)')\n .option('--thinking <level>', `thinking level: ${THINKING_LEVELS.join(', ')}`)\n .option('--cwd <dir>', 'working directory (default: current directory)')\n .argument('[prompt...]', 'initial prompt text')\n .parse(argv, { from: 'user' });\n\n const opts = program.opts();\n const cliArgs = program.processedArgs as string[][];\n\n // Handle model parsing with provider/model shorthand\n if (opts.model) {\n const parsed = parseModel(opts.model);\n args.model = parsed.model;\n if (parsed.provider) {\n args.provider = parsed.provider;\n }\n }\n // Provider can be overridden explicitly\n if (opts.provider) {\n args.provider = opts.provider;\n }\n\n // Validate thinking level\n if (opts.thinking) {\n if (!isThinkingLevel(opts.thinking)) {\n console.error(`--thinking must be one of: ${THINKING_LEVELS.join(', ')}`);\n process.exit(1);\n }\n args.thinking = opts.thinking;\n }\n\n args.print = opts.print ?? false;\n args.noSession = opts.noSession ?? false;\n args.continue = opts.continue ?? false;\n args.cwd = opts.cwd;\n\n // Collect positional arguments as messages\n if (cliArgs.length > 0 && cliArgs[0]) {\n args.messages = cliArgs[0];\n }\n\n return { args, program };\n}\n","/**\n * Returns the parsed package.json for the nearest package by traversing\n * up from the current module's directory.\n */\nimport { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nexport function getPackageJson<T = { name: string; version: string }>(): T {\n const __dirname = dirname(fileURLToPath(import.meta.url));\n let currentDir = __dirname;\n\n while (true) {\n const pkgPath = join(currentDir, 'package.json');\n if (existsSync(pkgPath)) {\n const content = readFileSync(pkgPath, 'utf-8');\n return JSON.parse(content) as T;\n }\n\n const parentDir = dirname(currentDir);\n // Stop at filesystem root\n if (parentDir === currentDir) {\n throw new Error('Could not find package.json');\n }\n currentDir = parentDir;\n }\n}\n","#!/usr/bin/env node\n/**\n * Genesys Agent v2 CLI entry point.\n *\n * Thin wrapper around pi's createAgentSession + InteractiveMode / runPrintMode.\n * All session persistence, model selection, tool management and compaction are\n * handled by the pi framework.\n */\n\nimport { readdir } from 'node:fs/promises';\nimport { dirname, join, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\n\nimport { getModel, setBedrockProviderModule } from '@mariozechner/pi-ai';\nimport { bedrockProviderModule } from '@mariozechner/pi-ai/bedrock-provider';\nimport {\n createAgentSession,\n DefaultResourceLoader,\n getAgentDir,\n InteractiveMode,\n runPrintMode,\n SessionManager,\n SettingsManager,\n} from '@mariozechner/pi-coding-agent';\n\nimport { parseArgs } from './args.js';\nimport { getPackageJson } from './utils/package.js';\n\n/**\n * Read all data from stdin if available.\n * Returns null if stdin is not piped/redirected.\n */\nasync function readStdin(): Promise<string | null> {\n if (process.stdin.isTTY) {\n // stdin is a terminal (not piped)\n return null;\n }\n\n return new Promise((resolve, reject) => {\n let data = '';\n process.stdin.setEncoding('utf-8');\n\n process.stdin.on('data', (chunk) => {\n data += chunk;\n });\n\n process.stdin.on('end', () => {\n resolve(data.trim() || null);\n });\n\n process.stdin.on('error', (err) => {\n reject(err);\n });\n\n // Resume stdin to start reading\n process.stdin.resume();\n });\n}\n\n// Register Bedrock provider so AWS users can use it without extra setup\nsetBedrockProviderModule(bedrockProviderModule);\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\nasync function main(argv: string[]): Promise<void> {\n const pkg = getPackageJson();\n const { args } = parseArgs(argv, pkg.version, pkg.name);\n\n const cwd = args.cwd ? resolve(args.cwd) : process.cwd();\n\n // -------------------------------------------------------------------------\n // Session manager\n // -------------------------------------------------------------------------\n let sessionManager: SessionManager | undefined;\n\n if (args.noSession) {\n sessionManager = SessionManager.inMemory();\n } else if (args.continue) {\n sessionManager = SessionManager.continueRecent(cwd);\n }\n // undefined → createAgentSession creates a new persisted session\n\n // -------------------------------------------------------------------------\n // Model resolution (only when --model is passed; pi picks from settings /\n // env vars automatically otherwise)\n // -------------------------------------------------------------------------\n let model: ReturnType<typeof getModel> | undefined;\n\n if (args.model) {\n const provider = (args.provider ?? 'anthropic') as Parameters<typeof getModel>[0];\n try {\n model = getModel(provider, args.model as Parameters<typeof getModel>[1]);\n } catch {\n console.warn(`Warning: unknown model \"${provider}/${args.model}\", falling back to default.`);\n }\n }\n\n // -------------------------------------------------------------------------\n // Create custom resource loader with our version-check extension\n // -------------------------------------------------------------------------\n const agentDir = getAgentDir();\n const settingsManager = SettingsManager.create(cwd, agentDir);\n\n // Scan extensions folder for all .ts and .js files (excluding .d.ts)\n const extensionsDir = join(__dirname, 'extensions');\n const extensionFiles = await readdir(extensionsDir).then((files) =>\n files\n .filter((f) => (f.endsWith('.ts') || f.endsWith('.js')) && !f.endsWith('.d.ts'))\n .map((f) => join(extensionsDir, f)),\n );\n\n const resourceLoader = new DefaultResourceLoader({\n cwd,\n agentDir,\n settingsManager,\n additionalExtensionPaths: extensionFiles,\n });\n await resourceLoader.reload();\n\n // -------------------------------------------------------------------------\n // Create session\n // -------------------------------------------------------------------------\n const { session, modelFallbackMessage } = await createAgentSession({\n cwd,\n ...(model ? { model } : {}),\n ...(args.thinking ? { thinkingLevel: args.thinking } : {}),\n ...(sessionManager ? { sessionManager } : {}),\n settingsManager,\n resourceLoader,\n });\n\n if (modelFallbackMessage) {\n console.warn(`Warning: ${modelFallbackMessage}`);\n }\n\n // -------------------------------------------------------------------------\n // Run mode\n // -------------------------------------------------------------------------\n\n // Read from stdin if -p flag is set but no prompt provided\n let initialMessage = args.messages[0];\n if (args.print && !initialMessage) {\n const stdinContent = await readStdin();\n if (stdinContent) {\n initialMessage = stdinContent;\n }\n }\n\n if (args.print) {\n await runPrintMode(session, {\n mode: 'text',\n initialMessage,\n messages: args.messages.slice(1),\n });\n process.exit(0);\n } else {\n const mode = new InteractiveMode(session, {\n initialMessage,\n initialMessages: args.messages.slice(1),\n });\n await mode.run();\n }\n}\n\nmain(process.argv.slice(2)).catch((err) => {\n console.error(err instanceof Error ? err.message : String(err));\n process.exit(1);\n});\n","#!/usr/bin/env node\n/**\n * Genesys Agent v2 CLI launcher.\n *\n * Sets environment variables before importing the main CLI to ensure\n * pi-coding-agent reads the correct configuration during initialization.\n */\n\nimport { existsSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Find the first directory containing package.json, starting from the given\n * directory and walking upward.\n */\nfunction findPackageDir(startDir: string): string | undefined {\n let dir = startDir;\n while (dir !== dirname(dir)) {\n if (existsSync(join(dir, 'package.json'))) {\n return dir;\n }\n dir = dirname(dir);\n }\n return undefined;\n}\n\n// Set PI_PACKAGE_DIR to the first directory with package.json\n// This MUST be set before importing @mariozechner/pi-coding-agent so that\n// packages/coding-agent/src/config.ts can read it during initialization\nconst packageDir = findPackageDir(__dirname);\nif (packageDir) {\n process.env.PI_PACKAGE_DIR = packageDir;\n}\n\n// Disable pi-coding-agent's built-in version check (we use an extension)\nprocess.env.PI_SKIP_VERSION_CHECK = '1';\n\n// Now import and run the actual CLI\nawait import('./cli.js');\n"],"mapp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AK,CAAC;AAAA,EAChB,OAAO;AACL,UAAM,OAAO,IAAI,gBAAgB,SAAS;AAAA,MACxC;AAAA,MACA,iBAAiB,KAAK,SAAS,MAAM,CAAC;AAAA,IACxC,CAAC;AACD,UAAM,KAAK,IAAI;AAAA,EACjB;AACF;AApKA,IA+DM,YACA;AAhEN;AAAA;AAAA;AA0BA;AACA;AAkCA,6BAAyB,qBAAqB;AAE9C,IAAM,aAAaC,eAAc,YAAY,GAAG;AAChD,IAAM,YAAYF,SAAQ,UAAU;AAsGpC,SAAK,QAAQ,KAAK,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,QAAQ;AACzC,cAAQ,MAAM,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC;AAC9D,cAAQ,KAAK,CAAC;AAAA,IAChB,CAAC;AAAA;AAAA;;;ACjKD,SAAS,cAAAI,mBAAkB;AAC3B,SAAS,WAAAC,UAAS,QAAAC,aAAY;AAC9B,SAAS,iBAAAC,sBAAqB;AAE9B,IAAMC,cAAaD,eAAc,YAAY,GAAG;AAChD,IAAME,aAAYJ,SAAQG,WAAU;AAMpC,SAAS,eAAe,UAAsC;AAC5D,MAAI,MAAM;AACV,SAAO,QAAQH,SAAQ,GAAG,GAAG;AAC3B,QAAID,YAAWE,MAAK,KAAK,cAAc,CAAC,GAAG;AACzC,aAAO;AAAA,IACT;AACA,UAAMD,SAAQ,GAAG;AAAA,EACnB;AACA,SAAO;AACT;AAKA,IAAM,aAAa,eAAeI,UAAS;AAC3C,IAAI,YAAY;AACd,UAAQ,IAAI,iBAAiB;AAC/B;AAGA,QAAQ,IAAI,wBAAwB;AAGpC,MAAM;","names":["fileURLToPath","__dirname","dirname","join","fileURLToPath","resolve","existsSync","dirname","join","fileURLToPath","__filename","__dirname"]}
|
package/dist/src/launcher.js
CHANGED
|
File without changes
|