@wellgrow/cli 0.1.0 → 0.1.1
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/dist/index.js +30 -29
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5646,9 +5646,26 @@ import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs9 } from "react/jsx-run
|
|
|
5646
5646
|
function isValidName(value) {
|
|
5647
5647
|
return value.trim().length > 0;
|
|
5648
5648
|
}
|
|
5649
|
-
function
|
|
5650
|
-
const
|
|
5651
|
-
|
|
5649
|
+
function MaskedInput({ onSubmit, placeholder }) {
|
|
5650
|
+
const [value, setValue] = useState8("");
|
|
5651
|
+
useInput5((input, key) => {
|
|
5652
|
+
if (key.return) {
|
|
5653
|
+
onSubmit(value);
|
|
5654
|
+
return;
|
|
5655
|
+
}
|
|
5656
|
+
if (key.backspace || key.delete) {
|
|
5657
|
+
setValue((prev) => prev.slice(0, -1));
|
|
5658
|
+
return;
|
|
5659
|
+
}
|
|
5660
|
+
if (key.ctrl || key.meta || key.escape || key.upArrow || key.downArrow || key.leftArrow || key.rightArrow || key.tab) {
|
|
5661
|
+
return;
|
|
5662
|
+
}
|
|
5663
|
+
setValue((prev) => prev + input);
|
|
5664
|
+
});
|
|
5665
|
+
if (value.length === 0 && placeholder) {
|
|
5666
|
+
return /* @__PURE__ */ jsx8(Text9, { dimColor: true, children: placeholder });
|
|
5667
|
+
}
|
|
5668
|
+
return /* @__PURE__ */ jsx8(Text9, { children: "*".repeat(value.length) });
|
|
5652
5669
|
}
|
|
5653
5670
|
var API_KEY_OPTIONS = [
|
|
5654
5671
|
{
|
|
@@ -5730,7 +5747,6 @@ function OnboardingWizard({ onComplete }) {
|
|
|
5730
5747
|
const [name, setName] = useState8("");
|
|
5731
5748
|
const [nameValue, setNameValue] = useState8("");
|
|
5732
5749
|
const [apiKey, setApiKey] = useState8("");
|
|
5733
|
-
const [apiKeyValue, setApiKeyValue] = useState8("");
|
|
5734
5750
|
const [hasEnvKey, setHasEnvKey] = useState8(false);
|
|
5735
5751
|
const [chosenMethod, setChosenMethod] = useState8(null);
|
|
5736
5752
|
useEffect4(() => {
|
|
@@ -5785,10 +5801,12 @@ function OnboardingWizard({ onComplete }) {
|
|
|
5785
5801
|
}
|
|
5786
5802
|
}, []);
|
|
5787
5803
|
const handleApiKeySubmit = useCallback6((value) => {
|
|
5788
|
-
|
|
5789
|
-
|
|
5804
|
+
const trimmed = value.trim();
|
|
5805
|
+
if (trimmed.length === 0) return;
|
|
5806
|
+
if (chosenMethod === "api-key" && !trimmed.startsWith("sk-ant-")) return;
|
|
5807
|
+
setApiKey(trimmed);
|
|
5790
5808
|
setStep("apiKeySubmitted");
|
|
5791
|
-
}, []);
|
|
5809
|
+
}, [chosenMethod]);
|
|
5792
5810
|
const pastNameSteps = [
|
|
5793
5811
|
"nameSubmitted",
|
|
5794
5812
|
"apiKeyCheck",
|
|
@@ -5854,20 +5872,12 @@ function OnboardingWizard({ onComplete }) {
|
|
|
5854
5872
|
/* @__PURE__ */ jsx8(Text9, { bold: true, children: "claude setup-token" })
|
|
5855
5873
|
] }),
|
|
5856
5874
|
/* @__PURE__ */ jsx8(Text9, {}),
|
|
5857
|
-
/* @__PURE__ */ jsx8(Text9, { children: "\
|
|
5875
|
+
/* @__PURE__ */ jsx8(Text9, { children: "\u8868\u793A\u3055\u308C\u308B sk-ant- \u3067\u59CB\u307E\u308BAPI\u30AD\u30FC\u3092\u8CBC\u308A\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044:" }),
|
|
5876
|
+
/* @__PURE__ */ jsx8(Text9, { color: colors.fog, children: "\uFF08\u203B Authentication Code \u3067\u306F\u306A\u304F\u3001\u305D\u306E\u5F8C\u306B\u8868\u793A\u3055\u308C\u308BAPI\u30AD\u30FC\u3067\u3059\uFF09" })
|
|
5858
5877
|
] }),
|
|
5859
5878
|
(step === "setupTokenGuide" || step === "setupTokenInput") && /* @__PURE__ */ jsxs9(Box8, { children: [
|
|
5860
5879
|
/* @__PURE__ */ jsx8(Text9, { color: colors.joy, children: "\u276F " }),
|
|
5861
|
-
/* @__PURE__ */ jsx8(
|
|
5862
|
-
TextInput2,
|
|
5863
|
-
{
|
|
5864
|
-
value: apiKeyValue,
|
|
5865
|
-
onChange: setApiKeyValue,
|
|
5866
|
-
onSubmit: handleApiKeySubmit,
|
|
5867
|
-
mask: "*",
|
|
5868
|
-
placeholder: "sk-ant-..."
|
|
5869
|
-
}
|
|
5870
|
-
)
|
|
5880
|
+
/* @__PURE__ */ jsx8(MaskedInput, { onSubmit: handleApiKeySubmit, placeholder: "sk-ant-..." })
|
|
5871
5881
|
] }),
|
|
5872
5882
|
step === "apiKeyInput" && /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
5873
5883
|
/* @__PURE__ */ jsxs9(BotMessage, { children: [
|
|
@@ -5881,16 +5891,7 @@ function OnboardingWizard({ onComplete }) {
|
|
|
5881
5891
|
] }),
|
|
5882
5892
|
/* @__PURE__ */ jsxs9(Box8, { children: [
|
|
5883
5893
|
/* @__PURE__ */ jsx8(Text9, { color: colors.joy, children: "\u276F " }),
|
|
5884
|
-
/* @__PURE__ */ jsx8(
|
|
5885
|
-
TextInput2,
|
|
5886
|
-
{
|
|
5887
|
-
value: apiKeyValue,
|
|
5888
|
-
onChange: setApiKeyValue,
|
|
5889
|
-
onSubmit: handleApiKeySubmit,
|
|
5890
|
-
mask: "*",
|
|
5891
|
-
placeholder: "sk-ant-..."
|
|
5892
|
-
}
|
|
5893
|
-
)
|
|
5894
|
+
/* @__PURE__ */ jsx8(MaskedInput, { onSubmit: handleApiKeySubmit, placeholder: "sk-ant-..." })
|
|
5894
5895
|
] })
|
|
5895
5896
|
] }),
|
|
5896
5897
|
step === "apiKeySubmitted" && /* @__PURE__ */ jsx8(BotMessage, { children: /* @__PURE__ */ jsx8(Text9, { children: "API\u30AD\u30FC\u3092\u8A2D\u5B9A\u3057\u3066\u3044\u307E\u3059..." }) }),
|
|
@@ -5992,7 +5993,7 @@ Error: ${formatErrorMessage(error)}
|
|
|
5992
5993
|
}
|
|
5993
5994
|
}
|
|
5994
5995
|
var program = new Command();
|
|
5995
|
-
program.name("wellgrow").description("WellGrow CLI \u2014 AI chat assistant").version("0.1.
|
|
5996
|
+
program.name("wellgrow").description("WellGrow CLI \u2014 AI chat assistant").version("0.1.1").argument("[prompt]", "\u30EF\u30F3\u30B7\u30E7\u30C3\u30C8\u8CEA\u554F\uFF08\u7701\u7565\u3067\u30A4\u30F3\u30BF\u30E9\u30AF\u30C6\u30A3\u30D6\u30E2\u30FC\u30C9\uFF09").option("--model <model>", "\u4F7F\u7528\u3059\u308B\u30E2\u30C7\u30EB").option("-a, --agent <agent>", "\u4F7F\u7528\u3059\u308B\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8").option(
|
|
5996
5997
|
"--mode <mode>",
|
|
5997
5998
|
"\u30E2\u30FC\u30C9 (plan, auto)"
|
|
5998
5999
|
).option("--verbose", "\u8A73\u7D30\u30ED\u30B0\u3092\u51FA\u529B").option("-p, --pipe", "\u30D1\u30A4\u30D7\u5165\u529B\u30E2\u30FC\u30C9\uFF08stdin\u304B\u3089\u306E\u5165\u529B\u3092\u53D7\u3051\u4ED8\u3051\u308B\uFF09").action(async (prompt, opts) => {
|