mumucc 0.1.2 → 0.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mumucc",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Open-source AI coding assistant CLI with multi-model support (Anthropic, OpenAI/GPT, DeepSeek, GLM, Ollama, etc.), MCP integration, agent swarms, and out-of-the-box developer experience.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/shims/globals.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  ;(globalThis as any).MACRO = {
7
- VERSION: '0.1.2-mumucc',
7
+ VERSION: '0.1.3-mumucc',
8
8
  VERSION_CHANGELOG: '{}',
9
9
  BUILD_TIME: new Date().toISOString(),
10
10
  PACKAGE_URL: 'https://github.com/mumuxsy/mumucc',
@@ -0,0 +1,169 @@
1
+ /**
2
+ * ExtendedLoginFlow — Onboarding login screen with all provider options.
3
+ *
4
+ * Wraps ConsoleOAuthFlow (for Anthropic OAuth) and adds third-party,
5
+ * custom, and Codex login paths so first-run users can configure any
6
+ * supported provider without needing `/login` afterwards.
7
+ */
8
+ import * as React from 'react'
9
+ import { Box, Text } from '../ink.js'
10
+ import { Select } from './CustomSelect/select.js'
11
+ import { ConsoleOAuthFlow } from './ConsoleOAuthFlow.js'
12
+ import { ThirdPartyLogin } from '../commands/login/ThirdPartyLogin.js'
13
+ import { CustomProviderLogin } from '../commands/login/CustomProviderLogin.js'
14
+ import { CodexLogin } from '../commands/login/CodexLogin.js'
15
+ import { BUILTIN_PROVIDERS } from '../utils/model/thirdPartyProviders.js'
16
+
17
+ type LoginPath =
18
+ | 'select' // show menu
19
+ | 'anthropic' // Anthropic OAuth (ConsoleOAuthFlow)
20
+ | 'third-party' // built-in third-party provider
21
+ | 'custom' // custom endpoint
22
+ | 'codex' // Codex / GPT
23
+
24
+ interface Props {
25
+ onDone(): void
26
+ }
27
+
28
+ export function ExtendedLoginFlow({ onDone }: Props): React.ReactNode {
29
+ const [path, setPath] = React.useState<LoginPath>('select')
30
+ const [selectedProviderId, setSelectedProviderId] = React.useState<string | null>(null)
31
+
32
+ // ── Anthropic OAuth ──
33
+ if (path === 'anthropic') {
34
+ return <ConsoleOAuthFlow onDone={onDone} />
35
+ }
36
+
37
+ // ── Third-party provider ──
38
+ if (path === 'third-party' && selectedProviderId) {
39
+ return (
40
+ <ThirdPartyLogin
41
+ initialProviderId={selectedProviderId}
42
+ onDone={(success, _msg) => {
43
+ if (success) onDone()
44
+ else setPath('select')
45
+ }}
46
+ />
47
+ )
48
+ }
49
+
50
+ // ── Custom provider ──
51
+ if (path === 'custom') {
52
+ return (
53
+ <CustomProviderLogin
54
+ onDone={(success, _msg) => {
55
+ if (success) onDone()
56
+ else setPath('select')
57
+ }}
58
+ />
59
+ )
60
+ }
61
+
62
+ // ── Codex / GPT ──
63
+ if (path === 'codex') {
64
+ return (
65
+ <CodexLogin
66
+ onDone={(success, _msg) => {
67
+ if (success) onDone()
68
+ else setPath('select')
69
+ }}
70
+ />
71
+ )
72
+ }
73
+
74
+ // ── Provider selection menu ──
75
+ const anthropicProviders = BUILTIN_PROVIDERS.filter(
76
+ (p) => !p.apiFormat || p.apiFormat === 'anthropic',
77
+ )
78
+ const openaiProviders = BUILTIN_PROVIDERS.filter(
79
+ (p) => p.apiFormat === 'openai',
80
+ )
81
+
82
+ const options = [
83
+ // Anthropic official
84
+ {
85
+ label: (
86
+ <Text>
87
+ Anthropic (Official) ·{' '}
88
+ <Text dimColor>OAuth sign-in, Pro/Max/Team/Enterprise</Text>
89
+ {'\n'}
90
+ </Text>
91
+ ),
92
+ value: 'anthropic',
93
+ },
94
+ // Anthropic-compatible third-party
95
+ ...anthropicProviders.map((p) => ({
96
+ label: (
97
+ <Text>
98
+ {p.name} ·{' '}
99
+ <Text dimColor>
100
+ [Anthropic API] {p.models.map((m) => m.id).join(', ')}
101
+ </Text>
102
+ {'\n'}
103
+ </Text>
104
+ ),
105
+ value: p.id,
106
+ })),
107
+ // OpenAI-compatible third-party
108
+ ...openaiProviders.map((p) => ({
109
+ label: (
110
+ <Text>
111
+ {p.name} ·{' '}
112
+ <Text dimColor>
113
+ [OpenAI API] {p.models.map((m) => m.id).join(', ')}
114
+ </Text>
115
+ {'\n'}
116
+ </Text>
117
+ ),
118
+ value: p.id,
119
+ })),
120
+ // Codex / GPT
121
+ {
122
+ label: (
123
+ <Text>
124
+ Codex / GPT (OpenAI) ·{' '}
125
+ <Text dimColor>GPT-4o, GPT-5.4, Codex via API key</Text>
126
+ {'\n'}
127
+ </Text>
128
+ ),
129
+ value: '__codex__',
130
+ },
131
+ // Custom provider
132
+ {
133
+ label: (
134
+ <Text>
135
+ + Custom Provider ·{' '}
136
+ <Text dimColor>Any OpenAI/Anthropic-compatible API endpoint</Text>
137
+ {'\n'}
138
+ </Text>
139
+ ),
140
+ value: '__custom__',
141
+ },
142
+ ]
143
+
144
+ return (
145
+ <Box flexDirection="column" gap={1} marginTop={1}>
146
+ <Text bold>
147
+ Welcome! Choose a login provider to get started:
148
+ </Text>
149
+ <Text>Select login method:</Text>
150
+ <Box>
151
+ <Select
152
+ options={options}
153
+ onChange={(value: string) => {
154
+ if (value === 'anthropic') {
155
+ setPath('anthropic')
156
+ } else if (value === '__codex__') {
157
+ setPath('codex')
158
+ } else if (value === '__custom__') {
159
+ setPath('custom')
160
+ } else {
161
+ setSelectedProviderId(value)
162
+ setPath('third-party')
163
+ }
164
+ }}
165
+ />
166
+ </Box>
167
+ </Box>
168
+ )
169
+ }
@@ -14,6 +14,7 @@ import { PreflightStep } from '../utils/preflightChecks.js';
14
14
  import type { ThemeSetting } from '../utils/theme.js';
