origem 0.2.0 → 0.2.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.
Files changed (2) hide show
  1. package/dist/index.js +11 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -636,6 +636,10 @@ function resolveApiUrl(flag) {
636
636
  const fromLock = readLock(process.cwd())?.apiUrl || void 0;
637
637
  return (flag || process.env.ORIGEM_API_URL || fromLock || readConfig().apiUrl || DEFAULT_API).replace(/\/$/, "");
638
638
  }
639
+ function resolveConnectUrl(flag) {
640
+ const fromLock = readLock(process.cwd())?.apiUrl || void 0;
641
+ return (flag || process.env.ORIGEM_API_URL || fromLock || DEFAULT_API).replace(/\/$/, "");
642
+ }
639
643
  function resolveKey(flag) {
640
644
  const key = flag || process.env.ORIGEM_TOKEN || readConfig().token || "";
641
645
  if (!key) {
@@ -1626,10 +1630,14 @@ async function runConnect(opts) {
1626
1630
  authorizeUrl.searchParams.set("code_challenge_method", "S256");
1627
1631
  authorizeUrl.searchParams.set("state", state);
1628
1632
  authorizeUrl.searchParams.set("scope", "read write");
1629
- info(`${color.cyan("\u2192")} opening your browser to authorise\u2026 ${color.dim(redirectUri)}`);
1633
+ info(`${color.cyan("\u2192")} connecting to ${color.bold(apiUrl)}`);
1634
+ info(`${color.cyan("\u2192")} opening your browser to authorise\u2026`);
1630
1635
  info(color.dim(` if nothing opens, paste this in your browser:
1631
1636
  ${authorizeUrl.toString()}`));
1632
1637
  openBrowser(authorizeUrl.toString());
1638
+ info(
1639
+ color.bold("\n Waiting for you to authorise. Keep this terminal open.") + color.dim("\n It is not frozen \u2014 it is listening on 127.0.0.1 for the browser to come back.\n")
1640
+ );
1633
1641
  const { code } = await server.waitForCode;
1634
1642
  token = await exchangeCode(endpoints.token, {
1635
1643
  code,
@@ -1728,7 +1736,7 @@ var STAGES = ["requisito", "design", "implementacao", "verificacao"];
1728
1736
  async function runSpec(opts) {
1729
1737
  const base = opts.apiUrl.replace(/\/$/, "");
1730
1738
  const q = `?k=${encodeURIComponent(opts.key)}`;
1731
- let res = await fetch(`${base}/specs${q}`, { signal: AbortSignal.timeout(15e3) });
1739
+ let res = await fetch(`${base}/api/specs${q}`, { signal: AbortSignal.timeout(15e3) });
1732
1740
  if (res.status === 404) {
1733
1741
  res = await fetch(`${base}/specsFeed${q}`, { signal: AbortSignal.timeout(15e3) });
1734
1742
  }
@@ -2252,7 +2260,7 @@ async function main() {
2252
2260
  switch (cmd) {
2253
2261
  case "connect": {
2254
2262
  await runConnect({
2255
- apiUrl: resolveApiUrl(flags.apiUrl),
2263
+ apiUrl: resolveConnectUrl(flags.apiUrl),
2256
2264
  scope: flags.scope,
2257
2265
  // `targets` já traz o default (CLAUDE_TARGETS); passar flags.targets aqui
2258
2266
  // faria o apply cair no "todos os alvos" e escrever GEMINI.md, .cursor/…
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "origem",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Connect a repository to your Origem harness: authorise in the browser, write CLAUDE.md and .claude/* to disk, and keep them in sync.",
5
5
  "type": "module",
6
6
  "bin": {