bantamkit-mcp 0.29.2 → 0.31.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 +83 -2
- package/assets/pricing/default.json +7 -0
- package/assets/schemas/shiftwork-checkpoint.json +12 -1
- package/assets/tools/memory_dream.json +20 -0
- package/assets/tools/repo_map.json +44 -0
- package/assets/tools/shiftwork_clock_out.json +1 -1
- package/assets/tools/token_ledger.json +40 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +135 -4
- package/dist/eventlog.js +6 -4
- package/dist/index.d.ts +5 -3
- package/dist/index.js +2 -1
- package/dist/mcp/identity.d.ts +80 -0
- package/dist/mcp/identity.js +466 -4
- package/dist/mcp/pyargs.d.ts +1 -1
- package/dist/mcp/pyargs.js +78 -0
- package/dist/mcp/server.d.ts +37 -6
- package/dist/mcp/server.js +209 -5
- package/dist/mcp/status.d.ts +54 -10
- package/dist/mcp/status.js +86 -10
- package/dist/memory/cli.js +1 -1
- package/dist/memory/component.d.ts +73 -2
- package/dist/memory/component.js +157 -5
- package/dist/memory/dream.d.ts +247 -0
- package/dist/memory/dream.js +903 -0
- package/dist/memory/store.d.ts +101 -1
- package/dist/memory/store.js +178 -4
- package/dist/pricing.d.ts +100 -0
- package/dist/pricing.js +357 -0
- package/dist/repomap.d.ts +247 -0
- package/dist/repomap.js +1040 -0
- package/dist/selfupdate.d.ts +320 -0
- package/dist/selfupdate.js +594 -0
- package/dist/shiftwork.d.ts +5 -3
- package/dist/shiftwork.js +82 -4
- package/dist/tokenledger.d.ts +91 -0
- package/dist/tokenledger.js +372 -0
- package/package.json +1 -1
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The command the operator typed, on BOTH runtimes. Not the package name — see the module
|
|
3
|
+
* docstring: PyPI has `bantamkit`, npm has `bantamkit-mcp`, and only this word is the same on
|
|
4
|
+
* both, so only this word can appear in a sentence the reference and this file share verbatim.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PROGRAM = "bantamkit-mcp";
|
|
7
|
+
/** The npm package this install would upgrade. Divergent by construction (`DISTRIBUTION`). */
|
|
8
|
+
export declare const PACKAGE = "bantamkit-mcp";
|
|
9
|
+
/**
|
|
10
|
+
* The one URL this toolbox ever fetches. Divergent by construction (`INDEX_URL`).
|
|
11
|
+
*
|
|
12
|
+
* `/latest` and not the full packument: the packument carries every version ever published and
|
|
13
|
+
* grows without bound, and the question here is one string. Measured 2026-09-11 — this document
|
|
14
|
+
* is 26 keys and carries `version` at the top level.
|
|
15
|
+
*/
|
|
16
|
+
export declare const INDEX_URL = "https://registry.npmjs.org/bantamkit-mcp/latest";
|
|
17
|
+
/**
|
|
18
|
+
* Explicit, and short enough that a person who typed the flag does not think it hung.
|
|
19
|
+
* AS-7(3): the network is not on any other path here, so nothing else inherits this.
|
|
20
|
+
*/
|
|
21
|
+
export declare const DEFAULT_TIMEOUT_SECONDS = 10;
|
|
22
|
+
/**
|
|
23
|
+
* What stands in for an installer that printed nothing, so the report has ONE shape rather
|
|
24
|
+
* than a line that is sometimes there. A conditional line is a second thing to port.
|
|
25
|
+
*/
|
|
26
|
+
export declare const NO_OUTPUT = "(nothing)";
|
|
27
|
+
/**
|
|
28
|
+
* Line 1 of every report, and the opening of the no-route refusal. It carries BOTH numbers
|
|
29
|
+
* because "up to date" without them is unfalsifiable by the person reading it.
|
|
30
|
+
*/
|
|
31
|
+
export declare const COMPARISON = "{program} {installed} is installed; the package index has {latest}.";
|
|
32
|
+
/** The user asked for this word specifically: "ถ้า match ให้แสดงคำ uptodate". */
|
|
33
|
+
export declare const UP_TO_DATE = "up to date.";
|
|
34
|
+
/**
|
|
35
|
+
* The registry BEHIND the installed version. A real state, not a curiosity: a checkout build,
|
|
36
|
+
* or a release that has not been published yet, both land here.
|
|
37
|
+
*/
|
|
38
|
+
export declare const AHEAD = "the installed version is ahead of the package index; there is nothing to update to.";
|
|
39
|
+
/** What the command is about to run. The command itself is divergent; this line is not. */
|
|
40
|
+
export declare const UPDATING = "updating from the package index: {command}";
|
|
41
|
+
/** The installer's own words, never summarised. Both runtimes print the block the same way. */
|
|
42
|
+
export declare const PRINTED = "the command printed:";
|
|
43
|
+
export declare const UPDATED = "updated {program} from {installed} to {latest}.";
|
|
44
|
+
/** AS-7(1), measured. This is the line that makes the success true rather than plausible. */
|
|
45
|
+
export declare const RESTART: string;
|
|
46
|
+
export declare const NO_ROUTE: string;
|
|
47
|
+
export declare const TIMED_OUT: string;
|
|
48
|
+
export declare const UNREACHABLE: string;
|
|
49
|
+
export declare const NOT_A_VERSION: string;
|
|
50
|
+
/**
|
|
51
|
+
* Multi-line on purpose. The installer's output is the only thing that says WHY it failed,
|
|
52
|
+
* and a refusal that swallowed it would send the operator to re-run the command by hand.
|
|
53
|
+
*/
|
|
54
|
+
export declare const COMMAND_FAILED: string;
|
|
55
|
+
/**
|
|
56
|
+
* The install shape itself could not be derived — `identity.Undetermined`, which is what an
|
|
57
|
+
* origin that is neither an index nor a path on this machine raises (`git+https://…`). That
|
|
58
|
+
* exception already carries the operator's next step, so this sentence quotes it rather than
|
|
59
|
+
* paraphrasing it, and refuses rather than picking a route.
|
|
60
|
+
*/
|
|
61
|
+
export declare const SHAPE_UNKNOWN: string;
|
|
62
|
+
/**
|
|
63
|
+
* The two ways a well-formed HTTP response can still not carry a version, as the `{why}` of
|
|
64
|
+
* `NOT_A_VERSION`. Both runtimes ask a different URL and read a different JSON path, so what
|
|
65
|
+
* is compared is that the same two failures produce the same two sentences.
|
|
66
|
+
*/
|
|
67
|
+
export declare const NOT_JSON = "the response is not JSON";
|
|
68
|
+
export declare const NO_VERSION_FIELD = "the response carries no version string";
|
|
69
|
+
/**
|
|
70
|
+
* The fallthrough for a shape word `ROUTES` has never heard of — `INSTALL_SHAPES` growing a
|
|
71
|
+
* sixth word. Not divergent: it names no package manager, so it is the reference's sentence.
|
|
72
|
+
*/
|
|
73
|
+
export declare const NO_RECORDED_ROUTE = "There is no recorded update route for a {shape} install, so --update will not guess one.";
|
|
74
|
+
/**
|
|
75
|
+
* Per shape, what the real update route is — the answer to "then how DO I update this?".
|
|
76
|
+
* DIVERGENT BY CONSTRUCTION and registered in `docs/porting.md` by J46-31: the reference's
|
|
77
|
+
* rows name pip and a Python tree; these name npm and a BUILT one.
|
|
78
|
+
*
|
|
79
|
+
* `registry` is absent on purpose, exactly as it is there. It is the one shape that HAS a
|
|
80
|
+
* route through this flag, so a sentence telling its operator to go do it by hand would never
|
|
81
|
+
* be reachable, and an unreachable sentence is one more thing for nobody to check.
|
|
82
|
+
*
|
|
83
|
+
* `{command}` is the SAME string `upgradeCommand` builds and `UPDATING` prints, never a second
|
|
84
|
+
* spelling of it — `local-file` is the one row whose advice is an actual command, and the
|
|
85
|
+
* README's measured fix for the real incident is exactly this: `npm i --prefix
|
|
86
|
+
* ~/.local/share/bantamkit-mcp bantamkit-mcp@latest`.
|
|
87
|
+
*
|
|
88
|
+
* `linked` and `checkout` BOTH say "rebuild it". That is not padding and it is the difference
|
|
89
|
+
* from the reference that matters most on this side: an editable Python install serves the
|
|
90
|
+
* `.py` files a `git pull` just changed, and a Node install serves `dist/`, which is build
|
|
91
|
+
* output. `README.md#updating`'s checkout row already says `git pull && npm ci && npm run
|
|
92
|
+
* build`, and a route that stopped at `git pull` would be a remedy that changes nothing.
|
|
93
|
+
*
|
|
94
|
+
* `ephemeral` IS NOT A TRANSLATION OF THE REFERENCE'S ROW, and making it one would make it
|
|
95
|
+
* false. There it says "the next run fetches {latest} by itself", which is true of a `pipx
|
|
96
|
+
* run` environment; here the shape is an `npx` cache, and `README.md#silent-version-float`
|
|
97
|
+
* measured that `npx -y bantamkit-mcp` RESOLVES `latest` ONCE AND CACHES IT — two people with
|
|
98
|
+
* byte-identical config can be running builds resolved weeks apart. So this row is true of the
|
|
99
|
+
* cache that actually exists rather than of a fresh resolve that does not happen, and it names
|
|
100
|
+
* the only thing that changes it: the spec on the host's command line.
|
|
101
|
+
*/
|
|
102
|
+
export declare const ROUTES: Record<string, string>;
|
|
103
|
+
/**
|
|
104
|
+
* A refusal carrying the sentence the operator should read. Never a stack trace.
|
|
105
|
+
*
|
|
106
|
+
* The same contract `hostinstall.InstallError` has, and for the same reason: `--update` can
|
|
107
|
+
* fail for four reasons that are all somebody else's to fix, and a stack trace names none.
|
|
108
|
+
*/
|
|
109
|
+
export declare class UpdateRefused extends Error {
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The clock ran out. THE CONTRACT BETWEEN `fetchIndex` AND `update` IS THIS TYPE.
|
|
113
|
+
*
|
|
114
|
+
* On the reference side the distinction is `TimeoutError` vs any other `OSError`, and the
|
|
115
|
+
* ORDER of the two `except` clauses is load-bearing because `TimeoutError` IS an `OSError`.
|
|
116
|
+
* The Node hazard is the same one with different names, and it is MEASURED (Node v25.2.1):
|
|
117
|
+
* an `AbortSignal.timeout` abort arrives as a `DOMException` whose `name` is `'TimeoutError'`
|
|
118
|
+
* — and `DOMException` IS `instanceof Error`. So a `catch` that tested `instanceof Error`
|
|
119
|
+
* first would swallow every timeout into the unreachable arm, which names the wrong problem
|
|
120
|
+
* and sends the operator to check a network that is working. `test/selfupdate.test.mjs` pins
|
|
121
|
+
* both halves: that this class is an `Error`, and that the real abort reason is one too.
|
|
122
|
+
*/
|
|
123
|
+
export declare class IndexTimeout extends Error {
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* The install shape and the path it can be pointed at, as `--update` needs them.
|
|
127
|
+
*
|
|
128
|
+
* DELIBERATELY NOT `identity.Install`. That record carries `sourceReason`, which is the
|
|
129
|
+
* `build_identity` wire shape's business and not this flag's; and this keeps the whole
|
|
130
|
+
* decision table testable by constructing a shape directly, including shape words this
|
|
131
|
+
* runtime would never derive. `runUpdate` does the one-line translation.
|
|
132
|
+
*/
|
|
133
|
+
export interface Origin {
|
|
134
|
+
readonly shape: string;
|
|
135
|
+
readonly source: string;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* WHERE an `npm install` would have to point to replace THIS copy, and whether that is the
|
|
139
|
+
* global tree. Not a second install-shape detector — it derives no shape and answers no shape
|
|
140
|
+
* question; the shape comes from `currentInstall()` and from nowhere else.
|
|
141
|
+
*
|
|
142
|
+
* `global` IS A RECORD, NOT A GUESS, AND THE DIFFERENCE IS DESTRUCTIVE. Measured on this
|
|
143
|
+
* machine 2026-09-11 with npm 11.6.2:
|
|
144
|
+
*
|
|
145
|
+
* - `npm install --prefix <dir> <pkg>` installs into `<dir>/node_modules` and, when `<dir>`
|
|
146
|
+
* already has the `package.json` npm itself wrote there, leaves every sibling package
|
|
147
|
+
* alone.
|
|
148
|
+
* - with NO `package.json` in `<dir>` — which is exactly the global tree's shape, confirmed
|
|
149
|
+
* at `/Users/kktest/.local/share/mise/installs/node/25.2.1/lib`, where `node_modules` holds
|
|
150
|
+
* `@shopify`, `eas-cli` and `npm` and there is no `package.json` beside it — the same
|
|
151
|
+
* command PRUNES the siblings. A fixture with two packages came back with one.
|
|
152
|
+
*
|
|
153
|
+
* So the presence of that `package.json` is the discriminator, and it is a file npm writes for
|
|
154
|
+
* a `--prefix` install and does not write for a global one. Getting this backwards would make
|
|
155
|
+
* `--update` delete a developer's other global CLIs, which is worse than every failure this
|
|
156
|
+
* flag has a sentence for.
|
|
157
|
+
*
|
|
158
|
+
* `root` is `''` when no `node_modules` ancestor exists at all. That arm cannot be reached
|
|
159
|
+
* from the `registry` shape — `deriveInstall` answers `registry` only from inside a
|
|
160
|
+
* `node_modules` — and the pairing is pinned in `test/selfupdate.test.mjs` rather than left as
|
|
161
|
+
* a comment, because the global command it produces needs no root and would otherwise be
|
|
162
|
+
* silently plausible.
|
|
163
|
+
*/
|
|
164
|
+
export interface Environment {
|
|
165
|
+
readonly root: string;
|
|
166
|
+
readonly global: boolean;
|
|
167
|
+
}
|
|
168
|
+
export declare function installEnvironment(runningFile?: string): Environment;
|
|
169
|
+
/**
|
|
170
|
+
* `str.format` over the one substitution shape these sentences use — `{name}` and nothing else.
|
|
171
|
+
*
|
|
172
|
+
* A missing key THROWS, the way `str.format` raises `KeyError`, rather than leaving `{name}`
|
|
173
|
+
* in the text: an unsubstituted placeholder reaching the operator is a defect the reference's
|
|
174
|
+
* suite asserts against by name, and a silent passthrough is how one ships.
|
|
175
|
+
*/
|
|
176
|
+
export declare function fill(template: string, values: Readonly<Record<string, string | number>>): string;
|
|
177
|
+
/**
|
|
178
|
+
* `shlex.join`: `shlex.quote` each word and space them.
|
|
179
|
+
*
|
|
180
|
+
* Hand-rolled from CPython's own rule — `_find_unsafe = re.compile(r'[^\w@%+=:,./-]', re.ASCII)`
|
|
181
|
+
* — because the rendered command is printed to the operator by `UPDATING`, by `COMMAND_FAILED`
|
|
182
|
+
* and by the `local-file` route, and a prefix path with a space in it is the normal case on
|
|
183
|
+
* macOS and on Windows. Single quotes, with an embedded `'` closed and reopened the way
|
|
184
|
+
* `shlex.quote` does it, so the line can be pasted back into a shell unchanged.
|
|
185
|
+
*/
|
|
186
|
+
export declare function shlexJoin(command: readonly string[]): string;
|
|
187
|
+
/**
|
|
188
|
+
* The version string out of the registry's JSON, or a named refusal. Pure — no network here.
|
|
189
|
+
*
|
|
190
|
+
* SPLIT FROM THE FETCH SO THE GARBAGE CASE IS TESTED THROUGH THE REAL PARSER, exactly as the
|
|
191
|
+
* reference splits it: a test that stubbed a parsed version would prove nothing about what
|
|
192
|
+
* happens when a captive-portal login page comes back with a 200, which is the realistic shape
|
|
193
|
+
* of "the index answered and it was not the index".
|
|
194
|
+
*
|
|
195
|
+
* THE JSON PATH IS THE DIVERGENCE. PyPI nests it at `info.version`; `registry.npmjs.org/<pkg>/
|
|
196
|
+
* latest` carries it at the top level. Both refusals below are the same two sentences.
|
|
197
|
+
*/
|
|
198
|
+
export declare function latestFromIndexPayload(text: string): string;
|
|
199
|
+
/**
|
|
200
|
+
* The ONLY network call in this runtime. One request, one timeout, two failure words.
|
|
201
|
+
*
|
|
202
|
+
* THE PLATFORM'S `fetch`, NOT A DEPENDENCY. `package.json` declares exactly one runtime
|
|
203
|
+
* dependency and the pure-node `npx` install is a standing ruling, so the HTTP client is the
|
|
204
|
+
* one Node ships (>= 18, and `engines` already requires >= 20) and the deadline is
|
|
205
|
+
* `AbortSignal.timeout`, which is the same object the abort arrives as.
|
|
206
|
+
*
|
|
207
|
+
* THE CONTRACT WITH `update` IS THE EXCEPTION TYPE — see `IndexTimeout`. Measured on Node
|
|
208
|
+
* v25.2.1 against a local socket that accepts and never answers: the rejection is a
|
|
209
|
+
* `DOMException` named `TimeoutError`. Everything else is a `TypeError: fetch failed` whose
|
|
210
|
+
* `cause` carries the sentence worth printing — `connect ECONNREFUSED 127.0.0.1:49999`,
|
|
211
|
+
* `getaddrinfo ENOTFOUND …` — so the cause's message is what `UNREACHABLE` interpolates and
|
|
212
|
+
* the bare "fetch failed" never reaches an operator.
|
|
213
|
+
*
|
|
214
|
+
* A non-2xx is an `Error` and not a timeout, the way the reference turns `HTTPError` into a
|
|
215
|
+
* plain `OSError`; and the body is decoded leniently, because a body that is not UTF-8 is not
|
|
216
|
+
* a version either and should be refused BY NAME in `latestFromIndexPayload`.
|
|
217
|
+
*/
|
|
218
|
+
export declare function fetchIndex(url?: string, timeout?: number): Promise<string>;
|
|
219
|
+
/**
|
|
220
|
+
* What a `registry` install upgrades with, ON THE TREE IT IS ACTUALLY IN.
|
|
221
|
+
*
|
|
222
|
+
* The reference's reason transfers exactly: "the server may be running from a venv whose `pip`
|
|
223
|
+
* is not the one first on `PATH`, and upgrading the wrong environment is a failure that
|
|
224
|
+
* reports success." Here the wrong environment is a different `node_modules`, and `--prefix` is
|
|
225
|
+
* npm's own way of naming the right one.
|
|
226
|
+
*
|
|
227
|
+
* `--global` FOR THE GLOBAL TREE AND NEVER `--prefix`. See `installEnvironment`: on a tree with
|
|
228
|
+
* no `package.json` beside `node_modules`, `npm install --prefix` prunes every sibling package.
|
|
229
|
+
* Both arms are the rows `README.md#updating` already documents.
|
|
230
|
+
*
|
|
231
|
+
* `@latest` IS NOT DECORATION. `npm install <pkg>` in a tree that already declares `<pkg>`
|
|
232
|
+
* satisfies the existing range rather than moving it, which is a command that exits 0 having
|
|
233
|
+
* changed nothing — the J46-4 defect, arrived at through npm's semantics rather than through
|
|
234
|
+
* this code's.
|
|
235
|
+
*/
|
|
236
|
+
export declare function upgradeCommand(environment: Environment): string[];
|
|
237
|
+
/**
|
|
238
|
+
* Run the installer, capture what it said, return both. The only side effect in this module.
|
|
239
|
+
*
|
|
240
|
+
* CAPTURED RATHER THAN INHERITED so the report has one shape whether or not anybody is
|
|
241
|
+
* watching, and so a test can inject a substitute and assert on the command WITHOUT a real
|
|
242
|
+
* install ever running.
|
|
243
|
+
*
|
|
244
|
+
* THE ONE PLACE THIS IS NOT THE REFERENCE'S BEHAVIOUR: `stderr=STDOUT` genuinely interleaves
|
|
245
|
+
* the two streams in the order they happened, and `spawnSync` has no fd-dup, so the two pipes
|
|
246
|
+
* are concatenated instead — stdout, then stderr. npm writes its progress to stderr and its
|
|
247
|
+
* result to stdout, so an operator reading a failure still gets both, in two blocks rather than
|
|
248
|
+
* one. The installer's own words are never compared across runtimes; the sentences around them
|
|
249
|
+
* are.
|
|
250
|
+
*
|
|
251
|
+
* `shell: true` ON WINDOWS ONLY, the idiom `hostinstall.installViaClaudeCli` established for
|
|
252
|
+
* the same reason: npm is a `npm.cmd` batch shim there and `spawnSync` returns ENOENT for a
|
|
253
|
+
* batch file without a shell. Arguments are quoted because `cmd.exe` gets a string.
|
|
254
|
+
*/
|
|
255
|
+
export declare function runInstaller(command: readonly string[]): [number, string];
|
|
256
|
+
/**
|
|
257
|
+
* -1 when the index is ahead, 0 when they agree, 1 when the installed version is ahead.
|
|
258
|
+
*
|
|
259
|
+
* The shorter of the two is padded with numeric zeros, so `0.30` and `0.30.0` agree — which is
|
|
260
|
+
* what a person means by them and what both registries would print for one release.
|
|
261
|
+
*/
|
|
262
|
+
export declare function compareVersions(installed: string, latest: string): number;
|
|
263
|
+
/**
|
|
264
|
+
* `10` rather than `10.0`, because the sentence is read by a person, not parsed.
|
|
265
|
+
*
|
|
266
|
+
* The reference spells this out so that Node's default rendering of a whole number is what
|
|
267
|
+
* both sides print, which is what keeps `TIMED_OUT` byte-identical instead of ruled. Here it
|
|
268
|
+
* is the identity function on a number, and it exists so the pairing is visible from both
|
|
269
|
+
* files rather than only from one.
|
|
270
|
+
*/
|
|
271
|
+
export declare function seconds(timeout: number): string;
|
|
272
|
+
export interface UpdateOptions {
|
|
273
|
+
readonly fetch?: (url: string, timeout: number) => Promise<string> | string;
|
|
274
|
+
readonly installer?: (command: string[]) => [number, string];
|
|
275
|
+
readonly url?: string;
|
|
276
|
+
readonly timeout?: number;
|
|
277
|
+
readonly environment?: Environment;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* The whole flag: ask the index, compare, and act — or refuse, by name.
|
|
281
|
+
*
|
|
282
|
+
* THE TWO SEAMS ARE `fetch` AND `installer`, and they are options with real defaults rather
|
|
283
|
+
* than module bindings a test rewrites. A test that reached the registry would fail on a plane
|
|
284
|
+
* and pass for the wrong reason off a cache; a test that ran a real installer would rewrite the
|
|
285
|
+
* developer's own `node_modules` mid-suite. Both substitutes are handed in here, so every arm
|
|
286
|
+
* below is reachable offline and the npm command is CAPTURED, never run.
|
|
287
|
+
*
|
|
288
|
+
* THE INDEX IS ASKED BEFORE THE SHAPE IS JUDGED, and that order is the reference's and is
|
|
289
|
+
* deliberate. The user asked the flag to go and check the latest version; an operator on a
|
|
290
|
+
* checkout five releases behind is owed that number even though this flag will not be the thing
|
|
291
|
+
* that installs it. The shape decides the ACTION, never whether the question is asked.
|
|
292
|
+
*/
|
|
293
|
+
export declare function update(installed: string, origin: Origin, options?: UpdateOptions): Promise<string>;
|
|
294
|
+
/**
|
|
295
|
+
* `--update` on the CLI: ask the package index, act on the answer, print what happened, exit.
|
|
296
|
+
*
|
|
297
|
+
* THE SENTENCES ARE NOT HERE. This function owns three things and nothing else: where the
|
|
298
|
+
* shape comes from, which stream each outcome is written to, and the exit code.
|
|
299
|
+
*
|
|
300
|
+
* STDOUT + EXIT 0 IS ONLY FOR AN ANSWER THAT IS ALREADY TRUE — up to date, the index behind,
|
|
301
|
+
* or an update that actually ran. Everything else is `error: <sentence>` on stderr and exit 1,
|
|
302
|
+
* including the install shapes this flag will not touch: an operator who typed `--update`
|
|
303
|
+
* asked for an update, and a command that exits 0 having changed nothing is the J46-4 defect
|
|
304
|
+
* by name. Exit 1 rather than 2 because argparse already owns 2 for a usage error.
|
|
305
|
+
*
|
|
306
|
+
* THE SHAPE IS `currentInstall()`'s ANSWER AND NOT A SECOND DETECTOR. J46-12 (`c9372ca`)
|
|
307
|
+
* shipped it as a module-level function taking no arguments and touching no server state,
|
|
308
|
+
* explicitly so this flag could ask it before a store or a transport exists.
|
|
309
|
+
*
|
|
310
|
+
* `Undetermined` — a `git+https://…` origin, which is neither an index nor a path on this
|
|
311
|
+
* machine — is a refusal and not a fallback. Its own message already names the route, so it is
|
|
312
|
+
* quoted rather than paraphrased.
|
|
313
|
+
*
|
|
314
|
+
* THE WRITERS ARE ARGUMENTS so this arm is testable without a subprocess and without rewriting
|
|
315
|
+
* `process.stdout`. `cli.ts` hands in the real two. Both receive a UTF-8 string, which is LF
|
|
316
|
+
* on every platform — the same reason the reference goes through `sys.stdout.buffer`, where
|
|
317
|
+
* `print` would emit CRLF on Windows and a byte-comparing conformance runner would read that
|
|
318
|
+
* as a divergence belonging to the writer rather than to the product.
|
|
319
|
+
*/
|
|
320
|
+
export declare function runUpdate(out: (text: string) => void, err: (text: string) => void, installed: string, packageDirectory: string, options?: UpdateOptions): Promise<number>;
|