@faces-sh/cli 1.1.0 → 1.3.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 (92) hide show
  1. package/README.md +106 -54
  2. package/dist/billing.js +11 -8
  3. package/dist/chat-command.d.ts +33 -0
  4. package/dist/chat-command.js +110 -0
  5. package/dist/chat.d.ts +49 -0
  6. package/dist/chat.js +157 -0
  7. package/dist/choices.d.ts +11 -5
  8. package/dist/choices.js +26 -9
  9. package/dist/client.d.ts +8 -0
  10. package/dist/client.js +37 -0
  11. package/dist/commands/billing/llm-costs.js +9 -5
  12. package/dist/commands/billing/subscription/index.js +1 -1
  13. package/dist/commands/catalog/doctor.js +2 -2
  14. package/dist/commands/{causes.d.ts → chat/chat.d.ts} +14 -14
  15. package/dist/commands/chat/chat.js +31 -0
  16. package/dist/commands/chat/messages.d.ts +32 -0
  17. package/dist/commands/chat/messages.js +21 -0
  18. package/dist/commands/chat/responses.d.ts +32 -0
  19. package/dist/commands/chat/responses.js +22 -0
  20. package/dist/commands/chat/thread.d.ts +40 -0
  21. package/dist/commands/chat/thread.js +238 -0
  22. package/dist/commands/choices.d.ts +4 -2
  23. package/dist/commands/choices.js +56 -15
  24. package/dist/commands/conversation/add.d.ts +2 -0
  25. package/dist/commands/conversation/add.js +5 -2
  26. package/dist/commands/conversation/compact.js +13 -16
  27. package/dist/commands/conversation/create.d.ts +2 -0
  28. package/dist/commands/conversation/create.js +14 -11
  29. package/dist/commands/decide.d.ts +32 -4
  30. package/dist/commands/decide.js +135 -83
  31. package/dist/commands/face/get.js +1 -1
  32. package/dist/commands/face/list.d.ts +2 -0
  33. package/dist/commands/face/list.js +23 -1
  34. package/dist/commands/fidelity/pick.js +2 -2
  35. package/dist/commands/fidelity/run.d.ts +20 -0
  36. package/dist/commands/fidelity/run.js +99 -0
  37. package/dist/commands/fidelity/start.d.ts +17 -0
  38. package/dist/commands/fidelity/start.js +56 -0
  39. package/dist/commands/fidelity/turn.d.ts +17 -0
  40. package/dist/commands/fidelity/turn.js +48 -0
  41. package/dist/commands/group/add.js +1 -1
  42. package/dist/commands/media/list.d.ts +12 -0
  43. package/dist/commands/media/list.js +35 -0
  44. package/dist/commands/models/list.js +13 -6
  45. package/dist/commands/premise/add.d.ts +30 -0
  46. package/dist/commands/premise/add.js +86 -0
  47. package/dist/commands/premise/choices.d.ts +21 -0
  48. package/dist/commands/premise/choices.js +68 -0
  49. package/dist/commands/premise/claim.d.ts +20 -0
  50. package/dist/commands/premise/claim.js +38 -0
  51. package/dist/commands/premise/decide.d.ts +18 -0
  52. package/dist/commands/premise/decide.js +36 -0
  53. package/dist/commands/premise/delete.d.ts +17 -0
  54. package/dist/commands/premise/delete.js +17 -0
  55. package/dist/commands/premise/edit.d.ts +28 -0
  56. package/dist/commands/premise/edit.js +51 -0
  57. package/dist/commands/premise/get.d.ts +22 -0
  58. package/dist/commands/premise/get.js +37 -0
  59. package/dist/commands/premise/refine.d.ts +20 -0
  60. package/dist/commands/premise/refine.js +80 -0
  61. package/dist/commands/session/compact.js +5 -8
  62. package/dist/commands/session/create.js +9 -8
  63. package/dist/commands/state/create.d.ts +13 -2
  64. package/dist/commands/state/create.js +55 -2
  65. package/dist/commands/state/get.d.ts +19 -2
  66. package/dist/commands/state/get.js +30 -2
  67. package/dist/commands/state/use.d.ts +16 -0
  68. package/dist/commands/state/use.js +25 -0
  69. package/dist/commands/style/make.js +1 -1
  70. package/dist/commands/style/upload.js +1 -1
  71. package/dist/conversation.d.ts +30 -3
  72. package/dist/conversation.js +202 -18
  73. package/dist/decisions.d.ts +0 -5
  74. package/dist/decisions.js +0 -18
  75. package/dist/fidelity.js +3 -3
  76. package/dist/foreman.d.ts +47 -0
  77. package/dist/foreman.js +115 -0
  78. package/dist/media.d.ts +8 -0
  79. package/dist/media.js +12 -0
  80. package/dist/model.d.ts +11 -0
  81. package/dist/model.js +53 -0
  82. package/dist/refine.d.ts +106 -0
  83. package/dist/refine.js +601 -0
  84. package/dist/routing.d.ts +1 -4
  85. package/dist/routing.js +4 -40
  86. package/dist/synopsis.d.ts +49 -0
  87. package/dist/synopsis.js +43 -0
  88. package/dist/utils.d.ts +1 -25
  89. package/dist/utils.js +10 -108
  90. package/oclif.manifest.json +3939 -1835
  91. package/package.json +10 -4
  92. package/dist/commands/causes.js +0 -146
