@straion/cli 0.0.1 → 0.0.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/CHANGELOG.md +13 -0
- package/README.md +0 -4
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -4
- package/dist/cli.js.map +1 -1
- package/dist/commands/default.d.ts.map +1 -1
- package/dist/commands/default.js +7 -30
- package/dist/commands/default.js.map +1 -1
- package/dist/commands/find-requirements.d.ts.map +1 -1
- package/dist/commands/find-requirements.integration.test.d.ts +5 -0
- package/dist/commands/find-requirements.integration.test.d.ts.map +1 -0
- package/dist/commands/find-requirements.integration.test.js +92 -0
- package/dist/commands/find-requirements.integration.test.js.map +1 -0
- package/dist/commands/find-requirements.js +26 -7
- package/dist/commands/find-requirements.js.map +1 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +2 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.integration.test.d.ts +13 -0
- package/dist/commands/login.integration.test.d.ts.map +1 -0
- package/dist/commands/login.integration.test.js +67 -0
- package/dist/commands/login.integration.test.js.map +1 -0
- package/dist/commands/login.js +20 -5
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.d.ts.map +1 -1
- package/dist/commands/logout.js +9 -14
- package/dist/commands/logout.js.map +1 -1
- package/dist/commands/session-start.d.ts.map +1 -1
- package/dist/commands/session-start.js +1 -2
- package/dist/commands/session-start.js.map +1 -1
- package/dist/commands/setup.d.ts +3 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +23 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/components/banner.d.ts +3 -0
- package/dist/components/banner.d.ts.map +1 -0
- package/dist/components/banner.js +13 -0
- package/dist/components/banner.js.map +1 -0
- package/dist/components/button.d.ts +2 -2
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +3 -3
- package/dist/components/button.js.map +1 -1
- package/dist/components/default-flow.d.ts +11 -0
- package/dist/components/default-flow.d.ts.map +1 -0
- package/dist/components/default-flow.js +64 -0
- package/dist/components/default-flow.js.map +1 -0
- package/dist/components/hero.d.ts +2 -1
- package/dist/components/hero.d.ts.map +1 -1
- package/dist/components/hero.js +79 -19
- package/dist/components/hero.js.map +1 -1
- package/dist/components/link.d.ts +2 -2
- package/dist/components/link.d.ts.map +1 -1
- package/dist/components/link.js +3 -3
- package/dist/components/link.js.map +1 -1
- package/dist/components/login/login-error.d.ts +6 -0
- package/dist/components/login/login-error.d.ts.map +1 -0
- package/dist/components/login/login-error.js +14 -0
- package/dist/components/login/login-error.js.map +1 -0
- package/dist/components/login/login-flow.d.ts +8 -2
- package/dist/components/login/login-flow.d.ts.map +1 -1
- package/dist/components/login/login-flow.js +95 -84
- package/dist/components/login/login-flow.js.map +1 -1
- package/dist/components/login/login-flow.test.js +69 -7
- package/dist/components/login/login-flow.test.js.map +1 -1
- package/dist/components/login/types.d.ts +2 -0
- package/dist/components/login/types.d.ts.map +1 -0
- package/dist/components/login/types.js +2 -0
- package/dist/components/login/types.js.map +1 -0
- package/dist/components/login/user-settings-link.d.ts +3 -0
- package/dist/components/login/user-settings-link.d.ts.map +1 -0
- package/dist/components/login/user-settings-link.js +8 -0
- package/dist/components/login/user-settings-link.js.map +1 -0
- package/dist/components/multi-select.d.ts +16 -0
- package/dist/components/multi-select.d.ts.map +1 -0
- package/dist/components/multi-select.js +105 -0
- package/dist/components/multi-select.js.map +1 -0
- package/dist/components/org-selector.d.ts +2 -1
- package/dist/components/org-selector.d.ts.map +1 -1
- package/dist/components/org-selector.js +9 -2
- package/dist/components/org-selector.js.map +1 -1
- package/dist/components/pat-input.d.ts +2 -1
- package/dist/components/pat-input.d.ts.map +1 -1
- package/dist/components/pat-input.js +9 -3
- package/dist/components/pat-input.js.map +1 -1
- package/dist/components/pat-input.test.js +8 -8
- package/dist/components/pat-input.test.js.map +1 -1
- package/dist/components/setup/agent-setup.d.ts +9 -0
- package/dist/components/setup/agent-setup.d.ts.map +1 -0
- package/dist/components/setup/agent-setup.js +65 -0
- package/dist/components/setup/agent-setup.js.map +1 -0
- package/dist/components/setup/agents/agent-registry.d.ts +44 -0
- package/dist/components/setup/agents/agent-registry.d.ts.map +1 -0
- package/dist/components/setup/agents/agent-registry.js +64 -0
- package/dist/components/setup/agents/agent-registry.js.map +1 -0
- package/dist/components/setup/agents/command-helpers.d.ts +5 -0
- package/dist/components/setup/agents/command-helpers.d.ts.map +1 -0
- package/dist/components/setup/agents/command-helpers.js +28 -0
- package/dist/components/setup/agents/command-helpers.js.map +1 -0
- package/dist/components/setup/checking-agents.d.ts +16 -0
- package/dist/components/setup/checking-agents.d.ts.map +1 -0
- package/dist/components/setup/checking-agents.js +30 -0
- package/dist/components/setup/checking-agents.js.map +1 -0
- package/dist/components/setup/download-skills-and-plugins.d.ts +9 -0
- package/dist/components/setup/download-skills-and-plugins.d.ts.map +1 -0
- package/dist/components/setup/download-skills-and-plugins.js +29 -0
- package/dist/components/setup/download-skills-and-plugins.js.map +1 -0
- package/dist/components/setup/perform-setup.d.ts +23 -0
- package/dist/components/setup/perform-setup.d.ts.map +1 -0
- package/dist/components/setup/perform-setup.js +45 -0
- package/dist/components/setup/perform-setup.js.map +1 -0
- package/dist/components/spinner.d.ts +6 -1
- package/dist/components/spinner.d.ts.map +1 -1
- package/dist/components/spinner.js +13 -5
- package/dist/components/spinner.js.map +1 -1
- package/dist/components/tabs.d.ts +3 -3
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +26 -21
- package/dist/components/tabs.js.map +1 -1
- package/dist/hooks/use-credentials.d.ts +13 -0
- package/dist/hooks/use-credentials.d.ts.map +1 -0
- package/dist/hooks/use-credentials.js +33 -0
- package/dist/hooks/use-credentials.js.map +1 -0
- package/dist/lib/graphql.d.ts +57 -41
- package/dist/lib/graphql.d.ts.map +1 -1
- package/dist/lib/graphql.js +7 -0
- package/dist/lib/graphql.js.map +1 -1
- package/dist/lib/ink-render.d.ts +1 -1
- package/dist/lib/ink-render.js +1 -1
- package/dist/lib/logger.d.ts +13 -8
- package/dist/lib/logger.d.ts.map +1 -1
- package/dist/lib/logger.js +6 -29
- package/dist/lib/logger.js.map +1 -1
- package/dist/lib/login.d.ts.map +1 -1
- package/dist/lib/middleware.d.ts +2 -1
- package/dist/lib/middleware.d.ts.map +1 -1
- package/dist/lib/middleware.js +18 -6
- package/dist/lib/middleware.js.map +1 -1
- package/dist/lib/skills-manager.d.ts +33 -0
- package/dist/lib/skills-manager.d.ts.map +1 -0
- package/dist/lib/skills-manager.js +233 -0
- package/dist/lib/skills-manager.js.map +1 -0
- package/dist/lib/skills-manager.test.d.ts +7 -0
- package/dist/lib/skills-manager.test.d.ts.map +1 -0
- package/dist/lib/skills-manager.test.js +248 -0
- package/dist/lib/skills-manager.test.js.map +1 -0
- package/dist/state/global-config.d.ts +23 -9
- package/dist/state/global-config.d.ts.map +1 -1
- package/dist/state/global-config.js +42 -36
- package/dist/state/global-config.js.map +1 -1
- package/dist/state/session-manager.js +2 -2
- package/dist/state/session-manager.js.map +1 -1
- package/dist/test/integration-helpers.d.ts +96 -0
- package/dist/test/integration-helpers.d.ts.map +1 -0
- package/dist/test/integration-helpers.js +171 -0
- package/dist/test/integration-helpers.js.map +1 -0
- package/package.json +17 -4
- package/dist/auth/cookie-jar.d.ts +0 -24
- package/dist/auth/cookie-jar.d.ts.map +0 -1
- package/dist/auth/cookie-jar.js +0 -45
- package/dist/auth/cookie-jar.js.map +0 -1
- package/dist/components/login/login.provider.d.ts +0 -2
- package/dist/components/login/login.provider.d.ts.map +0 -1
- package/dist/components/login/login.provider.js +0 -2
- package/dist/components/login/login.provider.js.map +0 -1
- package/dist/components/login/login.store.d.ts +0 -2
- package/dist/components/login/login.store.d.ts.map +0 -1
- package/dist/components/login/login.store.js +0 -2
- package/dist/components/login/login.store.js.map +0 -1
- package/dist/state/directory-config.d.ts +0 -21
- package/dist/state/directory-config.d.ts.map +0 -1
- package/dist/state/directory-config.js +0 -59
- package/dist/state/directory-config.js.map +0 -1
- /package/{LICENSE.txt → LICENSE} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../src/components/banner.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,eAAO,MAAM,MAAM,yBAElB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Text } from 'ink';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
const straionAscii = `
|
|
4
|
+
███████╗████████╗██████╗ █████╗ ██╗ ██████╗ ███╗ ██╗
|
|
5
|
+
██╔════╝╚══██╔══╝██╔══██╗██╔══██╗██║██╔═══██╗████╗ ██║
|
|
6
|
+
███████╗ ██║ ██████╔╝███████║██║██║ ██║██╔██╗ ██║
|
|
7
|
+
╚════██║ ██║ ██╔══██╗██╔══██║██║██║ ██║██║╚██╗██║
|
|
8
|
+
███████║ ██║ ██║ ██║██║ ██║██║╚██████╔╝██║ ╚████║
|
|
9
|
+
╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝`;
|
|
10
|
+
export const Banner = () => {
|
|
11
|
+
return React.createElement(Text, null, straionAscii);
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner.js","sourceRoot":"","sources":["../../src/components/banner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,YAAY,GAAG;;;;;;wDAMmC,CAAC;AAEzD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,EAAE;IACzB,OAAO,oBAAC,IAAI,QAAE,YAAY,CAAQ,CAAC;AACrC,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
2
|
export type ButtonProps = {
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
onPress: () => void;
|
|
5
5
|
};
|
|
6
|
-
export declare const Button: (props: ButtonProps) =>
|
|
6
|
+
export declare const Button: (props: ButtonProps) => React.JSX.Element;
|
|
7
7
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAExD,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,OAAO,WAAW,sBAuBxC,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { Box, Text, useFocus, useInput } from 'ink';
|
|
3
|
-
import { useState } from 'react';
|
|
2
|
+
import React, { useState } from 'react';
|
|
4
3
|
export const Button = (props) => {
|
|
5
4
|
const { isFocused } = useFocus();
|
|
6
5
|
const { children, onPress } = props;
|
|
@@ -13,6 +12,7 @@ export const Button = (props) => {
|
|
|
13
12
|
onPress();
|
|
14
13
|
}
|
|
15
14
|
});
|
|
16
|
-
return (
|
|
15
|
+
return (React.createElement(Box, { backgroundColor: isPressed ? 'magentaBright' : isFocused ? 'magenta' : 'white', flexDirection: 'row', paddingX: 1 },
|
|
16
|
+
React.createElement(Text, { color: "black" }, children)));
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AACpD,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAOxD,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAkB,EAAE,EAAE;IAC3C,MAAM,EAAE,SAAS,EAAE,GAAG,QAAQ,EAAE,CAAC;IACjC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACpC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,QAAQ,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACtB,IAAI,SAAS,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,KAAK,KAAK,GAAG,CAAC,EAAE,CAAC;YAC/C,sBAAsB;YACtB,YAAY,CAAC,IAAI,CAAC,CAAC;YACnB,UAAU,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;YAC3C,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,CACL,oBAAC,GAAG,IACF,eAAe,EAAE,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,EAC9E,aAAa,EAAE,KAAK,EACpB,QAAQ,EAAE,CAAC;QAEX,oBAAC,IAAI,IAAC,KAAK,EAAC,OAAO,IAAE,QAAQ,CAAQ,CACjC,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Logger } from 'pino';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type StoredCredentials } from '../auth/credentials.js';
|
|
4
|
+
interface DefaultFlowProps {
|
|
5
|
+
logger: Logger;
|
|
6
|
+
credentials: StoredCredentials | null;
|
|
7
|
+
defaultSetupDismissed: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function DefaultFlow({ logger, credentials, defaultSetupDismissed }: DefaultFlowProps): React.JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=default-flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-flow.d.ts","sourceRoot":"","sources":["../../src/components/default-flow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,KAAgC,MAAM,OAAO,CAAC;AAErD,OAAO,EAA2B,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAWzF,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACtC,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAED,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,EAAE,gBAAgB,qBA0F3F"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Box, Text, useInput } from 'ink';
|
|
2
|
+
import React, { useCallback, useState } from 'react';
|
|
3
|
+
import { createCredentialManager } from '../auth/credentials.js';
|
|
4
|
+
import { Banner } from '../components/banner.js';
|
|
5
|
+
import { Hero } from '../components/hero.js';
|
|
6
|
+
import { LoginFlow } from '../components/login/login-flow.js';
|
|
7
|
+
import { useHasValidCredentials } from '../hooks/use-credentials.js';
|
|
8
|
+
import { config, saveConfig } from '../state/global-config.js';
|
|
9
|
+
import { AgentSetup } from './setup/agent-setup.js';
|
|
10
|
+
import { Spinner } from './spinner.js';
|
|
11
|
+
export function DefaultFlow({ logger, credentials, defaultSetupDismissed }) {
|
|
12
|
+
const { hasValidCredentials, organizations, isFinished: credentialsCheckFinished, } = useHasValidCredentials({
|
|
13
|
+
credentials,
|
|
14
|
+
logger,
|
|
15
|
+
});
|
|
16
|
+
const [loginPerformed, setLoginPerformed] = useState(false);
|
|
17
|
+
const [setupDismissed, setSetupDismissed] = useState(defaultSetupDismissed);
|
|
18
|
+
const [showSetupFinished, setShowSetupFinished] = useState(false);
|
|
19
|
+
const showLogin = credentialsCheckFinished && !hasValidCredentials;
|
|
20
|
+
const showAgentSetup = (credentialsCheckFinished && hasValidCredentials) || loginPerformed;
|
|
21
|
+
const handleLoginComplete = useCallback(async (user, org, pat) => {
|
|
22
|
+
// Store credentials
|
|
23
|
+
const credentialManager = await createCredentialManager();
|
|
24
|
+
await credentialManager.setCredentials({
|
|
25
|
+
userId: user.id,
|
|
26
|
+
name: user.firstName ?? user.name,
|
|
27
|
+
accessToken: pat,
|
|
28
|
+
});
|
|
29
|
+
logger.debug('Stored user credentials in credential manager');
|
|
30
|
+
// Store global org
|
|
31
|
+
config.globalOrg = org;
|
|
32
|
+
saveConfig();
|
|
33
|
+
setLoginPerformed(true);
|
|
34
|
+
}, [logger]);
|
|
35
|
+
const handleLoginError = useCallback((error) => {
|
|
36
|
+
logger.error({ error: error?.message ?? 'Unknown error' }, 'Login failed');
|
|
37
|
+
}, [logger]);
|
|
38
|
+
const handleSetupComplete = useCallback(() => {
|
|
39
|
+
config.setupDismissed = true;
|
|
40
|
+
saveConfig();
|
|
41
|
+
setShowSetupFinished(true);
|
|
42
|
+
}, []);
|
|
43
|
+
useInput((_, key) => {
|
|
44
|
+
if (key.escape) {
|
|
45
|
+
logger.info('Setup dismissed by user');
|
|
46
|
+
config.setupDismissed = true;
|
|
47
|
+
saveConfig();
|
|
48
|
+
setSetupDismissed(true);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return (React.createElement(Box, { flexDirection: "column", paddingY: 1, paddingX: 2, gap: 1 },
|
|
52
|
+
React.createElement(Banner, null),
|
|
53
|
+
setupDismissed ? (React.createElement(Hero, { localOrg: config.globalOrg, credentials: credentials, organizations: organizations })) : (React.createElement(React.Fragment, null,
|
|
54
|
+
React.createElement(Box, { width: 80, flexDirection: 'column', gap: 1, borderStyle: 'classic', padding: 1 },
|
|
55
|
+
React.createElement(Text, null, "This is a first time setup to help you get started with Straion."),
|
|
56
|
+
React.createElement(Text, { dimColor: true }, "You can press ESC to skip the setup.")),
|
|
57
|
+
!credentialsCheckFinished ? React.createElement(Spinner, null, "Checking credentials...") : null,
|
|
58
|
+
showLogin ? (React.createElement(LoginFlow, { tokenSource: "input", onComplete: handleLoginComplete, onError: handleLoginError })) : null,
|
|
59
|
+
showAgentSetup ? React.createElement(AgentSetup, { logger: logger, onComplete: handleSetupComplete }) : null,
|
|
60
|
+
showSetupFinished ? (React.createElement(Box, { flexDirection: "column", gap: 1 },
|
|
61
|
+
React.createElement(Text, { color: "green" }, "\u2713 Setup completed!"),
|
|
62
|
+
React.createElement(Text, { dimColor: true }, "You can press ESC to dismiss."))) : null))));
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=default-flow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-flow.js","sourceRoot":"","sources":["../../src/components/default-flow.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAE1C,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,uBAAuB,EAA0B,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE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EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;gBACjF,oBAAC,IAAI,2EAAwE;gBAC7E,oBAAC,IAAI,IAAC,QAAQ,iDAA4C,CACtD;YACL,CAAC,wBAAwB,CAAC,CAAC,CAAC,oBAAC,OAAO,kCAAkC,CAAC,CAAC,CAAC,IAAI;YAC7E,SAAS,CAAC,CAAC,CAAC,CACX,oBAAC,SAAS,IACR,WAAW,EAAC,OAAO,EACnB,UAAU,EAAE,mBAAmB,EAC/B,OAAO,EAAE,gBAAgB,GACzB,CACH,CAAC,CAAC,CAAC,IAAI;YAEP,cAAc,CAAC,CAAC,CAAC,oBAAC,UAAU,IAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,mBAAmB,GAAI,CAAC,CAAC,CAAC,IAAI;YACvF,iBAAiB,CAAC,CAAC,CAAC,CACnB,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,GAAG,EAAE,CAAC;gBAChC,oBAAC,IAAI,IAAC,KAAK,EAAC,OAAO,8BAA0B;gBAC7C,oBAAC,IAAI,IAAC,QAAQ,0CAAqC,CAC/C,CACP,CAAC,CAAC,CAAC,IAAI,CACP,CACJ,CACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { StoredCredentials } from '../auth/credentials.js';
|
|
2
3
|
import type { OrganizationFragment } from '../lib/graphql.js';
|
|
3
4
|
interface HeroProps {
|
|
@@ -5,6 +6,6 @@ interface HeroProps {
|
|
|
5
6
|
localOrg: OrganizationFragment | null;
|
|
6
7
|
organizations: OrganizationFragment[] | null;
|
|
7
8
|
}
|
|
8
|
-
export declare function Hero({ credentials, localOrg, organizations }: HeroProps):
|
|
9
|
+
export declare function Hero({ credentials, localOrg, organizations }: HeroProps): React.JSX.Element;
|
|
9
10
|
export {};
|
|
10
11
|
//# sourceMappingURL=hero.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hero.d.ts","sourceRoot":"","sources":["../../src/components/hero.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hero.d.ts","sourceRoot":"","sources":["../../src/components/hero.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAiB9D,UAAU,SAAS;IACjB,WAAW,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACtC,QAAQ,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACtC,aAAa,EAAE,oBAAoB,EAAE,GAAG,IAAI,CAAC;CAC9C;AAED,wBAAgB,IAAI,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,SAAS,qBA+JvE"}
|
package/dist/components/hero.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { Box, Text, useApp, useInput } from 'ink';
|
|
3
|
-
import { useState } from 'react';
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
4
3
|
import { create } from 'zustand';
|
|
5
|
-
import
|
|
4
|
+
import packageJson from '../../package.json' with { type: 'json' };
|
|
5
|
+
import { config, saveConfig } from '../state/global-config.js';
|
|
6
6
|
import { Button } from './button.js';
|
|
7
7
|
import { Link } from './link.js';
|
|
8
8
|
import { OrgSelector } from './org-selector.js';
|
|
@@ -10,30 +10,90 @@ const useHeroStore = create((set) => ({
|
|
|
10
10
|
loginViewState: { type: 'idle' },
|
|
11
11
|
setLoginViewState: (state) => set({ loginViewState: state }),
|
|
12
12
|
}));
|
|
13
|
-
const straionAscii = `
|
|
14
|
-
███████╗████████╗██████╗ █████╗ ██╗ ██████╗ ███╗ ██╗
|
|
15
|
-
██╔════╝╚══██╔══╝██╔══██╗██╔══██╗██║██╔═══██╗████╗ ██║
|
|
16
|
-
███████╗ ██║ ██████╔╝███████║██║██║ ██║██╔██╗ ██║
|
|
17
|
-
╚════██║ ██║ ██╔══██╗██╔══██║██║██║ ██║██║╚██╗██║
|
|
18
|
-
███████║ ██║ ██║ ██║██║ ██║██║╚██████╔╝██║ ╚████║
|
|
19
|
-
╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝
|
|
20
|
-
`;
|
|
21
13
|
export function Hero({ credentials, localOrg, organizations }) {
|
|
22
14
|
const { exit } = useApp();
|
|
15
|
+
const isInteractive = process.stdout.isTTY === true;
|
|
23
16
|
const { loginViewState, setLoginViewState } = useHeroStore();
|
|
24
17
|
const [currentOrg, setCurrentOrg] = useState(localOrg);
|
|
25
18
|
const hasMultipleOrgs = organizations !== null && organizations.length > 1;
|
|
19
|
+
// In interactive mode, listen for 'q' or ESC to exit
|
|
26
20
|
useInput((input, key) => {
|
|
27
21
|
if (input === 'q' || key.escape) {
|
|
28
22
|
exit();
|
|
29
23
|
}
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
}, { isActive: isInteractive });
|
|
25
|
+
// In non-interactive mode, auto-exit after rendering
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (!isInteractive) {
|
|
28
|
+
exit();
|
|
29
|
+
}
|
|
30
|
+
}, [isInteractive, exit]);
|
|
31
|
+
return (React.createElement(Box, { flexDirection: "column", paddingY: 1 },
|
|
32
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
33
|
+
React.createElement(Text, { bold: true, color: "blue" }, "The Missing Piece for AI-Era Software Engineering at Scale")),
|
|
34
|
+
credentials && currentOrg ? (React.createElement(Box, { flexDirection: "column", borderStyle: "classic", paddingLeft: 1, marginBottom: 1 },
|
|
35
|
+
React.createElement(Text, null,
|
|
36
|
+
"Hello ",
|
|
37
|
+
React.createElement(Text, { bold: true }, credentials.name),
|
|
38
|
+
"!"),
|
|
39
|
+
React.createElement(Text, null,
|
|
40
|
+
"Organization:",
|
|
41
|
+
' ',
|
|
42
|
+
React.createElement(Text, { bold: true, color: "magenta" }, currentOrg.name)),
|
|
43
|
+
isInteractive && (React.createElement(Box, { paddingTop: 1 },
|
|
44
|
+
loginViewState.type === 'idle' && hasMultipleOrgs ? (React.createElement(Button, { onPress: () => {
|
|
45
|
+
setLoginViewState({ type: 'switch-org', orgs: organizations });
|
|
46
|
+
} },
|
|
47
|
+
'>',
|
|
48
|
+
" Switch Organization")) : null,
|
|
49
|
+
loginViewState.type === 'switch-org' && hasMultipleOrgs && currentOrg ? (React.createElement(OrgSelector, { organizations: loginViewState.orgs, defaultOrganization: currentOrg, onSelect: (org) => {
|
|
50
|
+
setCurrentOrg(org);
|
|
51
|
+
config.globalOrg = org;
|
|
52
|
+
saveConfig();
|
|
53
|
+
setLoginViewState({ type: 'idle' });
|
|
54
|
+
} })) : null)))) : (React.createElement(Box, { flexDirection: "column", borderStyle: "classic", paddingLeft: 1, marginBottom: 1 },
|
|
55
|
+
React.createElement(Text, { color: "yellow" }, "\u26A0 Not logged in"),
|
|
56
|
+
React.createElement(Text, null,
|
|
57
|
+
"Run ",
|
|
58
|
+
React.createElement(Text, { color: "green" }, "straion login"),
|
|
59
|
+
" to authenticate."))),
|
|
60
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
61
|
+
React.createElement(Text, { color: "gray" }, "\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\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")),
|
|
62
|
+
React.createElement(Box, { flexDirection: "column", marginBottom: 1 },
|
|
63
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
64
|
+
React.createElement(Text, { bold: true, color: "white" }, "Quick Start:")),
|
|
65
|
+
React.createElement(Box, { flexDirection: "column", marginLeft: 2 },
|
|
66
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
67
|
+
React.createElement(Text, { color: "cyan", bold: true }, "\u2192"),
|
|
68
|
+
React.createElement(Text, null, " "),
|
|
69
|
+
React.createElement(Text, { color: "green" }, "straion login"),
|
|
70
|
+
React.createElement(Text, { dimColor: true }, " ............ Login to your account")),
|
|
71
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
72
|
+
React.createElement(Text, { color: "cyan", bold: true }, "\u2192"),
|
|
73
|
+
React.createElement(Text, null, " "),
|
|
74
|
+
React.createElement(Text, { color: "green" }, "straion logout"),
|
|
75
|
+
React.createElement(Text, { dimColor: true }, " ........... Logout from your account")),
|
|
76
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
77
|
+
React.createElement(Text, { color: "cyan", bold: true }, "\u2192"),
|
|
78
|
+
React.createElement(Text, null, " "),
|
|
79
|
+
React.createElement(Text, { color: "green" }, "straion setup"),
|
|
80
|
+
React.createElement(Text, { dimColor: true }, " ............ Setup your coding agents")),
|
|
81
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
82
|
+
React.createElement(Text, { color: "cyan", bold: true }, "\u2192"),
|
|
83
|
+
React.createElement(Text, null, " "),
|
|
84
|
+
React.createElement(Text, { color: "green" }, "straion --help"),
|
|
85
|
+
React.createElement(Text, { dimColor: true }, " ........... Show all commands")))),
|
|
86
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
87
|
+
React.createElement(Text, { color: "gray" }, "\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\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")),
|
|
88
|
+
React.createElement(Box, { flexDirection: "column" },
|
|
89
|
+
React.createElement(Box, { marginBottom: 1, gap: 1 },
|
|
90
|
+
React.createElement(Text, null, "Learn more:"),
|
|
91
|
+
React.createElement(Link, { url: "https://straion.com", fallback: false },
|
|
92
|
+
React.createElement(Text, { color: "blue" }, "https://straion.com"))),
|
|
93
|
+
React.createElement(Box, { justifyContent: "space-between", width: 71 },
|
|
94
|
+
React.createElement(Text, { dimColor: true },
|
|
95
|
+
"Version ",
|
|
96
|
+
packageJson.version),
|
|
97
|
+
isInteractive && React.createElement(Text, { dimColor: true }, "Press ESC to exit")))));
|
|
38
98
|
}
|
|
39
99
|
//# sourceMappingURL=hero.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hero.js","sourceRoot":"","sources":["../../src/components/hero.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hero.js","sourceRoot":"","sources":["../../src/components/hero.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAClD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,WAAW,MAAM,oBAAoB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAGnE,OAAO,EAAE,MA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;
|
|
4
4
|
/**
|
|
@@ -38,6 +38,6 @@ type LinkProps = {
|
|
|
38
38
|
*/
|
|
39
39
|
readonly fallback?: boolean | ((text: string, url: string) => string);
|
|
40
40
|
};
|
|
41
|
-
export declare const Link: ({ children, url, fallback }: LinkProps) =>
|
|
41
|
+
export declare const Link: ({ children, url, fallback }: LinkProps) => React.JSX.Element;
|
|
42
42
|
export {};
|
|
43
43
|
//# sourceMappingURL=link.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/components/link.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/components/link.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG9C,KAAK,SAAS,GAAG;IACf,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAE7B;;;;;;;;;;;;QAYC;IACD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB;;;;;;;;;;;;;;;;;;;;QAoBC;IACD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;CACvE,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,6BAAoC,SAAS,sBAIjE,CAAC"}
|
package/dist/components/link.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { Text, Transform } from 'ink';
|
|
3
|
-
import {} from 'react';
|
|
2
|
+
import React, {} from 'react';
|
|
4
3
|
import terminalLink from 'terminal-link';
|
|
5
|
-
export const Link = ({ children, url, fallback = true }) => (
|
|
4
|
+
export const Link = ({ children, url, fallback = true }) => (React.createElement(Transform, { transform: (children) => terminalLink(children, url, { fallback }) },
|
|
5
|
+
React.createElement(Text, null, children)));
|
|
6
6
|
//# sourceMappingURL=link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../src/components/link.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../src/components/link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAC9C,OAAO,YAAY,MAAM,eAAe,CAAC;AA4CzC,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI,EAAa,EAAE,EAAE,CAAC,CACrE,oBAAC,SAAS,IAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,CAAC;IAC3E,oBAAC,IAAI,QAAE,QAAQ,CAAQ,CACb,CACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login-error.d.ts","sourceRoot":"","sources":["../../../src/components/login/login-error.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAG9C,eAAO,MAAM,UAAU,GAAI,OAAO;IAAE,WAAW,EAAE,WAAW,CAAA;CAAE,sBAiB7D,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Box, Text } from 'ink';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { UserSettingsLink } from './user-settings-link.js';
|
|
4
|
+
export const LoginError = (props) => {
|
|
5
|
+
const { tokenSource } = props;
|
|
6
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "single", paddingLeft: 1 },
|
|
7
|
+
React.createElement(Text, { color: "red" }, "\u2717 Login failed."),
|
|
8
|
+
tokenSource === 'env' && (React.createElement(Text, { dimColor: true }, "Token provided via STRAION_API_KEY environment variable.")),
|
|
9
|
+
React.createElement(Text, { dimColor: true }, "Try checking your Personal Access Token and internet connection, then try again."),
|
|
10
|
+
React.createElement(Box, null,
|
|
11
|
+
React.createElement(Text, { dimColor: true }, "You can find your Personal Access Token in your "),
|
|
12
|
+
React.createElement(UserSettingsLink, null))));
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=login-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login-error.js","sourceRoot":"","sources":["../../../src/components/login/login-error.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAmC,EAAE,EAAE;IAChE,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAC9B,OAAO,CACL,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,WAAW,EAAC,QAAQ,EAAC,WAAW,EAAE,CAAC;QAC7D,oBAAC,IAAI,IAAC,KAAK,EAAC,KAAK,2BAAuB;QACvC,WAAW,KAAK,KAAK,IAAI,CACxB,oBAAC,IAAI,IAAC,QAAQ,qEAAgE,CAC/E;QACD,oBAAC,IAAI,IAAC,QAAQ,6FAEP;QACP,oBAAC,GAAG;YACF,oBAAC,IAAI,IAAC,QAAQ,6DAAwD;YACtE,oBAAC,gBAAgB,OAAG,CAChB,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { LoggedInUserFragment, OrganizationFragment } from '../../lib/graphql.js';
|
|
3
|
+
import type { TokenSource } from './types.js';
|
|
2
4
|
interface LoginFlowProps {
|
|
3
5
|
defaultPat?: string;
|
|
6
|
+
tokenSource: TokenSource;
|
|
7
|
+
skipOrgSelection?: boolean;
|
|
8
|
+
/** If true, the component will not call exit() after completion. Parent controls app lifecycle. */
|
|
9
|
+
noExit?: boolean;
|
|
4
10
|
onComplete: (user: LoggedInUserFragment, org: OrganizationFragment, pat: string) => void;
|
|
5
|
-
onError: () => void;
|
|
11
|
+
onError: (error?: Error) => void;
|
|
6
12
|
}
|
|
7
|
-
export declare function LoginFlow({ defaultPat, onComplete, onError }: LoginFlowProps):
|
|
13
|
+
export declare function LoginFlow({ defaultPat, tokenSource, skipOrgSelection, onComplete, onError, }: LoginFlowProps): React.JSX.Element | null;
|
|
8
14
|
export {};
|
|
9
15
|
//# sourceMappingURL=login-flow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-flow.d.ts","sourceRoot":"","sources":["../../../src/components/login/login-flow.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"login-flow.d.ts","sourceRoot":"","sources":["../../../src/components/login/login-flow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAQvF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAe9C,UAAU,cAAc;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,mGAAmG;IACnG,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,CAAC,IAAI,EAAE,oBAAoB,EAAE,GAAG,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACzF,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED,wBAAgB,SAAS,CAAC,EACxB,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,OAAO,GACR,EAAE,cAAc,4BAqIhB"}
|