promptlike 0.12.2 → 0.12.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.12.3 — 2026-10-30
4
+
5
+ - **Fix: a queued report could be tagged with the wrong account.** The account id was read after a failed send, the
6
+ token before it: if another terminal switched accounts in between, one account's note could be queued under (and
7
+ later sent as) the other. Token and account id now come from one read of the saved login.
8
+ - **`ple feedback` now says whether a queued report was written under an account** (a line in the text output,
9
+ `"account": true|false` in `--json`), and `--help` and the README spell out when a queued report goes out
10
+ anonymously: signed out or the login could not be checked, another account signed in at sending time, a session
11
+ about to expire, or one the server refuses. The help text no longer says `PLE_FEEDBACK_QUEUE=off` only "turns that
12
+ off"; it writes nothing, as since 0.12.2.
13
+
3
14
  ## 0.12.2 — 2026-10-30
4
15
 
5
16
  - **Fix: `PLE_FEEDBACK_QUEUE=off` now writes nothing.** It used to stop only the sending later; an undelivered
package/README.md CHANGED
@@ -749,7 +749,7 @@ ple feedback --type missing --json "no way to rename a repo from the CLI"
749
749
  | `--prompt <title\|id>` | The prompt it is about: its **title or id**, never its text |
750
750
  | `--email <address>` | Where to answer you (optional) |
751
751
  | `--agent <name>` | Mark the report as written by an AI agent with this name |
752
- | `--json` | One JSON line on stdout: `{"ok":true,"id":"…","exit_code":0,…}` — on failure `{"ok":false,"exit_code":2,"error":"…"}`, or `{"ok":false,"queued":true,"exit_code":4,…}` |
752
+ | `--json` | One JSON line on stdout: `{"ok":true,"id":"…","exit_code":0,…}` — on failure `{"ok":false,"exit_code":2,"error":"…"}`, or `{"ok":false,"queued":true,"account":true,"exit_code":4,…}` (`"queued":false` with `PLE_FEEDBACK_QUEUE=off`; `account` says whether it was written under an account) |
753
753
 
754
754
  It never asks a question and never waits for input, so an agent can call it. A message is 1 to 2000 characters;
755
755
  one that looks like an API key or token is **refused** (the kind is named, the value never echoed).
@@ -775,8 +775,10 @@ anonymous. Who wrote it is decided from `--agent`, else from `PLE_AGENT=<name>`,
775
775
  the oldest is dropped when it is full; mode `0600`). After any other `ple` command it is sent silently, with a
776
776
  2 second limit, at most once every 15 minutes, never after the offline commands (`save`, `log`, `diff`, `rollback`,
777
777
  `suggest`, `import`) and never when the command failed. A report written while you are signed in is sent with that
778
- same account only; written signed out, it always goes out anonymously, and signing in later never attaches it to your
779
- account. Turn it off with `PLE_FEEDBACK_QUEUE=off`: then nothing is written to disk and a report that cannot be
778
+ same account only, and only while that account is still signed in with a session that is not about to expire and
779
+ that the server accepts. In every other case it goes out anonymously: written signed out (or while the saved login
780
+ could not be checked, e.g. offline with an expired session), another account signed in at sending time, or the
781
+ session refused. Signing in later never attaches an older report to the new account. Turn it off with `PLE_FEEDBACK_QUEUE=off`: then nothing is written to disk and a report that cannot be
780
782
  delivered is simply not sent (exit code 4, run `ple feedback` again when you are online).
781
783
 
782
784
  **Pointer on a miss.** When `ple search` finds nothing, or `ple get` fails, one line goes to stderr:
@@ -854,8 +856,8 @@ Scripts should treat any non-zero code as failure; `2` is the one worth retrying
854
856
  command: `ple whoami-typo` prints `error: unknown command` with the nearest command and exits `2`, like a usage
855
857
  error in `ple feedback`; retrying will not help.
856
858
 
