@leemour/max-cli 0.3.0 → 0.4.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.
- package/README.md +7 -0
- package/dist/cache/store.d.ts +4 -7
- package/dist/cache/store.d.ts.map +1 -1
- package/dist/cache/store.js +18 -3
- package/dist/cache/store.js.map +1 -1
- package/dist/client.d.ts +18 -9
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +92 -36
- package/dist/client.js.map +1 -1
- package/dist/commands/account.js +1 -1
- package/dist/commands/account.js.map +1 -1
- package/dist/commands/body.d.ts +23 -0
- package/dist/commands/body.d.ts.map +1 -0
- package/dist/commands/body.js +36 -0
- package/dist/commands/body.js.map +1 -0
- package/dist/commands/cache.js +2 -2
- package/dist/commands/cache.js.map +1 -1
- package/dist/commands/chats.js +1 -1
- package/dist/commands/chats.js.map +1 -1
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +55 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/contacts.js +2 -2
- package/dist/commands/contacts.js.map +1 -1
- package/dist/commands/context.d.ts +23 -2
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +42 -7
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/doctor.d.ts +18 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +72 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/messages.d.ts.map +1 -1
- package/dist/commands/messages.js +65 -5
- package/dist/commands/messages.js.map +1 -1
- package/dist/commands/runs.d.ts.map +1 -1
- package/dist/commands/runs.js +4 -6
- package/dist/commands/runs.js.map +1 -1
- package/dist/commands/session.js +2 -2
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/skill.d.ts +3 -0
- package/dist/commands/skill.d.ts.map +1 -0
- package/dist/commands/skill.js +23 -0
- package/dist/commands/skill.js.map +1 -0
- package/dist/config.d.ts +36 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +99 -9
- package/dist/config.js.map +1 -1
- package/dist/deadline.d.ts +30 -0
- package/dist/deadline.d.ts.map +1 -0
- package/dist/deadline.js +45 -0
- package/dist/deadline.js.map +1 -0
- package/dist/diagnose.d.ts +68 -0
- package/dist/diagnose.d.ts.map +1 -0
- package/dist/diagnose.js +115 -0
- package/dist/diagnose.js.map +1 -0
- package/dist/domain/models.d.ts +10 -0
- package/dist/domain/models.d.ts.map +1 -1
- package/dist/domain/models.js +11 -1
- package/dist/domain/models.js.map +1 -1
- package/dist/program.d.ts +2 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +11 -0
- package/dist/program.js.map +1 -1
- package/dist/protocol/connection.d.ts.map +1 -1
- package/dist/protocol/connection.js +9 -0
- package/dist/protocol/connection.js.map +1 -1
- package/dist/rendering/messages.d.ts +3 -3
- package/dist/rendering/messages.d.ts.map +1 -1
- package/dist/rendering/messages.js +2 -1
- package/dist/rendering/messages.js.map +1 -1
- package/dist/testing/mock-max.d.ts.map +1 -1
- package/dist/testing/mock-max.js +16 -2
- package/dist/testing/mock-max.js.map +1 -1
- package/dist/testing/sandbox.js +8 -1
- package/dist/testing/sandbox.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -1
- package/skills/max-cli/SKILL.md +83 -0
package/dist/commands/chats.js
CHANGED
|
@@ -10,7 +10,7 @@ export const chatsCommand = () => {
|
|
|
10
10
|
.option("--kind <dialog|group|channel>", "only chats of this kind")
|
|
11
11
|
.action(async function () {
|
|
12
12
|
const options = this.optsWithGlobals();
|
|
13
|
-
const context = forCommand(
|
|
13
|
+
const context = forCommand(this);
|
|
14
14
|
const { renderer, settings, createClient, run } = context;
|
|
15
15
|
const cache = await openProfileCache(settings.profile, { onProblem: (message) => renderer.note(message) });
|
|
16
16
|
await run("chats list", async (events) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chats.js","sourceRoot":"","sources":["../../src/commands/chats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE5D,MAAM,CAAC,MAAM,YAAY,GAAG,GAAY,EAAE;IACxC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,8BAA8B,CAAC,CAAA;IAEhF,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,8BAA8B,CAAC,CAAC;SAC5E,MAAM,CAAC,iBAAiB,EAAE,4DAA4D,CAAC;SACvF,MAAM,CAAC,+BAA+B,EAAE,yBAAyB,CAAC;SAClE,MAAM,CAAC,KAAK;QACX,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,EAAE,CAAA;QACtC,MAAM,OAAO,GAAG,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"chats.js","sourceRoot":"","sources":["../../src/commands/chats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE5D,MAAM,CAAC,MAAM,YAAY,GAAG,GAAY,EAAE;IACxC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,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,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;iBACxE,CAAC,CACH,CAAA;YACH,CAAC;oBAAS,CAAC;gBACT,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;gBACpB,KAAK,EAAE,KAAK,EAAE,CAAA;YAChB,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEJ,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAY,EAAE;IAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAA;IAC1C,IAAI,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,OAAO,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAA;IACpF,MAAM,IAAI,QAAQ,CAAC,kBAAkB,EAAE,+CAA+C,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;AACzG,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAcnC,eAAO,MAAM,aAAa,QAAO,OAqChC,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { pathsAreOverridden, resolvePaths } from "@leemour/cli-core";
|
|
4
|
+
import { Command } from "commander";
|
|
5
|
+
import { forCommand } from "./context.js";
|
|
6
|
+
const SHOWN = [
|
|
7
|
+
"limit",
|
|
8
|
+
"timeoutMs",
|
|
9
|
+
"commandTimeoutMs",
|
|
10
|
+
"color",
|
|
11
|
+
"senderColors",
|
|
12
|
+
"record",
|
|
13
|
+
"keepRunsForDays",
|
|
14
|
+
];
|
|
15
|
+
export const configCommand = () => {
|
|
16
|
+
const command = new Command("config").description("the settings in force, and where each one came from");
|
|
17
|
+
/**
|
|
18
|
+
* Printed whole: no field the configuration accepts can hold a secret (`src/config.ts`). Whether
|
|
19
|
+
* a profile has a token is not here — reading the keyring is `max doctor`'s (`CLI-12`).
|
|
20
|
+
*/
|
|
21
|
+
command
|
|
22
|
+
.command("show")
|
|
23
|
+
.description("the profile, the profiles that exist, and each setting with where it came from")
|
|
24
|
+
.action(function () {
|
|
25
|
+
const { settings, renderer } = forCommand(this);
|
|
26
|
+
const overridden = pathsAreOverridden({ appName: "max-cli", prefix: "MAX" });
|
|
27
|
+
renderer.result({
|
|
28
|
+
profile: settings.profile,
|
|
29
|
+
profileFrom: settings.sources.profile,
|
|
30
|
+
profiles: [...new Set([...settings.configuredProfiles, ...profilesWithState()])].sort(),
|
|
31
|
+
configFile: settings.configPath,
|
|
32
|
+
configFound: settings.configFound,
|
|
33
|
+
pathsOverridden: overridden,
|
|
34
|
+
settings: SHOWN.map((setting) => ({
|
|
35
|
+
setting,
|
|
36
|
+
value: settings[setting] ?? null,
|
|
37
|
+
from: settings.sources[setting],
|
|
38
|
+
})),
|
|
39
|
+
});
|
|
40
|
+
if (overridden) {
|
|
41
|
+
renderer.note("MAX_CONFIG_DIR, MAX_STATE_DIR or MAX_CACHE_DIR is set — a profile's keyring entry is not the usual one, " +
|
|
42
|
+
"so a session made without them reads as none");
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
return command;
|
|
46
|
+
};
|
|
47
|
+
const profilesWithState = () => {
|
|
48
|
+
const dir = join(resolvePaths({ appName: "max-cli", prefix: "MAX" }).state, "profiles");
|
|
49
|
+
if (!existsSync(dir))
|
|
50
|
+
return [];
|
|
51
|
+
return readdirSync(dir)
|
|
52
|
+
.filter((name) => name.endsWith(".json"))
|
|
53
|
+
.map((name) => name.slice(0, -".json".length));
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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e,EAAE,UAAU;YAC3B,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAChC,OAAO;gBACP,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,IAAI;gBAChC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC;aAChC,CAAC,CAAC;SACJ,CAAC,CAAA;QAEF,IAAI,UAAU,EAAE,CAAC;YACf,QAAQ,CAAC,IAAI,CACX,0GAA0G;gBACxG,8CAA8C,CACjD,CAAA;QACH,CAAC;IACH,CAAC,CAAC,CAAA;IAEJ,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,GAAa,EAAE;IACvC,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;IACvF,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAA;IAC/B,OAAO,WAAW,CAAC,GAAG,CAAC;SACpB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;SACxC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;AAClD,CAAC,CAAA"}
|
|
@@ -17,7 +17,7 @@ export const contactsCommand = () => {
|
|
|
17
17
|
.option("--search <text>", "only people whose name or @username contains this; at least 3 characters")
|
|
18
18
|
.action(async function () {
|
|
19
19
|
const options = this.optsWithGlobals();
|
|
20
|
-
const context = forCommand(
|
|
20
|
+
const context = forCommand(this);
|
|
21
21
|
const { renderer, settings, createClient, run } = context;
|
|
22
22
|
const cache = await openProfileCache(settings.profile, { onProblem: (message) => renderer.note(message) });
|
|
23
23
|
const order = orderFrom(options.order);
|
|
@@ -48,7 +48,7 @@ export const contactsCommand = () => {
|
|
|
48
48
|
.command("sync")
|
|
49
49
|
.description("forget where the last sync left off and take the whole list again")
|
|
50
50
|
.action(async function () {
|
|
51
|
-
const { renderer, settings, createClient, run } = forCommand(this
|
|
51
|
+
const { renderer, settings, createClient, run } = forCommand(this);
|
|
52
52
|
const cache = await openProfileCache(settings.profile, { onProblem: (message) => renderer.note(message) });
|
|
53
53
|
await run("contacts sync", async (events) => {
|
|
54
54
|
const client = createClient({ events, ...(cache ? { cache } : {}) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contacts.js","sourceRoot":"","sources":["../../src/commands/contacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE5D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAY,EAAE;IAC3C,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,wCAAwC,CAAC,CAAA;IAE7F,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,wCAAwC,CAAC,CAAC;SACtF,MAAM,CAAC,uBAAuB,EAAE,4CAA4C,CAAC;SAC7E,MAAM,CAAC,iBAAiB,EAAE,0EAA0E,CAAC;SACrG,MAAM,CAAC,KAAK;QACX,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,EAAE,CAAA;QACtC,MAAM,OAAO,GAAG,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"cont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;YAEpE,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAA;gBAC5C,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;gBACxB,QAAQ,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,KAAK,SAAS,OAAO,CAAC,OAAO,aAAa,OAAO,CAAC,KAAK,eAAe,CAAC,CAAA;YACrG,CAAC;oBAAS,CAAC;gBACT,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;gBACpB,KAAK,EAAE,KAAK,EAAE,CAAA;YAChB,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEJ,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,SAAS,GAAG,CAAC,KAAc,EAAe,EAAE;IAChD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAA;IACxC,IAAI,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,KAAK,CAAA;IACxD,MAAM,IAAI,QAAQ,CAAC,kBAAkB,EAAE,0CAA0C,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;AACpG,CAAC,CAAA"}
|
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
import type { Renderer, RenderFormat, Streams } from "@leemour/cli-core";
|
|
2
|
+
import type { Command } from "commander";
|
|
2
3
|
import { MaxClient, type MaxClientOptions } from "../client.js";
|
|
3
|
-
import { type
|
|
4
|
+
import { type Settings } from "../config.js";
|
|
4
5
|
import { SessionStore } from "../session/store.js";
|
|
6
|
+
/**
|
|
7
|
+
* What a command writes to and talks through, when it is not the real terminal, keyring and MAX.
|
|
8
|
+
* `run` sets it on the program; without it everything is the real thing.
|
|
9
|
+
*/
|
|
10
|
+
export interface Environment {
|
|
11
|
+
streams?: Streams;
|
|
12
|
+
tty?: boolean;
|
|
13
|
+
/** A store over a memory keyring, so a test never touches the owner's. */
|
|
14
|
+
store?: (profile: string) => SessionStore;
|
|
15
|
+
/** A fresh connection per client — to a scripted MAX in a test. */
|
|
16
|
+
connection?: () => NonNullable<MaxClientOptions["connection"]>;
|
|
17
|
+
}
|
|
18
|
+
export declare const provide: (program: Command, environment: Environment) => void;
|
|
19
|
+
/** For the commands that print but never need settings or a client. */
|
|
20
|
+
export declare const outputFor: (command: Command) => {
|
|
21
|
+
format: "json" | "jsonl" | "pretty";
|
|
22
|
+
color: boolean;
|
|
23
|
+
streams: Streams;
|
|
24
|
+
renderer: Renderer;
|
|
25
|
+
};
|
|
5
26
|
export interface CommandContext {
|
|
6
27
|
settings: Settings;
|
|
7
28
|
renderer: Renderer;
|
|
@@ -33,5 +54,5 @@ export interface CommandContext {
|
|
|
33
54
|
* The cache is not opened here on purpose — only the reading commands want one, and opening it
|
|
34
55
|
* would create a database file for `session end`, which will never read it.
|
|
35
56
|
*/
|
|
36
|
-
export declare const forCommand: (
|
|
57
|
+
export declare const forCommand: (command: Command) => CommandContext;
|
|
37
58
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/commands/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/commands/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/D,OAA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24 @@
|
|
|
1
1
|
import { MaxClient } from "../client.js";
|
|
2
2
|
import { resolveSettings } from "../config.js";
|
|
3
|
+
import { withDeadline } from "../deadline.js";
|
|
3
4
|
import { resolveOutput } from "../output.js";
|
|
5
|
+
import { rootOf } from "../profile.js";
|
|
4
6
|
import { recorded } from "../runs/recording.js";
|
|
5
7
|
import { SessionStore } from "../session/store.js";
|
|
8
|
+
const environments = new WeakMap();
|
|
9
|
+
export const provide = (program, environment) => {
|
|
10
|
+
environments.set(program, environment);
|
|
11
|
+
};
|
|
12
|
+
const environmentOf = (command) => environments.get(rootOf(command)) ?? {};
|
|
13
|
+
/** For the commands that print but never need settings or a client. */
|
|
14
|
+
export const outputFor = (command) => {
|
|
15
|
+
const { streams, tty } = environmentOf(command);
|
|
16
|
+
return resolveOutput({
|
|
17
|
+
...command.optsWithGlobals(),
|
|
18
|
+
...(streams ? { streams } : {}),
|
|
19
|
+
...(tty === undefined ? {} : { tty }),
|
|
20
|
+
});
|
|
21
|
+
};
|
|
6
22
|
/**
|
|
7
23
|
* Everything a command needs, resolved once — and **the only place a `MaxClient` is built.**
|
|
8
24
|
*
|
|
@@ -18,10 +34,18 @@ import { SessionStore } from "../session/store.js";
|
|
|
18
34
|
* The cache is not opened here on purpose — only the reading commands want one, and opening it
|
|
19
35
|
* would create a database file for `session end`, which will never read it.
|
|
20
36
|
*/
|
|
21
|
-
export const forCommand = (
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
37
|
+
export const forCommand = (command) => {
|
|
38
|
+
const environment = environmentOf(command);
|
|
39
|
+
const settings = resolveSettings(command.optsWithGlobals());
|
|
40
|
+
const { renderer, format, color, streams } = resolveOutput({
|
|
41
|
+
...settings,
|
|
42
|
+
...(environment.streams ? { streams: environment.streams } : {}),
|
|
43
|
+
...(environment.tty === undefined ? {} : { tty: environment.tty }),
|
|
44
|
+
});
|
|
45
|
+
const store = environment.store?.(settings.profile) ?? new SessionStore({ profile: settings.profile });
|
|
46
|
+
// Every client this command builds, so the deadline can shut them. There is always one; relying
|
|
47
|
+
// on that is what makes the second one, some day, the leak that keeps the process alive.
|
|
48
|
+
const clients = [];
|
|
25
49
|
return {
|
|
26
50
|
settings,
|
|
27
51
|
renderer,
|
|
@@ -29,14 +53,25 @@ export const forCommand = (flags) => {
|
|
|
29
53
|
color,
|
|
30
54
|
streams,
|
|
31
55
|
store,
|
|
32
|
-
createClient: (extra = {}) =>
|
|
33
|
-
|
|
56
|
+
createClient: (extra = {}) => {
|
|
57
|
+
const client = new MaxClient({
|
|
58
|
+
store,
|
|
59
|
+
timeoutMs: settings.timeoutMs,
|
|
60
|
+
warn: renderer.note,
|
|
61
|
+
...(environment.connection ? { connection: environment.connection() } : {}),
|
|
62
|
+
...extra,
|
|
63
|
+
});
|
|
64
|
+
clients.push(client);
|
|
65
|
+
return client;
|
|
66
|
+
},
|
|
67
|
+
run: (command, body) => withDeadline(settings.commandTimeoutMs, clients, () => recorded({
|
|
34
68
|
command,
|
|
35
69
|
profile: settings.profile,
|
|
36
70
|
options: { record: settings.record, trace: settings.trace },
|
|
37
71
|
format,
|
|
72
|
+
streams,
|
|
38
73
|
keepDays: settings.keepRunsForDays,
|
|
39
|
-
}, body),
|
|
74
|
+
}, body)),
|
|
40
75
|
};
|
|
41
76
|
};
|
|
42
77
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/commands/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/commands/context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAyB,MAAM,cAAc,CAAA;AAC/D,OAAO,EAAoB,eAAe,EAAiB,MAAM,cAAc,CAAA;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,MAAM,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,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE;YAC3D,MAAM;YACN,OAAO;YACP,QAAQ,EAAE,QAAQ,CAAC,eAAe;SACnC,EACD,IAAI,CACL,CACF;KACJ,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
/**
|
|
3
|
+
* The state every other command depends on, read from disk and **never from MAX**.
|
|
4
|
+
*
|
|
5
|
+
* ⚠ **It must answer when everything is broken**, because that is the only time anybody runs it.
|
|
6
|
+
* No session, no configuration file, a cache written by a newer `max`, a keyring that will not
|
|
7
|
+
* open — each is a field in the answer and none is an exception. A diagnosis that fails with
|
|
8
|
+
* `authentication_error` when asked "do I have a session" is worth nothing.
|
|
9
|
+
*
|
|
10
|
+
* It is a thin shell over `diagnose` on purpose: the gathering is worth asserting on field by
|
|
11
|
+
* field, and a command body is a worse place to do that from than a function that takes its
|
|
12
|
+
* environment as arguments.
|
|
13
|
+
*
|
|
14
|
+
* `max config show` is the neighbouring half and does not overlap: that one reads what was
|
|
15
|
+
* configured, this one reads what exists.
|
|
16
|
+
*/
|
|
17
|
+
export declare const doctorCommand: () => Command;
|
|
18
|
+
//# sourceMappingURL=doctor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAInC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,QAAO,OA6ChC,CAAA"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { diagnose } from "../diagnose.js";
|
|
3
|
+
import { forCommand } from "./context.js";
|
|
4
|
+
/**
|
|
5
|
+
* The state every other command depends on, read from disk and **never from MAX**.
|
|
6
|
+
*
|
|
7
|
+
* ⚠ **It must answer when everything is broken**, because that is the only time anybody runs it.
|
|
8
|
+
* No session, no configuration file, a cache written by a newer `max`, a keyring that will not
|
|
9
|
+
* open — each is a field in the answer and none is an exception. A diagnosis that fails with
|
|
10
|
+
* `authentication_error` when asked "do I have a session" is worth nothing.
|
|
11
|
+
*
|
|
12
|
+
* It is a thin shell over `diagnose` on purpose: the gathering is worth asserting on field by
|
|
13
|
+
* field, and a command body is a worse place to do that from than a function that takes its
|
|
14
|
+
* environment as arguments.
|
|
15
|
+
*
|
|
16
|
+
* `max config show` is the neighbouring half and does not overlap: that one reads what was
|
|
17
|
+
* configured, this one reads what exists.
|
|
18
|
+
*/
|
|
19
|
+
export const doctorCommand = () => {
|
|
20
|
+
const command = new Command("doctor").description("the state this installation is in, without contacting MAX");
|
|
21
|
+
command.action(async function () {
|
|
22
|
+
const { renderer, settings, format, run, store } = forCommand(this);
|
|
23
|
+
await run("doctor", async () => {
|
|
24
|
+
const report = await diagnose({
|
|
25
|
+
profile: settings.profile,
|
|
26
|
+
// Reading the keyring is the one thing here that can prompt or hang on a locked keyring,
|
|
27
|
+
// so its failure is "no token found" rather than a failed command.
|
|
28
|
+
hasKeyringToken: () => {
|
|
29
|
+
try {
|
|
30
|
+
return store.readToken() !== undefined;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
renderer.result(format === "pretty" ? forPerson(report, settings.profile) : report);
|
|
38
|
+
// ⚠ Said whenever the environment moved the keyring, because this is the one failure with no
|
|
39
|
+
// other symptom: the profile is there, the login happened, and the answer is "no session".
|
|
40
|
+
if (report.keyring.movedByEnvironment) {
|
|
41
|
+
renderer.note("MAX_CONFIG_DIR, MAX_STATE_DIR or MAX_CACHE_DIR is set, which changes the keyring entry — " +
|
|
42
|
+
"a login done without them is invisible here, and the other way round");
|
|
43
|
+
}
|
|
44
|
+
if (!report.cache.readable) {
|
|
45
|
+
renderer.note(`the local copy was written by a newer max (schema ${report.cache.schemaVersion}, this one speaks ` +
|
|
46
|
+
`${report.cache.speaks}) — commands still work, but the copy is ignored until \`max cache clear\``);
|
|
47
|
+
}
|
|
48
|
+
if (!report.token.present) {
|
|
49
|
+
renderer.note(`no token for this profile — \`max ${settings.profile} session start\` stores one`);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
return command;
|
|
54
|
+
};
|
|
55
|
+
/** One line per row: the pretty renderer prints a flat object and does not descend into one. */
|
|
56
|
+
const forPerson = (report, profile) => ({
|
|
57
|
+
profile,
|
|
58
|
+
token: report.token.present ? `yes, from the ${report.token.from}` : "none",
|
|
59
|
+
keyring: report.keyring.movedByEnvironment
|
|
60
|
+
? `${report.keyring.service} (moved by the environment)`
|
|
61
|
+
: report.keyring.service,
|
|
62
|
+
"logged in": report.session.exists
|
|
63
|
+
? `${report.session.logins ?? 0} time(s)${report.session.lastLoginAt ? `, last ${report.session.lastLoginAt}` : ""}`
|
|
64
|
+
: "never on this machine",
|
|
65
|
+
"account known": report.session.viewerId,
|
|
66
|
+
"profiles logged in": report.loggedInProfiles.length === 0 ? "none" : report.loggedInProfiles.join(", "),
|
|
67
|
+
"local copy": report.cache.exists
|
|
68
|
+
? `schema ${report.cache.schemaVersion ?? "unreadable"}, this max speaks ${report.cache.speaks}`
|
|
69
|
+
: "not created yet",
|
|
70
|
+
runs: `${report.runs.kept} kept in ${report.runs.directory}`,
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC;;;;;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CAAC,KAAK,CAAC,MAAM,EAAE;QAChG,CAAC,CAAC,iBAAiB;IACrB,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,YAAY,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE;CAC7D,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/commands/messages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/commands/messages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAQnC,eAAO,MAAM,eAAe,QAAO,OAiKlC,CAAA"}
|
|
@@ -2,6 +2,7 @@ import { CliError } from "@leemour/cli-core";
|
|
|
2
2
|
import { Command } from "commander";
|
|
3
3
|
import { openProfileCache } from "../cache/index.js";
|
|
4
4
|
import { renderMessages } from "../rendering/messages.js";
|
|
5
|
+
import { readBody } from "./body.js";
|
|
5
6
|
import { forCommand } from "./context.js";
|
|
6
7
|
import { renderPage } from "./paging.js";
|
|
7
8
|
export const messagesCommand = () => {
|
|
@@ -21,7 +22,7 @@ export const messagesCommand = () => {
|
|
|
21
22
|
.option("--before <id-or-time>", "read what came before this message id, or this ISO 8601 time")
|
|
22
23
|
.action(async function (chat) {
|
|
23
24
|
const options = this.optsWithGlobals();
|
|
24
|
-
const context = forCommand(
|
|
25
|
+
const context = forCommand(this);
|
|
25
26
|
const { renderer, settings, createClient, run } = context;
|
|
26
27
|
const cache = await openProfileCache(settings.profile, { onProblem: (message) => renderer.note(message) });
|
|
27
28
|
await run("messages list", async (events) => {
|
|
@@ -56,7 +57,7 @@ export const messagesCommand = () => {
|
|
|
56
57
|
.option("--limit <n>", "how many to show", (value) => Number.parseInt(value, 10))
|
|
57
58
|
.action(async function (text) {
|
|
58
59
|
const options = this.optsWithGlobals();
|
|
59
|
-
const context = forCommand(
|
|
60
|
+
const context = forCommand(this);
|
|
60
61
|
const { renderer, settings, createClient, run } = context;
|
|
61
62
|
const cache = await openProfileCache(settings.profile, { onProblem: (message) => renderer.note(message) });
|
|
62
63
|
await run("messages search", async (events) => {
|
|
@@ -80,17 +81,39 @@ export const messagesCommand = () => {
|
|
|
80
81
|
}
|
|
81
82
|
});
|
|
82
83
|
});
|
|
84
|
+
command
|
|
85
|
+
.command("show")
|
|
86
|
+
.argument("<chat>", "chat id, or part of a chat name")
|
|
87
|
+
.argument("<message>", "message id")
|
|
88
|
+
.description("one message by its id")
|
|
89
|
+
.action(async function (chat, messageId) {
|
|
90
|
+
await readWindow(this, chat, messageId, { before: 0, after: 0 }, "messages show");
|
|
91
|
+
});
|
|
92
|
+
command
|
|
93
|
+
.command("context")
|
|
94
|
+
.argument("<chat>", "chat id, or part of a chat name")
|
|
95
|
+
.argument("<message>", "message id")
|
|
96
|
+
.description("a message and what came either side of it, oldest first")
|
|
97
|
+
.option("--before <n>", "how many before it", count, 5)
|
|
98
|
+
.option("--after <n>", "how many after it", count, 5)
|
|
99
|
+
.action(async function (chat, messageId) {
|
|
100
|
+
const { before, after } = this.opts();
|
|
101
|
+
await readWindow(this, chat, messageId, { before, after }, "messages context");
|
|
102
|
+
});
|
|
83
103
|
/**
|
|
84
104
|
* One message, one command, no retry.
|
|
85
105
|
*
|
|
86
106
|
* There is no `--dry-run` here: the target and the text are both in the line the person typed, so
|
|
87
107
|
* a preview would restate the command back at them (REQUIREMENTS §21). What this command does owe
|
|
88
108
|
* the caller is honesty about an outcome it does not know — see `MaxClient.messages.send`.
|
|
109
|
+
*
|
|
110
|
+
* **The body may come from a pipe instead**, by leaving the argument off — `readBody` says why
|
|
111
|
+
* argv is the wrong place for it and why omission is the signal rather than a flag.
|
|
89
112
|
*/
|
|
90
113
|
command
|
|
91
114
|
.command("send")
|
|
92
115
|
.argument("<chat>", "chat id, or part of a chat name")
|
|
93
|
-
.argument("
|
|
116
|
+
.argument("[text]", "what to say; leave it off to read the message from stdin")
|
|
94
117
|
.description("send one text message")
|
|
95
118
|
.option("--cid <n>", "reuse a client id from an earlier ambiguous send; MAX collapses the duplicate", (value) => Number.parseInt(value, 10))
|
|
96
119
|
// `notify` is part of MSG_SEND and has always been sent as `true`. It is the one send option
|
|
@@ -99,13 +122,16 @@ export const messagesCommand = () => {
|
|
|
99
122
|
.option("--silent", "deliver without a notification")
|
|
100
123
|
.action(async function (chat, text) {
|
|
101
124
|
const options = this.optsWithGlobals();
|
|
102
|
-
const { renderer, settings, createClient, run } = forCommand(
|
|
125
|
+
const { renderer, settings, createClient, run } = forCommand(this);
|
|
126
|
+
// Before the run directory and before the socket: a body we cannot read is a command that
|
|
127
|
+
// never attempted anything, so there is nothing to record and nothing to close.
|
|
128
|
+
const body = text ?? (await readBody());
|
|
103
129
|
const cache = await openProfileCache(settings.profile, { onProblem: (message) => renderer.note(message) });
|
|
104
130
|
await run("messages send", async (events) => {
|
|
105
131
|
const client = createClient({ events, ...(cache ? { cache } : {}) });
|
|
106
132
|
try {
|
|
107
133
|
const chatId = await client.chats.resolve(chat);
|
|
108
|
-
const sent = await client.messages.send(chatId,
|
|
134
|
+
const sent = await client.messages.send(chatId, body, {
|
|
109
135
|
...(options.cid === undefined ? {} : { cid: options.cid }),
|
|
110
136
|
...(options.silent === true ? { notify: false } : {}),
|
|
111
137
|
});
|
|
@@ -138,4 +164,38 @@ const offlineChat = (reference) => {
|
|
|
138
164
|
throw new CliError("validation_error", `\`messages search --chat\` takes a chat id, not a name — searching never connects, and a name ` +
|
|
139
165
|
`can only be resolved by asking MAX. \`max chats list --search ${trimmed}\` gives you the id.`);
|
|
140
166
|
};
|
|
167
|
+
const count = (value) => {
|
|
168
|
+
const parsed = Number.parseInt(value, 10);
|
|
169
|
+
if (!Number.isInteger(parsed) || parsed < 0 || parsed > 100) {
|
|
170
|
+
throw new CliError("validation_error", `expected a number from 0 to 100, not "${value}"`);
|
|
171
|
+
}
|
|
172
|
+
return parsed;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* `show` is a window of none either side. **In JSON the one asked for carries `anchor: true`**
|
|
176
|
+
* (`NEED-131`); `show` answers the bare message, `context` an object holding the window.
|
|
177
|
+
*/
|
|
178
|
+
const readWindow = async (command, chat, messageId, window, name) => {
|
|
179
|
+
const context = forCommand(command);
|
|
180
|
+
const { renderer, settings, createClient, run, format, streams } = context;
|
|
181
|
+
const cache = await openProfileCache(settings.profile, { onProblem: (message) => renderer.note(message) });
|
|
182
|
+
await run(name, async (events) => {
|
|
183
|
+
const client = createClient({ events, ...(cache ? { cache } : {}) });
|
|
184
|
+
try {
|
|
185
|
+
const chatId = await client.chats.resolve(chat);
|
|
186
|
+
const found = await client.messages.around(chatId, messageId.trim(), window);
|
|
187
|
+
const single = window.before === 0 && window.after === 0;
|
|
188
|
+
if (format === "pretty")
|
|
189
|
+
streams.data(feed(context)(found));
|
|
190
|
+
else if (format === "jsonl")
|
|
191
|
+
renderer.stream(found);
|
|
192
|
+
else
|
|
193
|
+
renderer.result(single ? found[0] : { items: found });
|
|
194
|
+
}
|
|
195
|
+
finally {
|
|
196
|
+
await client.close();
|
|
197
|
+
cache?.close();
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
};
|
|
141
201
|
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/commands/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAuB,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAA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CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;QAC5D,CAAC;gBAAS,CAAC;YACT,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;YACpB,KAAK,EAAE,KAAK,EAAE,CAAA;QAChB,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/commands/runs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAInC;;;;;GAKG;AACH,eAAO,MAAM,WAAW,QAAO,
|
|
1
|
+
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/commands/runs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAInC;;;;;GAKG;AACH,eAAO,MAAM,WAAW,QAAO,OA8C9B,CAAA"}
|
package/dist/commands/runs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CliError } from "@leemour/cli-core";
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
-
import { resolveOutput } from "../output.js";
|
|
4
3
|
import { findRun, listRuns, readEvents, runsDirFor } from "../runs/run.js";
|
|
4
|
+
import { outputFor } from "./context.js";
|
|
5
5
|
/**
|
|
6
6
|
* What this tool did, when it was asked to keep the record.
|
|
7
7
|
*
|
|
@@ -16,7 +16,7 @@ export const runsCommand = () => {
|
|
|
16
16
|
.option("--limit <n>", "how many to show", (value) => Number.parseInt(value, 10), 20)
|
|
17
17
|
.action(function () {
|
|
18
18
|
const options = this.optsWithGlobals();
|
|
19
|
-
const { renderer } =
|
|
19
|
+
const { renderer } = outputFor(this);
|
|
20
20
|
const runs = listRuns(runsDirFor());
|
|
21
21
|
renderer.result(runs.slice(0, options.limit));
|
|
22
22
|
// An empty list reads as broken otherwise, and the reason is that nothing asked for a
|
|
@@ -30,8 +30,7 @@ export const runsCommand = () => {
|
|
|
30
30
|
.argument("<run-id>", "an id from `max runs list`")
|
|
31
31
|
.description("one run: what it was, and one line per request")
|
|
32
32
|
.action(function (id) {
|
|
33
|
-
const
|
|
34
|
-
const { renderer } = resolveOutput(options);
|
|
33
|
+
const { renderer } = outputFor(this);
|
|
35
34
|
const found = runOrRefuse(id);
|
|
36
35
|
// Both, because neither answers the question on its own: the metadata says how it ended and
|
|
37
36
|
// the events say where it went.
|
|
@@ -42,8 +41,7 @@ export const runsCommand = () => {
|
|
|
42
41
|
.argument("<run-id>", "an id from `max runs list`")
|
|
43
42
|
.description("the directory holding one run")
|
|
44
43
|
.action(function (id) {
|
|
45
|
-
const
|
|
46
|
-
const { renderer } = resolveOutput(options);
|
|
44
|
+
const { renderer } = outputFor(this);
|
|
47
45
|
// One JSON value on stdout here too, with no exception for convenience (`NEED-88`): a script
|
|
48
46
|
// reads `--json | jq -r .path`, and a terminal prints the bare path as a labelled line.
|
|
49
47
|
renderer.result({ path: runOrRefuse(id).dir });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../src/commands/runs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../src/commands/runs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC;;;;;GA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,EAAE,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;IAC3G,CAAC,CAAC,CAAA;IAEJ,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,QAAQ,CAAC,UAAU,EAAE,4BAA4B,CAAC;SAClD,WAAW,CAAC,+BAA+B,CAAC;SAC5C,MAAM,CAAC,UAAyB,EAAU;QACzC,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,CAAA;QAEpC,6FAA6F;QAC7F,wFAAwF;QACxF,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAA;IAChD,CAAC,CAAC,CAAA;IAEJ,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,QAAQ,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,EAA2B,EAAE,EAAE,CAAC,KAAK,CAAA;AAEjG,MAAM,WAAW,GAAG,CAAC,EAAU,EAAE,EAAE;IACjC,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,EAAE,EAAE,EAAE,CAAC,CAAA;IACvC,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,QAAQ,CAAC,WAAW,EAAE,oBAAoB,EAAE,2CAA2C,CAAC,CAAA;IAC9G,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
|
package/dist/commands/session.js
CHANGED
|
@@ -21,7 +21,7 @@ export const sessionCommand = () => {
|
|
|
21
21
|
.command("start")
|
|
22
22
|
.description("store a MAX session for this profile")
|
|
23
23
|
.action(async function () {
|
|
24
|
-
const { renderer, settings, store, createClient, run } = forCommand(this
|
|
24
|
+
const { renderer, settings, store, createClient, run } = forCommand(this);
|
|
25
25
|
// Creation is the only moment the collision can still be explained; after this the name is
|
|
26
26
|
// written down and `max <name>` would silently be a command instead.
|
|
27
27
|
refuseCommandName(settings.profile, commandWords(rootOf(this)));
|
|
@@ -57,7 +57,7 @@ export const sessionCommand = () => {
|
|
|
57
57
|
.command("end")
|
|
58
58
|
.description("forget the stored session for this profile")
|
|
59
59
|
.action(async function () {
|
|
60
|
-
const { renderer, store, run } = forCommand(this
|
|
60
|
+
const { renderer, store, run } = forCommand(this);
|
|
61
61
|
// It contacts nobody, so the run holds no events — but forgetting a session is an action, and
|
|
62
62
|
// "when did this profile stop working" is a question the record is kept to answer.
|
|
63
63
|
await run("session end", async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/commands/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAY,EAAE;IAC1C,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,yCAAyC,CAAC,CAAA;IAE7F;;;;;;;;;;;OAWG;IACH,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,sCAAsC,CAAC;SACnD,MAAM,CAAC,KAAK;QACX,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/commands/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,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