@wellgrow/cli 0.1.0 → 0.1.2

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 CHANGED
@@ -5227,7 +5227,7 @@ function App({ agentName, modelOverride, config, mode, verbose, initialMessage }
5227
5227
  "\u79D2\u5F8C)"
5228
5228
  ] }),
5229
5229
  status === "submitted" && /* @__PURE__ */ jsx7(ThinkingIndicator, {}),
5230
- status === "streaming" && streamingMessage && /* @__PURE__ */ jsx7(MessageItem, { message: streamingMessage }),
5230
+ status === "streaming" && streamingMessage && !activeAskUser && !activeApproval && /* @__PURE__ */ jsx7(MessageItem, { message: streamingMessage }),
5231
5231
  /* @__PURE__ */ jsx7(TodoList, { todos }),
5232
5232
  activeApproval && /* @__PURE__ */ jsx7(
5233
5233
  ApprovalPrompt,
@@ -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 isValidApiKey(value) {
5650
- const trimmed = value.trim();
5651
- return trimmed.length > 0 && trimmed.startsWith("sk-ant-");
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
  {
@@ -5662,31 +5679,8 @@ var API_KEY_OPTIONS = [
5662
5679
  description: "Anthropic API \u30AD\u30FC\u3092\u76F4\u63A5\u5165\u529B"
5663
5680
  }
5664
5681
  ];
5665
- function WelcomeHeader() {
5666
- return /* @__PURE__ */ jsxs9(
5667
- Box8,
5668
- {
5669
- borderStyle: "round",
5670
- borderColor: colors.signature,
5671
- paddingX: 1,
5672
- marginBottom: 1,
5673
- children: [
5674
- /* @__PURE__ */ jsxs9(Text9, { bold: true, color: colors.signature, children: [
5675
- " ",
5676
- "WellGrow",
5677
- " "
5678
- ] }),
5679
- /* @__PURE__ */ jsx8(Text9, { color: colors.fog, children: "|" }),
5680
- /* @__PURE__ */ jsx8(Text9, { color: colors.energy, children: " \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7 " })
5681
- ]
5682
- }
5683
- );
5684
- }
5685
5682
  function BotMessage({ children }) {
5686
- return /* @__PURE__ */ jsxs9(Box8, { flexDirection: "column", marginBottom: 1, children: [
5687
- /* @__PURE__ */ jsx8(Text9, { bold: true, color: colors.signature, children: "WellGrow" }),
5688
- /* @__PURE__ */ jsx8(Box8, { marginLeft: 2, flexDirection: "column", children })
5689
- ] });
5683
+ return /* @__PURE__ */ jsx8(Box8, { flexDirection: "column", marginBottom: 1, children });
5690
5684
  }
5691
5685
  function UserMessage({ text }) {
5692
5686
  return /* @__PURE__ */ jsx8(
@@ -5730,7 +5724,6 @@ function OnboardingWizard({ onComplete }) {
5730
5724
  const [name, setName] = useState8("");
5731
5725
  const [nameValue, setNameValue] = useState8("");
5732
5726
  const [apiKey, setApiKey] = useState8("");
5733
- const [apiKeyValue, setApiKeyValue] = useState8("");
5734
5727
  const [hasEnvKey, setHasEnvKey] = useState8(false);
5735
5728
  const [chosenMethod, setChosenMethod] = useState8(null);
5736
5729
  useEffect4(() => {
@@ -5785,10 +5778,12 @@ function OnboardingWizard({ onComplete }) {
5785
5778
  }
5786
5779
  }, []);
5787
5780
  const handleApiKeySubmit = useCallback6((value) => {
5788
- if (!isValidApiKey(value)) return;
5789
- setApiKey(value.trim());
5781
+ const trimmed = value.trim();
5782
+ if (trimmed.length === 0) return;
5783
+ if (chosenMethod === "api-key" && !trimmed.startsWith("sk-ant-")) return;
5784
+ setApiKey(trimmed);
5790
5785
  setStep("apiKeySubmitted");
5791
- }, []);
5786
+ }, [chosenMethod]);
5792
5787
  const pastNameSteps = [
5793
5788
  "nameSubmitted",
5794
5789
  "apiKeyCheck",
@@ -5809,13 +5804,12 @@ function OnboardingWizard({ onComplete }) {
5809
5804
  "done"
5810
5805
  ];
5811
5806
  return /* @__PURE__ */ jsxs9(Box8, { flexDirection: "column", children: [
5812
- /* @__PURE__ */ jsx8(WelcomeHeader, {}),
5813
5807
  /* @__PURE__ */ jsxs9(BotMessage, { children: [
5814
- /* @__PURE__ */ jsx8(Text9, { children: "\u3053\u3093\u306B\u3061\u306F\uFF01WellGrow CLI\u3078\u3088\u3046\u3053\u305D\u3002" }),
5815
- /* @__PURE__ */ jsx8(Text9, { children: "\u3042\u306A\u305F\u3060\u3051\u306EAI\u30A2\u30B7\u30B9\u30BF\u30F3\u30C8\u3092\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3057\u307E\u3057\u3087\u3046\u3002" })
5808
+ /* @__PURE__ */ jsx8(Text9, { children: "\u3084\u3063\u307B\u3049\u30FC\uFF01\u2728 \u3088\u3046\u3053\u305D\uFF01" }),
5809
+ /* @__PURE__ */ jsx8(Text9, { children: "\u3042\u306A\u305F\u3060\u3051\u306EAI\u30A2\u30B7\u30B9\u30BF\u30F3\u30C8\u3092\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3057\u3088\u3046 \u{1F60A}" })
5816
5810
  ] }),
5817
5811
  step === "welcome" && /* @__PURE__ */ jsx8(Text9, { color: colors.fog, children: "..." }),
5818
- step !== "welcome" && /* @__PURE__ */ jsx8(BotMessage, { children: /* @__PURE__ */ jsx8(Text9, { children: "\u307E\u305A\u3001\u304A\u540D\u524D\u3092\u6559\u3048\u3066\u304F\u3060\u3055\u3044\u3002" }) }),
5812
+ step !== "welcome" && /* @__PURE__ */ jsx8(BotMessage, { children: /* @__PURE__ */ jsx8(Text9, { children: "\u307E\u305A\u3001\u304A\u540D\u524D\u3092\u6559\u3048\u3066\u304F\u308C\u308B\u304B\u306A\uFF1F \u{1F308}" }) }),
5819
5813
  step === "name" && /* @__PURE__ */ jsxs9(Box8, { children: [
5820
5814
  /* @__PURE__ */ jsx8(Text9, { color: colors.joy, children: "\u276F " }),
5821
5815
  /* @__PURE__ */ jsx8(
@@ -5831,12 +5825,12 @@ function OnboardingWizard({ onComplete }) {
5831
5825
  name && /* @__PURE__ */ jsx8(UserMessage, { text: name }),
5832
5826
  pastNameSteps.includes(step) && /* @__PURE__ */ jsx8(BotMessage, { children: /* @__PURE__ */ jsxs9(Text9, { children: [
5833
5827
  name,
5834
- "\u3055\u3093\u3001\u3088\u308D\u3057\u304F\u304A\u9858\u3044\u3057\u307E\u3059\uFF01"
5828
+ "\u3055\u3093\u3060\u306D\uFF01\u3088\u308D\u3057\u304F\u306D\u301C\uFF01\u{1F389}"
5835
5829
  ] }) }),
5836
5830
  step === "apiKeyMethod" && /* @__PURE__ */ jsxs9(Fragment2, { children: [
5837
5831
  /* @__PURE__ */ jsxs9(BotMessage, { children: [
5838
- /* @__PURE__ */ jsx8(Text9, { children: "\u6B21\u306B\u3001AI\u3068\u4F1A\u8A71\u3059\u308B\u305F\u3081\u306EAPI\u30AD\u30FC\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u3087\u3046\u3002" }),
5839
- /* @__PURE__ */ jsx8(Text9, { children: "\u53D6\u5F97\u65B9\u6CD5\u3092\u9078\u3093\u3067\u304F\u3060\u3055\u3044:" })
5832
+ /* @__PURE__ */ jsx8(Text9, { children: "\u6B21\u306B\u3001AI\u3068\u4F1A\u8A71\u3059\u308B\u305F\u3081\u306EAPI\u30AD\u30FC\u3092\u8A2D\u5B9A\u3059\u308B\u3088\uFF01\u{1F4AA}" }),
5833
+ /* @__PURE__ */ jsx8(Text9, { children: "\u53D6\u5F97\u65B9\u6CD5\u3092\u9078\u3093\u3067\u306D:" })
5840
5834
  ] }),
5841
5835
  /* @__PURE__ */ jsx8(MethodSelector, { onSelect: handleMethodSelect })
5842
5836
  ] }),
@@ -5847,64 +5841,47 @@ function OnboardingWizard({ onComplete }) {
5847
5841
  }
5848
5842
  ),
5849
5843
  step === "setupTokenGuide" && /* @__PURE__ */ jsxs9(BotMessage, { children: [
5850
- /* @__PURE__ */ jsx8(Text9, { children: "\u5225\u306E\u30BF\u30FC\u30DF\u30CA\u30EB\u3067\u4EE5\u4E0B\u306E\u30B3\u30DE\u30F3\u30C9\u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044:" }),
5844
+ /* @__PURE__ */ jsx8(Text9, { children: "\u5225\u306E\u30BF\u30FC\u30DF\u30CA\u30EB\u3067\u3001\u3053\u306E\u30B3\u30DE\u30F3\u30C9\u3092\u5B9F\u884C\u3057\u3066\u306D:" }),
5851
5845
  /* @__PURE__ */ jsx8(Text9, {}),
5852
5846
  /* @__PURE__ */ jsxs9(Text9, { color: colors.insight, children: [
5853
5847
  " $ ",
5854
5848
  /* @__PURE__ */ jsx8(Text9, { bold: true, children: "claude setup-token" })
5855
5849
  ] }),
5856
5850
  /* @__PURE__ */ jsx8(Text9, {}),
5857
- /* @__PURE__ */ jsx8(Text9, { children: "\u53D6\u5F97\u3057\u305F\u30C8\u30FC\u30AF\u30F3\u3092\u8CBC\u308A\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044:" })
5851
+ /* @__PURE__ */ jsx8(Text9, { children: "\u51FA\u3066\u304D\u305F sk-ant- \u3067\u59CB\u307E\u308BAPI\u30AD\u30FC\u3092\u8CBC\u308A\u4ED8\u3051\u3066\u306D\uFF01\u2728" }),
5852
+ /* @__PURE__ */ jsx8(Text9, { color: colors.fog, children: "\uFF08\u203B Authentication Code \u3058\u3083\u306A\u304F\u3066\u3001\u305D\u306E\u5F8C\u306B\u8868\u793A\u3055\u308C\u308BAPI\u30AD\u30FC\u3060\u3088\uFF09" })
5858
5853
  ] }),
5859
5854
  (step === "setupTokenGuide" || step === "setupTokenInput") && /* @__PURE__ */ jsxs9(Box8, { children: [
5860
5855
  /* @__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
- )
5856
+ /* @__PURE__ */ jsx8(MaskedInput, { onSubmit: handleApiKeySubmit, placeholder: "sk-ant-..." })
5871
5857
  ] }),
5872
5858
  step === "apiKeyInput" && /* @__PURE__ */ jsxs9(Fragment2, { children: [
5873
5859
  /* @__PURE__ */ jsxs9(BotMessage, { children: [
5874
- /* @__PURE__ */ jsx8(Text9, { children: "Anthropic \u306E API \u30AD\u30FC\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002" }),
5860
+ /* @__PURE__ */ jsx8(Text9, { children: "Anthropic \u306E API \u30AD\u30FC\u3092\u5165\u529B\u3057\u3066\u306D\uFF01" }),
5875
5861
  /* @__PURE__ */ jsx8(Text9, {}),
5876
5862
  /* @__PURE__ */ jsxs9(Text9, { color: colors.insight, children: [
5877
5863
  "\u{1F4A1} ",
5878
5864
  /* @__PURE__ */ jsx8(Text9, { color: colors.flow, underline: true, children: "https://console.anthropic.com/settings/keys" }),
5879
- " \u304B\u3089\u53D6\u5F97\u3067\u304D\u307E\u3059"
5865
+ " \u304B\u3089\u53D6\u5F97\u3067\u304D\u308B\u3088"
5880
5866
  ] })
5881
5867
  ] }),
5882
5868
  /* @__PURE__ */ jsxs9(Box8, { children: [
5883
5869
  /* @__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
- )
5870
+ /* @__PURE__ */ jsx8(MaskedInput, { onSubmit: handleApiKeySubmit, placeholder: "sk-ant-..." })
5894
5871
  ] })
5895
5872
  ] }),
5896
- step === "apiKeySubmitted" && /* @__PURE__ */ jsx8(BotMessage, { children: /* @__PURE__ */ jsx8(Text9, { children: "API\u30AD\u30FC\u3092\u8A2D\u5B9A\u3057\u3066\u3044\u307E\u3059..." }) }),
5873
+ step === "apiKeySubmitted" && /* @__PURE__ */ jsx8(BotMessage, { children: /* @__PURE__ */ jsx8(Text9, { children: "API\u30AD\u30FC\u3092\u8A2D\u5B9A\u3057\u3066\u308B\u3088... \u23F3" }) }),
5897
5874
  step === "apiKeyCheck" && /* @__PURE__ */ jsx8(BotMessage, { children: /* @__PURE__ */ jsxs9(Text9, { color: colors.growth, children: [
5898
5875
  "\u2713 ",
5899
- /* @__PURE__ */ jsx8(Text9, { children: "API\u30AD\u30FC\u306F\u65E2\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u306D\u3002" })
5876
+ /* @__PURE__ */ jsx8(Text9, { children: "API\u30AD\u30FC\u306F\u3082\u3046\u8A2D\u5B9A\u3055\u308C\u3066\u308B\u306D\uFF01" })
5900
5877
  ] }) }),
5901
5878
  (step === "saving" || step === "done") && /* @__PURE__ */ jsxs9(BotMessage, { children: [
5902
5879
  /* @__PURE__ */ jsxs9(Text9, { color: colors.growth, children: [
5903
5880
  "\u2713 ",
5904
- /* @__PURE__ */ jsx8(Text9, { children: "\u8A2D\u5B9A\u5B8C\u4E86\uFF01" })
5881
+ /* @__PURE__ */ jsx8(Text9, { children: "\u8A2D\u5B9A\u5B8C\u4E86\uFF01\u308F\u3049\u304A\u3049\u3049\uFF01\u{1F38A}" })
5905
5882
  ] }),
5906
5883
  /* @__PURE__ */ jsx8(Text9, {}),
5907
- /* @__PURE__ */ jsx8(Text9, { children: "\u3053\u308C\u304B\u3089AI\u30A2\u30B7\u30B9\u30BF\u30F3\u30C8\u304C\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u306E\u7D9A\u304D\u3092\u304A\u624B\u4F1D\u3044\u3057\u307E\u3059\u3002" })
5884
+ /* @__PURE__ */ jsx8(Text9, { children: "\u3053\u308C\u304B\u3089AI\u30A2\u30B7\u30B9\u30BF\u30F3\u30C8\u304C\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u306E\u7D9A\u304D\u3092\u304A\u624B\u4F1D\u3044\u3059\u308B\u306D\uFF01\u2728" })
5908
5885
  ] }),
5909
5886
  step === "done" && /* @__PURE__ */ jsx8(Text9, { color: colors.fog, children: "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500" })
5910
5887
  ] });
@@ -5992,7 +5969,7 @@ Error: ${formatErrorMessage(error)}
5992
5969
  }
5993
5970
  }
5994
5971
  var program = new Command();
5995
- program.name("wellgrow").description("WellGrow CLI \u2014 AI chat assistant").version("0.1.0").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(
5972
+ program.name("wellgrow").description("WellGrow CLI \u2014 AI chat assistant").version("0.1.2").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
5973
  "--mode <mode>",
5997
5974
  "\u30E2\u30FC\u30C9 (plan, auto)"
5998
5975
  ).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) => {