@the-librarian/cli 1.0.0-rc.3 → 1.0.0-rc.5
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 +201 -0
- package/dist/bin.js +0 -0
- package/dist/commands/install.d.ts +6 -0
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +54 -2
- package/dist/commands/install.js.map +1 -1
- package/dist/harnesses/hermes.d.ts +1 -1
- package/dist/harnesses/hermes.js +1 -1
- package/dist/prompt.d.ts +7 -0
- package/dist/prompt.d.ts.map +1 -1
- package/dist/prompt.js +79 -29
- package/dist/prompt.js.map +1 -1
- package/dist/runtime.d.ts +6 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +23 -6
- package/dist/runtime.js.map +1 -1
- package/package.json +10 -11
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/dist/bin.js
CHANGED
|
File without changes
|
|
@@ -4,6 +4,12 @@ export interface InstallDeps {
|
|
|
4
4
|
home?: string | undefined;
|
|
5
5
|
shell?: Shell | undefined;
|
|
6
6
|
prompter: Prompter;
|
|
7
|
+
/**
|
|
8
|
+
* The process environment to read existing `LIBRARIAN_*` vars from (BUG 2).
|
|
9
|
+
* Injectable so tests never read the real `process.env`. Defaults to
|
|
10
|
+
* `process.env`. The token value is never logged.
|
|
11
|
+
*/
|
|
12
|
+
env?: NodeJS.ProcessEnv | undefined;
|
|
7
13
|
}
|
|
8
14
|
export interface InstallOutcome {
|
|
9
15
|
installed: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAIvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAG7C,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAIvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAG7C,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC;CACrC;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1C,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACzC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,+EAA+E;AAC/E,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CA2D5F"}
|
package/dist/commands/install.js
CHANGED
|
@@ -79,21 +79,73 @@ export async function runInstall(named, deps) {
|
|
|
79
79
|
* Returns the in-memory config and whether it differs from what's persisted
|
|
80
80
|
* (so the caller can defer the actual `setConfig` write until a harness
|
|
81
81
|
* install has succeeded — S1). Does NOT touch the filesystem.
|
|
82
|
+
*
|
|
83
|
+
* Source precedence (BUG 2 — reuse existing `LIBRARIAN_*`):
|
|
84
|
+
* 1. `~/.librarian/env` already has BOTH values → use them, no prompts.
|
|
85
|
+
* 2. Otherwise, consult `process.env` (injected as `deps.env`):
|
|
86
|
+
* - BOTH `LIBRARIAN_MCP_URL` + `LIBRARIAN_AGENT_TOKEN` present → offer
|
|
87
|
+
* to reuse them (URL shown in full, token redacted to
|
|
88
|
+
* `LIBRARIAN_AGENT_TOKEN=set` — the value is NEVER displayed). Accept
|
|
89
|
+
* → use them; decline → prompt for fresh values.
|
|
90
|
+
* - Only ONE present → prefill it as that prompt's default so the user
|
|
91
|
+
* can accept with enter; prompt for the other.
|
|
92
|
+
* - Neither → prompt for both (unchanged behaviour).
|
|
93
|
+
* The token value is never logged.
|
|
82
94
|
*/
|
|
83
95
|
async function resolveConfig(deps) {
|
|
84
96
|
const existing = readConfig(deps.home);
|
|
97
|
+
const env = deps.env ?? process.env;
|
|
98
|
+
const envUrl = (env.LIBRARIAN_MCP_URL ?? "").trim();
|
|
99
|
+
const envToken = (env.LIBRARIAN_AGENT_TOKEN ?? "").trim();
|
|
85
100
|
let mcpUrl = existing?.mcpUrl ?? "";
|
|
86
101
|
let token = existing?.token ?? "";
|
|
102
|
+
// When both env vars are present we offer to reuse them as a pair; if the
|
|
103
|
+
// user DECLINES we prompt for fresh values WITHOUT prefilling the rejected
|
|
104
|
+
// env defaults. A single env var, by contrast, prefills its prompt's default.
|
|
105
|
+
let declinedEnvPair = false;
|
|
106
|
+
// (2) Only consult the environment when the persisted config is incomplete.
|
|
107
|
+
if ((!mcpUrl || !token) && envUrl && envToken) {
|
|
108
|
+
// Both present → offer to reuse them, showing the URL but redacting the
|
|
109
|
+
// token (only that it's set, never its value).
|
|
110
|
+
const question = [
|
|
111
|
+
"Found these in your environment:",
|
|
112
|
+
` LIBRARIAN_MCP_URL=${envUrl}`,
|
|
113
|
+
" LIBRARIAN_AGENT_TOKEN=set",
|
|
114
|
+
"Use the LIBRARIAN_MCP_URL and LIBRARIAN_AGENT_TOKEN from your environment? [Y/n]",
|
|
115
|
+
].join("\n");
|
|
116
|
+
const answer = await deps.prompter.promptText(question, { default: "y" });
|
|
117
|
+
if (isYes(answer)) {
|
|
118
|
+
if (!mcpUrl)
|
|
119
|
+
mcpUrl = envUrl;
|
|
120
|
+
if (!token)
|
|
121
|
+
token = envToken;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
declinedEnvPair = true;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
// Prompt for anything still missing. When exactly one env var is present (and
|
|
128
|
+
// we didn't just decline the both-present pair), prefill it as the prompt's
|
|
129
|
+
// default so the user can accept it with a bare enter.
|
|
87
130
|
if (!mcpUrl) {
|
|
88
|
-
|
|
131
|
+
const opts = envUrl && !declinedEnvPair ? { default: envUrl } : undefined;
|
|
132
|
+
mcpUrl = await deps.prompter.promptText("MCP URL", opts);
|
|
89
133
|
}
|
|
90
134
|
if (!token) {
|
|
91
|
-
|
|
135
|
+
// A secret prompt never echoes a default, but a present env token can still
|
|
136
|
+
// back an empty reply — so pass it as the default invisibly.
|
|
137
|
+
const opts = envToken && !declinedEnvPair ? { default: envToken, secret: true } : { secret: true };
|
|
138
|
+
token = await deps.prompter.promptText("Agent token", opts);
|
|
92
139
|
}
|
|
93
140
|
const changed = mcpUrl !== existing?.mcpUrl || token !== existing?.token;
|
|
94
141
|
const cfg = { mcpUrl, token, serverUrl: deriveServerUrl(mcpUrl) };
|
|
95
142
|
return { cfg, changed };
|
|
96
143
|
}
|
|
144
|
+
/** A yes/no answer parser — empty (bare enter) counts as yes given a "y" default. */
|
|
145
|
+
function isYes(answer) {
|
|
146
|
+
const a = answer.trim().toLowerCase();
|
|
147
|
+
return a === "" || a === "y" || a === "yes";
|
|
148
|
+
}
|
|
97
149
|
/**
|
|
98
150
|
* Resolve the harness set to install into:
|
|
99
151
|
* - explicit args (validated) win;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,EAAE;AACF,QAAQ;AACR,yEAAyE;AACzE,8EAA8E;AAC9E,4EAA4E;AAC5E,qEAAqE;AACrE,+EAA+E;AAC/E,+EAA+E;AAC/E,+DAA+D;AAC/D,uEAAuE;AACvE,2EAA2E;AAC3E,4DAA4D;AAC5D,wEAAwE;AAExE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAwB,MAAM,cAAc,CAAC;AAE5F,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAsB,MAAM,uBAAuB,CAAC;AAEtF,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,EAAE;AACF,QAAQ;AACR,yEAAyE;AACzE,8EAA8E;AAC9E,4EAA4E;AAC5E,qEAAqE;AACrE,+EAA+E;AAC/E,+EAA+E;AAC/E,+DAA+D;AAC/D,uEAAuE;AACvE,2EAA2E;AAC3E,4DAA4D;AAC5D,wEAAwE;AAExE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAwB,MAAM,cAAc,CAAC;AAE5F,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,WAAW,EAA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
|
/**
|
|
4
4
|
* Fetches the Hermes adapter for a pinned ref and returns the absolute
|
|
5
5
|
* path to a directory whose contents ARE the adapter (the equivalent of
|
package/dist/harnesses/hermes.js
CHANGED
|
@@ -25,7 +25,7 @@ import { hermesConfigPath, hermesHomeDir, hermesPluginDir } from "../paths.js";
|
|
|
25
25
|
const PROVIDER_ID = "librarian";
|
|
26
26
|
// The pinned monorepo release we fetch the adapter from. Default to the
|
|
27
27
|
// repo's current release tag; the phase gate owns version bumps.
|
|
28
|
-
export const PINNED_REF = "v1.0.0-rc.
|
|
28
|
+
export const PINNED_REF = "v1.0.0-rc.5";
|
|
29
29
|
/** The default fetcher: codeload tarball → `tar` extract → adapter dir. */
|
|
30
30
|
const defaultFetcher = async (ref) => {
|
|
31
31
|
const url = `https://codeload.github.com/JimJafar/the-librarian/tar.gz/refs/tags/${ref}`;
|
package/dist/prompt.d.ts
CHANGED
|
@@ -16,6 +16,13 @@ export type PromptFn = (question: string, opts: {
|
|
|
16
16
|
export interface Prompter {
|
|
17
17
|
selectHarnesses(available: HarnessChoice[]): Promise<string[]>;
|
|
18
18
|
promptText(question: string, opts?: PromptTextOptions): Promise<string>;
|
|
19
|
+
/**
|
|
20
|
+
* Release any resources held for interactive prompting (the shared readline
|
|
21
|
+
* interface). Safe to call when nothing was opened, and idempotent. Callers
|
|
22
|
+
* MUST invoke this once the prompting phase is done — an open readline keeps
|
|
23
|
+
* the Node event loop alive, so the process won't exit until it's closed.
|
|
24
|
+
*/
|
|
25
|
+
close(): void;
|
|
19
26
|
}
|
|
20
27
|
/** A pickable harness in the multi-select. */
|
|
21
28
|
export interface HarnessChoice {
|
package/dist/prompt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,WAAW,iBA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AW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,yEAAyE;IACzE,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,uEAAuE;IACvE,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,2EAA2E;AAC3E,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,IAAI,EAAE,MAAM;CAIzB;AAED,4EAA4E;AAC5E,wBAAgB,cAAc,CAAC,OAAO,GAAE,eAAoB,GAAG,QAAQ,CAgEtE;AAED,kEAAkE;AAClE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE,CAarF"}
|
package/dist/prompt.js
CHANGED
|
@@ -26,7 +26,24 @@ export function createPrompter(options = {}) {
|
|
|
26
26
|
const output = options.output ?? process.stdout;
|
|
27
27
|
const interactive = options.interactive ??
|
|
28
28
|
(options.prompt !== undefined ? true : Boolean(input.isTTY));
|
|
29
|
-
|
|
29
|
+
// ONE line reader (over ONE readline interface) for this prompter's whole
|
|
30
|
+
// lifetime. Created lazily on the first real prompt — so a non-interactive
|
|
31
|
+
// or injected-`prompt` run never opens stdin — and reused for EVERY question.
|
|
32
|
+
//
|
|
33
|
+
// The old code built a FRESH `createInterface` per question and `rl.close()`d
|
|
34
|
+
// it. Closing the first interface discarded the input buffered past its line,
|
|
35
|
+
// so a second read over a single shared stream (e.g. a piped
|
|
36
|
+
// `librarian install <<EOF`, where both answers arrive in one chunk) never
|
|
37
|
+
// saw its input and the read hung — `resolveConfig` then threw "required".
|
|
38
|
+
// `close()` (called from the command lifecycle) tears the reader down exactly
|
|
39
|
+
// once so the open readline doesn't keep the Node event loop alive.
|
|
40
|
+
let reader;
|
|
41
|
+
const lineReader = () => {
|
|
42
|
+
if (!reader)
|
|
43
|
+
reader = createLineReader(input, output);
|
|
44
|
+
return reader;
|
|
45
|
+
};
|
|
46
|
+
const ask = options.prompt ?? ((question, opts) => lineReader().ask(question, opts.secret));
|
|
30
47
|
return {
|
|
31
48
|
async selectHarnesses(available) {
|
|
32
49
|
if (available.length === 0)
|
|
@@ -56,6 +73,15 @@ export function createPrompter(options = {}) {
|
|
|
56
73
|
throw new MissingValueError(question);
|
|
57
74
|
return raw;
|
|
58
75
|
},
|
|
76
|
+
close() {
|
|
77
|
+
// Idempotent: only the shared reader (if one was ever opened) is torn
|
|
78
|
+
// down. An open readline keeps the Node event loop alive, so the command
|
|
79
|
+
// lifecycle MUST call this once prompting is done or the process hangs.
|
|
80
|
+
if (reader) {
|
|
81
|
+
reader.close();
|
|
82
|
+
reader = undefined;
|
|
83
|
+
}
|
|
84
|
+
},
|
|
59
85
|
};
|
|
60
86
|
}
|
|
61
87
|
/** Map a multi-select answer string to the chosen harness ids. */
|
|
@@ -80,36 +106,60 @@ export function resolveSelection(answer, available) {
|
|
|
80
106
|
function write(output, text) {
|
|
81
107
|
output.write(text);
|
|
82
108
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
109
|
+
function createLineReader(input, output) {
|
|
110
|
+
const rl = readline.createInterface({ input, output, terminal: true });
|
|
111
|
+
const queue = [];
|
|
112
|
+
let waiting = null;
|
|
113
|
+
rl.on("line", (line) => {
|
|
114
|
+
if (waiting) {
|
|
115
|
+
const resolve = waiting;
|
|
116
|
+
waiting = null;
|
|
117
|
+
resolve(line);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
queue.push(line);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
// The original echo writer; restored after each secret question so a later
|
|
124
|
+
// non-secret prompt renders normally. Typed to allow `undefined` so the
|
|
125
|
+
// restore assignment is sound under `exactOptionalPropertyTypes`.
|
|
126
|
+
const ref = rl;
|
|
127
|
+
const nextLine = () => new Promise((resolve) => {
|
|
128
|
+
const queued = queue.shift();
|
|
129
|
+
if (queued !== undefined)
|
|
130
|
+
resolve(queued);
|
|
131
|
+
else
|
|
132
|
+
waiting = resolve;
|
|
133
|
+
});
|
|
134
|
+
return {
|
|
135
|
+
async ask(question, secret) {
|
|
136
|
+
if (!secret) {
|
|
137
|
+
if (question)
|
|
138
|
+
write(output, question);
|
|
139
|
+
return nextLine();
|
|
140
|
+
}
|
|
141
|
+
// Mute the echo just for this question: swallow each typed character so
|
|
142
|
+
// the token never renders, passing only newlines through. Restore the
|
|
143
|
+
// original writer afterwards so a following non-secret prompt echoes.
|
|
144
|
+
const original = ref._writeToOutput;
|
|
145
|
+
ref._writeToOutput = (s) => {
|
|
146
|
+
if (s.includes("\n") || s.includes("\r"))
|
|
147
|
+
original?.call(rl, s);
|
|
99
148
|
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
149
|
+
try {
|
|
150
|
+
if (question)
|
|
151
|
+
write(output, question);
|
|
152
|
+
const line = await nextLine();
|
|
153
|
+
return line;
|
|
154
|
+
}
|
|
155
|
+
finally {
|
|
156
|
+
ref._writeToOutput = original;
|
|
103
157
|
write(output, "\n");
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
rl.question(question, (answer) => {
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
close() {
|
|
110
161
|
rl.close();
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
});
|
|
162
|
+
},
|
|
163
|
+
};
|
|
114
164
|
}
|
|
115
165
|
//# sourceMappingURL=prompt.js.map
|
package/dist/prompt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,EAAE;AACF,gBAAgB;AAChB,6EAA6E;AAC7E,yCAAyC;AACzC,4EAA4E;AAC5E,4BAA4B;AAC5B,EAAE;AACF,qEAAqE;AACrE,mEAAmE;AACnE,yEAAyE;AACzE,8EAA8E;AAC9E,6EAA6E;AAC7E,kEAAkE;AAElE,OAAO,QAAQ,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,EAAE;AACF,gBAAgB;AAChB,6EAA6E;AAC7E,yCAAyC;AACzC,4EAA4E;AAC5E,4BAA4B;AAC5B,EAAE;AACF,qEAAqE;AACrE,mEAAmE;AACnE,yEAAyE;AACzE,8EAA8E;AAC9E,6EAA6E;AAC7E,kEAAkE;AAElE,OAAO,QAAQ,MAAM,eAAe,CAAC;AAiDrC,2EAA2E;AAC3E,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC1C,YAAY,IAAY;QACtB,KAAK,CAAC,GAAG,IAAI,+DAA+D,CAAC,CAAC;QAC9E,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF;AAED,4EAA4E;AAC5E,MAAM,UAAU,cAAc,CAAC,UAA2B,EAAE;IAC1D,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC;IAC7C,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAChD,MAAM,WAAW,GACf,OAAO,CAAC,WAAW;QACnB,CAAC,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAE,KAA6B,CAAC,KAAK,CAAC,CAAC,CAAC;IAExF,0EAA0E;IAC1E,2EAA2E;IAC3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AAE,CAAC,CAAC,CAAC;YAClE,CAAC,CAAC;YACF,IAAI,CAAC;gBACH,IAAI,QAAQ;oBAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;gBACtC,MAAM,IAAI,GAAG,MAAM,QAAQ,EAAE,CAAC;gBAC9B,OAAO,IAAI,CAAC;YACd,CAAC;oBAAS,CAAC;gBACT,GAAG,CAAC,cAAc,GAAG,QAAQ,CAAC;gBAC9B,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YACtB,CAAC;QACH,CAAC;QACD,KAAK;YACH,EAAE,CAAC,KAAK,EAAE,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/runtime.d.ts
CHANGED
|
@@ -12,6 +12,12 @@ export interface RuntimeOptions {
|
|
|
12
12
|
shell?: Shell;
|
|
13
13
|
/** Inject a prompter (tests). Defaults to a real stdio-backed prompter. */
|
|
14
14
|
prompter?: Prompter;
|
|
15
|
+
/**
|
|
16
|
+
* The process environment to read existing `LIBRARIAN_*` vars from (BUG 2).
|
|
17
|
+
* Injectable so tests never touch the real `process.env` and never log a
|
|
18
|
+
* token. Defaults to `process.env` in `runInstall`.
|
|
19
|
+
*/
|
|
20
|
+
env?: NodeJS.ProcessEnv;
|
|
15
21
|
}
|
|
16
22
|
/**
|
|
17
23
|
* The CLI entrypoint. Dispatches to the command handlers and — crucially —
|
package/dist/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;AAGnD,OAAO,EAAqC,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI/E,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;AAGnD,OAAO,EAAqC,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI/E,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB;AAID;;;;;;GAMG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,SAAS,CAAC,CAY7F;AAgID,wBAAgB,KAAK,IAAI,MAAM,CAwB9B"}
|
package/dist/runtime.js
CHANGED
|
@@ -105,17 +105,34 @@ async function runInstallCommand(rest, options) {
|
|
|
105
105
|
const { positionals, flags } = parseArgs(rest);
|
|
106
106
|
const shell = options.shell ?? resolveShellFlag(flags);
|
|
107
107
|
const prompter = options.prompter ?? createPrompter();
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
try {
|
|
109
|
+
const outcome = await runInstall(positionals, {
|
|
110
|
+
home: options.home,
|
|
111
|
+
shell,
|
|
112
|
+
prompter,
|
|
113
|
+
env: options.env,
|
|
114
|
+
});
|
|
115
|
+
// A mid-install failure makes the command non-zero so scripts notice; a
|
|
116
|
+
// pure skip (CLI absent) is a success.
|
|
117
|
+
return outcome.failed.length > 0 ? errOut(outcome.output) : ok(outcome.output);
|
|
118
|
+
}
|
|
119
|
+
finally {
|
|
120
|
+
// Tear down the shared readline (BUG 1) so an open interface doesn't keep
|
|
121
|
+
// the event loop alive and hang the process after the command completes.
|
|
122
|
+
prompter.close();
|
|
123
|
+
}
|
|
112
124
|
}
|
|
113
125
|
async function runUninstallCommand(rest, options) {
|
|
114
126
|
const { positionals, flags } = parseArgs(rest);
|
|
115
127
|
const shell = options.shell ?? resolveShellFlag(flags);
|
|
116
128
|
const prompter = options.prompter ?? createPrompter();
|
|
117
|
-
|
|
118
|
-
|
|
129
|
+
try {
|
|
130
|
+
const outcome = await runUninstall(positionals, { home: options.home, shell, prompter });
|
|
131
|
+
return outcome.failed.length > 0 ? errOut(outcome.output) : ok(outcome.output);
|
|
132
|
+
}
|
|
133
|
+
finally {
|
|
134
|
+
prompter.close();
|
|
135
|
+
}
|
|
119
136
|
}
|
|
120
137
|
async function runUpdateCommand(rest, options) {
|
|
121
138
|
const { positionals } = parseArgs(rest);
|
package/dist/runtime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,EAAE;AACF,4EAA4E;AAC5E,wEAAwE;AACxE,6EAA6E;AAC7E,wEAAwE;AACxE,6EAA6E;AAC7E,8EAA8E;AAC9E,yEAAyE;AACzE,kBAAkB;AAElB,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE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AE,CAAC,EAAE,CAAC;AAC7C,CAAC;AAED,qFAAqF;AACrF,SAAS,MAAM,CAAC,MAAc;IAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;AAC7C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@the-librarian/cli",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"main": "./dist/index.js",
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"bin": {
|
|
13
|
-
"librarian": "
|
|
13
|
+
"librarian": "dist/bin.js"
|
|
14
14
|
},
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
@@ -21,17 +21,16 @@
|
|
|
21
21
|
"files": [
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "^22.10.5",
|
|
26
|
+
"typescript": "^5.7.2",
|
|
27
|
+
"vitest": "^2.1.8"
|
|
28
|
+
},
|
|
29
|
+
"license": "Apache-2.0",
|
|
24
30
|
"scripts": {
|
|
25
|
-
"prepare": "tsc -p tsconfig.json",
|
|
26
31
|
"build": "tsc -p tsconfig.json",
|
|
27
32
|
"test:vitest": "vitest run",
|
|
28
33
|
"test": "pnpm run build && pnpm run test:vitest",
|
|
29
34
|
"typecheck": "tsc --noEmit"
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
"@types/node": "^22.10.5",
|
|
33
|
-
"typescript": "catalog:",
|
|
34
|
-
"vitest": "catalog:"
|
|
35
|
-
},
|
|
36
|
-
"license": "Apache-2.0"
|
|
37
|
-
}
|
|
35
|
+
}
|
|
36
|
+
}
|