pacework 1.0.0 → 1.0.2

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.
@@ -70,12 +70,12 @@ async function checkForUpdate() {
70
70
 
71
71
  // ── ascii banner ──────────────────────────────────────────────────────────────
72
72
 
73
- const BANNER = `\x1b[38;5;39m ██╗ ██╗███████╗███╗ ██╗████████╗██████╗ █████╗ ██╗
74
- ██║ ██╔╝██╔════╝████╗ ██║╚══██╔══╝██╔══██╗██╔══██╗██║
75
- █████╔╝ █████╗ ██╔██╗ ██║ ██║ ██████╔╝███████║██║
76
- ██╔═██╗ ██╔══╝ ██║╚██╗██║ ██║ ██╔══██╗██╔══██║██║
77
- ██║ ██╗███████╗██║ ╚████║ ██║ ██║ ██║██║ ██║███████╗
78
- ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝\x1b[0m`
73
+ const BANNER = `\x1b[38;5;39m ██████╗ █████╗ ██████╗███████╗██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗
74
+ ██╔══██╗██╔══██╗██╔════╝██╔════╝██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝
75
+ ██████╔╝███████║██║ █████╗ ██║ █╗ ██║██║ ██║██████╔╝█████╔╝
76
+ ██╔═══╝ ██╔══██║██║ ██╔══╝ ██║███╗██║██║ ██║██╔══██╗██╔═██╗
77
+ ██║ ██║ ██║╚██████╗███████╗╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗
78
+ ╚═╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝\x1b[0m`
79
79
 
80
80
  function printBanner(config) {
81
81
  const cols = process.stdout.columns || 80
@@ -243,6 +243,11 @@ function parseCliArgs(argv) {
243
243
  const token = argv[i]
244
244
  if (token.startsWith("--")) {
245
245
  const key = token.slice(2)
246
+ if (key.includes("=")) {
247
+ const at = key.indexOf("=")
248
+ result[key.slice(0, at)] = key.slice(at + 1)
249
+ continue
250
+ }
246
251
  const next = argv[i + 1]
247
252
  if (next && !next.startsWith("--")) { result[key] = next; i++ }
248
253
  else result[key] = "true"
@@ -312,7 +317,15 @@ if (!command || command === "--help" || command === "-h") {
312
317
 
313
318
  if (command === "login") {
314
319
  printBanner()
315
- const appUrl = parsedArgs["app-url"] || readConfig().appUrl || "https://pacework.io"
320
+ const savedUrl = readConfig().appUrl
321
+ let requestedUrl = parsedArgs["app-url"]
322
+ // A bare `login` (also what the menu runs) asks which server to use, so a
323
+ // saved URL, such as a local dev server, cannot pin every later login to it.
324
+ if (!requestedUrl && process.stdin.isTTY) {
325
+ requestedUrl = await promptLine(`pacework address [${savedUrl || "https://pacework.io"}]: `) || savedUrl
326
+ }
327
+ requestedUrl = String(requestedUrl || "https://pacework.io").trim().replace(/\/+$/, "")
328
+ const appUrl = /^https?:\/\//.test(requestedUrl) ? requestedUrl : `https://${requestedUrl}`
316
329
  console.log("Opening browser for authentication…")
317
330
 
318
331
  let token, loginUrl
@@ -1358,7 +1371,7 @@ else if (command === "menu") {
1358
1371
  if (executorIndex < 0) return
1359
1372
  await runChild(["use", EXECUTORS[executorIndex].id])
1360
1373
  } },
1361
- { label: "Log in again / switch workspace", action: () => runChild(["login"]) },
1374
+ { label: "Log in again / switch server or workspace", action: () => runChild(["login"]) },
1362
1375
  { label: "Log out", action: () => runChild(["logout"]) },
1363
1376
  { label: "Quit", action: null },
1364
1377
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pacework",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "pacework CLI: connect this machine as a runner for pacework AI agents",
5
5
  "type": "module",
6
6
  "bin": {