@faces-sh/cli 1.0.2 → 1.1.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.
Files changed (57) hide show
  1. package/README.md +71 -51
  2. package/dist/choices.d.ts +23 -0
  3. package/dist/choices.js +48 -0
  4. package/dist/commands/auth/connect.js +2 -2
  5. package/dist/commands/catalog/doctor.js +9 -68
  6. package/dist/commands/causes.d.ts +2 -0
  7. package/dist/commands/causes.js +2 -2
  8. package/dist/commands/{fidelity/run.d.ts → choices.d.ts} +9 -8
  9. package/dist/commands/choices.js +86 -0
  10. package/dist/commands/conversation/add.d.ts +2 -0
  11. package/dist/commands/conversation/add.js +21 -10
  12. package/dist/commands/conversation/close.js +5 -5
  13. package/dist/commands/conversation/compact.js +9 -9
  14. package/dist/commands/conversation/create.d.ts +2 -0
  15. package/dist/commands/conversation/create.js +14 -12
  16. package/dist/commands/conversation/get.js +4 -4
  17. package/dist/commands/conversation/items.js +19 -8
  18. package/dist/commands/decide.d.ts +3 -0
  19. package/dist/commands/decide.js +20 -3
  20. package/dist/commands/face/get.js +1 -1
  21. package/dist/commands/fidelity/pick.js +2 -2
  22. package/dist/commands/models/list.js +7 -3
  23. package/dist/commands/session/close.js +1 -1
  24. package/dist/commands/session/compact.js +2 -2
  25. package/dist/commands/session/create.js +2 -2
  26. package/dist/commands/session/get.js +1 -1
  27. package/dist/commands/state/add.d.ts +3 -0
  28. package/dist/commands/state/add.js +3 -0
  29. package/dist/commands/state/close.d.ts +3 -0
  30. package/dist/commands/state/close.js +3 -0
  31. package/dist/commands/state/compact.d.ts +3 -0
  32. package/dist/commands/state/compact.js +3 -0
  33. package/dist/commands/state/create.d.ts +3 -0
  34. package/dist/commands/state/create.js +3 -0
  35. package/dist/commands/state/get.d.ts +3 -0
  36. package/dist/commands/state/get.js +3 -0
  37. package/dist/commands/state/items.d.ts +3 -0
  38. package/dist/commands/state/items.js +3 -0
  39. package/dist/commands/style/make.js +2 -6
  40. package/dist/conversation.d.ts +27 -2
  41. package/dist/conversation.js +100 -16
  42. package/dist/fidelity.js +3 -3
  43. package/oclif.manifest.json +1100 -1493
  44. package/package.json +9 -9
  45. package/dist/commands/chat/chat.d.ts +0 -47
  46. package/dist/commands/chat/chat.js +0 -376
  47. package/dist/commands/chat/messages.d.ts +0 -30
  48. package/dist/commands/chat/messages.js +0 -148
  49. package/dist/commands/chat/responses.d.ts +0 -31
  50. package/dist/commands/chat/responses.js +0 -159
  51. package/dist/commands/chat/thread.d.ts +0 -50
  52. package/dist/commands/chat/thread.js +0 -472
  53. package/dist/commands/fidelity/run.js +0 -99
  54. package/dist/commands/fidelity/start.d.ts +0 -17
  55. package/dist/commands/fidelity/start.js +0 -56
  56. package/dist/commands/fidelity/turn.d.ts +0 -17
  57. package/dist/commands/fidelity/turn.js +0 -48
@@ -1,48 +0,0 @@
1
- import { Args, Flags } from '@oclif/core';
2
- import fs from 'node:fs';
3
- import { BaseCommand } from '../../base.js';
4
- import { FacesAPIError } from '../../client.js';
5
- import { answerLines, fidelityError, fidelityPost } from '../../fidelity.js';
6
- import { seg } from '../../utils.js';
7
- export default class FidelityTurn extends BaseCommand {
8
- static description = 'Send the next turn\'s message on a fidelity run. Prints two answers, a and b, in random order, with ' +
9
- 'nothing saying which is the face. Pick one with faces fidelity:pick before the next turn.';
10
- static examples = ['<%= config.bin %> <%= command.id %> <run> -m "How was the trip?"'];
11
- static flags = {
12
- ...BaseCommand.baseFlags,
13
- message: Flags.string({ char: 'm', description: 'Your message for this turn', exclusive: ['file'] }),
14
- file: Flags.string({ description: 'Read the message from a file' }),
15
- };
16
- static args = {
17
- run_id: Args.string({ description: 'Fidelity run id, from faces fidelity:start', required: true }),
18
- };
19
- async run() {
20
- const { args, flags } = await this.parse(FidelityTurn);
21
- const client = this.makeClient(flags);
22
- let message = flags.message;
23
- if (flags.file) {
24
- if (!fs.existsSync(flags.file))
25
- this.error(`File not found: ${flags.file}`);
26
- message = fs.readFileSync(flags.file, 'utf8');
27
- }
28
- if (!message?.trim())
29
- this.error('Give the message with -m "..." or --file <path>.');
30
- let data;
31
- try {
32
- data = await fidelityPost(client, `/v1/fidelity/${seg(args.run_id)}/turns`, { message });
33
- }
34
- catch (err) {
35
- if (err instanceof FacesAPIError)
36
- this.error(fidelityError(err, { run: args.run_id }));
37
- throw err;
38
- }
39
- if (this.jsonEnabled())
40
- return data;
41
- const turn = Number(data.turn);
42
- for (const line of answerLines(turn, (data.answers ?? {})))
43
- this.log(line);
44
- this.log('');
45
- this.log(`Pick one: faces fidelity:pick ${args.run_id} a|b [--correction "what they would have said"]`);
46
- return data;
47
- }
48
- }