@@ -0,0 +1,106 @@
1
+ import { FacesClient } from './client.js';
2
+ export declare const AND: string;
3
+ export declare const AND_LEAD = "It holds only if:";
4
+ export declare const OR: string;
5
+ export declare const OR_LEAD = "Take it to mean:";
6
+ export declare const NEEDED = "Is \"{k}: {v}\" needed for \"{P}\"? It is needed if \"{P}\" would be false without it.";
7
+ export declare const GATE: string;
8
+ export declare const GAP_ROUNDS = 3;
9
+ export declare const GAP_PROPOSE: string;
10
+ export declare const GAP_MAX = 4;
11
+ export declare const KIND = "Before anything is done, \"{P}\" has to be settled, and the choice here is how it will be settled.";
12
+ export declare const KIND_OPTIONS: Array<[Kind, string, string]>;
13
+ export declare const TEST: string;
14
+ export declare const TEST_LEAD = "Passes only if:";
15
+ export declare const AWAIT_QUESTION: string;
16
+ export declare const AWAIT_MAX = 2;
17
+ export declare const WHO = "the human";
18
+ export declare const RECHECK: string;
19
+ export declare const NAME_LINE = "Name each option by what it is, in a few words (e.g. the dishes themselves), and put the full statement in its description.";
20
+ export declare function named(question: string): string;
21
+ export declare const SAME = "Is \"{a}\" the same condition as \"{b}\"?";
22
+ export declare const AT = 0.5;
23
+ export declare const CLEAR_P = 0.6;
24
+ export declare const CLEAR_MARGIN = 0.2;
25
+ export declare const SIMILAR_AT = 0.85;
26
+ export declare const DECISION_MODEL: string;
27
+ export declare const CONDITION_MODEL: string;
28
+ export type Kind = 'and' | 'or' | 'test' | 'human';
29
+ export type Option = {
30
+ name: string;
31
+ description: string;
32
+ };
33
+ export declare function fill(t: string, vars: Record<string, string>): string;
34
+ export declare function stripLead(text: string, lead: string): string;
35
+ export declare function plainKey(text: string, limit?: number): string;
36
+ export declare function stripOptions(opts: Option[], lead?: string): Option[];
37
+ export declare function readsOf(definition: string): {
38
+ statement: string;
39
+ reads: string[];
40
+ };
41
+ export declare function asked(o: Option): string;
42
+ export declare function condition(template: string, p: string, o: Option): string;
43
+ export declare function clearWinner(probs: Record<string, number>): string | undefined;
44
+ export type Premise = {
45
+ key: string;
46
+ number: string | null;
47
+ value: unknown;
48
+ role: string | null;
49
+ origin: string | null;
50
+ status: string;
51
+ truth: string;
52
+ op: string | null;
53
+ children: string[];
54
+ on: string[];
55
+ refinement: string | null;
56
+ await: string | null;
57
+ messages?: Array<{
58
+ kind: string | null;
59
+ author: string;
60
+ }>;
61
+ };
62
+ export declare class Loop {
63
+ readonly client: FacesClient;
64
+ readonly sid: string;
65
+ readonly face: string;
66
+ readonly as?: string | undefined;
67
+ readonly log: (line: string) => void;
68
+ calls: number;
69
+ usage: {
70
+ input_tokens: number;
71
+ output_tokens: number;
72
+ };
73
+ constructor(client: FacesClient, sid: string, face: string, as?: string | undefined, log?: (line: string) => void);
74
+ private state;
75
+ send(method: 'GET' | 'POST' | 'PATCH' | 'DELETE', p: string, opts?: {
76
+ body?: Record<string, unknown>;
77
+ params?: Record<string, string>;
78
+ }): Promise<Record<string, unknown>>;
79
+ premises(): Promise<Record<string, Premise>>;
80
+ propose(key: string, question: string | undefined, max?: number, see?: boolean): Promise<Option[]>;
81
+ ownQuestion(key: string): Promise<string>;
82
+ write(into: string, kind: 'and' | 'or', options: Option[]): Promise<{
83
+ new: string[];
84
+ matched: string[];
85
+ }>;
86
+ sameP: Map<string, number>;
87
+ sameElsewhere(into: string, options: Option[], P: Record<string, Premise>): Promise<Option[]>;
88
+ decide(questions: Array<Record<string, unknown>>, dependsOn: string[], model?: string): Promise<Array<Record<string, unknown>>>;
89
+ predicates(texts: string[], dependsOn: string[], model?: string): Promise<number[]>;
90
+ choice(name: string, instructions: string, values: Array<[string, string]>, dependsOn: string[]): Promise<Record<string, number>>;
91
+ kind(key: string): Promise<[Kind, number]>;
92
+ judged(key: string, opts: Option[]): Promise<[Option[], string[]]>;
93
+ question(key: string, also?: string[]): Promise<string>;
94
+ edit(key: string, body: Record<string, unknown>): Promise<Record<string, unknown>>;
95
+ add(body: Record<string, unknown>): Promise<Record<string, unknown>>;
96
+ search(text: string, within?: string): Promise<Array<[string, number]>>;
97
+ awaitHuman(key: string, also?: string[]): Promise<string>;
98
+ weigh(key: string): Promise<Record<string, number>>;
99
+ }
100
+ export declare function refine(L: Loop, key: string): Promise<string[]>;
101
+ export declare function rank(L: Loop, key: string, awaitOnTie?: boolean): Promise<string[]>;
102
+ export declare function refineTree(L: Loop, root: string, depth: number, log?: (line: string) => void): Promise<{
103
+ refined: string[];
104
+ awaits: string[];
105
+ beyond: string[];
106
+ }>;