faces-cli 1.8.6 → 1.8.7

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/dist/catalog.js CHANGED
@@ -135,7 +135,7 @@ export class CatalogService {
135
135
  // what kept it alive across writes; dropping it lets the next sync
136
136
  // replace it with the real one.
137
137
  if (existingDescription.length > MAX_FRONTMATTER_VALUE) {
138
- process.stderr.write(`warn: discarded a ${existingDescription.length}-character description on '${alias}' ` +
138
+ process.stderr.write(`warn: discarded a ${existingDescription.length}-character description on '${alias}': ` +
139
139
  'too large to be real. It will be restored from the server on the next sync.\n');
140
140
  }
141
141
  else {
@@ -83,13 +83,13 @@ export default class AuthConnect extends BaseCommand {
83
83
  // 3. Show the code + URL and the one-time enable-setting guidance.
84
84
  emit('');
85
85
  emit('To connect ChatGPT:');
86
- emit(` 1. Open this URL in any browser (phone, laptop anywhere):`);
86
+ emit(` 1. Open this URL in any browser (phone, laptop, anywhere):`);
87
87
  emit(` ${verificationUri}`);
88
88
  emit(` 2. Enter this code: ${start.user_code}`);
89
89
  emit(` 3. Sign in to ChatGPT and click Continue.`);
90
90
  emit('');
91
91
  emit('If this is your first time, you may need to enable device-code authorization in ChatGPT first:');
92
- emit(` 1. Open ${SETTINGS_URL} (the settings panel can take a few seconds to appear give it a moment)`);
92
+ emit(` 1. Open ${SETTINGS_URL} (the settings panel can take a few seconds to appear, so give it a moment)`);
93
93
  emit(' 2. Turn on "Enable device code authorization for Codex"');
94
94
  emit(' 3. Then enter the code above');
95
95
  emit('');
@@ -193,7 +193,7 @@ export default class AuthConnect extends BaseCommand {
193
193
  const steps = Array.isArray(d.settings_steps) && d.settings_steps.length > 0
194
194
  ? d.settings_steps
195
195
  : [
196
- `Open ${url} (the settings panel can take a few seconds to appear give it a moment)`,
196
+ `Open ${url} (the settings panel can take a few seconds to appear, so give it a moment)`,
197
197
  'Turn on "Enable device code authorization for Codex"',
198
198
  'Then run `faces auth:connect openai` again',
199
199
  ];
@@ -26,7 +26,7 @@ export default class AuthConnections extends BaseCommand {
26
26
  const tier = label ? ` (${label})` : '';
27
27
  this.log(`openai connected${who}${tier} connected_at=${row.connected_at}`);
28
28
  if (!plan || plan === 'free') {
29
- this.log(' ⚠️ This ChatGPT plan may not include API access connecting requires a paid plan (Plus/Pro/Team, etc.).');
29
+ this.log(' ⚠️ This ChatGPT plan may not include API access. Connecting requires a paid plan (Plus/Pro/Team, etc.).');
30
30
  }
31
31
  }
32
32
  else {
@@ -46,7 +46,7 @@ export default class BillingSubscriptionActivate extends BaseCommand {
46
46
  }
47
47
  const result = data;
48
48
  if (!json) {
49
- this.log(`Reactivated. Connect plan continues next renewal: ${result.current_period_end ?? 'unknown'}.`);
49
+ this.log(`Reactivated. Connect plan continues. Next renewal: ${result.current_period_end ?? 'unknown'}.`);
50
50
  }
51
51
  return { status: 'reactivated', ...result };
52
52
  }
@@ -63,7 +63,7 @@ export default class BillingSubscriptionActivate extends BaseCommand {
63
63
  const result = data;
64
64
  const url = result.checkout_url;
65
65
  if (!json) {
66
- this.log('Subscription Connect $17/month');
66
+ this.log('Subscription Connect: $17/month');
67
67
  this.log('');
68
68
  this.log('Complete payment at this link:');
69
69
  this.log(` ${url}`);
@@ -301,7 +301,7 @@ export default class CatalogDoctor extends BaseCommand {
301
301
  }
302
302
  catch (err) {
303
303
  const msg = err instanceof FacesAPIError ? `Error (${err.statusCode}): ${err.message}` : String(err);
304
- this.log(` ${alias}: failed ${msg}`);
304
+ this.log(` ${alias}: failed: ${msg}`);
305
305
  }
306
306
  }
307
307
  this.log(`Generated ${generated} description(s).`);
@@ -19,7 +19,7 @@ export default class CatalogList extends BaseCommand {
19
19
  if (this.jsonEnabled())
20
20
  return entries;
21
21
  if (entries.length === 0) {
22
- this.log('(no faces in catalog run faces catalog:doctor --fix)');
22
+ this.log('(no faces in catalog. Run faces catalog:doctor --fix)');
23
23
  return entries;
24
24
  }
25
25
  const nameWidth = Math.max(...entries.map((e) => String(e.alias ?? '').length));
@@ -73,7 +73,7 @@ function listThreads() {
73
73
  return out;
74
74
  }
75
75
  export default class ChatThread extends BaseCommand {
76
- static description = 'Multi-turn chat thread. Conversation history is stored under ~/.faces/threads/<id>.json resume any thread later with --id.';
76
+ static description = 'Multi-turn chat thread. Conversation history is stored under ~/.faces/threads/<id>.json. Resume any thread later with --id.';
77
77
  static examples = [
78
78
  '<%= config.bin %> <%= command.id %> socrates -m "What is justice?"',
79
79
  '<%= config.bin %> <%= command.id %> --id t_abc123 -m "Say more about that"',
@@ -99,7 +99,7 @@ export default class ChatThread extends BaseCommand {
99
99
  };
100
100
  static args = {
101
101
  face_username: Args.string({
102
- description: 'Face alias (alias@model, or owner:alias@model for a published face) required when starting a new thread',
102
+ description: 'Face alias (alias@model, or owner:alias@model for a published face). Required when starting a new thread',
103
103
  required: false,
104
104
  }),
105
105
  };
@@ -64,7 +64,7 @@ export default class CompileAll extends BaseCommand {
64
64
  }
65
65
  if (items.length === 0) {
66
66
  if (!json)
67
- this.log('Nothing to compile all documents and threads are up to date.');
67
+ this.log('Nothing to compile. All documents and threads are up to date.');
68
68
  return { compiled: 0, failed: 0, items: [] };
69
69
  }
70
70
  if (!json)
@@ -17,7 +17,7 @@ export default class CompileDoc extends BaseCommand {
17
17
  ...BaseCommand.baseFlags,
18
18
  label: Flags.string({ description: 'Document label/title (single document only; with several files each is labelled by its filename)' }),
19
19
  content: Flags.string({ description: 'Inline text content', exclusive: ['file'] }),
20
- file: Flags.string({ description: 'Read content from file (repeatable each file becomes its own document)', multiple: true }),
20
+ file: Flags.string({ description: 'Read content from file (repeatable; each file becomes its own document)', multiple: true }),
21
21
  medium: Flags.string({ description: MEDIUM_FLAG_DESCRIPTION }),
22
22
  perspective: Flags.string({
23
23
  description: 'Perspective',
@@ -177,8 +177,8 @@ export default class CompileDoc extends BaseCommand {
177
177
  }
178
178
  /** Extensions the compile-documents endpoint takes as inline text. */
179
179
  const BINARY_HINTS = {
180
- '.pdf': 'PDF is supported, but not by this command — use: faces compile:upload <alias> --file <path> --kind document',
181
- '.docx': 'Word documents are supported, but not by this command — use: faces compile:upload <alias> --file <path> --kind document',
180
+ '.pdf': 'PDF is supported, but not by this command. Use: faces compile:upload <alias> --file <path> --kind document',
181
+ '.docx': 'Word documents are supported, but not by this command. Use: faces compile:upload <alias> --file <path> --kind document',
182
182
  '.doc': "Legacy '.doc' is not supported. Open it in Word or Pages and save as .docx, then upload that with: faces compile:upload <alias> --file <path> --kind document",
183
183
  '.pages': 'Pages documents are not supported. Export it as text or PDF first.',
184
184
  '.rtf': 'RTF is not supported. Convert it to plain text first (e.g. `textutil -convert txt file.rtf`).',
@@ -60,13 +60,13 @@ export default class CompileDocPause extends BaseCommand {
60
60
  }
61
61
  case 'synced':
62
62
  case 'ready': {
63
- return 'Compile finished before the pause took effect nothing to resume.';
63
+ return 'Compile finished before the pause took effect. Nothing to resume.';
64
64
  }
65
65
  case 'failed': {
66
66
  return 'Compile failed before the pause took effect.';
67
67
  }
68
68
  case null: {
69
- return 'Stopped the compile is no longer running.';
69
+ return 'Stopped. The compile is no longer running.';
70
70
  }
71
71
  default: {
72
72
  return `Still stopping after ${timeout}s. Poll with: faces compile:doc:get ${id} --json`;
@@ -56,7 +56,7 @@ export default class CompileImport extends BaseCommand {
56
56
  catch (err) {
57
57
  if (err instanceof FacesAPIError) {
58
58
  if (err.statusCode === 422 && flags.type === 'thread') {
59
- this.error(`${err.message} try again with --type document`);
59
+ this.error(`${err.message}. Try again with --type document`);
60
60
  }
61
61
  this.error(`Error (${err.statusCode}): ${err.message}`);
62
62
  }
@@ -61,13 +61,13 @@ export default class CompileThreadPause extends BaseCommand {
61
61
  }
62
62
  case 'synced':
63
63
  case 'ready': {
64
- return 'Compile finished before the pause took effect nothing to resume.';
64
+ return 'Compile finished before the pause took effect. Nothing to resume.';
65
65
  }
66
66
  case 'failed': {
67
67
  return 'Compile failed before the pause took effect.';
68
68
  }
69
69
  case null: {
70
- return 'Stopped the compile is no longer running.';
70
+ return 'Stopped. The compile is no longer running.';
71
71
  }
72
72
  default: {
73
73
  return `Still stopping after ${timeout}s. Poll with: faces compile:thread:get ${id} --json`;
@@ -30,7 +30,7 @@ export default class FaceDiff extends BaseCommand {
30
30
  if (!this.jsonEnabled()) {
31
31
  const res = data;
32
32
  const faces = res.faces;
33
- const fmt = (v) => (v === null || v === undefined ? '' : v.toFixed(2));
33
+ const fmt = (v) => (v === null || v === undefined ? '-' : v.toFixed(2));
34
34
  for (let i = 0; i < faces.length; i++) {
35
35
  for (let j = i + 1; j < faces.length; j++) {
36
36
  const a = faces[i];
@@ -2,7 +2,7 @@ import { Args } from '@oclif/core';
2
2
  import { BaseCommand } from '../../base.js';
3
3
  import { FacesAPIError } from '../../client.js';
4
4
  export default class FaceLock extends BaseCommand {
5
- static description = 'Lock a face (read-only). A locked face still reads and chats normally, but it and everything it owns (documents, threads, voiceprint) cannot be changed until unlocked.';
5
+ static description = 'Lock a face (read-only). A locked face still reads and chats normally, but it, and everything it owns (documents, threads, voiceprint), cannot be changed until unlocked.';
6
6
  static examples = ['<%= config.bin %> <%= command.id %> socrates'];
7
7
  static flags = {
8
8
  ...BaseCommand.baseFlags,
@@ -24,7 +24,7 @@ export default class FaceLock extends BaseCommand {
24
24
  }
25
25
  if (!this.jsonEnabled()) {
26
26
  const res = data;
27
- this.log(`Locked '${res.alias ?? args.face_id}' read only.`);
27
+ this.log(`Locked '${res.alias ?? args.face_id}' is now read only.`);
28
28
  const affected = res.affected ?? [];
29
29
  if (affected.length > 0)
30
30
  this.log(`Affected: ${affected.join(', ')}`);
@@ -6,7 +6,7 @@ export default class FaceNeighbors extends BaseCommand {
6
6
  static flags = {
7
7
  ...BaseCommand.baseFlags,
8
8
  k: Flags.integer({
9
- description: 'Number of results (120)',
9
+ description: 'Number of results (1-20)',
10
10
  default: 5,
11
11
  min: 1,
12
12
  max: 20,
@@ -15,7 +15,7 @@ export default class FaceShare extends BaseCommand {
15
15
  ...BaseCommand.baseFlags,
16
16
  list: Flags.boolean({ description: 'Show who the face is shared with, and change nothing', default: false }),
17
17
  add: Flags.string({
18
- description: 'Add an account, keeping everyone already on the list username or email (repeatable)',
18
+ description: 'Add an account, keeping everyone already on the list. Username or email (repeatable)',
19
19
  multiple: true,
20
20
  exclusive: ['with', 'none'],
21
21
  }),
@@ -24,7 +24,7 @@ export default class FaceUnlock extends BaseCommand {
24
24
  }
25
25
  if (!this.jsonEnabled()) {
26
26
  const res = data;
27
- this.log(`Unlocked '${res.alias ?? args.face_id}' writable.`);
27
+ this.log(`Unlocked '${res.alias ?? args.face_id}' is now writable.`);
28
28
  const affected = res.affected ?? [];
29
29
  if (affected.length > 0)
30
30
  this.log(`Affected: ${affected.join(', ')}`);
@@ -2,7 +2,7 @@ import { Args } from '@oclif/core';
2
2
  import { BaseCommand } from '../../base.js';
3
3
  import { FacesAPIError } from '../../client.js';
4
4
  export default class FaceUnpublish extends BaseCommand {
5
- static description = 'Stop publishing a face. Anyone it is individually shared with keeps their access publishing is an ' +
5
+ static description = 'Stop publishing a face. Anyone it is individually shared with keeps their access. Publishing is an ' +
6
6
  'override on top of sharing, not a replacement for it.';
7
7
  static flags = { ...BaseCommand.baseFlags };
8
8
  static args = {
@@ -2,7 +2,7 @@ import { Args, Flags } from '@oclif/core';
2
2
  import { BaseCommand } from '../../base.js';
3
3
  import { FacesAPIError } from '../../client.js';
4
4
  export default class FaceUnshare extends BaseCommand {
5
- static description = 'Revoke access to a shared face. Takes effect immediately there is no grace period.';
5
+ static description = 'Revoke access to a shared face. Takes effect immediately. There is no grace period.';
6
6
  static examples = [
7
7
  '<%= config.bin %> <%= command.id %> alice --from dana --yes',
8
8
  '<%= config.bin %> <%= command.id %> alice --all --yes',
@@ -55,15 +55,15 @@ export default class KeysCreate extends BaseCommand {
55
55
  }
56
56
  this.printHuman(data);
57
57
  this.log('');
58
- this.log('⚠ The full key is shown only once `faces keys:list` returns it truncated by design.');
58
+ this.log('⚠ The full key is shown only once. `faces keys:list` returns it truncated by design.');
59
59
  if (saved) {
60
- this.log('✓ Saved to ~/.faces/config.json as api_key faces commands will use it automatically.');
60
+ this.log('✓ Saved to ~/.faces/config.json as api_key. Faces commands will use it automatically.');
61
61
  }
62
62
  else if (!flags.save) {
63
63
  this.log(' Not saved (--no-save). Copy the key above now.');
64
64
  }
65
65
  else {
66
- this.warn('Could not find the key in the response nothing was saved. Copy it manually.');
66
+ this.warn('Could not find the key in the response. Nothing was saved. Copy it manually.');
67
67
  }
68
68
  return data;
69
69
  }
@@ -4,15 +4,20 @@ import { BaseCommand } from '../../base.js';
4
4
  import { FacesAPIError } from '../../client.js';
5
5
  import { STYLE_FACES_PATH } from '../../style.js';
6
6
  /**
7
- * The API takes a scope: `map` clears the captured style, `all` clears it and
8
- * destroys the uploaded material with it. This CLI only ever sends `map`.
7
+ * The API takes a scope. This CLI only ever sends `map`.
9
8
  *
10
- * Nothing that removes a style should be able to take source text with it. A
11
- * user reaching for "delete the style" is not asking to lose the writing it was
12
- * learned from, and the two are one keystroke apart on the same command. Source
13
- * text is deleted through the commands that own it compile:doc:delete and
14
- * compile:thread:delete where that is the whole point of the call rather than
15
- * a side effect of a flag value.
9
+ * `map` removes the installed style. `all` removes it and everything derived
10
+ * from it versions, jobs, checkpoints, style exemplars. **Neither touches the
11
+ * uploaded material.** The API reference said `all` destroyed it; that
12
+ * documentation was wrong and has been corrected, and the behaviour is not
13
+ * going to change (backend memo, 2026-08-28 pm).
14
+ *
15
+ * So the reason for sending only `map` is no longer that `all` is dangerous to
16
+ * source text. It is that one command should do one thing: this one forgets a
17
+ * style, and a deeper purge of derived artefacts is a different request nobody
18
+ * has asked for. Source text is deleted through the commands that own it,
19
+ * compile:doc:delete and compile:thread:delete, and a face's uploaded corpus
20
+ * through the corpus route — never as a side effect of a flag value here.
16
21
  */
17
22
  const SCOPE = 'map';
18
23
  export default class StyleDelete extends BaseCommand {
@@ -173,14 +173,23 @@ export default class StyleMake extends BaseCommand {
173
173
  else {
174
174
  chosen = [];
175
175
  const missing = [];
176
+ // Naming a source twice is accepted by the server and prints it twice,
177
+ // which weights it double in the analysis for no stated reason. A later
178
+ // mention wins so `--source X --source X:essay` declares a medium rather
179
+ // than being a contradiction.
180
+ const seen = new Map();
176
181
  for (const raw of flags.source ?? []) {
177
182
  const { id, medium } = parseSourceArg(raw);
178
- const s = byId.get(id);
179
- if (s)
180
- chosen.push({ s, declared: medium });
181
- else
183
+ if (!byId.has(id)) {
182
184
  missing.push(id);
185
+ continue;
186
+ }
187
+ if (seen.has(id) && medium === undefined)
188
+ continue;
189
+ seen.set(id, medium ?? seen.get(id));
183
190
  }
191
+ for (const [id, medium] of seen)
192
+ chosen.push({ s: byId.get(id), declared: medium });
184
193
  if (missing.length > 0) {
185
194
  this.error(`Not a source on '${alias}': ${missing.join(', ')}\n` +
186
195
  `List what is there with: faces face:sources ${alias}`);
package/dist/style.js CHANGED
@@ -181,6 +181,16 @@ export async function pollStyleJob(client, basePath, jobId, opts = {}) {
181
181
  * A build failure is shown to the user, and a stack trace or a SQL statement
182
182
  * tells them nothing they can act on while burying whatever might have. These
183
183
  * are reported as an upstream fault with the first line kept for a bug report.
184
+ *
185
+ * The server sanitises `error` itself now (faces-backend-shared#623), so this
186
+ * is inert against everything it currently returns — checked against the
187
+ * sanitised text and against every deliberate code it documents
188
+ * (CHATGPT_AUTH, INSUFFICIENT_CREDITS, NOTHING_AUTHORED, HOLDOUT_UNMEETABLE,
189
+ * OAUTH_RATE_LIMITED), none of which match. It is kept as a backstop rather
190
+ * than removed: `error` is rendered straight to a user, a raw statement reached
191
+ * one once, and a check that costs nothing until it fires is worth more than
192
+ * the line it saves. It is deliberately narrow so an actionable message can
193
+ * never be swallowed by it.
184
194
  */
185
195
  const INTERNAL_FAULT = /sqlalchemy|asyncpg|psycopg|Traceback|\[SQL:|IntegrityError|OperationalError/i;
186
196
  /** Failure text, with the one hint that is actionable rather than descriptive. */
package/dist/utils.js CHANGED
@@ -95,7 +95,7 @@ export function isMaxTokensRenameError(message) {
95
95
  * synonyms fold server-side, the set grows, and compile's own 422 names the
96
96
  * valid ones better than a stale local list could.
97
97
  */
98
- export const MEDIUM_FLAG_DESCRIPTION = 'What sort of writing this is e.g. email, text message, social post, essay, academic paper, ' +
98
+ export const MEDIUM_FLAG_DESCRIPTION = 'What sort of writing this is, e.g. email, text message, social post, essay, academic paper, ' +
99
99
  'blog post, legal document, thread reply, conversation (dialogue: transcripts, interviews, calls), ' +
100
100
  'lecture (sustained speech nobody interrupts: talks, sermons, keynotes). Common synonyms fold ' +
101
101
  'automatically. Omit it if you do not know: a wrong declaration is worse than none, because a ' +
@@ -120,7 +120,7 @@ export function warnDroppedParams(headers, flagFor) {
120
120
  .map((p) => flagFor[p] ?? `--${p.replaceAll('_', '-')}`);
121
121
  if (flags.length === 0)
122
122
  return;
123
- process.stderr.write(`Note: ${flags.join(' and ')} had no effect this request ran on your linked ChatGPT account, ` +
123
+ process.stderr.write(`Note: ${flags.join(' and ')} had no effect. This request ran on your linked ChatGPT account, ` +
124
124
  'which does not accept them. Use --no-oauth-only to run on the paid API instead.\n');
125
125
  }
126
126
  /** Maps the server's parameter names back to the flags a user actually typed. */