@rayul/kordis 0.7.0 → 0.7.1

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.
@@ -26,7 +26,8 @@ Keyword search; `--json` for parsing.
26
26
  | `--trending` | list packages trending in `--window` (overrides `--sort`) |
27
27
  | `--rising` | list rising packages by 7d acceleration (overrides `--sort`) |
28
28
  | `--window <w>` | `24h` (default), `7d`, or `30d` — only honoured with `--trending` |
29
- | `--limit <n>` | max results (default 20) |
29
+ | `--limit <n>` | max results per page (default 20, max 100) |
30
+ | `--cursor <t>` | pagination — pass `next_cursor` from a prior response to fetch page 2+. 0.6.7+. |
30
31
 
31
32
  ### `kordis info <full_slug> --json`
32
33
  Inspect metadata (title, description, type, tier, version, author, stars,
@@ -121,3 +122,13 @@ User: "how many packages has alice published?" / "alice가 publish한거 다 보
121
122
  `total: null`); render "Showing N of M matches"
122
123
  - do NOT post-process with jq for author filtering — use the flag
123
124
  </example>
125
+
126
+ <example>
127
+ User: "show me page 2 of those results" / "다음 페이지 보여줘"
128
+ - response from page 1 carries `next_cursor` (opaque base64 token, or
129
+ `null` when no more pages)
130
+ - kordis search <q> --cursor <token> --json # 0.6.7+
131
+ - keep feeding `next_cursor` from each response until it comes back `null`
132
+ - DO NOT try `--offset` for cursor-paginated endpoints — CLI passes
133
+ `--cursor` only
134
+ </example>
package/dist/index.js CHANGED
@@ -993,20 +993,35 @@ var init_client = __esm({
993
993
  };
994
994
  if (opts.body !== void 0) headers["content-type"] = "application/json";
995
995
  let res;
996
- try {
997
- const init = {
998
- method: opts.method ?? "GET",
999
- headers,
1000
- cache: "no-store"
1001
- };
1002
- if (opts.body !== void 0) init.body = JSON.stringify(opts.body);
1003
- res = await this.fetchImpl(url, init);
1004
- } catch (err) {
996
+ const init = {
997
+ method: opts.method ?? "GET",
998
+ headers,
999
+ cache: "no-store"
1000
+ };
1001
+ if (opts.body !== void 0) init.body = JSON.stringify(opts.body);
1002
+ const method = (init.method ?? "GET").toUpperCase();
1003
+ const retryable = method === "GET";
1004
+ let lastErr;
1005
+ for (let attempt = 0; attempt < (retryable ? 2 : 1); attempt++) {
1006
+ try {
1007
+ res = await this.fetchImpl(url, init);
1008
+ lastErr = void 0;
1009
+ break;
1010
+ } catch (err) {
1011
+ lastErr = err;
1012
+ if (attempt === 0 && retryable) {
1013
+ await new Promise((resolve2) => setTimeout(resolve2, 150));
1014
+ continue;
1015
+ }
1016
+ }
1017
+ }
1018
+ if (lastErr !== void 0) {
1005
1019
  throw new KordisNetworkError(
1006
- `cannot reach ${url.hostname}: ${err.message}`,
1007
- err
1020
+ `cannot reach ${url.hostname}: ${lastErr.message}`,
1021
+ lastErr
1008
1022
  );
1009
1023
  }
1024
+ res = res;
1010
1025
  const requestId = res.headers.get("x-request-id") ?? void 0;
1011
1026
  if (res.status === 204) return void 0;
1012
1027
  const text = await res.text();
@@ -1774,7 +1789,7 @@ async function useClient() {
1774
1789
  username = null;
1775
1790
  const msg = err instanceof Error ? err.message : String(err);
1776
1791
  process.stderr.write(
1777
- `[kordis] auto-finalize: server issued tokens but local persistence failed (${msg}). Run \`kordis login --emit-only\` again to retry.
1792
+ `[kordis] auto-finalize: server issued tokens but local persistence failed (${msg}). Run \`kordis login --emit-only\` again to retry. If this keeps happening on macOS, the OS keychain prompt may be timing out \u2014 set \`KORDIS_NO_KEYCHAIN=1\` to fall back to a plaintext file at ~/.kordis/.tokens.json (mode 0600). Set \`KORDIS_DEBUG=1\` for full auto-finalize stage output.
1778
1793
  `
1779
1794
  );
1780
1795
  void reportError("auto_finalize_stage2_fail", err);
@@ -1968,7 +1983,7 @@ function requireAuth(bundle) {
1968
1983
  error: {
1969
1984
  code: "not_authenticated",
1970
1985
  message: "authentication required",
1971
- hint: "Run `kordis login --emit-only` to start browser sign-in (exits immediately, no blocking poll), then re-run this command \u2014 the next CLI call auto-claims the token. For interactive shells, plain `kordis login` (10-min poll) also works."
1986
+ hint: "Run `kordis login --emit-only` to start browser sign-in (exits immediately, no blocking poll), then re-run this command \u2014 the next CLI call auto-claims the token. For interactive shells, plain `kordis login` (10-min poll) also works. If you DID login but auth keeps failing, run with `KORDIS_DEBUG=1` to surface auto-finalize stages (Round 12 F1 \u2014 diagnostic moment-of-need)."
1972
1987
  }
1973
1988
  });
1974
1989
  }
@@ -4783,7 +4798,16 @@ function buildProgram() {
4783
4798
  const program = new Command19("kordis").version(VERSION).description("Kordis \u2014 registry for agentic-coding packages").option("--json", "emit JSON output to stdout (default: human)", false).hook("preAction", (thisCommand) => {
4784
4799
  const opts = thisCommand.optsWithGlobals();
4785
4800
  if (opts.json) setJsonMode(true);
4786
- });
4801
+ }).addHelpText("after", `
4802
+ Environment variables (see README.md "Privacy & environment variables"):
4803
+ KORDIS_API_URL=<url> override registry endpoint (default: https://api.kordis.store)
4804
+ KORDIS_HOME=<dir> override config + token fallback dir (default: ~/.kordis)
4805
+ KORDIS_NO_CONTEXT=1 suppress personalization header even if opted in
4806
+ KORDIS_NO_TELEMETRY=1 suppress anonymized error telemetry even if opted in
4807
+ KORDIS_NO_KEYCHAIN=1 force plaintext token storage at ~/.kordis/.tokens.json
4808
+ (escape hatch for macOS keychain-prompt fatigue)
4809
+ KORDIS_DEBUG=1 surface auto-finalize stage outcomes to stderr (diagnostic)
4810
+ `);
4787
4811
  program.addCommand(loginCommand());
4788
4812
  program.addCommand(logoutCommand());
4789
4813
  program.addCommand(whoamiCommand());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rayul/kordis",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "private": false,
5
5
  "description": "Command-line client for the Kordis registry — discover, install, and publish agentic-coding packages.",
6
6
  "license": "MIT",