@wirecat/cli-base 0.0.0-stage → 0.22.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/LICENSE +204 -0
- package/README.md +390 -2
- package/config/biome.base.json +56 -0
- package/config/cspell.json +57 -0
- package/config/lefthook.yml +34 -0
- package/config/rumdl.toml +9 -0
- package/config/tsconfig.base.json +21 -0
- package/config/tsconfig.scripts.json +13 -0
- package/config/tsconfig.test.json +11 -0
- package/config/vale/CliDocs/Filler.yml +9 -0
- package/config/vale/CliDocs/SentenceLength.yml +6 -0
- package/config/vale/Tg/Tone.yml +7 -0
- package/config/wirecat/LICENSE +204 -0
- package/config/wirecat/biome.base.json +56 -0
- package/config/wirecat/check.mjs +41 -0
- package/config/wirecat/cspell.json +80 -0
- package/config/wirecat/lefthook.yml +26 -0
- package/config/wirecat/manifest.json +23 -0
- package/config/wirecat/markdownlint.json +10 -0
- package/config/wirecat/rumdl.toml +9 -0
- package/dist/codegen/index.d.ts +12 -0
- package/dist/codegen/index.d.ts.map +1 -0
- package/dist/codegen/index.js +11 -0
- package/dist/codegen/index.js.map +1 -0
- package/dist/codegen/manifest.d.ts +47 -0
- package/dist/codegen/manifest.d.ts.map +1 -0
- package/dist/codegen/manifest.js +73 -0
- package/dist/codegen/manifest.js.map +1 -0
- package/dist/codegen/model.d.ts +146 -0
- package/dist/codegen/model.d.ts.map +1 -0
- package/dist/codegen/model.js +7 -0
- package/dist/codegen/model.js.map +1 -0
- package/dist/codegen/names.d.ts +4 -0
- package/dist/codegen/names.d.ts.map +1 -0
- package/dist/codegen/names.js +46 -0
- package/dist/codegen/names.js.map +1 -0
- package/dist/codegen/pipeline.d.ts +24 -0
- package/dist/codegen/pipeline.d.ts.map +1 -0
- package/dist/codegen/pipeline.js +193 -0
- package/dist/codegen/pipeline.js.map +1 -0
- package/dist/codegen/runtime.d.ts +24 -0
- package/dist/codegen/runtime.d.ts.map +1 -0
- package/dist/codegen/runtime.js +38 -0
- package/dist/codegen/runtime.js.map +1 -0
- package/dist/codegen/tree.d.ts +29 -0
- package/dist/codegen/tree.d.ts.map +1 -0
- package/dist/codegen/tree.js +87 -0
- package/dist/codegen/tree.js.map +1 -0
- package/dist/codegen/typescript.d.ts +6 -0
- package/dist/codegen/typescript.d.ts.map +1 -0
- package/dist/codegen/typescript.js +78 -0
- package/dist/codegen/typescript.js.map +1 -0
- package/dist/codegen/valibot.d.ts +10 -0
- package/dist/codegen/valibot.d.ts.map +1 -0
- package/dist/codegen/valibot.js +132 -0
- package/dist/codegen/valibot.js.map +1 -0
- package/dist/commands/document.d.ts +72 -0
- package/dist/commands/document.d.ts.map +1 -0
- package/dist/commands/document.js +71 -0
- package/dist/commands/document.js.map +1 -0
- package/dist/commands/index.d.ts +83 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +85 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/page.d.ts +80 -0
- package/dist/commands/page.d.ts.map +1 -0
- package/dist/commands/page.js +100 -0
- package/dist/commands/page.js.map +1 -0
- package/dist/completion/index.d.ts +37 -0
- package/dist/completion/index.d.ts.map +1 -0
- package/dist/completion/index.js +87 -0
- package/dist/completion/index.js.map +1 -0
- package/dist/config.d.ts +20 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +61 -0
- package/dist/config.js.map +1 -0
- package/dist/credentials.d.ts +48 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +120 -0
- package/dist/credentials.js.map +1 -0
- package/dist/deadline.d.ts +14 -0
- package/dist/deadline.d.ts.map +1 -0
- package/dist/deadline.js +88 -0
- package/dist/deadline.js.map +1 -0
- package/dist/dev/bin.d.ts +3 -0
- package/dist/dev/bin.d.ts.map +1 -0
- package/dist/dev/bin.js +8 -0
- package/dist/dev/bin.js.map +1 -0
- package/dist/dev/lint.d.ts +31 -0
- package/dist/dev/lint.d.ts.map +1 -0
- package/dist/dev/lint.js +148 -0
- package/dist/dev/lint.js.map +1 -0
- package/dist/dev/main.d.ts +7 -0
- package/dist/dev/main.d.ts.map +1 -0
- package/dist/dev/main.js +279 -0
- package/dist/dev/main.js.map +1 -0
- package/dist/dev/next-version.d.ts +11 -0
- package/dist/dev/next-version.d.ts.map +1 -0
- package/dist/dev/next-version.js +33 -0
- package/dist/dev/next-version.js.map +1 -0
- package/dist/dev/slow-tests.d.ts +14 -0
- package/dist/dev/slow-tests.d.ts.map +1 -0
- package/dist/dev/slow-tests.js +17 -0
- package/dist/dev/slow-tests.js.map +1 -0
- package/dist/dev/test-matrix.d.ts +35 -0
- package/dist/dev/test-matrix.d.ts.map +1 -0
- package/dist/dev/test-matrix.js +93 -0
- package/dist/dev/test-matrix.js.map +1 -0
- package/dist/errors.d.ts +34 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +40 -0
- package/dist/errors.js.map +1 -0
- package/dist/executable.d.ts +3 -0
- package/dist/executable.d.ts.map +1 -0
- package/dist/executable.js +41 -0
- package/dist/executable.js.map +1 -0
- package/dist/exit-codes.d.ts +11 -0
- package/dist/exit-codes.d.ts.map +1 -0
- package/dist/exit-codes.js +25 -0
- package/dist/exit-codes.js.map +1 -0
- package/dist/http/index.d.ts +20 -0
- package/dist/http/index.d.ts.map +1 -0
- package/dist/http/index.js +46 -0
- package/dist/http/index.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/keyring.d.ts +27 -0
- package/dist/keyring.d.ts.map +1 -0
- package/dist/keyring.js +45 -0
- package/dist/keyring.js.map +1 -0
- package/dist/legacy-paths.d.ts +33 -0
- package/dist/legacy-paths.d.ts.map +1 -0
- package/dist/legacy-paths.js +128 -0
- package/dist/legacy-paths.js.map +1 -0
- package/dist/logger.d.ts +12 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +7 -0
- package/dist/logger.js.map +1 -0
- package/dist/logging.d.ts +31 -0
- package/dist/logging.d.ts.map +1 -0
- package/dist/logging.js +58 -0
- package/dist/logging.js.map +1 -0
- package/dist/mcp/index.d.ts +32 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +113 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/output-buffer.d.ts +16 -0
- package/dist/output-buffer.d.ts.map +1 -0
- package/dist/output-buffer.js +69 -0
- package/dist/output-buffer.js.map +1 -0
- package/dist/paths.d.ts +35 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +45 -0
- package/dist/paths.js.map +1 -0
- package/dist/pretty.d.ts +12 -0
- package/dist/pretty.d.ts.map +1 -0
- package/dist/pretty.js +83 -0
- package/dist/pretty.js.map +1 -0
- package/dist/release/index.d.ts +38 -0
- package/dist/release/index.d.ts.map +1 -0
- package/dist/release/index.js +91 -0
- package/dist/release/index.js.map +1 -0
- package/dist/release/markdown.d.ts +36 -0
- package/dist/release/markdown.d.ts.map +1 -0
- package/dist/release/markdown.js +153 -0
- package/dist/release/markdown.js.map +1 -0
- package/dist/release/structure.d.ts +16 -0
- package/dist/release/structure.d.ts.map +1 -0
- package/dist/release/structure.js +74 -0
- package/dist/release/structure.js.map +1 -0
- package/dist/renderer.d.ts +34 -0
- package/dist/renderer.d.ts.map +1 -0
- package/dist/renderer.js +55 -0
- package/dist/renderer.js.map +1 -0
- package/dist/result-fields.d.ts +4 -0
- package/dist/result-fields.d.ts.map +1 -0
- package/dist/result-fields.js +56 -0
- package/dist/result-fields.js.map +1 -0
- package/dist/retry.d.ts +27 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/retry.js +26 -0
- package/dist/retry.js.map +1 -0
- package/dist/sanitize.d.ts +25 -0
- package/dist/sanitize.d.ts.map +1 -0
- package/dist/sanitize.js +52 -0
- package/dist/sanitize.js.map +1 -0
- package/dist/skill/index.d.ts +78 -0
- package/dist/skill/index.d.ts.map +1 -0
- package/dist/skill/index.js +190 -0
- package/dist/skill/index.js.map +1 -0
- package/dist/standards/errors.d.ts +40 -0
- package/dist/standards/errors.d.ts.map +1 -0
- package/dist/standards/errors.js +33 -0
- package/dist/standards/errors.js.map +1 -0
- package/dist/standards/index.d.ts +8 -0
- package/dist/standards/index.d.ts.map +1 -0
- package/dist/standards/index.js +8 -0
- package/dist/standards/index.js.map +1 -0
- package/dist/standards/lint.d.ts +29 -0
- package/dist/standards/lint.d.ts.map +1 -0
- package/dist/standards/lint.js +50 -0
- package/dist/standards/lint.js.map +1 -0
- package/dist/standards/log.d.ts +21 -0
- package/dist/standards/log.d.ts.map +1 -0
- package/dist/standards/log.js +18 -0
- package/dist/standards/log.js.map +1 -0
- package/dist/standards/output.d.ts +126 -0
- package/dist/standards/output.d.ts.map +1 -0
- package/dist/standards/output.js +54 -0
- package/dist/standards/output.js.map +1 -0
- package/dist/standards/registry.d.ts +18 -0
- package/dist/standards/registry.d.ts.map +1 -0
- package/dist/standards/registry.js +41 -0
- package/dist/standards/registry.js.map +1 -0
- package/dist/standards/steps.d.ts +28 -0
- package/dist/standards/steps.d.ts.map +1 -0
- package/dist/standards/steps.js +56 -0
- package/dist/standards/steps.js.map +1 -0
- package/dist/standards/vocabulary.d.ts +40 -0
- package/dist/standards/vocabulary.d.ts.map +1 -0
- package/dist/standards/vocabulary.js +242 -0
- package/dist/standards/vocabulary.js.map +1 -0
- package/dist/streams.d.ts +24 -0
- package/dist/streams.d.ts.map +1 -0
- package/dist/streams.js +26 -0
- package/dist/streams.js.map +1 -0
- package/dist/testing/index.d.ts +24 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +29 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/time.d.ts +21 -0
- package/dist/time.d.ts.map +1 -0
- package/dist/time.js +19 -0
- package/dist/time.js.map +1 -0
- package/dist/update/index.d.ts +76 -0
- package/dist/update/index.d.ts.map +1 -0
- package/dist/update/index.js +160 -0
- package/dist/update/index.js.map +1 -0
- package/package.json +135 -4
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
import { duplicates, parseRegistry, text, word } from "./registry.js";
|
|
3
|
+
export const FLAG_TYPES = [
|
|
4
|
+
"switch",
|
|
5
|
+
"count",
|
|
6
|
+
"number",
|
|
7
|
+
"string",
|
|
8
|
+
"id",
|
|
9
|
+
"time",
|
|
10
|
+
"duration",
|
|
11
|
+
"choice",
|
|
12
|
+
"list",
|
|
13
|
+
"path",
|
|
14
|
+
"cursor",
|
|
15
|
+
];
|
|
16
|
+
const verbSchema = v.strictObject({ word, meaning: text, replaces: v.optional(v.array(word)) });
|
|
17
|
+
const nounSchema = v.strictObject({
|
|
18
|
+
word,
|
|
19
|
+
meaning: text,
|
|
20
|
+
// A collection is named in the plural; a singular is what a profile has exactly one of.
|
|
21
|
+
kind: v.picklist(["collection", "singular"]),
|
|
22
|
+
replaces: v.optional(v.array(word)),
|
|
23
|
+
});
|
|
24
|
+
const viewSchema = v.strictObject({ word, meaning: text });
|
|
25
|
+
const rootSchema = v.strictObject({ word, meaning: text });
|
|
26
|
+
const flagSchema = v.strictObject({
|
|
27
|
+
name: v.pipe(v.string(), v.regex(/^--[a-z][a-z0-9]*(-[a-z0-9]+)*$/, "a long flag: --lower-case-words")),
|
|
28
|
+
value: v.optional(v.pipe(v.string(), v.regex(/^<[a-z][a-z0-9-|]*>$/, "a value name such as <n>"))),
|
|
29
|
+
type: v.picklist(FLAG_TYPES),
|
|
30
|
+
meaning: text,
|
|
31
|
+
unit: v.optional(text),
|
|
32
|
+
});
|
|
33
|
+
export const vocabularySchema = v.strictObject({
|
|
34
|
+
verbs: v.array(verbSchema),
|
|
35
|
+
nouns: v.array(nounSchema),
|
|
36
|
+
views: v.array(viewSchema),
|
|
37
|
+
roots: v.array(rootSchema),
|
|
38
|
+
flags: v.array(flagSchema),
|
|
39
|
+
});
|
|
40
|
+
/** One word, one meaning within its kind: a second entry for the same verb, noun, view, root or flag is refused. */
|
|
41
|
+
export const defineVocabulary = (input) => parseRegistry("vocabulary", vocabularySchema, input, (vocabulary) => {
|
|
42
|
+
const problems = [];
|
|
43
|
+
const kinds = {
|
|
44
|
+
verbs: vocabulary.verbs.map((entry) => entry.word),
|
|
45
|
+
nouns: vocabulary.nouns.map((entry) => entry.word),
|
|
46
|
+
views: vocabulary.views.map((entry) => entry.word),
|
|
47
|
+
roots: vocabulary.roots.map((entry) => entry.word),
|
|
48
|
+
flags: vocabulary.flags.map((entry) => entry.name),
|
|
49
|
+
};
|
|
50
|
+
for (const [kind, words] of Object.entries(kinds))
|
|
51
|
+
for (const repeated of duplicates(words))
|
|
52
|
+
problems.push(`${kind}: "${repeated}" is listed twice`);
|
|
53
|
+
for (const flag of vocabulary.flags)
|
|
54
|
+
if ((flag.type === "switch") !== (flag.value === undefined))
|
|
55
|
+
problems.push(`flags: ${flag.name} — a switch has no value name; every other type has one`);
|
|
56
|
+
const verbs = new Set(kinds.verbs);
|
|
57
|
+
for (const verb of vocabulary.verbs)
|
|
58
|
+
for (const old of verb.replaces ?? [])
|
|
59
|
+
if (verbs.has(old))
|
|
60
|
+
problems.push(`verbs: "${verb.word}" replaces "${old}", which is itself a verb`);
|
|
61
|
+
return problems;
|
|
62
|
+
});
|
|
63
|
+
const verbs = [
|
|
64
|
+
["list", "show many"],
|
|
65
|
+
["show", "show one"],
|
|
66
|
+
["search", "find by text; the description says where it looks"],
|
|
67
|
+
["related", "what is nearest in meaning to one thing, without a query"],
|
|
68
|
+
["info", "facts about a singular thing itself: where it is, its size, its version, its schema"],
|
|
69
|
+
["status", "how a thing stands right now"],
|
|
70
|
+
["check", "verify, and change nothing; the answer says what is wrong and how to fix it"],
|
|
71
|
+
["test", "run rules over what is already stored and say what they would have done, doing none of it"],
|
|
72
|
+
["pause", "stop what a running process does for a profile, without stopping the process"],
|
|
73
|
+
["resume", "restart what pause stopped"],
|
|
74
|
+
["create", "make a thing"],
|
|
75
|
+
["delete", "destroy a thing"],
|
|
76
|
+
["add", "put an existing thing into a set"],
|
|
77
|
+
["remove", "take a thing out of a set"],
|
|
78
|
+
["clear", "empty a set"],
|
|
79
|
+
["update", "change a thing's fields"],
|
|
80
|
+
["set", "set one named key"],
|
|
81
|
+
["unset", "remove one named key"],
|
|
82
|
+
["rename", "change a thing's name only"],
|
|
83
|
+
["start", "start a running process, or a login session"],
|
|
84
|
+
["stop", "stop a running process"],
|
|
85
|
+
["restart", "stop and start a running process"],
|
|
86
|
+
["end", "end a login session"],
|
|
87
|
+
["install", "install a system unit"],
|
|
88
|
+
["uninstall", "remove a system unit"],
|
|
89
|
+
["cancel", "stop a job or a pending thing"],
|
|
90
|
+
[
|
|
91
|
+
"sync",
|
|
92
|
+
"bring the local store up to date from the source: only what changed, or the whole list where the source cannot say",
|
|
93
|
+
],
|
|
94
|
+
["fetch", "one bounded pull of one named thing into the store, not a catch-up"],
|
|
95
|
+
["export", "write from the store to a file"],
|
|
96
|
+
["import", "bring a file or list the user gives into the store or the messenger, once"],
|
|
97
|
+
["download", "save a file from the source to this machine"],
|
|
98
|
+
["transcribe", "turn speech into text"],
|
|
99
|
+
["extract", "read the text inside files already on this machine into the store"],
|
|
100
|
+
["migrate", "bring a file up to this build's schema"],
|
|
101
|
+
["backup", "copy a file somewhere safe"],
|
|
102
|
+
["restore", "put a backup back in its place"],
|
|
103
|
+
["repair", "bring a file's tables to this build's shape without deleting anything"],
|
|
104
|
+
["link", "record that two identities are one person"],
|
|
105
|
+
["unlink", "undo a link"],
|
|
106
|
+
["lookup", "ask the messenger who is behind a phone number"],
|
|
107
|
+
["inspect", "look at a link without joining it"],
|
|
108
|
+
["send", "send a message"],
|
|
109
|
+
["edit", "change a sent message"],
|
|
110
|
+
["forward", "send an existing message on to another chat"],
|
|
111
|
+
["pin", "pin a message or chat"],
|
|
112
|
+
["unpin", "unpin a message or chat"],
|
|
113
|
+
["vote", "answer a poll"],
|
|
114
|
+
["close", "close a thing that stays: a poll, a task"],
|
|
115
|
+
["join", "join a chat"],
|
|
116
|
+
["leave", "leave a chat"],
|
|
117
|
+
["block", "block a person"],
|
|
118
|
+
["unblock", "unblock a person"],
|
|
119
|
+
["mark-read", "mark a chat read; the other person sees it"],
|
|
120
|
+
["reset", "replace a thing; the old one stops working"],
|
|
121
|
+
["moderate", "apply a chat's rules: delete what breaks them, act on who broke them"],
|
|
122
|
+
["confirm", "the owner accepts what an agent proposed"],
|
|
123
|
+
["reject", "the owner refuses what an agent proposed"],
|
|
124
|
+
["move", "move a file in the source"],
|
|
125
|
+
["copy", "copy a file in the source"],
|
|
126
|
+
];
|
|
127
|
+
const replaces = {
|
|
128
|
+
list: ["ls"],
|
|
129
|
+
show: ["get", "view"],
|
|
130
|
+
search: ["find", "query"],
|
|
131
|
+
delete: ["rm", "trash"],
|
|
132
|
+
create: ["mkdir"],
|
|
133
|
+
update: ["plan"],
|
|
134
|
+
set: ["configure"],
|
|
135
|
+
sync: ["refresh"],
|
|
136
|
+
check: ["audit", "preflight"],
|
|
137
|
+
status: ["readiness"],
|
|
138
|
+
confirm: ["accept", "approve"],
|
|
139
|
+
reject: ["decline", "deny"],
|
|
140
|
+
};
|
|
141
|
+
const collections = [
|
|
142
|
+
["chats", "conversations in a messenger"],
|
|
143
|
+
["contacts", "identities in a messenger's contact list"],
|
|
144
|
+
["messages", "posts in a messenger chat, or emails"],
|
|
145
|
+
["polls", "polls in a chat"],
|
|
146
|
+
["reactions", "reactions to a message"],
|
|
147
|
+
["recipients", "who a message goes to"],
|
|
148
|
+
["replies", "the automatic replies of a profile"],
|
|
149
|
+
["sends", "messages waiting to be sent, or sent by this tool"],
|
|
150
|
+
["runs", "past runs of this tool"],
|
|
151
|
+
["topics", "forum topics in a group"],
|
|
152
|
+
["models", "local or remote models"],
|
|
153
|
+
["tags", "labels the owner puts on things"],
|
|
154
|
+
["searches", "the owner's saved searches"],
|
|
155
|
+
["copies", "tables kept aside by a repair"],
|
|
156
|
+
["attachments", "files of stored messages"],
|
|
157
|
+
["tasks", "what waits on the owner"],
|
|
158
|
+
["members", "people in a chat"],
|
|
159
|
+
["admins", "administrators of a chat"],
|
|
160
|
+
["tracking", "the chats whose member lists are fetched daily"],
|
|
161
|
+
["documents", "files imported from Google Drive or Docs, or linked in a chat"],
|
|
162
|
+
["notes", "text the owner writes, or files from a notes folder"],
|
|
163
|
+
["projects", "the owner's work units with a task key"],
|
|
164
|
+
["organizations", "companies, teams, families or communities"],
|
|
165
|
+
["identities", "accounts of a person in one messenger or mailbox"],
|
|
166
|
+
["facts", "what happened, with evidence"],
|
|
167
|
+
["memories", "what an agent concluded, with evidence and scope"],
|
|
168
|
+
["relationships", "confirmed or suggested links between people, organizations and projects"],
|
|
169
|
+
];
|
|
170
|
+
const singulars = [
|
|
171
|
+
["session", "this tool's login"],
|
|
172
|
+
["account", "the messenger or mail account behind a profile"],
|
|
173
|
+
["config", "a profile's settings"],
|
|
174
|
+
["server", "the long-running process of a profile"],
|
|
175
|
+
["store", "the local SQLite database the tools share"],
|
|
176
|
+
["skill", "the agent skill file of this tool"],
|
|
177
|
+
["cache", "max's per-profile cache"],
|
|
178
|
+
["flood", "what the messenger told this profile to hold off on"],
|
|
179
|
+
];
|
|
180
|
+
const views = [
|
|
181
|
+
["logs", "the log of a running process"],
|
|
182
|
+
["events", "what happened in a thing over time"],
|
|
183
|
+
["scheduled", "what is scheduled to happen"],
|
|
184
|
+
["context", "what surrounds one thing"],
|
|
185
|
+
["path", "where a thing is on this machine"],
|
|
186
|
+
["config", "the configuration a thing needs"],
|
|
187
|
+
["history", "past uses of a thing"],
|
|
188
|
+
["top", "a ranked view under stats"],
|
|
189
|
+
["official", "the view the messenger itself computed, under stats"],
|
|
190
|
+
];
|
|
191
|
+
const roots = [
|
|
192
|
+
["inbox", "what waits across every chat"],
|
|
193
|
+
["review", "go through what needs the owner"],
|
|
194
|
+
["watch", "follow new events as they come"],
|
|
195
|
+
["serve", "the long-running process"],
|
|
196
|
+
["doctor", "check this machine's setup"],
|
|
197
|
+
["upgrade", "install a newer version of this tool"],
|
|
198
|
+
["commands", "the command tree as data"],
|
|
199
|
+
["complete", "shell completion"],
|
|
200
|
+
["mcp", "the MCP server and its setup"],
|
|
201
|
+
["bot", "the profile's bot account"],
|
|
202
|
+
["stats", "statistics"],
|
|
203
|
+
["search", "searches across resources"],
|
|
204
|
+
];
|
|
205
|
+
const flags = [
|
|
206
|
+
{ name: "--limit", value: "<n>", type: "count", meaning: "how many items", unit: "items" },
|
|
207
|
+
{ name: "--page", value: "<n>", type: "count", meaning: "which page, from 1, where the source has no cursor" },
|
|
208
|
+
{
|
|
209
|
+
name: "--page-size",
|
|
210
|
+
value: "<n>",
|
|
211
|
+
type: "count",
|
|
212
|
+
meaning: "how many items one request to the source asks for",
|
|
213
|
+
unit: "items",
|
|
214
|
+
},
|
|
215
|
+
{ name: "--cursor", value: "<cursor>", type: "cursor", meaning: "continue from where the previous page ended" },
|
|
216
|
+
{ name: "--before-id", value: "<id>", type: "id", meaning: "read what came before this message id" },
|
|
217
|
+
{ name: "--after-id", value: "<id>", type: "id", meaning: "read what came after this message id" },
|
|
218
|
+
{ name: "--before-time", value: "<time>", type: "time", meaning: "read what came before this time" },
|
|
219
|
+
{ name: "--after-time", value: "<time>", type: "time", meaning: "read what came after this time" },
|
|
220
|
+
{ name: "--since-time", value: "<time>", type: "time", meaning: "only what came since this time" },
|
|
221
|
+
{ name: "--at-time", value: "<time>", type: "time", meaning: "do it at this time" },
|
|
222
|
+
{ name: "--before-n", value: "<n>", type: "count", meaning: "how many messages before it", unit: "messages" },
|
|
223
|
+
{ name: "--after-n", value: "<n>", type: "count", meaning: "how many messages after it", unit: "messages" },
|
|
224
|
+
{ name: "--timeout", value: "<duration>", type: "duration", meaning: "give up after this long" },
|
|
225
|
+
{ name: "--dry-run", type: "switch", meaning: "judge and plan; do nothing" },
|
|
226
|
+
];
|
|
227
|
+
/** The words every CLI on cli-base is judged against. Seeded from STANDARD's command-name rules and the glossary. */
|
|
228
|
+
export const VOCABULARY = defineVocabulary({
|
|
229
|
+
verbs: verbs.map(([entry, meaning]) => ({
|
|
230
|
+
word: entry,
|
|
231
|
+
meaning,
|
|
232
|
+
...(replaces[entry] ? { replaces: replaces[entry] } : {}),
|
|
233
|
+
})),
|
|
234
|
+
nouns: [
|
|
235
|
+
...collections.map(([entry, meaning]) => ({ word: entry, meaning, kind: "collection" })),
|
|
236
|
+
...singulars.map(([entry, meaning]) => ({ word: entry, meaning, kind: "singular" })),
|
|
237
|
+
],
|
|
238
|
+
views: views.map(([entry, meaning]) => ({ word: entry, meaning })),
|
|
239
|
+
roots: roots.map(([entry, meaning]) => ({ word: entry, meaning })),
|
|
240
|
+
flags,
|
|
241
|
+
});
|
|
242
|
+
//# sourceMappingURL=vocabulary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocabulary.js","sourceRoot":"","sources":["../../src/standards/vocabulary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAErE,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,UAAU;IACV,QAAQ;IACR,MAAM;IACN,MAAM;IACN,QAAQ;CACA,CAAA;AAEV,MAAM,UAAU,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAA;AAC/F,MAAM,UAAU,GAAG,CAAC,CAAC,YAAY,CAAC;IAChC,IAAI;IACJ,OAAO,EAAE,IAAI;IACb,wFAAwF;IACxF,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IAC5C,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CA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E,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1D,CAAC,CAAC;IACH,KAAK,EAAE;QACL,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;QACxF,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;KACrF;IACD,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IAClE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IAClE,KAAK;CACN,CAAC,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The line every machine mode depends on: **stdout carries data, stderr carries everything
|
|
3
|
+
* else.** Two functions and no formatting decisions — the renderer that chooses tables, colour
|
|
4
|
+
* and spinners is `CLI-5` and sits on top of this, never beside it.
|
|
5
|
+
*/
|
|
6
|
+
export interface Streams {
|
|
7
|
+
data: (text: string) => void;
|
|
8
|
+
diagnostic: (text: string) => void;
|
|
9
|
+
/**
|
|
10
|
+
* A line that replaces itself — a progress counter, and nothing else.
|
|
11
|
+
*
|
|
12
|
+
* It lives here rather than beside the renderer so that a test capturing streams captures this
|
|
13
|
+
* too: the invariant it could break is rule 3, and an output channel the machine-output test
|
|
14
|
+
* cannot see is exactly how that gets broken quietly. An empty string clears the line.
|
|
15
|
+
*/
|
|
16
|
+
progress?: (text: string) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare const processStreams: Streams;
|
|
19
|
+
/** Collects both halves separately, so a test can assert nothing leaked across. */
|
|
20
|
+
export declare const captureStreams: () => Streams & {
|
|
21
|
+
stdout: string[];
|
|
22
|
+
stderr: string[];
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=streams.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streams.d.ts","sourceRoot":"","sources":["../src/streams.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5B,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAClC;AAED,eAAO,MAAM,cAAc,EAAE,OAY5B,CAAA;AAED,mFAAmF;AACnF,eAAO,MAAM,cAAc,QAAO,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAW/E,CAAA"}
|
package/dist/streams.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const processStreams = {
|
|
2
|
+
data: (text) => {
|
|
3
|
+
process.stdout.write(`${text}\n`);
|
|
4
|
+
},
|
|
5
|
+
diagnostic: (text) => {
|
|
6
|
+
process.stderr.write(`${text}\n`);
|
|
7
|
+
},
|
|
8
|
+
progress: (text) => {
|
|
9
|
+
// Carriage return and no newline, so the next line overwrites this one. Padded to the width of
|
|
10
|
+
// what was there before, or the tail of a longer previous line is left on screen.
|
|
11
|
+
process.stderr.write(`\r${text.padEnd(72)}${text === "" ? "\r" : ""}`);
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
/** Collects both halves separately, so a test can assert nothing leaked across. */
|
|
15
|
+
export const captureStreams = () => {
|
|
16
|
+
const stdout = [];
|
|
17
|
+
const stderr = [];
|
|
18
|
+
return {
|
|
19
|
+
stdout,
|
|
20
|
+
stderr,
|
|
21
|
+
data: (text) => stdout.push(text),
|
|
22
|
+
diagnostic: (text) => stderr.push(text),
|
|
23
|
+
progress: (text) => stderr.push(text),
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=streams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streams.js","sourceRoot":"","sources":["../src/streams.ts"],"names":[],"mappings":"AAkBA,MAAM,CAAC,MAAM,cAAc,GAAY;IACrC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE;QACb,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAA;IACnC,CAAC;IACD,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE;QACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAA;IACnC,CAAC;IACD,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;QACjB,+FAA+F;QAC/F,kFAAkF;QAClF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IACxE,CAAC;CACF,CAAA;AAED,mFAAmF;AACnF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAqD,EAAE;IACnF,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,MAAM,MAAM,GAAa,EAAE,CAAA;IAE3B,OAAO;QACL,MAAM;QACN,MAAM;QACN,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QACjC,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QACvC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;KACtC,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The seams a test needs, so that "no test touched the real machine" is a property of the code
|
|
3
|
+
* rather than a hope about every test remembering to opt out.
|
|
4
|
+
*/
|
|
5
|
+
export { brokenKeyring, memoryKeyring } from "../keyring.js";
|
|
6
|
+
export { captureStreams } from "../streams.js";
|
|
7
|
+
import type { MonotonicClock, SleepLike, WallClock } from "../time.js";
|
|
8
|
+
export interface FakeClock {
|
|
9
|
+
clock: MonotonicClock;
|
|
10
|
+
now: WallClock;
|
|
11
|
+
sleep: SleepLike;
|
|
12
|
+
/** Every sleep asked for, in order, with the reason the caller gave. Nothing actually waits. */
|
|
13
|
+
waits: {
|
|
14
|
+
ms: number;
|
|
15
|
+
reason?: string;
|
|
16
|
+
}[];
|
|
17
|
+
advance(ms: number): void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Time that never passes unless a test says so. A retry test that really sleeps 250 ms is a retry
|
|
21
|
+
* test nobody runs, so `sleep` resolves at once and records what it was asked for.
|
|
22
|
+
*/
|
|
23
|
+
export declare const fakeClock: (startMs?: number) => FakeClock;
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEtE,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,cAAc,CAAA;IACrB,GAAG,EAAE,SAAS,CAAA;IACd,KAAK,EAAE,SAAS,CAAA;IAChB,gGAAgG;IAChG,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACxC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,wBAAkB,SAiBvC,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The seams a test needs, so that "no test touched the real machine" is a property of the code
|
|
3
|
+
* rather than a hope about every test remembering to opt out.
|
|
4
|
+
*/
|
|
5
|
+
export { brokenKeyring, memoryKeyring } from "../keyring.js";
|
|
6
|
+
export { captureStreams } from "../streams.js";
|
|
7
|
+
/**
|
|
8
|
+
* Time that never passes unless a test says so. A retry test that really sleeps 250 ms is a retry
|
|
9
|
+
* test nobody runs, so `sleep` resolves at once and records what it was asked for.
|
|
10
|
+
*/
|
|
11
|
+
export const fakeClock = (startMs = 0) => {
|
|
12
|
+
let elapsed = startMs;
|
|
13
|
+
const waits = [];
|
|
14
|
+
return {
|
|
15
|
+
waits,
|
|
16
|
+
clock: () => elapsed,
|
|
17
|
+
now: () => new Date(startMs + elapsed),
|
|
18
|
+
sleep: async (ms, signal, reason) => {
|
|
19
|
+
if (signal?.aborted)
|
|
20
|
+
throw new DOMException("The operation was aborted.", "AbortError");
|
|
21
|
+
waits.push(reason === undefined ? { ms } : { ms, reason });
|
|
22
|
+
elapsed += ms;
|
|
23
|
+
},
|
|
24
|
+
advance: (ms) => {
|
|
25
|
+
elapsed += ms;
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAa9C;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAAO,GAAG,CAAC,EAAa,EAAE;IAClD,IAAI,OAAO,GAAG,OAAO,CAAA;IACrB,MAAM,KAAK,GAAsC,EAAE,CAAA;IAEnD,OAAO;QACL,KAAK;QACL,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO;QACpB,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACtC,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;YAClC,IAAI,MAAM,EAAE,OAAO;gBAAE,MAAM,IAAI,YAAY,CAAC,4BAA4B,EAAE,YAAY,CAAC,CAAA;YACvF,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;YAC1D,OAAO,IAAI,EAAE,CAAA;QACf,CAAC;QACD,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE;YACd,OAAO,IAAI,EAAE,CAAA;QACf,CAAC;KACF,CAAA;AACH,CAAC,CAAA"}
|
package/dist/time.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two clocks and the one timer core needs. All three are injectable, which is what makes
|
|
3
|
+
* timeout and backoff testable without anything actually waiting.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Why the client is waiting. The real sleep ignores it; a test uses it to tell an attempt's
|
|
7
|
+
* deadline apart from a delay between attempts, which are the only two reasons core ever waits.
|
|
8
|
+
* Without it a test that records waits sees both and cannot assert on either.
|
|
9
|
+
*/
|
|
10
|
+
export type SleepReason = "timeout" | "retry";
|
|
11
|
+
/** Rejects with an `AbortError` if the signal fires first, the way `fetch` does. */
|
|
12
|
+
export type SleepLike = (ms: number, signal?: AbortSignal, reason?: SleepReason) => Promise<void>;
|
|
13
|
+
/** Monotonic milliseconds. Durations come from here; a wall clock can step backwards. */
|
|
14
|
+
export type MonotonicClock = () => number;
|
|
15
|
+
/** Wall time. Timestamps that a person or another system will read come from here. */
|
|
16
|
+
export type WallClock = () => Date;
|
|
17
|
+
export declare const abortError: () => DOMException;
|
|
18
|
+
export declare const realSleep: SleepLike;
|
|
19
|
+
export declare const monotonic: MonotonicClock;
|
|
20
|
+
export declare const wallClock: WallClock;
|
|
21
|
+
//# sourceMappingURL=time.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,OAAO,CAAA;AAE7C,oFAAoF;AACpF,MAAM,MAAM,SAAS,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;AAEjG,yFAAyF;AACzF,MAAM,MAAM,cAAc,GAAG,MAAM,MAAM,CAAA;AAEzC,sFAAsF;AACtF,MAAM,MAAM,SAAS,GAAG,MAAM,IAAI,CAAA;AAElC,eAAO,MAAM,UAAU,QAAO,YAA4E,CAAA;AAE1G,eAAO,MAAM,SAAS,EAAE,SAgBpB,CAAA;AAEJ,eAAO,MAAM,SAAS,EAAE,cAAwC,CAAA;AAEhE,eAAO,MAAM,SAAS,EAAE,SAA4B,CAAA"}
|
package/dist/time.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two clocks and the one timer core needs. All three are injectable, which is what makes
|
|
3
|
+
* timeout and backoff testable without anything actually waiting.
|
|
4
|
+
*/
|
|
5
|
+
export const abortError = () => new DOMException("The operation was aborted.", "AbortError");
|
|
6
|
+
export const realSleep = (ms, signal) => new Promise((resolve, reject) => {
|
|
7
|
+
if (signal?.aborted) {
|
|
8
|
+
reject(abortError());
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const timer = setTimeout(resolve, ms);
|
|
12
|
+
signal?.addEventListener("abort", () => {
|
|
13
|
+
clearTimeout(timer);
|
|
14
|
+
reject(abortError());
|
|
15
|
+
}, { once: true });
|
|
16
|
+
});
|
|
17
|
+
export const monotonic = () => performance.now();
|
|
18
|
+
export const wallClock = () => new Date();
|
|
19
|
+
//# sourceMappingURL=time.js.map
|
package/dist/time.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.js","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkBH,MAAM,CAAC,MAAM,UAAU,GAAG,GAAiB,EAAE,CAAC,IAAI,YAAY,CAAC,4BAA4B,EAAE,YAAY,CAAC,CAAA;AAE1G,MAAM,CAAC,MAAM,SAAS,GAAc,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CACjD,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IAC9B,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;QACpB,MAAM,CAAC,UAAU,EAAE,CAAC,CAAA;QACpB,OAAM;IACR,CAAC;IAED,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;IACrC,MAAM,EAAE,gBAAgB,CACtB,OAAO,EACP,GAAG,EAAE;QACH,YAAY,CAAC,KAAK,CAAC,CAAA;QACnB,MAAM,CAAC,UAAU,EAAE,CAAC,CAAA;IACtB,CAAC,EACD,EAAE,IAAI,EAAE,IAAI,EAAE,CACf,CAAA;AACH,CAAC,CAAC,CAAA;AAEJ,MAAM,CAAC,MAAM,SAAS,GAAmB,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,CAAA;AAEhE,MAAM,CAAC,MAAM,SAAS,GAAc,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAA"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export { executableEnvironment, executableOnPath } from "../executable.js";
|
|
2
|
+
import * as v from "valibot";
|
|
3
|
+
import type { FetchLike } from "../http/index.js";
|
|
4
|
+
export type Installer = "pnpm" | "npm" | "bun" | "npx" | "checkout" | "unknown";
|
|
5
|
+
/**
|
|
6
|
+
* Read from where the running file really lives — `realpath` of the script, not `which`: the
|
|
7
|
+
* command on `PATH` is a shim or a link, and only its target says who installed it. Paths measured
|
|
8
|
+
* on 2026-09-24 by installing into throwaway prefixes.
|
|
9
|
+
*/
|
|
10
|
+
export declare const installerOf: (scriptPath: string) => Installer;
|
|
11
|
+
/** The argv that updates a global install, or `undefined` where there is nothing to run. */
|
|
12
|
+
export declare const updateCommand: (installer: Installer, packageName: string) => string[] | undefined;
|
|
13
|
+
/** Plain `x.y.z` only: a pre-release is never offered, so it never counts as newer. */
|
|
14
|
+
export declare const isNewer: (candidate: string, current: string) => boolean;
|
|
15
|
+
/** The `latest` version on npm, or `undefined` on any failure — a hint may never fail a command. */
|
|
16
|
+
export declare const latestVersion: (packageName: string, fetch: FetchLike, { timeoutMs }?: {
|
|
17
|
+
timeoutMs?: number;
|
|
18
|
+
}) => Promise<string | undefined>;
|
|
19
|
+
export declare const CHECK_EVERY_MS: number;
|
|
20
|
+
export interface NotifyContext {
|
|
21
|
+
/** `pretty`, `json` or `jsonl` — the line exists only for the first. */
|
|
22
|
+
format: string;
|
|
23
|
+
stderrIsTTY: boolean;
|
|
24
|
+
quiet: boolean;
|
|
25
|
+
/** The setting; `false` turns the check off. */
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
installer: Installer;
|
|
28
|
+
env: Readonly<Record<string, string | undefined>>;
|
|
29
|
+
/** Extra variables that turn it off, for the CLI's own prefix: `MAX_NO_UPDATE_CHECK`. */
|
|
30
|
+
offVariables?: readonly string[];
|
|
31
|
+
}
|
|
32
|
+
/** Whether a person is at a terminal who could be told — the only case a check is worth making. */
|
|
33
|
+
export declare const mayNotify: ({ format, stderrIsTTY, quiet, enabled, installer, env, offVariables, }: NotifyContext) => boolean;
|
|
34
|
+
declare const updateState: v.ObjectSchema<{
|
|
35
|
+
readonly checkedAt: v.NumberSchema<undefined>;
|
|
36
|
+
readonly latest: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
37
|
+
/** When the skill hint (`cli-base/skill`) was last shown — the other daily notice kept in this file. */
|
|
38
|
+
readonly skillHintAt: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
39
|
+
}, undefined>;
|
|
40
|
+
export type UpdateState = v.InferOutput<typeof updateState>;
|
|
41
|
+
/** The file as it is, `checkedAt: 0` when it is missing or unreadable. */
|
|
42
|
+
export declare const readNoticeState: (path: string) => UpdateState;
|
|
43
|
+
/** What the last check found. A missing or unreadable file is "never checked", not an error. */
|
|
44
|
+
export declare const readUpdateState: (path: string) => UpdateState | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Merged into the file as it is at the moment of writing: the update notice reads before it asks
|
|
47
|
+
* npm and writes after, and the skill hint may have written in between.
|
|
48
|
+
*/
|
|
49
|
+
export declare const writeUpdateState: (path: string, state: Partial<UpdateState>) => void;
|
|
50
|
+
export declare const checkIsDue: (state: UpdateState | undefined, now: number) => boolean;
|
|
51
|
+
/** Resolve Windows shims from explicit PATH entries; cross-spawn quotes them through the trusted shell. */
|
|
52
|
+
export declare const spawnPlan: ([command, ...args]: readonly string[], platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv, exists?: (path: string) => boolean) => {
|
|
53
|
+
file: string;
|
|
54
|
+
args: string[];
|
|
55
|
+
shell: boolean;
|
|
56
|
+
};
|
|
57
|
+
/** Runs the update and answers its exit code. stdout stays one result: the package manager's output goes to stderr. */
|
|
58
|
+
export declare const runUpdate: (argv: readonly string[]) => number;
|
|
59
|
+
export interface NoticeRequest extends NotifyContext {
|
|
60
|
+
/** The words the CLI was run with, to leave `update` and `complete` alone. */
|
|
61
|
+
argv: readonly string[];
|
|
62
|
+
packageName: string;
|
|
63
|
+
/** The command a person types: `braze`, `max`. */
|
|
64
|
+
command: string;
|
|
65
|
+
version: string;
|
|
66
|
+
/** Where the last answer from npm is kept — the CLI's state directory. */
|
|
67
|
+
statePath: string;
|
|
68
|
+
fetch: FetchLike;
|
|
69
|
+
now?: () => number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The daily "a newer version exists" line, or `undefined`. Meant to be started beside the command
|
|
73
|
+
* and awaited after it, so asking npm costs the command nothing; any failure is silence.
|
|
74
|
+
*/
|
|
75
|
+
export declare const updateNotice: ({ argv, packageName, command, version, statePath, fetch, now, ...context }: NoticeRequest) => Promise<string | undefined>;
|
|
76
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/update/index.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAE1E,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEjD,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,CAAA;AAE/E;;;;GAIG;AACH,eAAO,MAAM,WAAW,eAAgB,MAAM,KAAG,SAOhD,CAAA;AAED,4FAA4F;AAC5F,eAAO,MAAM,aAAa,cAAe,SAAS,eAAe,MAAM,KAAG,MAAM,EAAE,GAAG,SAYpF,CAAA;AAED,u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