857
- `ple feedback` has its own table (`0` sent · `1` unexpected · `2` usage or validation · `3` rate limited · `4` queued for
858
- later) — see [its section](#ple-feedback-message--tell-the-maker-what-is-missing-or-broken).
859
+ `ple feedback` has its own table (`0` sent · `1` unexpected · `2` usage or validation · `3` rate limited · `4` server or network
860
+ problem: queued for later, or not saved with `PLE_FEEDBACK_QUEUE=off`) — see [its section](#ple-feedback-message--tell-the-maker-what-is-missing-or-broken).
859
861
 
860
862
  ## Security notes
861
863
 
@@ -43,7 +43,7 @@ exports.FEEDBACK_EXIT_CODES_HELP = [
43
43
  '1 unexpected problem (list / close: also not signed in, or not allowed)',
44
44
  '2 usage or validation error — nothing was sent',
45
45
  '3 rate limited — try again after the delay shown',
46
- '4 server or network problem — saved to the local queue, sent by a later `ple` command',
46
+ '4 server or network problem — saved to the local queue and sent by a later `ple` command (with PLE_FEEDBACK_QUEUE=off: not saved, not sent)',
47
47
  ];
48
48
  // ---------------------------------------------------------------------------
49
49
  // Output
@@ -65,12 +65,14 @@ function fail(json, code, error, extra = {}) {
65
65
  // ---------------------------------------------------------------------------
66
66
  // ple feedback "<message>"
67
67
  // ---------------------------------------------------------------------------
68
+ /** The token and the id of the account it belongs to, read from ONE snapshot of the saved login (another terminal may switch accounts at any moment). */
68
69
  async function defaultToken() {
69
70
  if ((0, config_1.configStatus)() !== 'valid')
70
71
  return {};
71
72
  try {
72
73
  await (0, api_client_1.ensureAuthed)();
73
- return { token: (0, config_1.readConfig)()?.access_token };
74
+ const config = (0, config_1.readConfig)();
75
+ return { token: config?.access_token, userId: config?.user_id || undefined };
74
76
  }
75
77
  catch (err) {
76
78
  // The server could not be reached to refresh the session: it cannot take the report either.
@@ -147,7 +149,7 @@ async function submit(message, opts, deps, json) {
147
149
  return fail(json, exports.EXIT_RATE_LIMITED, `Rate limited. Try again${wait !== undefined ? ` in ${wait}s` : ' in a moment'}.`, { retry_after: wait ?? null });
148
150
  }
149
151
  case 'unavailable':
150
- return queueIt(payload, result.message, json, env, deps, base, attachedAccount ? (deps.accountId ?? (() => (0, config_1.readConfig)()?.user_id))() : undefined);
152
+ return queueIt(payload, result.message, json, env, deps, base, attachedAccount ? auth.userId : undefined);
151
153
  case 'auth':
152
154
  return fail(json, exports.EXIT_UNEXPECTED, `The server refused the report (HTTP ${result.status}).`);
153
155
  default:
@@ -182,6 +184,7 @@ function queueIt(payload, reason, json, env, deps, base, userId) {
182
184
  queued: true,
183
185
  exit_code: exports.EXIT_QUEUED,
184
186
  queue_size: queued.size,
187
+ account: Boolean(userId),
185
188
  ...(queued.droppedOldest ? { dropped_oldest: true } : {}),
186
189
  send_later: sendsLater,
187
190
  error: reason,
@@ -191,6 +194,9 @@ function queueIt(payload, reason, json, env, deps, base, userId) {
191
194
  }
192
195
  console.error(format_1.c.warn(`⚠ Could not deliver the report (${reason})`));
193
196
  console.error(format_1.c.muted(` Saved to the local queue (${queued.size} waiting${queued.droppedOldest ? ', the oldest one was dropped' : ''}). ${note}`));
197
+ console.error(format_1.c.muted(userId
198
+ ? ' Written under your account: it is sent with that account only if it is still signed in then, otherwise anonymously.'
199
+ : ' It will be sent anonymously (no account was signed in, or the saved login could not be checked).'));
194
200
  }
195
201
  async function ownerAuth() {
196
202
  if ((0, config_1.configStatus)() !== 'valid')
package/dist/program.js CHANGED
@@ -333,7 +333,9 @@ function buildProgram() {
333
333
  'looks like a key or token is refused.',
334
334
  '',
335
335
  'If the server cannot be reached the report is saved to ~/.promptlike/feedback/queue.json (max 50) and',
336
- 'sent by a later `ple` command (at most every 15 minutes; PLE_FEEDBACK_QUEUE=off turns that off).',
336
+ 'sent by a later `ple` command (at most every 15 minutes). A report written while you are signed in goes',
337
+ 'out with that same account only; otherwise (signed out, another account, a session about to expire or',
338
+ 'refused) it goes out anonymously. With PLE_FEEDBACK_QUEUE=off nothing is saved or sent later.',
337
339
  '',
338
340
  'Exit codes:',
339
341
  ...feedback_1.FEEDBACK_EXIT_CODES_HELP.map((l) => ` ${l}`),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "promptlike",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "description": "Terminal access to your PromptLikeEngineer prompt library - search, read, and copy your saved prompts without leaving the shell.",
5
5
  "bin": {
6
6
  "ple": "dist/index.js"