@wirecat/hubspot-cli 0.0.0-stage → 0.2.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/CHANGELOG.md +53 -0
- package/LICENSE +204 -0
- package/README.md +280 -2
- package/contracts/wirecat.json +3270 -0
- package/dist/bin/hubspot.d.ts +3 -0
- package/dist/bin/hubspot.d.ts.map +1 -0
- package/dist/bin/hubspot.js +40 -0
- package/dist/bin/hubspot.js.map +1 -0
- package/dist/bundle/all-profiles-64JAUYW4.js +279 -0
- package/dist/bundle/anthropic-VJOS4OUM.js +91 -0
- package/dist/bundle/app-server-GXV2OFML.js +245 -0
- package/dist/bundle/bun-M3J2QTR3.js +169 -0
- package/dist/bundle/bun-sqlite-IX3XYA5F.js +76 -0
- package/dist/bundle/chunk-24ERVFJP.js +73 -0
- package/dist/bundle/chunk-2QZK5BEP.js +392 -0
- package/dist/bundle/chunk-2UOJ7DLZ.js +46 -0
- package/dist/bundle/chunk-2VGD63G6.js +604 -0
- package/dist/bundle/chunk-2VGZRYEH.js +334 -0
- package/dist/bundle/chunk-36ITRDYY.js +63116 -0
- package/dist/bundle/chunk-3WLYWRGG.js +1395 -0
- package/dist/bundle/chunk-43EKCUBJ.js +72 -0
- package/dist/bundle/chunk-4W6BMH45.js +731 -0
- package/dist/bundle/chunk-5A6ZYNAQ.js +2003 -0
- package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
- package/dist/bundle/chunk-5GBUCHRU.js +274 -0
- package/dist/bundle/chunk-5K7QLJMM.js +4072 -0
- package/dist/bundle/chunk-65TWQ7BV.js +54 -0
- package/dist/bundle/chunk-7ELMWE3P.js +12066 -0
- package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
- package/dist/bundle/chunk-B3MANLNK.js +602 -0
- package/dist/bundle/chunk-C32AKHTY.js +2310 -0
- package/dist/bundle/chunk-CLAN3FES.js +1246 -0
- package/dist/bundle/chunk-CWXOXIWS.js +46 -0
- package/dist/bundle/chunk-D72URWJE.js +532 -0
- package/dist/bundle/chunk-DB2XKHI4.js +72 -0
- package/dist/bundle/chunk-DBEQI5YM.js +100 -0
- package/dist/bundle/chunk-DFCHHR5M.js +38 -0
- package/dist/bundle/chunk-DFDN6AUB.js +21 -0
- package/dist/bundle/chunk-DRWWJLI6.js +188 -0
- package/dist/bundle/chunk-DSP36YHQ.js +29 -0
- package/dist/bundle/chunk-E52JAS35.js +1028 -0
- package/dist/bundle/chunk-E5WLE7BM.js +78 -0
- package/dist/bundle/chunk-ECEZOLOD.js +230 -0
- package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
- package/dist/bundle/chunk-FBCCBCFH.js +288 -0
- package/dist/bundle/chunk-FKA7DOCK.js +53 -0
- package/dist/bundle/chunk-FOZYMDRL.js +259 -0
- package/dist/bundle/chunk-FPUGMDJV.js +7 -0
- package/dist/bundle/chunk-FTFV3HFW.js +721 -0
- package/dist/bundle/chunk-GPYCBYX5.js +218 -0
- package/dist/bundle/chunk-H3TNVEQX.js +782 -0
- package/dist/bundle/chunk-HC5ZWE5X.js +193 -0
- package/dist/bundle/chunk-HCAZV5NP.js +95 -0
- package/dist/bundle/chunk-HZRQLAHO.js +16 -0
- package/dist/bundle/chunk-IJADZW42.js +195 -0
- package/dist/bundle/chunk-IMJQRPLN.js +92 -0
- package/dist/bundle/chunk-JLDBMEKZ.js +106 -0
- package/dist/bundle/chunk-LOBVOGOE.js +66 -0
- package/dist/bundle/chunk-LXZ66MCH.js +1328 -0
- package/dist/bundle/chunk-MFNMKHML.js +26462 -0
- package/dist/bundle/chunk-MVA5HVKL.js +1392 -0
- package/dist/bundle/chunk-N2XADGL4.js +76 -0
- package/dist/bundle/chunk-NHHJHXMQ.js +58 -0
- package/dist/bundle/chunk-NUU4WZVL.js +52 -0
- package/dist/bundle/chunk-NWHEHV3K.js +133 -0
- package/dist/bundle/chunk-NXERIDPJ.js +319 -0
- package/dist/bundle/chunk-O3DYRCIT.js +23 -0
- package/dist/bundle/chunk-O55RWNSH.js +161 -0
- package/dist/bundle/chunk-P5BHKKBI.js +206 -0
- package/dist/bundle/chunk-PPHBRESD.js +82 -0
- package/dist/bundle/chunk-PVKF24ZW.js +364 -0
- package/dist/bundle/chunk-Q2OLOMHL.js +4045 -0
- package/dist/bundle/chunk-QGFX5MXL.js +460 -0
- package/dist/bundle/chunk-QJW35N5V.js +761 -0
- package/dist/bundle/chunk-QU25DA5N.js +360 -0
- package/dist/bundle/chunk-RMIYKDUL.js +1068 -0
- package/dist/bundle/chunk-RR5MX5TM.js +142 -0
- package/dist/bundle/chunk-SDQGB4KB.js +185 -0
- package/dist/bundle/chunk-TBJYLC5K.js +2788 -0
- package/dist/bundle/chunk-TI46WQXQ.js +1197 -0
- package/dist/bundle/chunk-TKVL2C3B.js +170 -0
- package/dist/bundle/chunk-TLKEPUAV.js +786 -0
- package/dist/bundle/chunk-TOSCB4SO.js +1227 -0
- package/dist/bundle/chunk-TP7GDWVF.js +6848 -0
- package/dist/bundle/chunk-URX6YDUL.js +9393 -0
- package/dist/bundle/chunk-UUMUL4L3.js +72 -0
- package/dist/bundle/chunk-VOH7S5M4.js +40963 -0
- package/dist/bundle/chunk-W53EJOFQ.js +63 -0
- package/dist/bundle/chunk-W7HM2VGO.js +24 -0
- package/dist/bundle/chunk-WE4UFASG.js +88 -0
- package/dist/bundle/chunk-X2M6NIQG.js +18 -0
- package/dist/bundle/chunk-XRREFEIW.js +372 -0
- package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
- package/dist/bundle/chunk-YMCY7VRE.js +1846 -0
- package/dist/bundle/chunk-Z73OL5HV.js +41 -0
- package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
- package/dist/bundle/command-contract-C6CBFXZF.js +40 -0
- package/dist/bundle/command-server-entry-DJKVVZCQ.js +169 -0
- package/dist/bundle/decode-FC65Y4IV.js +297 -0
- package/dist/bundle/definitions-MVPICAWV.js +2991 -0
- package/dist/bundle/dispatch-KOISQ5QJ.js +411 -0
- package/dist/bundle/dist-7TGU56B2.js +7577 -0
- package/dist/bundle/echarts-FVTUDXDU.js +42501 -0
- package/dist/bundle/embed-VNBZFPYH.js +38 -0
- package/dist/bundle/embedder-6U4NOFRO.js +111 -0
- package/dist/bundle/failure-FZ6VYKEQ.js +25 -0
- package/dist/bundle/first-run-UWAFSINQ.js +29 -0
- package/dist/bundle/first-screen-RTVMGHAE.js +40 -0
- package/dist/bundle/hubspot.js +198 -0
- package/dist/bundle/instructions-HET7BCYK.js +11 -0
- package/dist/bundle/mcp-RGNRW77S.js +167 -0
- package/dist/bundle/meeting-combined-L5AGBPYX.js +25 -0
- package/dist/bundle/meeting-model-NTB4RK3F.js +25 -0
- package/dist/bundle/meeting-semantic-JY3OGCBS.js +22 -0
- package/dist/bundle/node-CXZIFHZC.js +176 -0
- package/dist/bundle/node-P4E63KXA.js +2340 -0
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/node-sqlite-P3O7XN7Q.js +74 -0
- package/dist/bundle/oauth-HNCY4B2S.js +20 -0
- package/dist/bundle/open-F4P6YV54.js +23 -0
- package/dist/bundle/openai-4AICLIK3.js +238 -0
- package/dist/bundle/process-5RUXWGYS.js +91 -0
- package/dist/bundle/program-XA4C44Z4.js +9374 -0
- package/dist/bundle/prompt-NFMDVBZ4.js +17 -0
- package/dist/bundle/recognize-DKN3RY4V.js +26 -0
- package/dist/bundle/remote-6QHAGQWY.js +31 -0
- package/dist/bundle/rerank-M4KHEHUZ.js +52 -0
- package/dist/bundle/schemas-JRL3DLMP.js +952 -0
- package/dist/bundle/serve-DNU43ND6.js +199 -0
- package/dist/bundle/server-ATG5KY7K.js +207 -0
- package/dist/bundle/server-VNWVVH7A.js +77 -0
- package/dist/bundle/source-54HR4IWG.js +661 -0
- package/dist/bundle/sqlite-runtime-EMQAC63N.js +20 -0
- package/dist/bundle/state-T45CX7VY.js +36 -0
- package/dist/bundle/store-6LCEVBAZ.js +176 -0
- package/dist/bundle/store-6TZ2FCVA.js +295 -0
- package/dist/bundle/store-DXWYNVVB.js +32 -0
- package/dist/bundle/store-maintenance-command-J57HCJYY.js +68 -0
- package/dist/bundle/writer-NLLI5YRM.js +79 -0
- package/dist/commands/account.d.ts +3 -0
- package/dist/commands/account.d.ts.map +1 -0
- package/dist/commands/account.js +87 -0
- package/dist/commands/account.js.map +1 -0
- package/dist/commands/api.d.ts +9 -0
- package/dist/commands/api.d.ts.map +1 -0
- package/dist/commands/api.js +70 -0
- package/dist/commands/api.js.map +1 -0
- package/dist/commands/crm-shared.d.ts +8 -0
- package/dist/commands/crm-shared.d.ts.map +1 -0
- package/dist/commands/crm-shared.js +109 -0
- package/dist/commands/crm-shared.js.map +1 -0
- package/dist/commands/schedule.d.ts +3 -0
- package/dist/commands/schedule.d.ts.map +1 -0
- package/dist/commands/schedule.js +9 -0
- package/dist/commands/schedule.js.map +1 -0
- package/dist/commands/session.d.ts +14 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +164 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/config.d.ts +60 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +153 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +88 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +137 -0
- package/dist/context.js.map +1 -0
- package/dist/crm/activities.d.ts +24 -0
- package/dist/crm/activities.d.ts.map +1 -0
- package/dist/crm/activities.js +214 -0
- package/dist/crm/activities.js.map +1 -0
- package/dist/crm/associations.d.ts +20 -0
- package/dist/crm/associations.d.ts.map +1 -0
- package/dist/crm/associations.js +47 -0
- package/dist/crm/associations.js.map +1 -0
- package/dist/crm/records.d.ts +63 -0
- package/dist/crm/records.d.ts.map +1 -0
- package/dist/crm/records.js +333 -0
- package/dist/crm/records.js.map +1 -0
- package/dist/crm/search.d.ts +57 -0
- package/dist/crm/search.d.ts.map +1 -0
- package/dist/crm/search.js +47 -0
- package/dist/crm/search.js.map +1 -0
- package/dist/crm/source.d.ts +37 -0
- package/dist/crm/source.d.ts.map +1 -0
- package/dist/crm/source.js +366 -0
- package/dist/crm/source.js.map +1 -0
- package/dist/crm/writer.d.ts +15 -0
- package/dist/crm/writer.d.ts.map +1 -0
- package/dist/crm/writer.js +199 -0
- package/dist/crm/writer.js.map +1 -0
- package/dist/generated/definitions.d.ts +3 -0
- package/dist/generated/definitions.d.ts.map +1 -0
- package/dist/generated/definitions.js +2987 -0
- package/dist/generated/definitions.js.map +1 -0
- package/dist/generated/manifest.d.ts +6 -0
- package/dist/generated/manifest.d.ts.map +1 -0
- package/dist/generated/manifest.js +6504 -0
- package/dist/generated/manifest.js.map +1 -0
- package/dist/generated/schemas.d.ts +205 -0
- package/dist/generated/schemas.d.ts.map +1 -0
- package/dist/generated/schemas.js +810 -0
- package/dist/generated/schemas.js.map +1 -0
- package/dist/generated/types.d.ts +1114 -0
- package/dist/generated/types.d.ts.map +1 -0
- package/dist/generated/types.js +5 -0
- package/dist/generated/types.js.map +1 -0
- package/dist/hubspot/account.d.ts +12 -0
- package/dist/hubspot/account.d.ts.map +1 -0
- package/dist/hubspot/account.js +23 -0
- package/dist/hubspot/account.js.map +1 -0
- package/dist/hubspot/transport.d.ts +81 -0
- package/dist/hubspot/transport.d.ts.map +1 -0
- package/dist/hubspot/transport.js +354 -0
- package/dist/hubspot/transport.js.map +1 -0
- package/dist/identity.d.ts +7 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +32 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/program.d.ts +6 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +78 -0
- package/dist/program.js.map +1 -0
- package/dist/reasons.d.ts +10 -0
- package/dist/reasons.d.ts.map +1 -0
- package/dist/reasons.js +33 -0
- package/dist/reasons.js.map +1 -0
- package/dist/setup/flow.d.ts +2 -0
- package/dist/setup/flow.d.ts.map +1 -0
- package/dist/setup/flow.js +97 -0
- package/dist/setup/flow.js.map +1 -0
- package/dist/setup/texts.en.json +19 -0
- package/dist/setup/texts.es.json +19 -0
- package/dist/setup/texts.ru.json +19 -0
- package/dist/store.d.ts +16 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +34 -0
- package/dist/store.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/dist/wcat.d.ts +3 -0
- package/dist/wcat.d.ts.map +1 -0
- package/dist/wcat.js +4 -0
- package/dist/wcat.js.map +1 -0
- package/dist/whoami.d.ts +19 -0
- package/dist/whoami.d.ts.map +1 -0
- package/dist/whoami.js +15 -0
- package/dist/whoami.js.map +1 -0
- package/package.json +98 -4
- package/skills/hubspot-cli/SKILL.md +102 -0
- package/skills/hubspot-cli/references/api/api-advanced.md +51 -0
- package/skills/hubspot-cli/references/api/api-basic.md +1064 -0
- package/skills/hubspot-cli/references/api/api-batch.md +724 -0
- package/skills/hubspot-cli/references/api/api-search.md +147 -0
- package/skills/hubspot-cli/references/api.md +16 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
updateCommand
|
|
5
|
+
} from "./chunk-RR5MX5TM.js";
|
|
6
|
+
import {
|
|
7
|
+
QUESTIONS,
|
|
8
|
+
readSetupAnswers,
|
|
9
|
+
unanswered,
|
|
10
|
+
writeSetupAnswers
|
|
11
|
+
} from "./chunk-NUU4WZVL.js";
|
|
12
|
+
import {
|
|
13
|
+
DEFAULT_STEMMERS,
|
|
14
|
+
LANGUAGES
|
|
15
|
+
} from "./chunk-C32AKHTY.js";
|
|
16
|
+
import {
|
|
17
|
+
sharedConfigPath
|
|
18
|
+
} from "./chunk-TI46WQXQ.js";
|
|
19
|
+
import {
|
|
20
|
+
installerOf
|
|
21
|
+
} from "./chunk-O3DYRCIT.js";
|
|
22
|
+
import {
|
|
23
|
+
storePath
|
|
24
|
+
} from "./chunk-65TWQ7BV.js";
|
|
25
|
+
import {
|
|
26
|
+
__name
|
|
27
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
28
|
+
|
|
29
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/cli/first-run.js
|
|
30
|
+
import { spawnSync } from "node:child_process";
|
|
31
|
+
import { accessSync, constants, realpathSync } from "node:fs";
|
|
32
|
+
import { delimiter, join } from "node:path";
|
|
33
|
+
var SKIPPED = /* @__PURE__ */ new Set(["help", "guide", "completion", "mcp", "serve", "server", "update", "store"]);
|
|
34
|
+
var asksAtStart = /* @__PURE__ */ __name((start) => !start.headless && start.terminal && !start.env.AI_AGENT && !start.env.CLAUDECODE && start.readOnlyLock === void 0 && !SKIPPED.has(start.path[0] ?? ""), "asksAtStart");
|
|
35
|
+
var systemLanguage = /* @__PURE__ */ __name((env) => {
|
|
36
|
+
const named = [env.LC_ALL, env.LC_MESSAGES, env.LANG, ...(env.LANGUAGE ?? "").split(":")].map((value) => value?.trim()).find((value) => value && value !== "C" && value !== "POSIX" && !value.startsWith("C."));
|
|
37
|
+
return (named ?? Intl.DateTimeFormat().resolvedOptions().locale).slice(0, 2).toLowerCase();
|
|
38
|
+
}, "systemLanguage");
|
|
39
|
+
var stemmersOf = /* @__PURE__ */ __name((languages) => {
|
|
40
|
+
const latin = LANGUAGES.filter(({ name, script }) => script === "latin" && languages.includes(name));
|
|
41
|
+
return {
|
|
42
|
+
cyrillic: languages.includes("russian") ? "russian" : "none",
|
|
43
|
+
latin: latin.length ? latin.map(({ name }) => name).join(",") : "none"
|
|
44
|
+
};
|
|
45
|
+
}, "stemmersOf");
|
|
46
|
+
var languagesOf = /* @__PURE__ */ __name((stemmers) => LANGUAGES.filter(({ name }) => stemmers.cyrillic === name || stemmers.latin.split(",").includes(name)).map(({ name }) => name), "languagesOf");
|
|
47
|
+
var choose = /* @__PURE__ */ __name(async (io, prompt, count, chosen) => {
|
|
48
|
+
for (let attempt = 0; attempt < 3; attempt++) {
|
|
49
|
+
const answer = (await io.ask(prompt)).trim();
|
|
50
|
+
if (!answer)
|
|
51
|
+
return chosen;
|
|
52
|
+
if (/^(none|-)$/i.test(answer))
|
|
53
|
+
return [];
|
|
54
|
+
const numbers = answer.split(/[\s,]+/).filter(Boolean).map(Number);
|
|
55
|
+
if (numbers.every((number) => Number.isInteger(number) && number >= 1 && number <= count))
|
|
56
|
+
return [...new Set(numbers)].sort((a, b) => a - b);
|
|
57
|
+
io.say(`Choose numbers from 1 to ${count}, separated by commas.`);
|
|
58
|
+
}
|
|
59
|
+
return chosen;
|
|
60
|
+
}, "choose");
|
|
61
|
+
var yes = /* @__PURE__ */ __name(async (io, prompt) => /^y(es)?$/i.test((await io.ask(prompt)).trim()), "yes");
|
|
62
|
+
var onPath = /* @__PURE__ */ __name((command, env) => {
|
|
63
|
+
const names = process.platform === "win32" ? [".cmd", ".exe", ""].map((ending) => command + ending) : [command];
|
|
64
|
+
return (env.PATH ?? env.Path ?? "").split(delimiter).some((folder) => names.some((name) => {
|
|
65
|
+
try {
|
|
66
|
+
accessSync(join(folder, name), process.platform === "win32" ? constants.F_OK : constants.X_OK);
|
|
67
|
+
return true;
|
|
68
|
+
} catch {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
}));
|
|
72
|
+
}, "onPath");
|
|
73
|
+
var installWith = /* @__PURE__ */ __name((argv) => spawnSync(argv[0], argv.slice(1), { stdio: ["inherit", 2, 2] }).status === 0, "installWith");
|
|
74
|
+
var installerHere = /* @__PURE__ */ __name(() => {
|
|
75
|
+
try {
|
|
76
|
+
return installerOf(realpathSync(process.argv[1] ?? ""));
|
|
77
|
+
} catch {
|
|
78
|
+
return "unknown";
|
|
79
|
+
}
|
|
80
|
+
}, "installerHere");
|
|
81
|
+
var suggested = /* @__PURE__ */ __name((env, contentLanguages) => {
|
|
82
|
+
const own = LANGUAGES.filter(({ code }) => contentLanguages?.includes(code));
|
|
83
|
+
const system = systemLanguage(env);
|
|
84
|
+
return (own.length ? own : LANGUAGES.filter(({ code }) => code === "en" || code === system)).map(({ name }) => name);
|
|
85
|
+
}, "suggested");
|
|
86
|
+
var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLanguages }) => {
|
|
87
|
+
const { openStore } = await import("./store-6LCEVBAZ.js");
|
|
88
|
+
const store = await openStore({ env });
|
|
89
|
+
let rebuild = false;
|
|
90
|
+
try {
|
|
91
|
+
const saved = await store.searchIndex.stemmers() ?? void 0;
|
|
92
|
+
const inUse = saved !== void 0 || (await store.accounts.accounts()).length > 0;
|
|
93
|
+
const ticked = inUse ? languagesOf(saved ?? DEFAULT_STEMMERS) : suggested(env, contentLanguages);
|
|
94
|
+
const numbers = ticked.map((name) => LANGUAGES.findIndex((one) => one.name === name) + 1);
|
|
95
|
+
io.say("Languages you write and speak \u2014 search finds every form of their words, and spellings speech mangles:");
|
|
96
|
+
LANGUAGES.forEach(({ name, label }, at) => {
|
|
97
|
+
io.say(` ${at + 1}. ${label}${ticked.includes(name) ? " \u2713" : ""}`);
|
|
98
|
+
});
|
|
99
|
+
const chosen = await choose(io, `Numbers (${numbers.join(",")}): `, LANGUAGES.length, numbers);
|
|
100
|
+
const next = stemmersOf(chosen.map((number) => LANGUAGES[number - 1].name));
|
|
101
|
+
const before = saved ?? DEFAULT_STEMMERS;
|
|
102
|
+
if (inUse && before.cyrillic === next.cyrillic && before.latin === next.latin)
|
|
103
|
+
return;
|
|
104
|
+
if (inUse && !await yes(io, "Rebuild the word forms of every stored message now? Word search waits for it; a large store takes minutes. [y/N] ")) {
|
|
105
|
+
io.say(`Languages kept as they were; \`${command} setup\` asks again.`);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
await store.searchIndex.saveStemmers(next);
|
|
109
|
+
rebuild = inUse;
|
|
110
|
+
} finally {
|
|
111
|
+
await store.close();
|
|
112
|
+
}
|
|
113
|
+
if (!rebuild)
|
|
114
|
+
return;
|
|
115
|
+
const [{ openCache }, { buildStems }] = await Promise.all([
|
|
116
|
+
import("./open-F4P6YV54.js"),
|
|
117
|
+
import("./store-maintenance-command-J57HCJYY.js")
|
|
118
|
+
]);
|
|
119
|
+
const database = await openCache(storePath(env));
|
|
120
|
+
try {
|
|
121
|
+
buildStems(database, (note) => io.say(` ${note}`), { force: true });
|
|
122
|
+
} finally {
|
|
123
|
+
database.close();
|
|
124
|
+
}
|
|
125
|
+
}, "askLanguages");
|
|
126
|
+
var askTools = /* @__PURE__ */ __name(async (run) => {
|
|
127
|
+
const { command, env, io } = run;
|
|
128
|
+
const installed = run.installed ?? ((name) => onPath(name, env));
|
|
129
|
+
const { WIRECAT_TOOLS } = await import("./first-screen-RTVMGHAE.js");
|
|
130
|
+
const others = WIRECAT_TOOLS.filter((tool) => tool.command !== command);
|
|
131
|
+
const missing = others.filter((tool) => !installed(tool.command));
|
|
132
|
+
io.say("Other WireCat tools \u2014 they share this store, so one search finds everything:");
|
|
133
|
+
for (const tool of others) {
|
|
134
|
+
const at = missing.indexOf(tool);
|
|
135
|
+
io.say(` ${at < 0 ? "\u2713 " : `${at + 1}.`} ${tool.command} \u2014 ${tool.does}`);
|
|
136
|
+
}
|
|
137
|
+
if (!missing.length)
|
|
138
|
+
return;
|
|
139
|
+
const chosen = await choose(io, "Numbers to install (none): ", missing.length, []);
|
|
140
|
+
const installer = run.installer ?? installerHere();
|
|
141
|
+
for (const number of chosen) {
|
|
142
|
+
const tool = missing[number - 1];
|
|
143
|
+
const argv = updateCommand(installer, tool.package);
|
|
144
|
+
if (!argv) {
|
|
145
|
+
io.say(`Install ${tool.command} with \`npm install -g ${tool.package}\`.`);
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
io.say(`Installing ${tool.command}: ${argv.join(" ")}`);
|
|
149
|
+
if (!(run.install ?? installWith)(argv))
|
|
150
|
+
io.say(`${tool.command} was not installed; run \`${argv.join(" ")}\`.`);
|
|
151
|
+
}
|
|
152
|
+
}, "askTools");
|
|
153
|
+
var PERMISSION_CHOICES = [
|
|
154
|
+
{ answer: "readonly", text: "read only \u2014 search and read; nothing sends or changes" },
|
|
155
|
+
{ answer: "allow", text: "read and write \u2014 as each profile's permissions allow" }
|
|
156
|
+
];
|
|
157
|
+
var askPermissions = /* @__PURE__ */ __name(async ({ io }, answers) => {
|
|
158
|
+
const now = answers.permissions ?? "allow";
|
|
159
|
+
const current = Math.max(1, PERMISSION_CHOICES.findIndex(({ answer }) => answer === now) + 1);
|
|
160
|
+
io.say("Read only, or read and write? The same for you, scripts and agents over MCP, in every WireCat tool:");
|
|
161
|
+
PERMISSION_CHOICES.forEach(({ text }, at) => {
|
|
162
|
+
io.say(` ${at + 1}. ${text}`);
|
|
163
|
+
});
|
|
164
|
+
const [chosen = current] = await choose(io, `Number (${current}): `, PERMISSION_CHOICES.length, [current]);
|
|
165
|
+
return PERMISSION_CHOICES[chosen - 1].answer;
|
|
166
|
+
}, "askPermissions");
|
|
167
|
+
var answersAt = /* @__PURE__ */ __name((path) => {
|
|
168
|
+
try {
|
|
169
|
+
return readSetupAnswers(path);
|
|
170
|
+
} catch {
|
|
171
|
+
return {};
|
|
172
|
+
}
|
|
173
|
+
}, "answersAt");
|
|
174
|
+
var askSetupQuestions = /* @__PURE__ */ __name(async (run) => {
|
|
175
|
+
const path = sharedConfigPath(storePath(run.env), run.env);
|
|
176
|
+
const answers = answersAt(path);
|
|
177
|
+
const asking = run.all ? [...QUESTIONS] : unanswered(answers);
|
|
178
|
+
for (const question of asking) {
|
|
179
|
+
run.io.say("");
|
|
180
|
+
if (question === "languages") {
|
|
181
|
+
await askLanguages(run);
|
|
182
|
+
writeSetupAnswers(path, { languages: true });
|
|
183
|
+
} else if (question === "tools") {
|
|
184
|
+
await askTools(run);
|
|
185
|
+
writeSetupAnswers(path, { tools: true });
|
|
186
|
+
} else
|
|
187
|
+
writeSetupAnswers(path, { permissions: await askPermissions(run, answers) });
|
|
188
|
+
}
|
|
189
|
+
return asking;
|
|
190
|
+
}, "askSetupQuestions");
|
|
191
|
+
var setupAtStart = /* @__PURE__ */ __name(async (start) => {
|
|
192
|
+
const input = start.input ?? process.stdin;
|
|
193
|
+
const terminal = start.terminal ?? (input.isTTY === true && process.stderr.isTTY === true);
|
|
194
|
+
if (!asksAtStart({ ...start, terminal, readOnlyLock: start.readOnlyLock }))
|
|
195
|
+
return;
|
|
196
|
+
await askSetupQuestions({
|
|
197
|
+
command: start.command,
|
|
198
|
+
env: start.env,
|
|
199
|
+
contentLanguages: start.contentLanguages,
|
|
200
|
+
// `setup describe` and `setup apply` are a program's; only the bare walk-through asks everything again.
|
|
201
|
+
all: start.path.length === 1 && start.path[0] === "setup",
|
|
202
|
+
io: {
|
|
203
|
+
ask: /* @__PURE__ */ __name(async (prompt) => (await import("./prompt-NFMDVBZ4.js")).readSecret(prompt, { input, echo: true }), "ask"),
|
|
204
|
+
say: /* @__PURE__ */ __name((text) => process.stderr.write(`${text}
|
|
205
|
+
`), "say")
|
|
206
|
+
}
|
|
207
|
+
}).catch((error) => {
|
|
208
|
+
process.stderr.write(`setup questions skipped: ${error instanceof Error ? error.message : String(error)} \u2014 \`${start.command} setup\` asks them again
|
|
209
|
+
`);
|
|
210
|
+
});
|
|
211
|
+
}, "setupAtStart");
|
|
212
|
+
|
|
213
|
+
export {
|
|
214
|
+
asksAtStart,
|
|
215
|
+
systemLanguage,
|
|
216
|
+
askSetupQuestions,
|
|
217
|
+
setupAtStart
|
|
218
|
+
};
|