primcli 3.0.0-preview.1 → 3.0.0-preview.11
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 +21 -11
- package/dist/api-command-CkMEFiBL.js +56583 -0
- package/dist/{json-output-BzSBR-KX.js → json-output-ch756TXV.js} +14 -1
- package/dist/{listen-background-C0F9gNDD.js → listen-background-DyBYca28.js} +323 -36
- package/dist/{machine-session-Cp_eQ9t_.js → machine-session-D39TUEGF.js} +6 -6
- package/dist/{notify-session-BN0JTPZ3.js → notify-session-DcFHxUL9.js} +3 -3
- package/dist/oclif/auto-signal-worker.js +3 -3
- package/dist/oclif/auto-signals.js +1 -1
- package/dist/oclif/command-not-found.js +62 -0
- package/dist/oclif/index.js +14204 -51004
- package/dist/oclif/listen-supervisor.js +1 -1
- package/dist/oclif/proxy-auto-detect.js +1 -1
- package/dist/oclif/receiver-heal.js +4 -3
- package/dist/oclif/root-signup-hint.js +15 -15
- package/dist/{repeats-Dj_o6c-X-Bf9G0xds.js → repeats-Dj_o6c-X-ChTwFlyB.js} +758 -226
- package/dist/{scoped-chat-DZ42V3jq.js → scoped-chat-DVhJu-DF.js} +1 -1
- package/dist/{signal-command-CRUMUCNa.js → signal-command-CGgHQ_po.js} +4 -4
- package/man/primitive.1 +20 -4
- package/package.json +18 -6
- package/dist/api-command-ctHBqTL5.js +0 -3634
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { $ as parseWebhookEvent, Nt as downloadEmailAttachmentPart, Q as isTrustedSender, Z as isEmailReceivedEvent, c as classifySignalContent } from "./repeats-Dj_o6c-X-ChTwFlyB.js";
|
|
2
|
+
import { B as skillFirstLine, V as wakeReadCommand, nt as wakeInteractionSentence } from "./api-command-CkMEFiBL.js";
|
|
3
3
|
import { _ as acquireListenLock, g as ListenStateError, y as listenIdentity } from "./shared-mail-files-BAQSGxxz.js";
|
|
4
4
|
import { closeSync, copyFileSync, existsSync, fsyncSync, lstatSync, mkdirSync, openSync, opendirSync, readFileSync, readdirSync, readlinkSync, renameSync, rmSync, statSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { createHash, randomUUID, scryptSync } from "node:crypto";
|
|
6
6
|
import { dirname, isAbsolute, join, normalize, resolve } from "node:path";
|
|
7
7
|
import { spawn } from "node:child_process";
|
|
8
|
+
import { isDeepStrictEqual } from "node:util";
|
|
8
9
|
import { homedir } from "node:os";
|
|
9
10
|
import { lstat, realpath } from "node:fs/promises";
|
|
10
|
-
import { isDeepStrictEqual } from "node:util";
|
|
11
11
|
import WebSocket from "ws";
|
|
12
12
|
import { request } from "node:http";
|
|
13
13
|
import { request as request$1 } from "node:https";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { tn as getSentEmail } from "../repeats-Dj_o6c-X-ChTwFlyB.js";
|
|
2
|
+
import { I as readThreadContext, en as createAuthenticatedCliApiClient } from "../api-command-CkMEFiBL.js";
|
|
3
3
|
import { AUTO_SIGNAL_KIND_ENV, AUTO_WORKING_RENEW_MS, autoSignalsDisabled, clearWorkingSending, markWorkingSending, readAutoClaim, readWorkingLease, recordRenewer, stopWorkingLease, writeWorkingLease } from "./auto-signals.js";
|
|
4
4
|
import { _ as acquireListenLock } from "../shared-mail-files-BAQSGxxz.js";
|
|
5
|
-
import { t as sendSignal } from "../signal-command-
|
|
5
|
+
import { t as sendSignal } from "../signal-command-CGgHQ_po.js";
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
import { homedir } from "node:os";
|
|
8
8
|
// src/oclif/auto-signal-worker.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as isPlainChatReply, o as scopedChatSenderTrust } from "../scoped-chat-
|
|
1
|
+
import { n as isPlainChatReply, o as scopedChatSenderTrust } from "../scoped-chat-DVhJu-DF.js";
|
|
2
2
|
import { d as readMailJson, h as writeMailJson, i as mailId, l as privateMailDirectory, r as mailAddress } from "../shared-mail-files-BAQSGxxz.js";
|
|
3
3
|
import { existsSync, readFileSync, readdirSync, unlinkSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { r as jsonOutputRequested } from "../json-output-ch756TXV.js";
|
|
2
|
+
// src/oclif/command-not-found.ts
|
|
3
|
+
/**
|
|
4
|
+
* What to say for an id no command has. oclif joins every word before the
|
|
5
|
+
* first flag into the id while no command along the way takes arguments, so
|
|
6
|
+
* `emails list foo` arrives as `emails:list:foo`: when a leading part is a
|
|
7
|
+
* real command, the rest was an argument it does not take.
|
|
8
|
+
*/
|
|
9
|
+
function commandNotFoundMessage(id, lookup) {
|
|
10
|
+
const parts = id.split(":");
|
|
11
|
+
const typed = `primitive ${parts.join(" ")}`;
|
|
12
|
+
for (let end = parts.length - 1; end > 0; end -= 1) {
|
|
13
|
+
const known = parts.slice(0, end).join(":");
|
|
14
|
+
const command = lookup.find(known);
|
|
15
|
+
const topic = lookup.hasSubcommands(known);
|
|
16
|
+
if (!command && !topic) continue;
|
|
17
|
+
const shown = `primitive ${parts.slice(0, end).join(" ")}`;
|
|
18
|
+
const rest = parts.slice(end).join(" ");
|
|
19
|
+
if (topic || !command) return {
|
|
20
|
+
code: "command_not_found",
|
|
21
|
+
message: `Unknown command "${typed}". Run "${shown} --help" to see the commands under it.`
|
|
22
|
+
};
|
|
23
|
+
if (command.takesArguments) return {
|
|
24
|
+
code: "command_not_found",
|
|
25
|
+
message: `Unknown command "${parts.join(":")}". To pass "${rest}" to "${shown}", run "${shown} ${rest}".`
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
code: "unexpected_argument",
|
|
29
|
+
message: `Unexpected argument "${rest}" for "${shown}", which takes no arguments. Run "${shown} --help" to see the flags it takes.`
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
code: "command_not_found",
|
|
34
|
+
message: `Unknown command "${typed}". Run "primitive --help" to see the commands.`
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Say what went wrong in plain words, and under --json as one JSON document
|
|
39
|
+
* on stdout like every other failure, instead of oclif's "command <id> not
|
|
40
|
+
* found" naming a command nobody typed.
|
|
41
|
+
*/
|
|
42
|
+
const hook = async (options) => {
|
|
43
|
+
const { config } = options;
|
|
44
|
+
const { code, message } = commandNotFoundMessage(options.id, {
|
|
45
|
+
find: (id) => {
|
|
46
|
+
const command = config.findCommand(id);
|
|
47
|
+
return command ? { takesArguments: Object.keys(command.args ?? {}).length > 0 } : void 0;
|
|
48
|
+
},
|
|
49
|
+
hasSubcommands: (id) => config.commandIDs.some((other) => other.startsWith(`${id}:`))
|
|
50
|
+
});
|
|
51
|
+
if (jsonOutputRequested([...process.argv.slice(2), ...options.argv ?? []])) process.stdout.write(`${JSON.stringify({
|
|
52
|
+
error: {
|
|
53
|
+
code,
|
|
54
|
+
message
|
|
55
|
+
},
|
|
56
|
+
exit_code: 2
|
|
57
|
+
}, null, 2)}\n`);
|
|
58
|
+
else process.stderr.write(` › Error: ${message}\n`);
|
|
59
|
+
process.exitCode = 2;
|
|
60
|
+
return message;
|
|
61
|
+
};
|
|
62
|
+
export { commandNotFoundMessage, hook as default };
|