15
15
  import { ApproveApiKey } from './ApproveApiKey.js';
16
16
  import { ConsoleOAuthFlow } from './ConsoleOAuthFlow.js';
17
+ import { ExtendedLoginFlow } from './ExtendedLoginFlow.js';
17
18
  import { Select } from './CustomSelect/select.js';
18
19
  import { WelcomeV2 } from './LogoV2/WelcomeV2.js';
19
20
  import { PressEnterToContinue } from './PressEnterToContinue.js';
@@ -130,14 +131,13 @@ export function Onboarding({
130
131
  component: <ApproveApiKey customApiKeyTruncated={apiKeyNeedingApproval} onDone={handleApiKeyDone} />
131
132
  });
132
133
  }
133
- if (oauthEnabled) {
134
- steps.push({
135
- id: 'oauth',
136
- component: <SkippableStep skip={skipOAuth} onSkip={goToNextStep}>
137
- <ConsoleOAuthFlow onDone={goToNextStep} />
138
- </SkippableStep>
139
- });
140
- }
134
+ // Always show login step — supports Anthropic OAuth + all third-party providers
135
+ steps.push({
136
+ id: 'oauth',
137
+ component: <SkippableStep skip={skipOAuth} onSkip={goToNextStep}>
138
+ <ExtendedLoginFlow onDone={goToNextStep} />
139
+ </SkippableStep>
140
+ });
141
141
  steps.push({
142
142
  id: 'security',
143
143
  component: securityStep