@faces-sh/cli 0.0.0-stage → 1.0.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.
- package/LICENSE +21 -0
- package/README.md +158 -2
- package/bin/dev.js +5 -0
- package/bin/run.js +5 -0
- package/dist/base.d.ts +26 -0
- package/dist/base.js +181 -0
- package/dist/benchmark.d.ts +21 -0
- package/dist/benchmark.js +95 -0
- package/dist/billing.d.ts +17 -0
- package/dist/billing.js +101 -0
- package/dist/catalog.d.ts +35 -0
- package/dist/catalog.js +242 -0
- package/dist/client.d.ts +98 -0
- package/dist/client.js +590 -0
- package/dist/commands/account/preferences.d.ts +20 -0
- package/dist/commands/account/preferences.js +190 -0
- package/dist/commands/account/state.d.ts +11 -0
- package/dist/commands/account/state.js +24 -0
- package/dist/commands/auth/connect.d.ts +17 -0
- package/dist/commands/auth/connect.js +190 -0
- package/dist/commands/auth/connections.d.ts +12 -0
- package/dist/commands/auth/connections.js +40 -0
- package/dist/commands/auth/disconnect.d.ts +15 -0
- package/dist/commands/auth/disconnect.js +49 -0
- package/dist/commands/auth/login.d.ts +13 -0
- package/dist/commands/auth/login.js +42 -0
- package/dist/commands/auth/logout.d.ts +11 -0
- package/dist/commands/auth/logout.js +14 -0
- package/dist/commands/auth/refresh.d.ts +11 -0
- package/dist/commands/auth/refresh.js +30 -0
- package/dist/commands/auth/register.d.ts +15 -0
- package/dist/commands/auth/register.js +98 -0
- package/dist/commands/auth/whoami.d.ts +11 -0
- package/dist/commands/auth/whoami.js +108 -0
- package/dist/commands/benchmark/get.d.ts +16 -0
- package/dist/commands/benchmark/get.js +42 -0
- package/dist/commands/benchmark/list.d.ts +13 -0
- package/dist/commands/benchmark/list.js +47 -0
- package/dist/commands/benchmark/start.d.ts +22 -0
- package/dist/commands/benchmark/start.js +80 -0
- package/dist/commands/billing/balance.d.ts +11 -0
- package/dist/commands/billing/balance.js +27 -0
- package/dist/commands/billing/card/default.d.ts +15 -0
- package/dist/commands/billing/card/default.js +33 -0
- package/dist/commands/billing/card/remove.d.ts +16 -0
- package/dist/commands/billing/card/remove.js +41 -0
- package/dist/commands/billing/card-setup.d.ts +13 -0
- package/dist/commands/billing/card-setup.js +41 -0
- package/dist/commands/billing/cards.d.ts +11 -0
- package/dist/commands/billing/cards.js +34 -0
- package/dist/commands/billing/llm-costs.d.ts +14 -0
- package/dist/commands/billing/llm-costs.js +95 -0
- package/dist/commands/billing/subscription/activate.d.ts +14 -0
- package/dist/commands/billing/subscription/activate.js +91 -0
- package/dist/commands/billing/subscription/cancel.d.ts +12 -0
- package/dist/commands/billing/subscription/cancel.js +54 -0
- package/dist/commands/billing/subscription/index.d.ts +11 -0
- package/dist/commands/billing/subscription/index.js +46 -0
- package/dist/commands/billing/subscription/plan.d.ts +16 -0
- package/dist/commands/billing/subscription/plan.js +86 -0
- package/dist/commands/billing/topup.d.ts +16 -0
- package/dist/commands/billing/topup.js +60 -0
- package/dist/commands/billing/usage.d.ts +15 -0
- package/dist/commands/billing/usage.js +68 -0
- package/dist/commands/catalog/backup.d.ts +11 -0
- package/dist/commands/catalog/backup.js +169 -0
- package/dist/commands/catalog/doctor.d.ts +14 -0
- package/dist/commands/catalog/doctor.js +303 -0
- package/dist/commands/catalog/list.d.ts +11 -0
- package/dist/commands/catalog/list.js +39 -0
- package/dist/commands/catalog/restore.d.ts +17 -0
- package/dist/commands/catalog/restore.js +259 -0
- package/dist/commands/causes.d.ts +27 -0
- package/dist/commands/causes.js +135 -0
- package/dist/commands/chat/chat.d.ts +42 -0
- package/dist/commands/chat/chat.js +363 -0
- package/dist/commands/chat/messages.d.ts +26 -0
- package/dist/commands/chat/messages.js +139 -0
- package/dist/commands/chat/responses.d.ts +27 -0
- package/dist/commands/chat/responses.js +150 -0
- package/dist/commands/chat/thread.d.ts +43 -0
- package/dist/commands/chat/thread.js +458 -0
- package/dist/commands/compile/all.d.ts +14 -0
- package/dist/commands/compile/all.js +186 -0
- package/dist/commands/compile/doc/create.d.ts +19 -0
- package/dist/commands/compile/doc/create.js +58 -0
- package/dist/commands/compile/doc/delete.d.ts +15 -0
- package/dist/commands/compile/doc/delete.js +33 -0
- package/dist/commands/compile/doc/edit.d.ts +19 -0
- package/dist/commands/compile/doc/edit.js +59 -0
- package/dist/commands/compile/doc/get.d.ts +15 -0
- package/dist/commands/compile/doc/get.js +43 -0
- package/dist/commands/compile/doc/index.d.ts +24 -0
- package/dist/commands/compile/doc/index.js +211 -0
- package/dist/commands/compile/doc/list.d.ts +15 -0
- package/dist/commands/compile/doc/list.js +46 -0
- package/dist/commands/compile/doc/make.d.ts +17 -0
- package/dist/commands/compile/doc/make.js +95 -0
- package/dist/commands/compile/doc/pause.d.ts +17 -0
- package/dist/commands/compile/doc/pause.js +74 -0
- package/dist/commands/compile/doc/reset.d.ts +15 -0
- package/dist/commands/compile/doc/reset.js +33 -0
- package/dist/commands/compile/import.d.ts +20 -0
- package/dist/commands/compile/import.js +138 -0
- package/dist/commands/compile/stats.d.ts +11 -0
- package/dist/commands/compile/stats.js +75 -0
- package/dist/commands/compile/status.d.ts +17 -0
- package/dist/commands/compile/status.js +110 -0
- package/dist/commands/compile/thread/create.d.ts +16 -0
- package/dist/commands/compile/thread/create.js +42 -0
- package/dist/commands/compile/thread/delete.d.ts +15 -0
- package/dist/commands/compile/thread/delete.js +33 -0
- package/dist/commands/compile/thread/edit.d.ts +19 -0
- package/dist/commands/compile/thread/edit.js +120 -0
- package/dist/commands/compile/thread/get.d.ts +15 -0
- package/dist/commands/compile/thread/get.js +48 -0
- package/dist/commands/compile/thread/list.d.ts +14 -0
- package/dist/commands/compile/thread/list.js +38 -0
- package/dist/commands/compile/thread/make.d.ts +17 -0
- package/dist/commands/compile/thread/make.js +87 -0
- package/dist/commands/compile/thread/message.d.ts +16 -0
- package/dist/commands/compile/thread/message.js +43 -0
- package/dist/commands/compile/thread/pause.d.ts +17 -0
- package/dist/commands/compile/thread/pause.js +75 -0
- package/dist/commands/compile/thread/replace.d.ts +27 -0
- package/dist/commands/compile/thread/replace.js +114 -0
- package/dist/commands/compile/thread/reset.d.ts +15 -0
- package/dist/commands/compile/thread/reset.js +33 -0
- package/dist/commands/compile/upload.d.ts +21 -0
- package/dist/commands/compile/upload.js +162 -0
- package/dist/commands/config/clear.d.ts +12 -0
- package/dist/commands/config/clear.js +17 -0
- package/dist/commands/config/set.d.ts +15 -0
- package/dist/commands/config/set.js +43 -0
- package/dist/commands/config/show.d.ts +11 -0
- package/dist/commands/config/show.js +19 -0
- package/dist/commands/decide.d.ts +35 -0
- package/dist/commands/decide.js +242 -0
- package/dist/commands/face/attributes.d.ts +11 -0
- package/dist/commands/face/attributes.js +44 -0
- package/dist/commands/face/avatar/delete.d.ts +15 -0
- package/dist/commands/face/avatar/delete.js +38 -0
- package/dist/commands/face/avatar/get.d.ts +20 -0
- package/dist/commands/face/avatar/get.js +100 -0
- package/dist/commands/face/avatar/list.d.ts +14 -0
- package/dist/commands/face/avatar/list.js +56 -0
- package/dist/commands/face/avatar/make.d.ts +16 -0
- package/dist/commands/face/avatar/make.js +64 -0
- package/dist/commands/face/avatar/upload.d.ts +15 -0
- package/dist/commands/face/avatar/upload.js +67 -0
- package/dist/commands/face/create.d.ts +23 -0
- package/dist/commands/face/create.js +122 -0
- package/dist/commands/face/delete.d.ts +15 -0
- package/dist/commands/face/delete.js +39 -0
- package/dist/commands/face/diff.d.ts +12 -0
- package/dist/commands/face/diff.js +50 -0
- package/dist/commands/face/edit.d.ts +25 -0
- package/dist/commands/face/edit.js +155 -0
- package/dist/commands/face/get.d.ts +16 -0
- package/dist/commands/face/get.js +145 -0
- package/dist/commands/face/groups.d.ts +15 -0
- package/dist/commands/face/groups.js +34 -0
- package/dist/commands/face/list.d.ts +23 -0
- package/dist/commands/face/list.js +168 -0
- package/dist/commands/face/lock.d.ts +15 -0
- package/dist/commands/face/lock.js +35 -0
- package/dist/commands/face/neighbors.d.ts +16 -0
- package/dist/commands/face/neighbors.js +63 -0
- package/dist/commands/face/publish.d.ts +16 -0
- package/dist/commands/face/publish.js +43 -0
- package/dist/commands/face/share.d.ts +22 -0
- package/dist/commands/face/share.js +104 -0
- package/dist/commands/face/sources.d.ts +21 -0
- package/dist/commands/face/sources.js +169 -0
- package/dist/commands/face/stats.d.ts +12 -0
- package/dist/commands/face/stats.js +46 -0
- package/dist/commands/face/tag/add.d.ts +15 -0
- package/dist/commands/face/tag/add.js +40 -0
- package/dist/commands/face/tag/all.d.ts +11 -0
- package/dist/commands/face/tag/all.js +31 -0
- package/dist/commands/face/tag/list.d.ts +14 -0
- package/dist/commands/face/tag/list.js +36 -0
- package/dist/commands/face/tag/remove.d.ts +16 -0
- package/dist/commands/face/tag/remove.js +44 -0
- package/dist/commands/face/tag/set.d.ts +15 -0
- package/dist/commands/face/tag/set.js +40 -0
- package/dist/commands/face/unlock.d.ts +15 -0
- package/dist/commands/face/unlock.js +35 -0
- package/dist/commands/face/unpublish.d.ts +14 -0
- package/dist/commands/face/unpublish.js +32 -0
- package/dist/commands/face/unshare.d.ts +18 -0
- package/dist/commands/face/unshare.js +66 -0
- package/dist/commands/fidelity/get.d.ts +15 -0
- package/dist/commands/fidelity/get.js +42 -0
- package/dist/commands/fidelity/pick.d.ts +19 -0
- package/dist/commands/fidelity/pick.js +70 -0
- package/dist/commands/fidelity/run.d.ts +20 -0
- package/dist/commands/fidelity/run.js +99 -0
- package/dist/commands/fidelity/save-thread.d.ts +15 -0
- package/dist/commands/fidelity/save-thread.js +35 -0
- package/dist/commands/fidelity/start.d.ts +17 -0
- package/dist/commands/fidelity/start.js +56 -0
- package/dist/commands/fidelity/turn.d.ts +17 -0
- package/dist/commands/fidelity/turn.js +48 -0
- package/dist/commands/group/add.d.ts +16 -0
- package/dist/commands/group/add.js +83 -0
- package/dist/commands/group/create.d.ts +16 -0
- package/dist/commands/group/create.js +68 -0
- package/dist/commands/group/delete.d.ts +15 -0
- package/dist/commands/group/delete.js +39 -0
- package/dist/commands/group/edit.d.ts +18 -0
- package/dist/commands/group/edit.js +75 -0
- package/dist/commands/group/get.d.ts +14 -0
- package/dist/commands/group/get.js +29 -0
- package/dist/commands/group/list.d.ts +11 -0
- package/dist/commands/group/list.js +39 -0
- package/dist/commands/group/members.d.ts +15 -0
- package/dist/commands/group/members.js +68 -0
- package/dist/commands/group/remove.d.ts +15 -0
- package/dist/commands/group/remove.js +55 -0
- package/dist/commands/group/tag/add.d.ts +15 -0
- package/dist/commands/group/tag/add.js +30 -0
- package/dist/commands/group/tag/list.d.ts +14 -0
- package/dist/commands/group/tag/list.js +36 -0
- package/dist/commands/group/tag/remove.d.ts +15 -0
- package/dist/commands/group/tag/remove.js +30 -0
- package/dist/commands/group/tag/set.d.ts +15 -0
- package/dist/commands/group/tag/set.js +30 -0
- package/dist/commands/keys/create.d.ts +17 -0
- package/dist/commands/keys/create.js +72 -0
- package/dist/commands/keys/list.d.ts +11 -0
- package/dist/commands/keys/list.js +24 -0
- package/dist/commands/keys/revoke.d.ts +15 -0
- package/dist/commands/keys/revoke.js +49 -0
- package/dist/commands/keys/update.d.ts +17 -0
- package/dist/commands/keys/update.js +41 -0
- package/dist/commands/models/list.d.ts +15 -0
- package/dist/commands/models/list.js +98 -0
- package/dist/commands/session/close.d.ts +16 -0
- package/dist/commands/session/close.js +36 -0
- package/dist/commands/session/compact.d.ts +15 -0
- package/dist/commands/session/compact.js +58 -0
- package/dist/commands/session/create.d.ts +15 -0
- package/dist/commands/session/create.js +45 -0
- package/dist/commands/session/get.d.ts +15 -0
- package/dist/commands/session/get.js +34 -0
- package/dist/commands/style/delete.d.ts +19 -0
- package/dist/commands/style/delete.js +94 -0
- package/dist/commands/style/make.d.ts +28 -0
- package/dist/commands/style/make.js +298 -0
- package/dist/commands/style/revert.d.ts +17 -0
- package/dist/commands/style/revert.js +66 -0
- package/dist/commands/style/status.d.ts +20 -0
- package/dist/commands/style/status.js +109 -0
- package/dist/commands/style/upload.d.ts +19 -0
- package/dist/commands/style/upload.js +100 -0
- package/dist/commands/style/versions.d.ts +15 -0
- package/dist/commands/style/versions.js +104 -0
- package/dist/commands/user/follow.d.ts +14 -0
- package/dist/commands/user/follow.js +38 -0
- package/dist/commands/user/followers.d.ts +14 -0
- package/dist/commands/user/followers.js +50 -0
- package/dist/commands/user/following.d.ts +14 -0
- package/dist/commands/user/following.js +50 -0
- package/dist/commands/user/get.d.ts +14 -0
- package/dist/commands/user/get.js +49 -0
- package/dist/commands/user/unfollow.d.ts +14 -0
- package/dist/commands/user/unfollow.js +38 -0
- package/dist/config.d.ts +32 -0
- package/dist/config.js +139 -0
- package/dist/decisions.d.ts +42 -0
- package/dist/decisions.js +262 -0
- package/dist/fidelity.d.ts +50 -0
- package/dist/fidelity.js +92 -0
- package/dist/group-catalog.d.ts +22 -0
- package/dist/group-catalog.js +133 -0
- package/dist/paths.d.ts +1 -0
- package/dist/paths.js +8 -0
- package/dist/poll.d.ts +26 -0
- package/dist/poll.js +75 -0
- package/dist/routing.d.ts +15 -0
- package/dist/routing.js +135 -0
- package/dist/session.d.ts +14 -0
- package/dist/session.js +18 -0
- package/dist/style.d.ts +46 -0
- package/dist/style.js +285 -0
- package/dist/utils.d.ts +149 -0
- package/dist/utils.js +865 -0
- package/oclif.manifest.json +11070 -0
- package/package.json +127 -4
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { BaseCommand } from '../../../base.js';
|
|
4
|
+
import { MEDIUM_MISSING_MESSAGE, MEDIUM_REQUIRED_DESCRIPTION, RUSH_FLAG_DESCRIPTION, compileCostNote, compileRate, compileStatusOf, makeRefusalMessage, makeScheduleLines, seg, readTextFile, documentWarningLines } from '../../../utils.js';
|
|
5
|
+
import { FacesAPIError } from '../../../client.js';
|
|
6
|
+
import { pollCompileProgress, progressLine } from '../../../poll.js';
|
|
7
|
+
export default class CompileDoc extends BaseCommand {
|
|
8
|
+
static description = 'Compile one or more documents into a face (create → make in one step). ' +
|
|
9
|
+
'Repeat --file to submit several documents in a single command; each file becomes its own ' +
|
|
10
|
+
'document rather than being concatenated. A document is the face\'s own writing, and every word in ' +
|
|
11
|
+
'it is read as theirs. An interview, transcript or dialogue is a thread: upload it with ' +
|
|
12
|
+
'faces compile:upload ALIAS --file FILE --kind thread --face-speaker NAME.';
|
|
13
|
+
static examples = [
|
|
14
|
+
'<%= config.bin %> <%= command.id %> alice --file notes.txt',
|
|
15
|
+
'<%= config.bin %> <%= command.id %> alice --file a.txt --file b.txt --file c.txt --no-wait --json',
|
|
16
|
+
];
|
|
17
|
+
static flags = {
|
|
18
|
+
...BaseCommand.baseFlags,
|
|
19
|
+
label: Flags.string({ description: 'Document label/title (single document only; with several files each is labelled by its filename)' }),
|
|
20
|
+
content: Flags.string({ description: 'Inline text content', exclusive: ['file'] }),
|
|
21
|
+
file: Flags.string({ description: 'Read content from file (repeatable; each file becomes its own document)', multiple: true }),
|
|
22
|
+
medium: Flags.string({ description: MEDIUM_REQUIRED_DESCRIPTION }),
|
|
23
|
+
perspective: Flags.string({
|
|
24
|
+
description: 'Who wrote it. first-person (default) means the subject did; third-person means it is ABOUT ' +
|
|
25
|
+
'them. Get this wrong and someone else\'s writing is compiled as the subject\'s own. Third-person ' +
|
|
26
|
+
'material compiles, but never goes into a style.',
|
|
27
|
+
options: ['first-person', 'third-person'],
|
|
28
|
+
default: 'first-person',
|
|
29
|
+
}),
|
|
30
|
+
timeout: Flags.integer({ description: 'Compile timeout in seconds, per document, counted from its start', default: 600 }),
|
|
31
|
+
rush: Flags.boolean({ description: RUSH_FLAG_DESCRIPTION, default: false }),
|
|
32
|
+
'no-wait': Flags.boolean({
|
|
33
|
+
description: 'Create and trigger compilation, then return immediately without polling.',
|
|
34
|
+
default: false,
|
|
35
|
+
}),
|
|
36
|
+
};
|
|
37
|
+
static args = {
|
|
38
|
+
face_id: Args.string({ description: 'Face alias', required: true }),
|
|
39
|
+
};
|
|
40
|
+
async run() {
|
|
41
|
+
const { args, flags } = await this.parse(CompileDoc);
|
|
42
|
+
const client = this.makeClient(flags);
|
|
43
|
+
const json = this.jsonEnabled();
|
|
44
|
+
const files = flags.file ?? [];
|
|
45
|
+
if (files.length === 0 && !flags.content)
|
|
46
|
+
this.error('Provide --content or --file.');
|
|
47
|
+
if (flags.label && files.length > 1) {
|
|
48
|
+
this.error('--label applies to a single document. With several --file flags each document is labelled by its filename.');
|
|
49
|
+
}
|
|
50
|
+
if (!flags.medium)
|
|
51
|
+
this.error(MEDIUM_MISSING_MESSAGE);
|
|
52
|
+
const sources = files.map((file) => {
|
|
53
|
+
try {
|
|
54
|
+
return { name: file, content: readTextFile(file) };
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
return { name: file, readError: err instanceof Error ? err.message : String(err) };
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
if (flags.content)
|
|
61
|
+
sources.push({ name: '(--content)', content: flags.content });
|
|
62
|
+
const results = [];
|
|
63
|
+
const multi = files.length > 1;
|
|
64
|
+
const started = [];
|
|
65
|
+
let rate;
|
|
66
|
+
for (const source of sources) {
|
|
67
|
+
if (source.readError !== undefined) {
|
|
68
|
+
results.push({ file: source.name, error: source.readError });
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
let savedId;
|
|
72
|
+
let warnings;
|
|
73
|
+
try {
|
|
74
|
+
const payload = { alias: args.face_id, content: source.content };
|
|
75
|
+
if (flags.label)
|
|
76
|
+
payload.label = flags.label;
|
|
77
|
+
else if (multi)
|
|
78
|
+
payload.label = path.basename(source.name);
|
|
79
|
+
payload.medium = flags.medium;
|
|
80
|
+
if (flags.perspective)
|
|
81
|
+
payload.perspective = flags.perspective;
|
|
82
|
+
if (!json)
|
|
83
|
+
process.stderr.write(`Creating document${multi ? ` (${source.name})` : ''}... `);
|
|
84
|
+
const doc = (await client.post('/v1/compile/documents', { body: payload }));
|
|
85
|
+
const docId = String(doc.document_id ?? doc.id ?? '');
|
|
86
|
+
if (!docId)
|
|
87
|
+
throw new Error('Server did not return a document_id');
|
|
88
|
+
savedId = docId;
|
|
89
|
+
if (!json)
|
|
90
|
+
process.stderr.write(`done (${docId})\n`);
|
|
91
|
+
const file = source.name === '(--content)' ? undefined : source.name;
|
|
92
|
+
for (const line of documentWarningLines(doc, source.content, args.face_id, file))
|
|
93
|
+
process.stderr.write(`${line}\n`);
|
|
94
|
+
if (Array.isArray(doc.warnings) && doc.warnings.length > 0)
|
|
95
|
+
warnings = doc.warnings;
|
|
96
|
+
if (typeof doc.token_count === 'number' && doc.token_count >= 10_000) {
|
|
97
|
+
const note = compileCostNote(doc.token_count, (rate ??= await compileRate(client)));
|
|
98
|
+
if (note)
|
|
99
|
+
process.stderr.write(`${note}\n`);
|
|
100
|
+
}
|
|
101
|
+
const makeResponse = (await client.post(`/v1/compile/documents/${seg(docId)}/make`, flags.rush ? { body: { rush: true } } : {}));
|
|
102
|
+
const status = compileStatusOf(makeResponse.status) ?? undefined;
|
|
103
|
+
const startsAt = typeof makeResponse.starts_at === 'string' ? makeResponse.starts_at : null;
|
|
104
|
+
if (!json)
|
|
105
|
+
for (const line of makeScheduleLines(makeResponse, flags.rush))
|
|
106
|
+
process.stderr.write(`${line}\n`);
|
|
107
|
+
started.push({ source, docId, status, startsAt });
|
|
108
|
+
const result = { file: source.name, document_id: docId, status };
|
|
109
|
+
if (warnings)
|
|
110
|
+
result.warnings = warnings;
|
|
111
|
+
if ('starts_at' in makeResponse)
|
|
112
|
+
result.starts_at = startsAt;
|
|
113
|
+
if (typeof makeResponse.rush === 'boolean')
|
|
114
|
+
result.rush = makeResponse.rush;
|
|
115
|
+
results.push(result);
|
|
116
|
+
}
|
|
117
|
+
catch (err) {
|
|
118
|
+
if (!json)
|
|
119
|
+
process.stderr.write('failed\n');
|
|
120
|
+
const message = err instanceof FacesAPIError
|
|
121
|
+
? (savedId ? makeRefusalMessage(err, savedId) : `HTTP ${err.statusCode}: ${err.message}`)
|
|
122
|
+
: err instanceof Error ? err.message : String(err);
|
|
123
|
+
results.push(savedId
|
|
124
|
+
? { file: source.name, document_id: savedId, saved: true, error: `saved, but not compiled: ${message}`, ...(warnings ? { warnings } : {}) }
|
|
125
|
+
: { file: source.name, error: message });
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (started.length === 0) {
|
|
129
|
+
for (const r of results)
|
|
130
|
+
if (r.error)
|
|
131
|
+
process.stderr.write(`${r.file}: ${r.error}\n`);
|
|
132
|
+
const saved = results.filter((r) => r.saved).length;
|
|
133
|
+
if (saved > 0) {
|
|
134
|
+
this.error(`${saved} of ${results.length} document(s) were saved but none could be compiled; the reasons are above. ` +
|
|
135
|
+
`They are listed in: faces face:sources ${args.face_id}`);
|
|
136
|
+
}
|
|
137
|
+
this.error(results.length === 1 ? 'Document was not accepted.' : 'No documents were accepted.');
|
|
138
|
+
}
|
|
139
|
+
if (!json)
|
|
140
|
+
for (const r of results)
|
|
141
|
+
if (r.error)
|
|
142
|
+
process.stderr.write(`${r.file}: ${r.error}\n`);
|
|
143
|
+
if (flags['no-wait']) {
|
|
144
|
+
if (!json) {
|
|
145
|
+
for (const s of started) {
|
|
146
|
+
process.stderr.write(`Compilation started in background${s.status === 'queued' ? ' (queued)' : ''}: ${s.docId}\n`);
|
|
147
|
+
}
|
|
148
|
+
process.stderr.write(`Poll with: faces compile:doc:get <id> --json\n`);
|
|
149
|
+
}
|
|
150
|
+
return this.shape(results);
|
|
151
|
+
}
|
|
152
|
+
for (const s of started) {
|
|
153
|
+
if (!json)
|
|
154
|
+
process.stderr.write(`Compiling${multi ? ` ${s.source.name}` : ''}:\n`);
|
|
155
|
+
try {
|
|
156
|
+
const result = (await pollCompileProgress(client, s.docId, {
|
|
157
|
+
timeoutMs: flags.timeout * 1000,
|
|
158
|
+
startsAt: s.startsAt,
|
|
159
|
+
onProgress: (p) => {
|
|
160
|
+
if (!json)
|
|
161
|
+
process.stderr.write(` ${progressLine(p)}\n`);
|
|
162
|
+
},
|
|
163
|
+
}));
|
|
164
|
+
const hit = results.find((r) => r.document_id === s.docId);
|
|
165
|
+
if (hit)
|
|
166
|
+
hit.compiled = result;
|
|
167
|
+
}
|
|
168
|
+
catch (err) {
|
|
169
|
+
const hit = results.find((r) => r.document_id === s.docId);
|
|
170
|
+
if (hit)
|
|
171
|
+
hit.error = err instanceof Error ? err.message : String(err);
|
|
172
|
+
if (!json)
|
|
173
|
+
process.stderr.write(`${s.source.name}: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (!json)
|
|
177
|
+
process.stderr.write('Done.\n');
|
|
178
|
+
return this.shape(results);
|
|
179
|
+
}
|
|
180
|
+
shape(results) {
|
|
181
|
+
const documents = results.map((r) => {
|
|
182
|
+
const out = { file: r.file };
|
|
183
|
+
if (r.document_id)
|
|
184
|
+
out.document_id = r.document_id;
|
|
185
|
+
if (r.status !== undefined)
|
|
186
|
+
out.status = r.status;
|
|
187
|
+
if (r.starts_at !== undefined)
|
|
188
|
+
out.starts_at = r.starts_at;
|
|
189
|
+
if (r.rush !== undefined)
|
|
190
|
+
out.rush = r.rush;
|
|
191
|
+
if (r.error)
|
|
192
|
+
out.error = r.error;
|
|
193
|
+
if (r.warnings)
|
|
194
|
+
out.warnings = r.warnings;
|
|
195
|
+
return out;
|
|
196
|
+
});
|
|
197
|
+
const body = { documents };
|
|
198
|
+
if (results.length === 1) {
|
|
199
|
+
const only = results[0];
|
|
200
|
+
Object.assign(body, only.compiled ?? {}, only.document_id ? { document_id: only.document_id } : {});
|
|
201
|
+
if (only.status !== undefined && body.status === undefined)
|
|
202
|
+
body.status = only.status;
|
|
203
|
+
if (only.starts_at !== undefined && body.starts_at === undefined)
|
|
204
|
+
body.starts_at = only.starts_at;
|
|
205
|
+
if (only.rush !== undefined && body.rush === undefined)
|
|
206
|
+
body.rush = only.rush;
|
|
207
|
+
body.documents = documents;
|
|
208
|
+
}
|
|
209
|
+
return body;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base.js';
|
|
2
|
+
export default class CompileDocList extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
token: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
static args: {
|
|
12
|
+
face_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<unknown>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../../base.js';
|
|
3
|
+
import { FacesAPIError } from '../../../client.js';
|
|
4
|
+
import { freshnessSummary } from '../../../utils.js';
|
|
5
|
+
export default class CompileDocList extends BaseCommand {
|
|
6
|
+
static description = "List documents for a face. Each document's full text is omitted unless --verbose, so a face with a " +
|
|
7
|
+
'real corpus stays readable. For a table of every source, documents and threads together, use face:sources.';
|
|
8
|
+
static flags = {
|
|
9
|
+
...BaseCommand.baseFlags,
|
|
10
|
+
verbose: Flags.boolean({ description: "Include each document's full text", default: false }),
|
|
11
|
+
};
|
|
12
|
+
static args = {
|
|
13
|
+
face_id: Args.string({ description: 'Face alias', required: true }),
|
|
14
|
+
};
|
|
15
|
+
async run() {
|
|
16
|
+
const { args, flags } = await this.parse(CompileDocList);
|
|
17
|
+
const client = this.makeClient(flags);
|
|
18
|
+
let data;
|
|
19
|
+
try {
|
|
20
|
+
data = await client.get('/v1/compile/documents', { params: { alias: args.face_id } });
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
if (err instanceof FacesAPIError)
|
|
24
|
+
this.error(`HTTP ${err.statusCode}: ${err.message}`);
|
|
25
|
+
throw err;
|
|
26
|
+
}
|
|
27
|
+
if (!this.jsonEnabled()) {
|
|
28
|
+
const items = Array.isArray(data) ? data : [];
|
|
29
|
+
const omitted = flags.verbose ? 0 : items.filter((d) => typeof d.content === 'string' && d.content !== '').length;
|
|
30
|
+
this.printHuman(flags.verbose
|
|
31
|
+
? data
|
|
32
|
+
: items.map((d) => Object.fromEntries(Object.entries(d).filter(([k]) => k !== 'content'))));
|
|
33
|
+
if (omitted > 0) {
|
|
34
|
+
this.log('');
|
|
35
|
+
this.log(`Text omitted for ${omitted} document(s). Pass --verbose to include it.`);
|
|
36
|
+
}
|
|
37
|
+
const summary = freshnessSummary(items, 'document');
|
|
38
|
+
if (summary.length > 0) {
|
|
39
|
+
this.log('');
|
|
40
|
+
for (const line of summary)
|
|
41
|
+
this.log(line);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return data;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base.js';
|
|
2
|
+
export default class CompileDocMake extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
timeout: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
rush: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
'no-wait': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
token: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
static args: {
|
|
14
|
+
doc_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<unknown>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../../base.js';
|
|
3
|
+
import { FacesAPIError } from '../../../client.js';
|
|
4
|
+
import { pollCompileProgress, progressLine } from '../../../poll.js';
|
|
5
|
+
import { compileCostNote, compileRate, compileStatusOf, makeRefusalMessage, makeScheduleLines, msUntilStart, RUSH_FLAG_DESCRIPTION, seg } from '../../../utils.js';
|
|
6
|
+
export default class CompileDocMake extends BaseCommand {
|
|
7
|
+
static description = 'Compile an existing document and wait for it to finish. A compile may have a scheduled start: it says when, and ' +
|
|
8
|
+
'waits for it; --rush starts it now at the rush rate, and --no-wait returns at once.';
|
|
9
|
+
static flags = {
|
|
10
|
+
...BaseCommand.baseFlags,
|
|
11
|
+
timeout: Flags.integer({ description: 'Compile timeout in seconds, counted from the compile\'s start', default: 600 }),
|
|
12
|
+
rush: Flags.boolean({
|
|
13
|
+
description: RUSH_FLAG_DESCRIPTION,
|
|
14
|
+
default: false,
|
|
15
|
+
}),
|
|
16
|
+
'no-wait': Flags.boolean({
|
|
17
|
+
description: 'Return immediately after triggering compilation. Prints the document ID for manual polling.',
|
|
18
|
+
default: false,
|
|
19
|
+
}),
|
|
20
|
+
};
|
|
21
|
+
static args = {
|
|
22
|
+
doc_id: Args.string({ description: 'Document ID', required: true }),
|
|
23
|
+
};
|
|
24
|
+
async run() {
|
|
25
|
+
const { args, flags } = await this.parse(CompileDocMake);
|
|
26
|
+
const client = this.makeClient(flags);
|
|
27
|
+
const json = this.jsonEnabled();
|
|
28
|
+
try {
|
|
29
|
+
const doc = (await client.get(`/v1/compile/documents/${seg(args.doc_id)}`));
|
|
30
|
+
if (typeof doc.token_count === 'number' && doc.token_count >= 10_000 && doc.synced !== true) {
|
|
31
|
+
const note = compileCostNote(doc.token_count, await compileRate(client));
|
|
32
|
+
if (note)
|
|
33
|
+
process.stderr.write(`${note}\n`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
catch { }
|
|
37
|
+
let makeResponse;
|
|
38
|
+
try {
|
|
39
|
+
makeResponse = await client.post(`/v1/compile/documents/${seg(args.doc_id)}/make`, flags.rush ? { body: { rush: true } } : {});
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
if (err instanceof FacesAPIError) {
|
|
43
|
+
this.error(makeRefusalMessage(err, args.doc_id));
|
|
44
|
+
}
|
|
45
|
+
throw err;
|
|
46
|
+
}
|
|
47
|
+
const queued = compileStatusOf(makeResponse.status) === 'queued';
|
|
48
|
+
const schedule = makeScheduleLines(makeResponse, flags.rush);
|
|
49
|
+
const scheduled = makeResponse.rush !== true && msUntilStart(makeResponse.starts_at) > 0;
|
|
50
|
+
if (!json)
|
|
51
|
+
for (const line of schedule)
|
|
52
|
+
process.stderr.write(`${line}\n`);
|
|
53
|
+
if (flags['no-wait']) {
|
|
54
|
+
if (!json) {
|
|
55
|
+
process.stderr.write(`Compilation started in background${queued ? ' (queued)' : ''}.\n`);
|
|
56
|
+
process.stderr.write(`Poll with: faces compile:doc:get ${args.doc_id} --json\n`);
|
|
57
|
+
}
|
|
58
|
+
return makeResponse;
|
|
59
|
+
}
|
|
60
|
+
if (!json) {
|
|
61
|
+
process.stderr.write(scheduled
|
|
62
|
+
? 'Waiting for the scheduled start; it starts on its own, so stopping here leaves it scheduled.\n' +
|
|
63
|
+
`To start it now instead: faces compile:doc:make ${args.doc_id} --rush\n`
|
|
64
|
+
: `Compiling${queued ? ' (queued, and it starts on its own)' : ''}:\n`);
|
|
65
|
+
}
|
|
66
|
+
let result;
|
|
67
|
+
try {
|
|
68
|
+
result = await pollCompileProgress(client, args.doc_id, {
|
|
69
|
+
timeoutMs: flags.timeout * 1000,
|
|
70
|
+
startsAt: makeResponse.starts_at,
|
|
71
|
+
onProgress: (p) => {
|
|
72
|
+
if (!json)
|
|
73
|
+
process.stderr.write(` ${progressLine(p)}\n`);
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
catch (err) {
|
|
78
|
+
if (err instanceof Error)
|
|
79
|
+
this.error(err.message);
|
|
80
|
+
throw err;
|
|
81
|
+
}
|
|
82
|
+
if (!json)
|
|
83
|
+
process.stderr.write('Done.\n');
|
|
84
|
+
if (result && typeof result === 'object') {
|
|
85
|
+
const r = result;
|
|
86
|
+
if (r.starts_at === undefined && 'starts_at' in makeResponse)
|
|
87
|
+
r.starts_at = makeResponse.starts_at;
|
|
88
|
+
if (r.rush === undefined && 'rush' in makeResponse)
|
|
89
|
+
r.rush = makeResponse.rush;
|
|
90
|
+
}
|
|
91
|
+
if (json)
|
|
92
|
+
this.log(JSON.stringify(result, null, 2));
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base.js';
|
|
2
|
+
export default class CompileDocPause extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
'no-wait': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
timeout: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
token: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
static args: {
|
|
13
|
+
doc_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<unknown>;
|
|
16
|
+
private report;
|
|
17
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../../base.js';
|
|
3
|
+
import { FacesAPIError } from '../../../client.js';
|
|
4
|
+
import { pollUntilPaused } from '../../../poll.js';
|
|
5
|
+
import { seg } from '../../../utils.js';
|
|
6
|
+
export default class CompileDocPause extends BaseCommand {
|
|
7
|
+
static description = 'Ask a running document compilation to stop (preserves progress, resume with make). ' +
|
|
8
|
+
'The compile stops within a few seconds; this waits for it unless --no-wait.';
|
|
9
|
+
static flags = {
|
|
10
|
+
...BaseCommand.baseFlags,
|
|
11
|
+
'no-wait': Flags.boolean({
|
|
12
|
+
description: 'Return as soon as the pause is accepted, without waiting for the compile to stop.',
|
|
13
|
+
default: false,
|
|
14
|
+
}),
|
|
15
|
+
timeout: Flags.integer({ description: 'Seconds to wait for the compile to stop', default: 60 }),
|
|
16
|
+
};
|
|
17
|
+
static args = {
|
|
18
|
+
doc_id: Args.string({ description: 'Document ID', required: true }),
|
|
19
|
+
};
|
|
20
|
+
async run() {
|
|
21
|
+
const { args, flags } = await this.parse(CompileDocPause);
|
|
22
|
+
const client = this.makeClient(flags);
|
|
23
|
+
const json = this.jsonEnabled();
|
|
24
|
+
let data;
|
|
25
|
+
try {
|
|
26
|
+
data = await client.post(`/v1/compile/documents/${seg(args.doc_id)}/pause`);
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
if (err instanceof FacesAPIError)
|
|
30
|
+
this.error(`HTTP ${err.statusCode}: ${err.message}`);
|
|
31
|
+
throw err;
|
|
32
|
+
}
|
|
33
|
+
if (flags['no-wait']) {
|
|
34
|
+
if (!json) {
|
|
35
|
+
process.stderr.write(`Pausing. Poll with: faces compile:doc:get ${args.doc_id} --json\n`);
|
|
36
|
+
}
|
|
37
|
+
return data;
|
|
38
|
+
}
|
|
39
|
+
if (!json)
|
|
40
|
+
process.stderr.write('Pausing');
|
|
41
|
+
const status = await pollUntilPaused(client, args.doc_id, {
|
|
42
|
+
timeoutMs: flags.timeout * 1000,
|
|
43
|
+
onTick: () => {
|
|
44
|
+
if (!json && process.stderr.isTTY)
|
|
45
|
+
process.stderr.write('.');
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
if (!json)
|
|
49
|
+
process.stderr.write('\n');
|
|
50
|
+
if (!json)
|
|
51
|
+
this.log(this.report(status, args.doc_id, flags.timeout));
|
|
52
|
+
return { ...data, status: status ?? null };
|
|
53
|
+
}
|
|
54
|
+
report(status, id, timeout) {
|
|
55
|
+
switch (status) {
|
|
56
|
+
case 'paused': {
|
|
57
|
+
return `Paused. Resume with: faces compile:doc:make ${id}`;
|
|
58
|
+
}
|
|
59
|
+
case 'compiled': {
|
|
60
|
+
return 'Compile finished before the pause took effect. Nothing to resume.';
|
|
61
|
+
}
|
|
62
|
+
case 'failed': {
|
|
63
|
+
return 'Compile failed before the pause took effect.';
|
|
64
|
+
}
|
|
65
|
+
case 'not_compiled':
|
|
66
|
+
case null: {
|
|
67
|
+
return 'Stopped. The compile is no longer running.';
|
|
68
|
+
}
|
|
69
|
+
default: {
|
|
70
|
+
return `Still stopping after ${timeout}s. Poll with: faces compile:doc:get ${id} --json`;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base.js';
|
|
2
|
+
export default class CompileDocReset extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
token: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
static args: {
|
|
12
|
+
doc_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<unknown>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../../base.js';
|
|
3
|
+
import { FacesAPIError } from '../../../client.js';
|
|
4
|
+
import { seg } from '../../../utils.js';
|
|
5
|
+
export default class CompileDocReset extends BaseCommand {
|
|
6
|
+
static description = 'Withdraw a document from the face while keeping it. What it contributed ' +
|
|
7
|
+
'leaves the face, and it leaves the document itself untouched for recompiling. This is how to undo a ' +
|
|
8
|
+
'compile that went wrong without deleting the material and paying to upload it again.';
|
|
9
|
+
static flags = {
|
|
10
|
+
...BaseCommand.baseFlags,
|
|
11
|
+
yes: Flags.boolean({ description: 'Skip confirmation', default: false }),
|
|
12
|
+
};
|
|
13
|
+
static args = {
|
|
14
|
+
doc_id: Args.string({ description: 'Document ID', required: true }),
|
|
15
|
+
};
|
|
16
|
+
async run() {
|
|
17
|
+
const { args, flags } = await this.parse(CompileDocReset);
|
|
18
|
+
const client = this.makeClient(flags);
|
|
19
|
+
let data;
|
|
20
|
+
try {
|
|
21
|
+
data = await client.post(`/v1/compile/documents/${seg(args.doc_id)}/reset`);
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
if (err instanceof FacesAPIError)
|
|
25
|
+
this.error(`HTTP ${err.statusCode}: ${err.message}`);
|
|
26
|
+
throw err;
|
|
27
|
+
}
|
|
28
|
+
if (!this.jsonEnabled()) {
|
|
29
|
+
this.log(`Reset. Recompile with: faces compile:doc:make ${args.doc_id}`);
|
|
30
|
+
}
|
|
31
|
+
return data;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base.js';
|
|
2
|
+
export default class CompileImport extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
url: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
type: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
perspective: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
medium: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'face-speaker': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'no-wait': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
token: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
};
|
|
16
|
+
static args: {
|
|
17
|
+
face_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
18
|
+
};
|
|
19
|
+
run(): Promise<unknown>;
|
|
20
|
+
}
|