@openwop/cli 1.4.1 → 1.5.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 CHANGED
@@ -134,7 +134,7 @@ openwop packs search ads # browse the signed pack registry
134
134
 
135
135
  The `onboard` wizard walks you through:
136
136
 
137
- 1. **Host URL** — `https://app.openwop.dev/api` (shared demo), `http://localhost:8080` (local), or a custom URL.
137
+ 1. **Host URL** — `https://api.openwop.dev` (shared demo; `https://app.openwop.dev/api` also works), `http://localhost:8080` (local), or a custom URL.
138
138
  2. **AI provider** — `anthropic`, `openai`, `google`, or `minimax` (matches what the demo backend dispatches to).
139
139
  3. **API key** — auto-detects `ANTHROPIC_API_KEY` / `OPENAI_API_KEY` / `GOOGLE_API_KEY` / `MINIMAX_API_KEY`, or hidden-input via raw-mode stdin. The key is POSTed to `/v1/host/openwop-app/byok/secrets` on the configured host. **The key is never written to your local config file** — only a credential ref pointer is stored.
140
140
  4. **Model** — provider-specific recommended defaults plus a custom option.
package/dist/cli.js CHANGED
@@ -578,7 +578,7 @@ function errText(err) {
578
578
  // package.json
579
579
  var package_default = {
580
580
  name: "@openwop/cli",
581
- version: "1.4.1",
581
+ version: "1.5.0",
582
582
  description: "OpenWOP CLI for operating the workflow-engine demo app and OpenWOP-compatible hosts.",
583
583
  license: "Apache-2.0",
584
584
  type: "module",
@@ -667,7 +667,10 @@ var PROVIDER_CATALOG = {
667
667
  }
668
668
  };
669
669
  var HOST_PRESETS = [
670
- { key: "shared", label: "Shared demo at https://app.openwop.dev/api (recommended for trying things out)", url: "https://app.openwop.dev/api" },
670
+ // openwop-app ADR 0827: the protocol origin, served straight from Cloud Run with
671
+ // no CDN in front (`https://app.openwop.dev/api` still works; its edge drops
672
+ // conditional requests). `openwop login` opens the host-named web page.
673
+ { key: "shared", label: "Shared demo at https://api.openwop.dev (recommended for trying things out)", url: "https://api.openwop.dev" },
671
674
  { key: "local", label: "Local demo at http://localhost:8080 (run `openwop demo start` to launch)", url: "http://localhost:8080" }
672
675
  ];
673
676
 
@@ -14925,13 +14928,21 @@ Approve a code ONLY if you just ran \`openwop login\` yourself.
14925
14928
  Exit codes: 0 signed in / signed out \xB7 1 denied, expired or not available on this host \xB7 2 usage.
14926
14929
 
14927
14930
  Examples:
14928
- export OPENWOP_BASE_URL=https://app.openwop.dev/api
14931
+ export OPENWOP_BASE_URL=https://api.openwop.dev
14929
14932
  openwop login
14930
14933
  openwop login --label "work laptop"
14931
14934
  openwop logout
14932
14935
  `;
14933
14936
  var sleep2 = (ms2) => new Promise((r) => setTimeout(r, ms2));
14934
- function approvalUrl(baseUrl, path) {
14937
+ function approvalUrl(baseUrl, path, uri) {
14938
+ if (typeof uri === "string") {
14939
+ try {
14940
+ const u = new URL(uri);
14941
+ const loopback = u.hostname === "localhost" || u.hostname === "127.0.0.1" || u.hostname === "[::1]";
14942
+ if (u.protocol === "https:" || u.protocol === "http:" && loopback) return u.toString();
14943
+ } catch {
14944
+ }
14945
+ }
14935
14946
  const p = typeof path === "string" && path.startsWith("/") ? path : "/access?tab=api-keys";
14936
14947
  try {
14937
14948
  return `${new URL(baseUrl).origin}${p}`;
@@ -14969,7 +14980,7 @@ async function runLogin(ctx, argv) {
14969
14980
  const userCode = started?.userCode;
14970
14981
  if (typeof deviceCode !== "string" || typeof userCode !== "string") throw notAvailable(ctx);
14971
14982
  writeLine(ctx.io.stderr, "");
14972
- writeLine(ctx.io.stderr, ` 1. Open ${approvalUrl(ctx.baseUrl, started.verificationPath)}`);
14983
+ writeLine(ctx.io.stderr, ` 1. Open ${approvalUrl(ctx.baseUrl, started.verificationPath, started.verificationUri)}`);
14973
14984
  writeLine(ctx.io.stderr, ` 2. Enter ${userCode} under "Sign in the OpenWOP CLI", and approve.`);
14974
14985
  writeLine(ctx.io.stderr, "");
14975
14986
  writeLine(ctx.io.stderr, "Waiting for approval\u2026");
package/dist/openwop.js CHANGED
@@ -579,7 +579,7 @@ function errText(err) {
579
579
  // package.json
580
580
  var package_default = {
581
581
  name: "@openwop/cli",
582
- version: "1.4.1",
582
+ version: "1.5.0",
583
583
  description: "OpenWOP CLI for operating the workflow-engine demo app and OpenWOP-compatible hosts.",
584
584
  license: "Apache-2.0",
585
585
  type: "module",
@@ -668,7 +668,10 @@ var PROVIDER_CATALOG = {
668
668
  }
669
669
  };
670
670
  var HOST_PRESETS = [
671
- { key: "shared", label: "Shared demo at https://app.openwop.dev/api (recommended for trying things out)", url: "https://app.openwop.dev/api" },
671
+ // openwop-app ADR 0827: the protocol origin, served straight from Cloud Run with
672
+ // no CDN in front (`https://app.openwop.dev/api` still works; its edge drops
673
+ // conditional requests). `openwop login` opens the host-named web page.
674
+ { key: "shared", label: "Shared demo at https://api.openwop.dev (recommended for trying things out)", url: "https://api.openwop.dev" },
672
675
  { key: "local", label: "Local demo at http://localhost:8080 (run `openwop demo start` to launch)", url: "http://localhost:8080" }
673
676
  ];
674
677
 
@@ -14925,13 +14928,21 @@ Approve a code ONLY if you just ran \`openwop login\` yourself.
14925
14928
  Exit codes: 0 signed in / signed out \xB7 1 denied, expired or not available on this host \xB7 2 usage.
14926
14929
 
14927
14930
  Examples:
14928
- export OPENWOP_BASE_URL=https://app.openwop.dev/api
14931
+ export OPENWOP_BASE_URL=https://api.openwop.dev
14929
14932
  openwop login
14930
14933
  openwop login --label "work laptop"
14931
14934
  openwop logout
14932
14935
  `;
14933
14936
  var sleep2 = (ms2) => new Promise((r) => setTimeout(r, ms2));
14934
- function approvalUrl(baseUrl, path) {
14937
+ function approvalUrl(baseUrl, path, uri) {
14938
+ if (typeof uri === "string") {
14939
+ try {
14940
+ const u = new URL(uri);
14941
+ const loopback = u.hostname === "localhost" || u.hostname === "127.0.0.1" || u.hostname === "[::1]";
14942
+ if (u.protocol === "https:" || u.protocol === "http:" && loopback) return u.toString();
14943
+ } catch {
14944
+ }
14945
+ }
14935
14946
  const p = typeof path === "string" && path.startsWith("/") ? path : "/access?tab=api-keys";
14936
14947
  try {
14937
14948
  return `${new URL(baseUrl).origin}${p}`;
@@ -14969,7 +14980,7 @@ async function runLogin(ctx, argv) {
14969
14980
  const userCode = started?.userCode;
14970
14981
  if (typeof deviceCode !== "string" || typeof userCode !== "string") throw notAvailable(ctx);
14971
14982
  writeLine(ctx.io.stderr, "");
14972
- writeLine(ctx.io.stderr, ` 1. Open ${approvalUrl(ctx.baseUrl, started.verificationPath)}`);
14983
+ writeLine(ctx.io.stderr, ` 1. Open ${approvalUrl(ctx.baseUrl, started.verificationPath, started.verificationUri)}`);
14973
14984
  writeLine(ctx.io.stderr, ` 2. Enter ${userCode} under "Sign in the OpenWOP CLI", and approve.`);
14974
14985
  writeLine(ctx.io.stderr, "");
14975
14986
  writeLine(ctx.io.stderr, "Waiting for approval\u2026");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openwop/cli",
3
- "version": "1.4.1",
3
+ "version": "1.5.0",
4
4
  "description": "OpenWOP CLI for operating the workflow-engine demo app and OpenWOP-compatible hosts.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",