@orchagent/cli 0.3.109 → 0.3.111
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/commands/login.js
CHANGED
|
@@ -79,7 +79,7 @@ async function browserBasedLogin(port) {
|
|
|
79
79
|
const existing = await (0, config_1.loadConfig)();
|
|
80
80
|
const isFirstLogin = !existing.api_key;
|
|
81
81
|
const resolved = await (0, config_1.getResolvedConfig)();
|
|
82
|
-
process.stdout.write('Opening browser for authentication...\n');
|
|
82
|
+
process.stdout.write('Opening browser for authentication...\n\n');
|
|
83
83
|
try {
|
|
84
84
|
const result = await (0, browser_auth_1.startBrowserAuth)(resolved.apiUrl, port);
|
|
85
85
|
const nextConfig = {
|
|
@@ -183,7 +183,33 @@ function registerScheduleCommand(program) {
|
|
|
183
183
|
throw new errors_1.CliError('Missing org. Use org/agent format or set default org.');
|
|
184
184
|
}
|
|
185
185
|
// Resolve agent to get the ID (pass workspace context for private agents)
|
|
186
|
-
|
|
186
|
+
let agent = await (0, api_2.getAgentWithFallback)(config, org, ref.agent, ref.version, workspaceId);
|
|
187
|
+
// Warn if scheduling a non-latest version (skip in --json mode)
|
|
188
|
+
if (ref.version !== 'latest' && !options.json) {
|
|
189
|
+
const allAgents = await (0, api_1.listMyAgents)(config, workspaceId);
|
|
190
|
+
const versions = allAgents
|
|
191
|
+
.filter((a) => a.name === ref.agent)
|
|
192
|
+
.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime());
|
|
193
|
+
if (versions.length > 1 && versions[0].version !== ref.version) {
|
|
194
|
+
const latest = versions[0];
|
|
195
|
+
const current = versions.find((a) => a.version === ref.version);
|
|
196
|
+
const fmtDate = (iso) => new Date(iso).toLocaleString();
|
|
197
|
+
const currentDate = current ? ` (published ${fmtDate(current.created_at)})` : '';
|
|
198
|
+
const latestDate = ` (published ${fmtDate(latest.created_at)})`;
|
|
199
|
+
process.stdout.write(chalk_1.default.yellow(`\u26a0 Scheduling ${ref.version}${currentDate}. `) +
|
|
200
|
+
`A newer version is available: ${chalk_1.default.bold(latest.version)}${latestDate}.\n`);
|
|
201
|
+
const rl = promises_1.default.createInterface({
|
|
202
|
+
input: process.stdin,
|
|
203
|
+
output: process.stdout,
|
|
204
|
+
});
|
|
205
|
+
const answer = await rl.question(`Use latest (${latest.version}) instead? (Y/n): `);
|
|
206
|
+
rl.close();
|
|
207
|
+
if (answer.trim().toLowerCase() !== 'n' && answer.trim().toLowerCase() !== 'no') {
|
|
208
|
+
agent = latest;
|
|
209
|
+
ref.version = latest.version;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
187
213
|
// Parse input data (--data is primary, --input is deprecated alias)
|
|
188
214
|
const rawInput = options.data ?? options.input;
|
|
189
215
|
let inputData;
|
package/dist/commands/service.js
CHANGED
|
@@ -69,12 +69,14 @@ function healthColor(health) {
|
|
|
69
69
|
return chalk_1.default.gray(health);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
75
|
-
return
|
|
76
|
-
|
|
77
|
-
return
|
|
72
|
+
function formatServiceTier(svc) {
|
|
73
|
+
const tier = svc.service_tier_label;
|
|
74
|
+
if (tier)
|
|
75
|
+
return tier;
|
|
76
|
+
const rawTier = svc.service_tier || 'standard';
|
|
77
|
+
return rawTier === 'performance'
|
|
78
|
+
? 'Performance (Dedicated 1 vCPU, 512 MB)'
|
|
79
|
+
: 'Standard (Shared CPU, 512 MB)';
|
|
78
80
|
}
|
|
79
81
|
function severityColor(severity, message) {
|
|
80
82
|
switch (severity.toUpperCase()) {
|
|
@@ -200,7 +202,7 @@ function registerServiceCommand(program) {
|
|
|
200
202
|
process.stdout.write(` ${chalk_1.default.bold('Name:')} ${svc.service_name}\n`);
|
|
201
203
|
process.stdout.write(` ${chalk_1.default.bold('Agent:')} ${svc.agent_name}@${svc.agent_version}\n`);
|
|
202
204
|
process.stdout.write(` ${chalk_1.default.bold('State:')} ${stateColor(svc.current_state)}\n`);
|
|
203
|
-
process.stdout.write(` ${chalk_1.default.bold('
|
|
205
|
+
process.stdout.write(` ${chalk_1.default.bold('Tier:')} ${formatServiceTier(svc)}\n`);
|
|
204
206
|
if (options.pin) {
|
|
205
207
|
process.stdout.write(` ${chalk_1.default.bold('Pinned:')} ${chalk_1.default.yellow(`yes (won't auto-update on publish)`)}\n`);
|
|
206
208
|
}
|
|
@@ -363,8 +365,7 @@ function registerServiceCommand(program) {
|
|
|
363
365
|
process.stdout.write(` Fail Streak: ${chalk_1.default.red(String(svc.consecutive_restart_failures))} / ${svc.max_restart_failures}\n`);
|
|
364
366
|
}
|
|
365
367
|
process.stdout.write(` Instances: ${svc.min_instances}-${svc.max_instances}\n`);
|
|
366
|
-
process.stdout.write(`
|
|
367
|
-
process.stdout.write(` URL: ${formatServiceUrl(svc)}\n`);
|
|
368
|
+
process.stdout.write(` Tier: ${formatServiceTier(svc)}\n`);
|
|
368
369
|
process.stdout.write(` Deployed: ${formatDate(svc.last_deployed_at)}\n`);
|
|
369
370
|
process.stdout.write(` Last Restart: ${formatDate(svc.last_restart_at)}\n`);
|
|
370
371
|
if (svc.last_error) {
|
package/dist/lib/browser-auth.js
CHANGED
|
@@ -130,13 +130,13 @@ async function startBrowserAuth(apiUrl, port = DEFAULT_PORT) {
|
|
|
130
130
|
const { auth_url } = await initResponse.json();
|
|
131
131
|
// Step 2: Start local server to receive callback
|
|
132
132
|
const tokenPromise = waitForCallback(port, AUTH_TIMEOUT_MS);
|
|
133
|
-
// Step 3: Open browser
|
|
133
|
+
// Step 3: Open browser + always show URL as fallback
|
|
134
|
+
process.stdout.write(`\nIf your browser doesn't open, visit this URL:\n${auth_url}\n\n`);
|
|
134
135
|
try {
|
|
135
136
|
await (0, open_1.default)(auth_url);
|
|
136
137
|
}
|
|
137
138
|
catch {
|
|
138
|
-
//
|
|
139
|
-
process.stdout.write(`\nPlease open this URL in your browser:\n${auth_url}\n\n`);
|
|
139
|
+
// Browser open failed — URL already printed above
|
|
140
140
|
}
|
|
141
141
|
// Step 4: Wait for callback
|
|
142
142
|
const token = await tokenPromise;
|
package/package.json
CHANGED